Interface RoutingTable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void apply​(AddressOperation addressOperation)
      Apply the specified operation to all addresses currently held in the routing table.
      boolean containsKey​(String participantId)  
      Address get​(String participantId)  
      Address get​(String participantId, String gbid)  
      long getExpiryDateMs​(String participantId)
      Query the expiry date of a routing entry for a participant id.
      boolean getIsGloballyVisible​(String participantId)
      Query the routing table for the status of isGloballyVisible parameter
      boolean getIsSticky​(String participantId)
      Query the sticky-flag of a routing entry for a participant id.
      void incrementReferenceCount​(String participantId)
      Increment the reference count of the entry with the given participantId.
      void purge()
      Purge all expired routing entries from the table
      boolean put​(String participantId, Address address, boolean isGloballyVisible, long expiryDateMs)
      Overload of put method with isSticky set to false.
      boolean put​(String participantId, Address address, boolean isGloballyVisible, long expiryDateMs, boolean isSticky)
      Adds a new routing entry.
      void remove​(String participantId)  
      void setGcdParticipantId​(String gcdParticipantId)
      Sets the participantId of the Global Capabilities Directory (GCD) before adding it to the routing table
    • Method Detail

      • get

        Address get​(String participantId)
        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 get(String, String)
      • get

        Address get​(String participantId,
                    String gbid)
        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
      • setGcdParticipantId

        void setGcdParticipantId​(String gcdParticipantId)
        Sets the participantId of the Global Capabilities Directory (GCD) before adding it to the routing table
        Parameters:
        gcdParticipantId - the participantId of the GCD
      • put

        boolean put​(String participantId,
                    Address address,
                    boolean isGloballyVisible,
                    long expiryDateMs,
                    boolean isSticky)
        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).
        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
        isSticky - If set to true, the routing entry never expires and cannot be replaced
        Returns:
        true if succeeded, false otherwise
      • put

        boolean put​(String participantId,
                    Address address,
                    boolean isGloballyVisible,
                    long expiryDateMs)
        Overload of put method with isSticky set to false.
        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
      • containsKey

        boolean containsKey​(String participantId)
      • getIsGloballyVisible

        boolean getIsGloballyVisible​(String participantId)
        Query the routing table for the status of isGloballyVisible parameter
        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
        Throws:
        JoynrRuntimeException - if no entry exists for the given participantId
      • getExpiryDateMs

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

        boolean getIsSticky​(String participantId)
        Query the sticky-flag of a routing entry for a participant id.
        Parameters:
        participantId - participantId for which the sticky-flag shall be looked up
        Returns:
        The routing entry's sticky state.
      • remove

        void remove​(String participantId)
      • apply

        void apply​(AddressOperation addressOperation)
        Apply the specified operation to all addresses currently held in the routing table.
        Parameters:
        addressOperation - the address operation to perform.
      • purge

        void purge()
        Purge all expired routing entries from the table
      • incrementReferenceCount

        void incrementReferenceCount​(String participantId)
        Increment the reference count of the entry with the given participantId. If no such enbtry is available, a JoynrIllegalstateException is thrown.
        Parameters:
        participantId -