Class RoutingTableImpl

    • Method Detail

      • setGcdParticipantId

        public void setGcdParticipantId​(String gcdParticipantId)
        Description copied from interface: RoutingTable
        Sets the participantId of the Global Capabilities Directory (GCD) before adding it to the routing table
        Specified by:
        setGcdParticipantId in interface RoutingTable
        Parameters:
        gcdParticipantId - the participantId of the GCD
      • get

        public Address get​(String participantId)
        Specified by:
        get in interface RoutingTable
        Parameters:
        participantId - participantId for which an Address will be returned from the routing table
        Returns:
        Address the stored address for the given participantId (unmodified, see RoutingTable.get(String, String)
      • get

        public Address get​(String participantId,
                           String gbid)
        Specified by:
        get in interface RoutingTable
        Parameters:
        participantId - participantId for which an Address will be returned from the routing table
        gbid - name of the backend (evaluated for gcdParticipantId only): selects the backend specific address of GCD (if participantId is the participantId of the GCD)
        Returns:
        Address the stored address for the given participantId
        - in case of gcdParticipantId, the gbid is evaluated to adapt the stored address for the selected backend before it is returned (this allows communication with GCD instances in different backends
        even though there is only one address per participantId
        return null if the gbid is unknown (not part of the configured list of GBIDs ConfigurableMessagingSettings.PROPERTY_GBIDS
        - return unmodified address otherwise
      • put

        public boolean put​(String participantId,
                           Address address,
                           boolean isGloballyVisible,
                           long expiryDateMs)
        Description copied from interface: RoutingTable
        Overload of put method with isSticky set to false.
        Specified by:
        put in interface RoutingTable
        Parameters:
        participantId - participant id for which a routing entry shall be created
        address - Address which shall be associated with the participant id
        isGloballyVisible - States whether the endpoint is globally visible or not
        expiryDateMs - Expiry date of the routing entry in milliseconds
        Returns:
        true if succeeded, false otherwise
      • put

        public boolean put​(String participantId,
                           Address address,
                           boolean isGloballyVisible,
                           long expiryDateMs,
                           boolean sticky)
        Description copied from interface: RoutingTable
        Adds a new routing entry. If a routing entry for the provided participantId already exists, only the expiryDate and the sticky-flag are updated unless the update is allowed (See RoutingTableAddressValidator).
        Specified by:
        put in interface RoutingTable
        Parameters:
        participantId - participant id for which a routing entry shall be created
        address - Address which shall be associated with the participant id
        isGloballyVisible - States whether the endpoint is globally visible or not
        expiryDateMs - Expiry date of the routing entry in milliseconds
        sticky - If set to true, the routing entry never expires and cannot be replaced
        Returns:
        true if succeeded, false otherwise
      • getIsGloballyVisible

        public boolean getIsGloballyVisible​(String participantId)
        Description copied from interface: RoutingTable
        Query the routing table for the status of isGloballyVisible parameter
        Specified by:
        getIsGloballyVisible in interface RoutingTable
        Parameters:
        participantId - participantId for which the visibility shall be looked up
        Returns:
        true if participantId is globally visible, false if participantId is not globally visible
      • getExpiryDateMs

        public long getExpiryDateMs​(String participantId)
        Description copied from interface: RoutingTable
        Query the expiry date of a routing entry for a participant id.
        Specified by:
        getExpiryDateMs in interface RoutingTable
        Parameters:
        participantId - participantId for which the expiryDate shall be looked up
        Returns:
        The routing entry's expiry date in ms.
      • getIsSticky

        public boolean getIsSticky​(String participantId)
        Description copied from interface: RoutingTable
        Query the sticky-flag of a routing entry for a participant id.
        Specified by:
        getIsSticky in interface RoutingTable
        Parameters:
        participantId - participantId for which the sticky-flag shall be looked up
        Returns:
        The routing entry's sticky state.
      • apply

        public void apply​(AddressOperation addressOperation)
        Description copied from interface: RoutingTable
        Apply the specified operation to all addresses currently held in the routing table.
        Specified by:
        apply in interface RoutingTable
        Parameters:
        addressOperation - the address operation to perform.
      • purge

        public void purge()
        Description copied from interface: RoutingTable
        Purge all expired routing entries from the table
        Specified by:
        purge in interface RoutingTable
      • incrementReferenceCount

        public void incrementReferenceCount​(String participantId)
        Description copied from interface: RoutingTable
        Increment the reference count of the entry with the given participantId. If no such enbtry is available, a JoynrIllegalstateException is thrown.
        Specified by:
        incrementReferenceCount in interface RoutingTable