Class LDAPReplicationDomain

    • Field Detail

      • DS_SYNC_CONFLICT

        public static final String DS_SYNC_CONFLICT
        The attribute used to mark conflicting entries. The value of this attribute should be the dn that this entry was supposed to have when it was marked as conflicting.
        See Also:
        Constant Field Values
    • Method Detail

      • processServerShutdown

        public void processServerShutdown​(LocalizableMessage reason)
        Description copied from interface: ServerShutdownListener
        Indicates that the Directory Server has received a request to stop running and that this shutdown listener should take any action necessary to prepare for it.
        Specified by:
        processServerShutdown in interface ServerShutdownListener
        Parameters:
        reason - The human-readable reason for the shutdown.
      • receiveEntryBytes

        protected byte[] receiveEntryBytes()
        Receives bytes related to an entry in the context of an import to initialize the domain (called by ReplLDIFInputStream).

        This is overwritten to allow stopping the (online) import process by the fractional ldif import plugin when it detects that the (imported) remote data set is not consistent with the local fractional configuration.

        Overrides:
        receiveEntryBytes in class ReplicationDomain
        Returns:
        The bytes. Null when the Done or Err message has been received
      • initializeRemote

        protected void initializeRemote​(ReplicaId target,
                                        ReplicaId requestorID,
                                        Task initTask,
                                        int initWindow)
                                 throws LdapException
        Process the initialization of some other server or servers in the topology specified by the target argument when this initialization specifying the server that requests the initialization.

        This is overwritten to allow stopping the (online) export process if the local domain is fractional and the destination is all other servers: This make no sense to have only fractional servers in a replicated topology. This prevents from administrator manipulation error that would lead to whole topology data corruption.

        Overrides:
        initializeRemote in class ReplicationDomain
        Parameters:
        target - The target replica that should be initialized.
        requestorID - The replica that initiated the export. It can be the replica id of this server, or the replica id of a remote replica.
        initTask - The task in this server that triggers this initialization and that should be updated with its progress. Null when the export is done following a request coming from a remote server (task is remote).
        initWindow - The value of the initialization window for flow control between the importer and the exporter.
        Throws:
        LdapException - When an error occurs. No exception raised means success.
      • shutdown

        public void shutdown()
        Shutdown this ReplicationDomain.
      • suspend

        public void suspend()
        Suspends replication on this domain. The session to the replication server will be stopped. The domain will not be destroyed but call to the pre-operation methods will result in failure. The listener thread will be destroyed. The monitor informations will still be accessible.
      • resume

        public void resume()
        Restart replication for this domain after a previous suspend. The domain will connect back to a replication Server and will recreate threads to listen for messages from the Synchronization server. The generationId will be retrieved or computed if necessary. The ServerState will also be read again from the local database.
      • retrievesReplicationDomain

        public static LDAPReplicationDomain retrievesReplicationDomain​(Dn baseDN,
                                                                       ServerContext serverContext)
                                                                throws LdapException
        Retrieves a replication domain based on the baseDN.
        Parameters:
        baseDN - The baseDN of the domain to retrieve
        serverContext - The server context
        Returns:
        The domain retrieved
        Throws:
        LdapException - When an error occurred or no domain match the provided baseDN.
      • getAlerts

        public Map<String,​String> getAlerts()
        Description copied from interface: AlertGenerator
        Retrieves information about the set of alerts that this generator may produce. The map returned should be between the notification type for a particular notification and the human-readable description for that notification. This alert generator must not generate any alerts with types that are not contained in this list.
        Specified by:
        getAlerts in interface AlertGenerator
        Returns:
        Information about the set of alerts that this generator may produce.
      • getComponentEntryDN

        public Dn getComponentEntryDN()
        Description copied from interface: AlertGenerator
        Retrieves the DN of the configuration entry with which this alert generator is associated.
        Specified by:
        getComponentEntryDN in interface AlertGenerator
        Returns:
        The DN of the configuration entry with which this alert generator is associated.
      • start

        public void start()
        Starts the Replication Domain.
      • sessionInitiated

        public void sessionInitiated​(ServerStatus initStatus,
                                     ServerState rsState,
                                     ServerState newestChangelogStateOfReplica)
        Description copied from class: ReplicationDomain
        Set the initial status of the domain and perform necessary initializations. This method will be called by the Broker each time the ReplicationBroker establish a new session to a Replication Server. Implementations may override this method when they need to perform additional computing after session establishment. The default implementation should be sufficient for ReplicationDomains that don't need to perform additional computing.
        Overrides:
        sessionInitiated in class ReplicationDomain
        Parameters:
        initStatus - The status to enter the state machine with.
        rsState - The ServerState of the ReplicationServer with which the session was established.
        newestChangelogStateOfReplica - The newest known ServerState of the change-log for this replica across the contacted ReplicationServers
      • countEntries

        public long countEntries()
                          throws LdapException
        This method should return the total number of objects in the replicated domain. This count will be used for reporting.
        Specified by:
        countEntries in class ReplicationDomain
        Returns:
        The number of objects in the replication domain.
        Throws:
        LdapException - when needed.
      • updateState

        protected void updateState()
        Once the updates are completed by the replay threads (concurrently), dependency data and the server state are cleaned up. This method is called also when no new updates are being received, so that updates being completed by the replay threads can be post-processed properly.
        Overrides:
        updateState in class ReplicationDomain
      • decodeSource

        public ReplicaId decodeSource​(String sourceReplicaName)
                               throws LdapException
        Verifies that the given string represents a valid source from which this server can be initialized.
        Parameters:
        sourceReplicaName - The string representing the name of the source
        Returns:
        the source ReplicaId
        Throws:
        LdapException - if the string is not valid
      • purgeConflictsHistorical

        public void purgeConflictsHistorical​(PurgeConflictsHistoricalTask task,
                                             Duration purgeTaskMaxDuration)
                                      throws LdapException
        Check and purge the historical attribute on all eligible entries under this domain. The purging logic is the same applied to individual entries during modify operations. This task may be useful in scenarios where a large number of changes are made as a one-off occurrence. Running a purge-historical after the 'ds-cfg-conflicts-historical-purge-delay' period has elapsed would clear out obsolete historical data from all the modified entries reducing the overall database size.
        Parameters:
        task - the task raising this purge.
        purgeTaskMaxDuration - the maximum time allowed for this purge operation.
        Throws:
        LdapException - if the maximum time is reached or when an exception happens.