AbstractCommander

The abstract base for classes that generate commands in response to incoming messages.

Constructors

Link copied to clipboard
public void AbstractCommander()

Functions

Link copied to clipboard
public DispatchOutcome dispatch(CommandEnvelope command)
Dispatches the message contained in the passed envelope and returns the outcome.
Link copied to clipboard
public DispatchOutcome dispatchEvent(EventEnvelope event)
Dispatches the event and returns the outcome of dispatching.
Link copied to clipboard
public ImmutableSet<EventClass> domesticEvents()
Obtains domestic event classes dispatched by this delegate.
Link copied to clipboard
public ImmutableSet<EventClass> events()
Obtains all event classes dispatched by this delegate.
Link copied to clipboard
public ImmutableSet<EventClass> externalEvents()
Obtains external event classes dispatched by this delegate.
Link copied to clipboard
public ImmutableSet<CommandClass> messageClasses()
Obtains a set of message classes that can be processed by this dispatcher.
Link copied to clipboard
public ImmutableSet<EventClass> producedEvents()
Obtains classes of the events produced by this object.
Link copied to clipboard
public void registerWith(BoundedContext context)
Registers this instance as a part of the given Bounded Context.
Link copied to clipboard
public Version version()
The version of the object to be put into events.

Inherited functions

Link copied to clipboard
public boolean canDispatch(E envelope)
Checks if this dispatcher can dispatch the given message.
Link copied to clipboard
public void checkNotRegistered()
Verifies that this instance is NOT registered yet.
Link copied to clipboard
public void checkRegistered()
Verifies that this instance is already registered.
Link copied to clipboard
public boolean dispatchesCommands()
Verifies if this instance dispatches at least one command.
Link copied to clipboard
public boolean dispatchesEvents()
Verifies if this instance dispatches at least one event.
Link copied to clipboard
public boolean dispatchesExternalEvents()
Verifies if this instance dispatches at least one external event.
Link copied to clipboard
public DoNothing doNothing()
Obtains the io.spine.server.model.
Link copied to clipboard
public boolean equals(Object o)
Indicates whether some other command handler is "equal to" this one.
Link copied to clipboard
public int hashCode()
Link copied to clipboard
public String id()
Obtains identity string of the dispatcher.
Link copied to clipboard
public ImmutableSet<String> identity()
Returns immutable set with one element with the identity of the multicast dispatcher that dispatches messages to itself.
Link copied to clipboard
public boolean isRegistered()
Determines if this instance is already registered with a Bounded Context.
Link copied to clipboard
public Nothing nothing()
Obtains the io.spine.server.model.
Link copied to clipboard
protected void onError(SignalEnvelope<? extends Object, ? extends Object, ? extends Object> signal, Error error)
Link copied to clipboard
protected void onRejection(SignalEnvelope<? extends Object, ? extends Object, ? extends Object> signal, Event rejection)
Link copied to clipboard
protected void postEvents(Iterable<Event> events)
Posts passed events to EventBus.
Link copied to clipboard
public Any producerId()
Obtains ID packed into Any for being used in generated events.