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 Detail

      • reply

        <S> Action.Effect<S> reply​(S message)
        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

        <S> Action.Effect<S> reply​(S message,
                                   Metadata metadata)
        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.
        metadata - The metadata for the message.
        Returns:
        A message reply.
      • forward

        <S> Action.Effect<S> forward​(ServiceCall serviceCall)
        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.
      • noReply

        <S> Action.Effect<S> noReply()
        Create a reply that contains neither a message nor a forward nor an error.
        Type Parameters:
        S - The type of the message that must be returned by this call.
        Returns:
        The reply.
      • error

        <S> Action.Effect<S> error​(String description)
        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.
      • asyncReply

        <S> Action.Effect<S> asyncReply​(java.util.concurrent.CompletionStage<S> message)
        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.
      • asyncEffect

        <S> Action.Effect<S> asyncEffect​(java.util.concurrent.CompletionStage<Action.Effect<S>> futureEffect)
        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.