public class ReplicationServer extends Object implements org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.ReplicationServerCfg>
Constructor and Description |
---|
ReplicationServer(org.forgerock.opendj.server.config.server.ReplicationServerCfg cfg)
Creates a new Replication server using the provided configuration entry.
|
ReplicationServer(org.forgerock.opendj.server.config.server.ReplicationServerCfg cfg,
DSRSShutdownSync dsrsShutdownSync)
Creates a new Replication server using the provided configuration entry and shutdown
synchronization object.
|
ReplicationServer(org.forgerock.opendj.server.config.server.ReplicationServerCfg cfg,
DSRSShutdownSync dsrsShutdownSync,
ECLEnabledDomainPredicate predicate)
Creates a new Replication server using the provided configuration entry, shutdown
synchronization object and domain predicate.
|
Modifier and Type | Method and Description |
---|---|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(org.forgerock.opendj.server.config.server.ReplicationServerCfg configuration) |
static List<ReplicationServer> |
getAllInstances()
Get the list of every replication servers instantiated in the current VM.
|
long |
getAssuredTimeout()
Get the assured mode timeout.
|
ChangelogDB |
getChangelogDB()
Returns the changelogDB.
|
int |
getDegradedStatusThreshold()
Get the degraded status threshold value for status analyzer.
|
Iterator<ReplicationServerDomain> |
getDomainIterator()
Returns an iterator on the list of replicationServerDomain.
|
long |
getGenerationId(org.forgerock.opendj.ldap.Dn baseDN)
Get the value of generationId for the replication replicationServerDomain
associated with the provided baseDN.
|
byte |
getGroupId()
Get The replication server group id.
|
long |
getMonitoringPublisherPeriod()
Get the monitoring publisher period value.
|
String |
getMonitorInstanceName()
Retrieves a printable name for this Replication Server Instance.
|
long |
getNewestChangeNumber()
Returns the newest change number in the change number index DB.
|
MultiDomainServerState |
getNewestECLCookie(Set<org.forgerock.opendj.ldap.Dn> excludedBaseDNs)
Returns the newest cookie value.
|
long |
getOldestChangeNumber()
Returns the oldest change number in the change number index DB.
|
long |
getPurgeDelay()
Retrieves the time after which changes must be deleted from the
persistent storage (in milliseconds).
|
int |
getReplicationPort()
Retrieves the port used by this ReplicationServer.
|
ReplicationServerDomain |
getReplicationServerDomain(org.forgerock.opendj.ldap.Dn baseDN)
Get the ReplicationServerDomain associated to the base DN given in
parameter.
|
ReplicationServerDomain |
getReplicationServerDomain(org.forgerock.opendj.ldap.Dn baseDN,
boolean create)
Get the ReplicationServerDomain associated to the base DN given in
parameter.
|
int |
getServerId()
Get the serverId for this replication server.
|
String |
getServerURL()
Getter on the server URL.
|
int |
getWeight()
Gets the weight affected to the replication server.
|
boolean |
isChangeNumberEnabled()
Returns whether change-log indexing is enabled for this RS.
|
static boolean |
isConfigurationAcceptable(org.forgerock.opendj.server.config.server.ReplicationServerCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Check if the provided configuration is acceptable for add.
|
boolean |
isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.ReplicationServerCfg configuration,
List<LocalizableMessage> unacceptableReasons) |
boolean |
isECLEnabled()
Returns whether the external change-log contains data from at least a domain.
|
boolean |
isEncrypted()
Return whether change-log records should be encrypted.
|
static boolean |
isLocalReplicationServerPort(int port)
Returns
true if the provided port is one of the ports that this
replication server is listening on. |
static void |
onlyForTestsAddlocalReplicationServer(String server)
WARNING : only use this methods for tests purpose.
|
static void |
onlyForTestsClearLocalReplicationServerList()
WARNING : only use this methods for tests purpose.
|
void |
remove()
Do what needed when the config object related to this replication server
is deleted from the server configuration.
|
void |
shutdown()
Shutdown the Replication Server service and all its connections.
|
String |
toString() |
void |
validateCookie(MultiDomainServerState cookie,
Set<org.forgerock.opendj.ldap.Dn> ignoredBaseDNs)
Validate that provided cookie is coherent with this replication server,
when ignoring the provided set of DNs.
|
public ReplicationServer(org.forgerock.opendj.server.config.server.ReplicationServerCfg cfg) throws org.forgerock.opendj.config.server.ConfigException
cfg
- The configuration of this replication server.org.forgerock.opendj.config.server.ConfigException
- When Configuration is invalid.public ReplicationServer(org.forgerock.opendj.server.config.server.ReplicationServerCfg cfg, DSRSShutdownSync dsrsShutdownSync) throws org.forgerock.opendj.config.server.ConfigException
cfg
- The configuration of this replication server.dsrsShutdownSync
- Synchronization object for shutdown of combined DS/RS instances.org.forgerock.opendj.config.server.ConfigException
- When Configuration is invalid.public ReplicationServer(org.forgerock.opendj.server.config.server.ReplicationServerCfg cfg, DSRSShutdownSync dsrsShutdownSync, ECLEnabledDomainPredicate predicate) throws org.forgerock.opendj.config.server.ConfigException
cfg
- The configuration of this replication server.dsrsShutdownSync
- Synchronization object for shutdown of combined DS/RS instances.predicate
- Indicates whether a domain is enabled for the external changelog.org.forgerock.opendj.config.server.ConfigException
- When Configuration is invalid.public static List<ReplicationServer> getAllInstances()
public ReplicationServerDomain getReplicationServerDomain(org.forgerock.opendj.ldap.Dn baseDN)
baseDN
- The base DN for which the ReplicationServerDomain must be
returned.public void validateCookie(MultiDomainServerState cookie, Set<org.forgerock.opendj.ldap.Dn> ignoredBaseDNs) throws DirectoryException
The cookie is coherent if and only if it exactly has the set of DNs corresponding to the replication domains, and the states in the cookie are not older than oldest states in the server.
cookie
- The multi domain state (cookie) to validate.ignoredBaseDNs
- The set of DNs to ignore when validatingDirectoryException
- If the cookie is not validpublic ReplicationServerDomain getReplicationServerDomain(org.forgerock.opendj.ldap.Dn baseDN, boolean create)
baseDN
- The base DN for which the ReplicationServerDomain must be
returned.create
- Specifies whether to create the ReplicationServerDomain if
it does not already exist.public void shutdown()
public long getPurgeDelay()
public static boolean isConfigurationAcceptable(org.forgerock.opendj.server.config.server.ReplicationServerCfg configuration, List<LocalizableMessage> unacceptableReasons)
configuration
- The configuration to check.unacceptableReasons
- When the configuration is not acceptable, this
table is use to return the reasons why this
configuration is not acceptable.public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(org.forgerock.opendj.server.config.server.ReplicationServerCfg configuration)
applyConfigurationChange
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.ReplicationServerCfg>
public boolean isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.ReplicationServerCfg configuration, List<LocalizableMessage> unacceptableReasons)
isConfigurationChangeAcceptable
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.ReplicationServerCfg>
public long getGenerationId(org.forgerock.opendj.ldap.Dn baseDN)
baseDN
- The baseDN of the replicationServerDomain.public int getServerId()
public void remove()
public Iterator<ReplicationServerDomain> getDomainIterator()
public long getAssuredTimeout()
It is the Timeout (in milliseconds) when waiting for acknowledgments.
public byte getGroupId()
public int getDegradedStatusThreshold()
The degraded status threshold is the number of pending changes for a DS, considered as threshold value to put the DS in DEGRADED_STATUS. If value is 0, status analyzer is disabled.
public long getMonitoringPublisherPeriod()
It is the number of milliseconds to wait before sending new monitoring messages. If value is 0, monitoring publisher is disabled.
public String getMonitorInstanceName()
public int getReplicationPort()
public String getServerURL()
public static void onlyForTestsAddlocalReplicationServer(String server)
server
- The server to be added.public static void onlyForTestsClearLocalReplicationServerList()
public static boolean isLocalReplicationServerPort(int port)
true
if the provided port is one of the ports that this
replication server is listening on.port
- The port to be checked.true
if the provided port is one of the ports that this
replication server is listening on.public long getOldestChangeNumber() throws DirectoryException
DirectoryException
- When a problem happenspublic long getNewestChangeNumber() throws DirectoryException
DirectoryException
- When a problem happenspublic MultiDomainServerState getNewestECLCookie(Set<org.forgerock.opendj.ldap.Dn> excludedBaseDNs)
excludedBaseDNs
- The set of baseDNs excluded from ECL.public int getWeight()
Each replication server of the topology has a weight. When combined together, the weights of the replication servers of a same group can be translated to a percentage that determines the quantity of directory servers of the topology that should be connected to a replication server.
For instance imagine a topology with 3 replication servers (with the same group id) with the following weights: RS1=1, RS2=1, RS3=2. This means that RS1 should have 25% of the directory servers connected in the topology, RS2 25%, and RS3 50%. This may be useful if the replication servers of the topology have a different power and one wants to spread the load between the replication servers according to their power.
public ChangelogDB getChangelogDB()
public boolean isChangeNumberEnabled()
public boolean isECLEnabled()
public boolean isEncrypted()
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.