Package kalix.javasdk.eventsourcedentity
Interface EventSourcedEntity.Effect.Builder<S,E>
- Type Parameters:
S
- The type of the state for this entity.
- Enclosing interface:
- EventSourcedEntity.Effect<T>
public static interface EventSourcedEntity.Effect.Builder<S,E>
Construct the effect that is returned by the command handler. The effect describes next
processing actions, such as emitting events and sending a reply.
-
Method Summary
Modifier and TypeMethodDescriptionemitEvents
(List<? extends E> event) <T> EventSourcedEntity.Effect<T>
Create an error reply.<T> EventSourcedEntity.Effect<T>
Create an error reply.<T> EventSourcedEntity.Effect<T>
error
(String description, StatusCode.ErrorCode httpErrorCode) Create an error reply with a custom status code.<T> EventSourcedEntity.Effect<T>
forward
(DeferredCall<? extends Object, T> serviceCall) Create a forward reply.<T> EventSourcedEntity.Effect<T>
reply
(T message) Create a message reply.<T> EventSourcedEntity.Effect<T>
Create a message reply.
-
Method Details
-
emitEvent
-
emitEvents
-
reply
Create a message reply.- Type Parameters:
T
- 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.- Type Parameters:
T
- 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:
T
- 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:
T
- 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.- 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 a 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.- Returns:
- An error reply.
-