Class AddressManager


  • public class AddressManager
    extends Object
    • Field Detail

      • multicastAddressCalculatorParticipantId

        public static final String multicastAddressCalculatorParticipantId
        See Also:
        Constant Field Values
    • Method Detail

      • getParticipantIdMap

        public Map<Address,​Set<String>> getParticipantIdMap​(ImmutableMessage message)
        Get the participantIds to which the passed in message should be sent to grouped by their address.
        • For multicast messages, the returned map can have multiple entries with multiple participantIds.
        • For non multicast messages, the returned map always has a single entry: a dummy address mapped to the participantId of the recipient.
        Parameters:
        message - the message for which we want to find the participantIds to send it to.
        Returns:
        map of participantIds to send the message to grouped by their addresses. Will not be null, because if a participantId can't be determined, the returned map will be empty.
      • getAddressForDelayableImmutableMessage

        public Optional<Address> getAddressForDelayableImmutableMessage​(DelayableImmutableMessage message)
        Get the address to which the passed in message should be sent to. This can be an address contained in the RoutingTable, or a multicast address calculated from the header content of the message.

        If the message has multiple recipients (this should only happen for multicast messages), this methods expects that all recipients have the same address, see getParticipantIdMap(ImmutableMessage)).

        Parameters:
        message - the message for which we want to find an address to send it to.
        Returns:
        Optional of an address to send the message to. Will not be null, because if an address can't be determined, the returned Optional will be empty.