Package org.forgerock.opendj.discovery
Class StaticServiceDiscoveryMechanism
java.lang.Object
org.forgerock.opendj.discovery.StaticServiceDiscoveryMechanism
- All Implemented Interfaces:
Closeable,AutoCloseable,ServiceDiscoveryMechanism
This mechanism only returns the list of servers in its configuration, without checking for availability.
It will periodically query the list of servers for changes in their baseDns.
-
Field Summary
FieldsModifier and TypeFieldDescriptionInterval between two replication server configuration discovery queries.static final Option<Supplier<ScheduledExecutorService>>The scheduled executor service where service discovery is scheduled.Specifies a list of servers that will be used in preference to secondary servers when available.Specifies a list of servers that will be used in place of primary servers when all primary servers are unavailable. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Frees any resources in use, mechanism will not be used anymore afterwards.final voidDe-registers a listener from notifications on service changes.getPartition(Collection<Dn> baseDns) Returns the partition.final voidRegisters a listener to be notified when changes in the service occur.toString()
-
Field Details
-
PRIMARY_SERVERS
Specifies a list of servers that will be used in preference to secondary servers when available. -
SECONDARY_SERVERS
Specifies a list of servers that will be used in place of primary servers when all primary servers are unavailable. -
DISCOVERY_INTERVAL
Interval between two replication server configuration discovery queries.Specifies how frequently to query a replication server configuration in order to discover information about available directory server replicas.
Default value:
1m -
EXECUTOR_SERVICE
The scheduled executor service where service discovery is scheduled.
-
-
Method Details
-
getPartition
Description copied from interface:ServiceDiscoveryMechanismReturns the partition.The
Partitionwill only contain servers that are known to expose the provided list of base DNs. An empty list of base DNs will result in all partitions and all servers being returned. In other words, an empty list of base DNs implies that all servers contain exactly the same base DNs.- Parameters:
baseDns- the baseDNs for which to retrieve the partitions- Returns:
- the partition that can serve the provided base DNs
-
close
public final void close()Description copied from interface:ServiceDiscoveryMechanismFrees any resources in use, mechanism will not be used anymore afterwards.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceServiceDiscoveryMechanism
-
registerChangeListener
Description copied from interface:ServiceDiscoveryMechanismRegisters a listener to be notified when changes in the service occur.- Specified by:
registerChangeListenerin interfaceServiceDiscoveryMechanism- Parameters:
listener- the listener to register for notifications
-
deregisterChangeListener
Description copied from interface:ServiceDiscoveryMechanismDe-registers a listener from notifications on service changes.- Specified by:
deregisterChangeListenerin interfaceServiceDiscoveryMechanism- Parameters:
listener- the listener to de-register
-
toString
-