Interface Handler<COMMAND,​EVENT,​ERROR,​STATE>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      HandlerResult<ERROR,​EVENT> handle​(COMMAND cmd, STATE state)
      The execute method is responsible for handling a COMMAND, which can either result in an ERROR or a list of EVENT's (can be an empty list).
      Note: This method is called decide in the decider pattern
      Idempotent handling of a COMMAND will result in an empty list of EVENT's
    • Method Detail

      • handle

        HandlerResult<ERROR,​EVENT> handle​(COMMAND cmd,
                                                STATE state)
        The execute method is responsible for handling a COMMAND, which can either result in an ERROR or a list of EVENT's (can be an empty list).
        Note: This method is called decide in the decider pattern
        Idempotent handling of a COMMAND will result in an empty list of EVENT's
        Parameters:
        cmd - the command to handle
        state - the state of the aggregate
        Returns:
        either an ERROR or a list of EVENT's.
        Idempotent handling of a COMMAND will result in an empty list of EVENT's