Class ReplicationServiceDiscoveryMechanism
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ServiceDiscoveryMechanism
The partitions returned by this class contain the directory servers that are part of the same topology as the configured replication servers.
It will periodically query the topology to discover any new or removed servers and notify listeners of any changes.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Option<BindRequest>
The bind request to use to perform service discovery when connecting to servers.The addresses of one or more replication servers within the topology which this server should connect to in order to discover the rest of the topology.Interval between two replication server configuration discovery queries.static final Option<Supplier<ScheduledExecutorService>>
The scheduled executor service where service discovery is scheduled.Replication domain group ID of preferred directory server replicas. -
Constructor Summary
ConstructorDescriptionInitializes the mechanism with the provided options. -
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
-
BIND_REQUEST
The bind request to use to perform service discovery when connecting to servers.- Prerequisite for using
external SASL
: all replication servers must be able to map the certificate to an admin user. - Prerequisite for using
simple bind
: all replication servers must have the same admin DN and bindPassword.
- Prerequisite for using
-
BOOTSTRAP_REPLICATION_SERVERS
The addresses of one or more replication servers within the topology which this server should connect to in order to discover the rest of the topology.Addresses must be specified using the administration port of the remote replication servers using the syntax "hostname:admin-port". When using an IPv6 address as the hostname, put brackets around the address as in "[IPv6Address]:admin-port".
-
PRIMARY_GROUP_ID
Replication domain group ID of preferred directory server replicas.Directory server replicas with this replication domain group ID will be preferred over other directory server replicas. Secondary server replicas will only be used when all primary server replicas become 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.
-
-
Constructor Details
-
ReplicationServiceDiscoveryMechanism
Initializes the mechanism with the provided options.- Parameters:
options
- the options for initialization
-
-
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
-