Class ReplicaClient
java.lang.Object
org.forgerock.opendj.server.leaderbasedreplication.ReplicaClient
Represents a client that interacts with a remote replica, either regular or providing the Core feature.
Three operations are provided:
- Fetch changes from a replica:
fetchChangesFromReplica()
- Register to the core:
registerToCore()
- Fetch the topology from the core:
ReplicaClient#fetchTopologyFromCore()
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents the changelog state and the domain state (SCP and PP) for a given domain.static final record
Represents information that a replica must provide to register to the core regularly.static final record
Represents the information that is returned upon aReplicaClient.RegistrationToCoreRequest
sent by a replica to the core. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfetchChangesFromReplica
(ReplicaId replicaId, Connection replicaConnection, Set<ReplicaClient.ChangelogAndDomainStates> domainStates, SearchResultHandler searchResultHandler, String logContext) Fetches changes from a remote replica.fetchTopologyFromCore
(Connection coreConnection) Fetches the topology from the core.static void
logChangelogEntry
(SearchResultEntry searchResultEntry, String logContext) Logs the provided changelog entry.registerToCore
(Connection coreConnection, ReplicaClient.RegistrationToCoreRequest request) Registers a replica to the core.
-
Constructor Details
-
ReplicaClient
public ReplicaClient()
-
-
Method Details
-
fetchChangesFromReplica
public Result fetchChangesFromReplica(ReplicaId replicaId, Connection replicaConnection, Set<ReplicaClient.ChangelogAndDomainStates> domainStates, SearchResultHandler searchResultHandler, String logContext) throws LdapException Fetches changes from a remote replica.- Parameters:
replicaId
- the replica idreplicaConnection
- the connection to the replicadomainStates
- the states of the domains to fetchsearchResultHandler
- the handler to process the search resultslogContext
- provides context for logging (originator of the request)- Returns:
- the result of the search
- Throws:
LdapException
- if an error occurs while fetching the changes
-
registerToCore
public ReplicaClient.RegistrationToCoreResponse registerToCore(Connection coreConnection, ReplicaClient.RegistrationToCoreRequest request) throws LdapException Registers a replica to the core.- Parameters:
coreConnection
- the connection to the corerequest
- the registration request from the replica- Returns:
- the response from the core
- Throws:
LdapException
- if an error occurs while registering to the core
-
fetchTopologyFromCore
Fetches the topology from the core.- Parameters:
coreConnection
- the connection to the core- Returns:
- the topology
- Throws:
LdapException
- if an error occurs while fetching the topology
-
logChangelogEntry
Logs the provided changelog entry.- Parameters:
searchResultEntry
- the changelog entrylogContext
- provides context for logging (originator of the request)
-