Interface MulticastReceiverRegistry

  • All Known Implementing Classes:
    InMemoryMulticastReceiverRegistry

    public interface MulticastReceiverRegistry
    The multicast receiver registry is responsible for maintaining a mapping between multicast IDs and the participant IDs of interested receivers.
    • Method Detail

      • registerMulticastReceiver

        void registerMulticastReceiver​(String multicastId,
                                       String participantId)
        Add 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.
        Parameters:
        multicastId - the ID of the multicast the receiver is interested in.
        participantId - the participant ID of the receiver interested in the multicast.
      • unregisterMulticastReceiver

        void unregisterMulticastReceiver​(String multicastId,
                                         String participantId)
        This method is the reverse operation of registerMulticastReceiver(String, String) and will remove an interested participant from the set of those interested in the given multicast.
        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

        Set<String> getReceivers​(String multicastId)
        Obtains the current set of participant IDs of the those receivers interested in the given multicast.
        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

        Map<String,​Set<String>> getReceivers()
        Obtain a map representing all currently registered receivers.
        Returns:
        a map keyed by multicast ID and valued with sets of participant IDs interested in the relevant multicast.