StateUpdateRouting

public final class StateUpdateRouting<I> extends MessageRouting<M, C, R>

A routing schema used to deliver entity state updates.

A routing schema consists of a default route and custom routes per entity state class. When calculating targets to be notified on the updated state, StateUpdateRouting would see if there is a custom route set for the type of the entity state. If not found, the default route will be applied.

Parameters

<I>

the type of the entity IDs to which the updates are routed

Functions

Link copied to clipboard
public static StateUpdateRouting<I> newInstance<I>(Class<I> idClass)
Creates a new StateUpdateRouting.
Link copied to clipboard
public StateUpdateRouting<I> route<S extends EntityState>(Class<S> stateClass, StateUpdateRoute<I, S> via)
Sets a custom route for the passed entity state class.
Link copied to clipboard
public boolean supports(Class<? extends EntityState> stateType)
Verifies if the passed state type can be routed by a custom route, or the message has a field matching the type of identifiers served by this routing.

Inherited functions

Link copied to clipboard
public BiFunction<T, U, V> andThen<V>(Function<? extends Object, ? extends V> after)
Link copied to clipboard
public R apply(M message, C context)
Obtains IDs of entities to which the passed message should be delivered.
public abstract R apply(T p, U p1)
Link copied to clipboard
protected Route<M, C, R> defaultRoute()
Obtains the default route used by the schema.
Link copied to clipboard
public void remove(Class<? extends M> messageClass)
Removes a route for the passed message class.