java.lang.Object
org.forgerock.opendj.server.leaderbasedreplication.ReplicaClient

public class ReplicaClient extends Object
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()
  • 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 id
      replicaConnection - the connection to the replica
      domainStates - the states of the domains to fetch
      searchResultHandler - the handler to process the search results
      logContext - 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

      Registers a replica to the core.
      Parameters:
      coreConnection - the connection to the core
      request - the registration request from the replica
      Returns:
      the response from the core
      Throws:
      LdapException - if an error occurs while registering to the core
    • fetchTopologyFromCore

      public Topology fetchTopologyFromCore(Connection coreConnection) throws LdapException
      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

      public static void logChangelogEntry(SearchResultEntry searchResultEntry, String logContext)
      Logs the provided changelog entry.
      Parameters:
      searchResultEntry - the changelog entry
      logContext - provides context for logging (originator of the request)