BusFilter

public interface BusFilter<E extends MessageEnvelope<? extends Object, ? extends Object, ? extends Object>> implements AutoCloseable

The filter for the messages posted to a bus.

A bus may have several filters which can prevent a message from being posted.

Inheritors

Functions

Link copied to clipboard
public void close()
By default, performs no action.
Link copied to clipboard
public abstract Optional<Ack> filter(E envelope)
Accepts or rejects a passed message.
Link copied to clipboard
public Optional<Ack> letPass()
Lets the message pass the filter.
Link copied to clipboard
public Optional<Ack> reject(E envelope)
Rejects the message with the OK status.
public Optional<Ack> reject(E envelope, ThrowableMessage cause)
Rejects the message with a rejection status.
public Optional<Ack> reject(E envelope, Error cause)
Rejects the message with an Error status.