public class RoutingTableImpl extends Object implements RoutingTable
| Constructor and Description |
|---|
RoutingTableImpl(long routingTableGracePeriodMs,
String[] gbidsArray,
RoutingTableAddressValidator addressValidator) |
| Modifier and Type | Method and 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
|
void |
put(String participantId,
Address address,
boolean isGloballyVisible,
long expiryDateMs)
Overload of put method with isSticky set to false.
|
void |
put(String participantId,
Address address,
boolean isGloballyVisible,
long expiryDateMs,
boolean sticky)
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
|
@Inject
public RoutingTableImpl(long routingTableGracePeriodMs,
String[] gbidsArray,
RoutingTableAddressValidator addressValidator)
public void setGcdParticipantId(String gcdParticipantId)
RoutingTablesetGcdParticipantId in interface RoutingTablegcdParticipantId - the participantId of the GCDpublic Address get(String participantId)
get in interface RoutingTableparticipantId - participantId for which an Address will be returned from the
routing tableRoutingTable.get(String, String)public Address get(String participantId, String gbid)
get in interface RoutingTableparticipantId - 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)ConfigurableMessagingSettings.PROPERTY_GBIDSpublic void put(String participantId, Address address, boolean isGloballyVisible, long expiryDateMs)
RoutingTableput in interface RoutingTableparticipantId - 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 millisecondspublic void put(String participantId, Address address, boolean isGloballyVisible, long expiryDateMs, boolean sticky)
RoutingTableput in interface RoutingTableparticipantId - 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 millisecondssticky - If set to true, the routing entry never expires and cannot be replacedpublic boolean containsKey(String participantId)
containsKey in interface RoutingTablepublic boolean getIsGloballyVisible(String participantId)
RoutingTablegetIsGloballyVisible in interface RoutingTableparticipantId - participantId for which the visibility shall be looked uppublic long getExpiryDateMs(String participantId)
RoutingTablegetExpiryDateMs in interface RoutingTableparticipantId - participantId for which the expiryDate shall be looked uppublic boolean getIsSticky(String participantId)
RoutingTablegetIsSticky in interface RoutingTableparticipantId - participantId for which the sticky-flag shall be looked uppublic void remove(String participantId)
remove in interface RoutingTablepublic void apply(AddressOperation addressOperation)
RoutingTableapply in interface RoutingTableaddressOperation - the address operation to perform.public void purge()
RoutingTablepurge in interface RoutingTablepublic void incrementReferenceCount(String participantId)
RoutingTableincrementReferenceCount in interface RoutingTableCopyright © 2021. All rights reserved.