Class Topology
A server may be a DS, an RS or a DS/RS.
If the topology contains servers with version 6.5 or lower, there can be multiple entries for the same server because there are multiple server ids per server.
The topology is updated with information from the local server and with information provided by the
TopologyMsg
received. A server is automatically removed from the topology if there is no update received
from it during a given period of time.
The topology provides a way to know the list of all participating RSs through the getChangelogEndpoints()
method. As an RS may listen to several interfaces, it provides one to many endpoints to contact for each RS.
-
Constructor Summary
ConstructorDescriptionTopology
(ServerContext serverContext, ServerId<?> localServerId) Creates an empty topology. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLocalAdminPorts
(Collection<com.forgerock.opendj.util.HostPort> adminEndpoints) Adds administrative host ports to the local server.void
addLocalLdapPorts
(ConnectionSecurity connSecurity, Collection<com.forgerock.opendj.util.HostPort> ldapEndpoints) Adds LDAP (LDAPS / StartTLS) host ports to the local server.void
addLocalReplicationDomain
(ReplicaId replicaId, Dn baseDn) Adds a replication domain to the local server in the topology.void
applyTopologyMessage
(TopologyMsg topologyMsg, Dn baseDn, ReplicationServerId senderId) Updates the topology with the provided topology message.Returns the set of replication endpoints for all the replication servers in the topology.boolean
isLocalServerEndpoint
(com.forgerock.opendj.util.HostPort endpoint) Indicates whether the providedHostPort
corresponds to this local server.boolean
isLocalServerHost
(com.forgerock.opendj.util.Host host) Indicates whether the providedHostPort
has the sameHost
as this local server.void
removeBootstrapServersForReplicationDomain
(Dn domainBaseDn) Removes the bootstrap servers - i.e.void
Removes the bootstrap servers - i.e.void
removeLocalAdminPorts
(Collection<com.forgerock.opendj.util.HostPort> adminEndpoints) Removes administrative host ports from the local server.void
removeLocalLdapPorts
(ConnectionSecurity connSecurity, Collection<com.forgerock.opendj.util.HostPort> ldapEndpoints) Removes LDAP (LDAPS / StartTLS) host ports from the local server.void
removeLocalReplicationDomain
(ReplicaId replicaId, Dn baseDn) Removes a replication domain from the local server in the topology.void
setBootstrapServersForReplicationDomain
(Set<com.forgerock.opendj.util.HostPort> bootstrapServers, Dn domainBaseDn) Sets the bootstrap servers - i.e.void
setBootstrapServersForReplicationServer
(Set<com.forgerock.opendj.util.HostPort> bootstrapServers) Sets the bootstrap servers - i.e.void
setLocalReplicationServer
(ReplicationServerId rsId, com.forgerock.opendj.discovery.GroupId groupId, Duration changelogPurgeDelay, SortedSet<com.forgerock.opendj.util.Host> changelogEndpoints, int replicationPort) Sets the local replication server in the topology, merging it with any existing local replication domains.toDSInfoOrNull
(ReplicaId replicaId) Returns the information available from the topology for this replica ID as aDSInfo
object.toRSInfoOrNull
(ReplicationServerId replicationServerId) Returns the information available from the topology for this replication server ID as aRSInfo
object.toString()
void
updateLocalGroupId
(String groupId) Updates the groupID for the local server.
-
Constructor Details
-
Topology
Creates an empty topology.- Parameters:
serverContext
- The server context.localServerId
- The server id for the local server- Throws:
ConfigException
- if the configuration cannot be read
-
-
Method Details
-
isLocalServerEndpoint
public boolean isLocalServerEndpoint(com.forgerock.opendj.util.HostPort endpoint) Indicates whether the providedHostPort
corresponds to this local server.- Parameters:
endpoint
- the address to test.- Returns:
true
if the providedHostPort
corresponds to this local server.
-
isLocalServerHost
public boolean isLocalServerHost(com.forgerock.opendj.util.Host host) Indicates whether the providedHostPort
has the sameHost
as this local server.Note that the test is comparing hosts without DNS lookup, so it requires that the hosts are provided in the same form (i.e. with the same hostname or the same IP address).
- Parameters:
host
- the address to test.- Returns:
true
if the providedHostPort
has the sameHost
as this local server.
-
getChangelogEndpoints
Returns the set of replication endpoints for all the replication servers in the topology.A replication server can listen on several addresses, so there could be multiple endpoints for it.
- Returns:
- the set of replication endpoints for all servers in the topology.
-
setBootstrapServersForReplicationDomain
public void setBootstrapServersForReplicationDomain(Set<com.forgerock.opendj.util.HostPort> bootstrapServers, Dn domainBaseDn) Sets the bootstrap servers - i.e. the servers known in the configuration - for a replication domain.- Parameters:
bootstrapServers
- the set of host and port of the bootstrap servers.domainBaseDn
- the base dn of the replication domain
-
setBootstrapServersForReplicationServer
public void setBootstrapServersForReplicationServer(Set<com.forgerock.opendj.util.HostPort> bootstrapServers) Sets the bootstrap servers - i.e. the servers known in the configuration - for the replication server.- Parameters:
bootstrapServers
- the set of host and port of the bootstrap servers.
-
removeBootstrapServersForReplicationDomain
Removes the bootstrap servers - i.e. the servers known in the configuration - for a replication domain.- Parameters:
domainBaseDn
- the base dn of the replication domain
-
removeBootstrapServersForReplicationServer
public void removeBootstrapServersForReplicationServer()Removes the bootstrap servers - i.e. the servers known in the configuration - for the replication server. -
setLocalReplicationServer
public void setLocalReplicationServer(ReplicationServerId rsId, com.forgerock.opendj.discovery.GroupId groupId, Duration changelogPurgeDelay, SortedSet<com.forgerock.opendj.util.Host> changelogEndpoints, int replicationPort) Sets the local replication server in the topology, merging it with any existing local replication domains.- Parameters:
rsId
- the server ID of the local server.groupId
- the group ID of the local server.changelogPurgeDelay
- the purge delay for the changelog.changelogEndpoints
- the addresses of the local replication server.replicationPort
- the port of the local replication server.
-
addLocalReplicationDomain
Adds a replication domain to the local server in the topology.- Parameters:
replicaId
- The replicaId of the local server.baseDn
- The baseDn of the replication domain.
-
removeLocalReplicationDomain
Removes a replication domain from the local server in the topology.- Parameters:
replicaId
- The replicaId of the local server.baseDn
- The baseDn of the replication domain.
-
addLocalAdminPorts
Adds administrative host ports to the local server.- Parameters:
adminEndpoints
- the administrative host ports
-
addLocalLdapPorts
public void addLocalLdapPorts(ConnectionSecurity connSecurity, Collection<com.forgerock.opendj.util.HostPort> ldapEndpoints) Adds LDAP (LDAPS / StartTLS) host ports to the local server.- Parameters:
connSecurity
- connection security for the provided host portsldapEndpoints
- the ldap host ports
-
removeLocalAdminPorts
Removes administrative host ports from the local server.- Parameters:
adminEndpoints
- the administrative host ports
-
removeLocalLdapPorts
public void removeLocalLdapPorts(ConnectionSecurity connSecurity, Collection<com.forgerock.opendj.util.HostPort> ldapEndpoints) Removes LDAP (LDAPS / StartTLS) host ports from the local server.- Parameters:
connSecurity
- connection security for the provided host portsldapEndpoints
- the ldap host ports
-
toString
-
toDSInfoOrNull
Returns the information available from the topology for this replica ID as aDSInfo
object.- Parameters:
replicaId
- the replica ID- Returns:
- the available information as an DSInfo
-
toRSInfoOrNull
Returns the information available from the topology for this replication server ID as aRSInfo
object.- Parameters:
replicationServerId
- the replication server ID- Returns:
- the available information as an RSInfo
-
updateLocalGroupId
Updates the groupID for the local server.- Parameters:
groupId
- the new groupID
-
applyTopologyMessage
Updates the topology with the provided topology message.- Parameters:
topologyMsg
- a topology message received from a remote RS.baseDn
- the base Dn of the domain for which the topology message was received.senderId
- the id of the RS that sent the topology message.
-