Package kalix.javasdk.action
Interface Action.Effect.Builder
- Enclosing interface:
Action.Effect<T>
public static interface Action.Effect.Builder
Construct the effect that is returned by the command handler. The effect describes next
processing actions, such as sending a reply.
-
Method Summary
Modifier and TypeMethodDescription<S> Action.Effect
<S> asyncEffect
(CompletionStage<Action.Effect<S>> futureEffect) Create a reply from an async operation result returning an effect.<S> Action.Effect
<S> asyncReply
(CompletionStage<S> message) Create a message reply from an async operation result.<S> Action.Effect
<S> asyncReply
(CompletionStage<S> message, Metadata metadata) Create a message reply from an async operation result with custom Metadata.<S> Action.Effect
<S> Create an error reply.<T> Action.Effect
<T> Create an error reply with a custom gRPC status code.<T> Action.Effect
<T> error
(String description, StatusCode.ErrorCode httpErrorCode) Create an error reply with a custom status code.<S> Action.Effect
<S> forward
(DeferredCall<? extends Object, S> serviceCall) Create a forward reply.<S> Action.Effect
<S> ignore()
Ignore the current element and proceed with processing the next element if returned for an element from a subscription.<S> Action.Effect
<S> reply
(S message) Create a message reply.<S> Action.Effect
<S> Create a message reply with custom Metadata.
-
Method Details
-
reply
Create a message reply.- Type Parameters:
S
- The type of the message that must be returned by this call.- Parameters:
message
- The payload of the reply.- Returns:
- A message reply.
-
reply
Create a message reply with custom Metadata.- Type Parameters:
S
- The type of the message that must be returned by this call.- Parameters:
message
- The payload of the reply.metadata
- The metadata for the message.- Returns:
- A message reply.
-
forward
Create a forward reply.- Type Parameters:
S
- The type of the message that must be returned by this call.- Parameters:
serviceCall
- The service call representing the forward.- Returns:
- A forward reply.
-
error
Create an error reply.- Type Parameters:
S
- The type of the message that must be returned by this call.- Parameters:
description
- The description of the error.- Returns:
- An error reply.
-
error
Create an error reply with a custom gRPC status code.- Type Parameters:
T
- The type of the message that must be returned by this call.- Parameters:
description
- The description of the error.grpcErrorCode
- A custom gRPC status code.- Returns:
- An error reply.
-
error
Create an error reply with a custom status code. This status code will be translated to an HTTP or gRPC code depending on the type of service being exposed.- Type Parameters:
T
- The type of the message that must be returned by this call.- Parameters:
description
- The description of the error.httpErrorCode
- A custom Kalix status code to represent the error.- Returns:
- An error reply.
-
asyncReply
Create a message reply from an async operation result.- Type Parameters:
S
- The type of the message that must be returned by this call.- Parameters:
message
- The future payload of the reply.- Returns:
- A message reply.
-
asyncReply
Create a message reply from an async operation result with custom Metadata.- Type Parameters:
S
- The type of the message that must be returned by this call.- Parameters:
message
- The future payload of the reply.metadata
- The metadata for the message.- Returns:
- A message reply.
-
asyncEffect
Create a reply from an async operation result returning an effect.- Type Parameters:
S
- The type of the message that must be returned by this call.- Parameters:
futureEffect
- The future effect to reply with.- Returns:
- A reply, the actual type depends on the nested Effect.
-
ignore
Ignore the current element and proceed with processing the next element if returned for an element from a subscription. If used as a response to a regular gRPC or HTTP request it is turned into a NotFound response.Ignore is not allowed to have side effects added with `addSideEffects`
-