Package io.joynr.messaging.routing
Interface RoutingTable
-
- All Known Implementing Classes:
DummyRoutingTable,RoutingTableImpl
public interface RoutingTable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapply(AddressOperation addressOperation)Apply the specified operation to all addresses currently held in the routing table.booleancontainsKey(String participantId)Addressget(String participantId)Addressget(String participantId, String gbid)longgetExpiryDateMs(String participantId)Query the expiry date of a routing entry for a participant id.booleangetIsGloballyVisible(String participantId)Query the routing table for the status of isGloballyVisible parameterbooleangetIsSticky(String participantId)Query the sticky-flag of a routing entry for a participant id.voidincrementReferenceCount(String participantId)Increment the reference count of the entry with the given participantId.voidpurge()Purge all expired routing entries from the tablebooleanput(String participantId, Address address, boolean isGloballyVisible, long expiryDateMs)Overload of put method with isSticky set to false.booleanput(String participantId, Address address, boolean isGloballyVisible, long expiryDateMs, boolean isSticky)Adds a new routing entry.voidremove(String participantId)voidsetGcdParticipantId(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 tablegbid- 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 GBIDsConfigurableMessagingSettings.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 createdaddress- Address which shall be associated with the participant idisGloballyVisible- States whether the endpoint is globally visible or notexpiryDateMs- Expiry date of the routing entry in millisecondsisSticky- 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 createdaddress- Address which shall be associated with the participant idisGloballyVisible- States whether the endpoint is globally visible or notexpiryDateMs- 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-
-
-