Class CommandCallbackRepository<A>

java.lang.Object
org.axonframework.commandhandling.distributed.CommandCallbackRepository<A>
Type Parameters:
A - The type of the endpoint identifier.

public class CommandCallbackRepository<A> extends Object
This class retains a list of callbacks for CommandCallbackConnectors to use.
  • Constructor Details

    • CommandCallbackRepository

      public CommandCallbackRepository()
  • Method Details

    • cancelCallbacks

      public void cancelCallbacks(A channelId)
      Deprecated.
      Removes all callbacks for a given channel. Registered callbacks will receive a failure response containing a CommandBusConnectorCommunicationException.
      Parameters:
      channelId - the channel identifier
    • cancelCallbacksForChannel

      public Collection<CommandCallbackWrapper> cancelCallbacksForChannel(A channelId)
      Removes all callbacks for a given channel. Registered callbacks will receive a failure response containing a CommandBusConnectorCommunicationException.
      Parameters:
      channelId - the channel identifier
      Returns:
      the collection of removed callbacks
    • fetchAndRemove

      public <E, C, R> CommandCallbackWrapper<E,C,R> fetchAndRemove(String callbackId)
      Fetches and removes a callback. The callback will not be used a second time, so removal should be fine
      Type Parameters:
      E - The type of the remote endpoint identifier
      C - The type of the command
      R - The type of the result
      Parameters:
      callbackId - The Callback Id to fetch the callback for
      Returns:
      The stored CommandCallbackWrapper or null if not found
    • store

      public <E, C, R> void store(String callbackId, CommandCallbackWrapper<E,C,R> commandCallbackWrapper)
      Stores a callback
      Type Parameters:
      E - The type of the remote endpoint identifier
      C - The type of the command
      R - The type of the result
      Parameters:
      callbackId - The id to store the callback with
      commandCallbackWrapper - The CommandCallbackWrapper to store
    • callbacks

      protected Map<String,CommandCallbackWrapper> callbacks()
      Returns the callbacks mapped by callback identifier.
      Returns:
      the command callbacks by id