public interface MessageClassificator<C> extends ReflectionConstructable2<SimNode,Parameters>
MessageClassificator
is used to manage a set of handlers for
aggregates of packets, i.e. flows, and their mapping to these flows.
MessageClassificator
s are used to identify the proper sub-
StackableQueuingDiscipline
in hierarchical queuing disciplines. Any
class implementing this interface MUST implement a constructor taking
Parameters
, SimNode
and String
as parameters to allow
for dynamic configuration. Most implementations will be part of the IKR
ProtocolSupport library since they are relevant for DataMessages only. A
MessageClassificator
never creates new Consumers.CREATE_INSTANCE_METHOD_NAME
Modifier and Type | Method and Description |
---|---|
C |
getConsumer(Message msg)
This method returns the Consumer object for the given
Message
according to its classification mapping. |
java.util.Collection<C> |
getConsumers()
This method returns a set if the consumers existing in / managed by this
MessageClassificator . |
java.util.Set<java.util.Map.Entry<java.lang.Object,C>> |
getEntrySet()
This method shall give access to the key-value pairs to allow for
manipulation.
|
void |
insertConsumer(Message msg,
C c)
This method maps a consumer c to the flow the
Message msg belongs
to, according to the MessageClassificator 's internal mapping
algorithms. |
void |
removeConsumer(Message msg) |
C getConsumer(Message msg)
Message
according to its classification mapping. If such Consumer, e.g. a
StackableQueuingDiscipline
, does not exist, it returns null. It
does not create new Consumers.void insertConsumer(Message msg, C c)
Message
msg belongs
to, according to the MessageClassificator
's internal mapping
algorithms. Unfortunately, Java does not allow to define derived Classes
to expose methods accepting the Generic Parameter, so implementations will
accept Object
s here and have to cast them.void removeConsumer(Message msg)
java.util.Collection<C> getConsumers()
MessageClassificator
. Collection
result in
changes in the MessageClassificator
itself.Iterator
to access the stored
consumer for tracing. Therefore, any implementation should return that
Collection
in the order of insertion. This is the case for
LinkedHashMap
s for example.java.util.Set<java.util.Map.Entry<java.lang.Object,C>> getEntrySet()