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
Modifier 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 void
close()
Frees any resources in use, mechanism will not be used anymore afterwards.final void
De-registers a listener from notifications on service changes.getPartition
(Collection<Dn> baseDns) Returns the partition.final void
Registers 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:ServiceDiscoveryMechanism
Returns the partition.The
Partition
will 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:ServiceDiscoveryMechanism
Frees any resources in use, mechanism will not be used anymore afterwards.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceServiceDiscoveryMechanism
-
registerChangeListener
Description copied from interface:ServiceDiscoveryMechanism
Registers a listener to be notified when changes in the service occur.- Specified by:
registerChangeListener
in interfaceServiceDiscoveryMechanism
- Parameters:
listener
- the listener to register for notifications
-
deregisterChangeListener
Description copied from interface:ServiceDiscoveryMechanism
De-registers a listener from notifications on service changes.- Specified by:
deregisterChangeListener
in interfaceServiceDiscoveryMechanism
- Parameters:
listener
- the listener to de-register
-
toString
-