Package eu.bandm.tools.message
Class MessageLevelFilter<M extends Message>
java.lang.Object
eu.bandm.tools.message.MessageLevelFilter<M>
- Type Parameters:
M
- the message subtype which can be received
- All Implemented Interfaces:
MessageReceiver<M>
A filter which sends messages only to its sink if their
level value is equal to or below a given threshold.
-
Field Summary
Modifier and TypeFieldDescription(package private) MessageReceiver<? super M>
(package private) int
(package private) EnumSet<Message.Kind>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
EvidentsetDrain
(MessageReceiver<? super M> drain) setLevel
(int level) setUnfilteredKinds
(EnumSet<Message.Kind> unfiltered) Define the set of Message.Kind which will not be filtered by the threshold, i.e. which will always be forwarded.
-
Field Details
-
level
int level -
drain
MessageReceiver<? super M extends Message> drain -
unfiltered
EnumSet<Message.Kind> unfiltered
-
-
Constructor Details
-
MessageLevelFilter
public MessageLevelFilter() -
MessageLevelFilter
-
-
Method Details
-
setDrain
-
setLevel
-
setUnfilteredKinds
Define the set of Message.Kind which will not be filtered by the threshold, i.e. which will always be forwarded. The initial setting lets all error and failure messages pass, what is appropriate in most use cases. -
receive
Description copied from interface:MessageReceiver
Evident- Specified by:
receive
in interfaceMessageReceiver<M extends Message>
-