Package io.joynr.messaging.routing
Class InMemoryMulticastReceiverRegistry
- java.lang.Object
-
- io.joynr.messaging.routing.InMemoryMulticastReceiverRegistry
-
- All Implemented Interfaces:
MulticastReceiverRegistry
public class InMemoryMulticastReceiverRegistry extends Object implements MulticastReceiverRegistry
-
-
Constructor Summary
Constructors Constructor Description InMemoryMulticastReceiverRegistry(MulticastWildcardRegexFactory multicastWildcardRegexFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Set<String>>getReceivers()Obtain a map representing all currently registered receivers.Set<String>getReceivers(String multicastId)Obtains the current set of participant IDs of the those receivers interested in the given multicast.voidregisterMulticastReceiver(String multicastId, String participantId)Add an interested receiver's participant ID to the set of those interested for the given multicast ID.voidunregisterMulticastReceiver(String multicastId, String participantId)This method is the reverse operation ofMulticastReceiverRegistry.registerMulticastReceiver(String, String)and will remove an interested participant from the set of those interested in the given multicast.
-
-
-
Constructor Detail
-
InMemoryMulticastReceiverRegistry
@Inject public InMemoryMulticastReceiverRegistry(MulticastWildcardRegexFactory multicastWildcardRegexFactory)
-
-
Method Detail
-
registerMulticastReceiver
public void registerMulticastReceiver(String multicastId, String participantId)
Description copied from interface:MulticastReceiverRegistryAdd an interested receiver's participant ID to the set of those interested for the given multicast ID. Calling this method repeatedly after the first invocation with the same values has no effect.- Specified by:
registerMulticastReceiverin interfaceMulticastReceiverRegistry- Parameters:
multicastId- the ID of the multicast the receiver is interested in.participantId- the participant ID of the receiver interested in the multicast.
-
unregisterMulticastReceiver
public void unregisterMulticastReceiver(String multicastId, String participantId)
Description copied from interface:MulticastReceiverRegistryThis method is the reverse operation ofMulticastReceiverRegistry.registerMulticastReceiver(String, String)and will remove an interested participant from the set of those interested in the given multicast.- Specified by:
unregisterMulticastReceiverin interfaceMulticastReceiverRegistry- Parameters:
multicastId- the ID of the multicast the participant is no longer interested in.participantId- the ID of the participant wanting to remove themselves from the set of interested receiers.
-
getReceivers
public Set<String> getReceivers(String multicastId)
Description copied from interface:MulticastReceiverRegistryObtains the current set of participant IDs of the those receivers interested in the given multicast.- Specified by:
getReceiversin interfaceMulticastReceiverRegistry- Parameters:
multicastId- the ID of the multicast for which to obtain the set of interested receivers.- Returns:
- the set of participant IDs interested in receiving the given multicast. Never null - if there are no interested receivers, an emtpy set is returned.
-
getReceivers
public Map<String,Set<String>> getReceivers()
Description copied from interface:MulticastReceiverRegistryObtain a map representing all currently registered receivers.- Specified by:
getReceiversin interfaceMulticastReceiverRegistry- Returns:
- a map keyed by multicast ID and valued with sets of participant IDs interested in the relevant multicast.
-
-