Class ReplicationDomain

  • Direct Known Subclasses:
    LDAPReplicationDomain

    public abstract class ReplicationDomain
    extends Object
    This class should be used as a base for Replication implementations.

    It is intended that developer in need of a replication mechanism subclass this class with their own implementation.

    The startup phase of the ReplicationDomain subclass, should read the list of replication servers from the configuration, instantiate a ServerState then start the publish service by calling startPublishService(). At this point it can start calling the publish(UpdateMsg) method if needed.

    When the startup phase reach the point when the subclass is ready to handle updates the Replication Domain implementation should call the startListenService() method. At this point a Listener thread is created on the Replication Service and which can start receiving updates.

    When updates are received the Replication Service calls the processUpdate(UpdateMsg) method. ReplicationDomain implementation should implement the appropriate code for replaying the update on the local repository. When fully done the subclass must call the processUpdateDone(UpdateMsg, String) method. This allows to process the update asynchronously if necessary.

    To propagate changes to other replica, a ReplicationDomain implementation must use the publish(UpdateMsg) method.

    If the Full Initialization process is needed then implementation for importBackend(InputStream) and exportBackend(OutputStream) must be provided.

    Full Initialization of a replica can be triggered by LDAP clients by creating InitializeTasks or InitializeTargetTask. Full initialization can also be triggered from the ReplicationDomain implementation using methods initializeRemote(int, Task) or initializeFromRemote(int, Task).

    At shutdown time, the disableService() method should be called to cleanly stop the replication service.

    • Field Detail

      • config

        protected volatile ReplicationDomainCfg config
        The configuration of the replication domain.
      • broker

        protected ReplicationBroker broker
        The ReplicationBroker that is used by this ReplicationDomain to connect to the ReplicationService.
      • serviceStateLock

        protected final Object serviceStateLock
        Serialises the stopping and the starting of the session of this domain, so that a pair of them is atomic: a session stopped so that the configuration it reads can be changed must not be brought back in the middle of that change by something else.

        Holding it costs something, and knowingly: enableService() connects to the replication servers under this lock, so a shutdown, an import or a configuration change which arrives while a replay thread is bringing the session back waits for that connect - up to the configured connection timeout when the replication servers are unreachable, which is the same outage that failed the replay. Every one of those stops the session as its first act, so what they wait for is a session which is about to be stopped again. A wait between a stop and a start belongs outside the lock, so that the waiting is bounded by a connect rather than by a backoff.

        It comes after the configuration backend's update lock and never before it: a write to the configuration entry of a domain holds that lock while it calls the domain's configuration change listener, which takes this one. So nothing may write a configuration entry while holding this lock - that is why neither the state a domain saves on its way down nor the generationId it stores on its way up falls back to the domain configuration entry when the base entry of the suffix is missing.

      • generationId

        protected volatile long generationId
        The generationId for this replication domain. It is made of a hash of the 1000 first entries for this domain.
    • Constructor Detail

      • ReplicationDomain

        public ReplicationDomain​(ReplicationDomainCfg config,
                                 long generationId)
        Creates a ReplicationDomain with the provided parameters.
        Parameters:
        config - The configuration object for this ReplicationDomain
        generationId - the generation of this ReplicationDomain
      • ReplicationDomain

        public ReplicationDomain​(ReplicationDomainCfg config,
                                 long generationId,
                                 ServerState serverState)
        Creates a ReplicationDomain with the provided parameters. (for unit test purpose only)
        Parameters:
        config - The configuration object for this ReplicationDomain
        generationId - the generation of this ReplicationDomain
        serverState - The serverState to use
    • Method Detail

      • sessionInitiated

        public void sessionInitiated​(ServerStatus initStatus,
                                     ServerState rsState)
        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.
        Parameters:
        initStatus - The status to enter the state machine with.
        rsState - The ServerState of the ReplicationServer with which the session was established.
      • getStatus

        public ServerStatus getStatus()
        Gets the status for this domain.
        Returns:
        The status for this domain.
      • getBaseDN

        public DN getBaseDN()
        Returns the base DN of this ReplicationDomain. All Replication Domain using this baseDN will be connected through the Replication Service.
        Returns:
        The base DN of this ReplicationDomain
      • getServerId

        public int getServerId()
        Get the server ID. The identifier of this Replication Domain inside the Replication Service. Each Domain must use a unique ServerID.
        Returns:
        The server ID.
      • isAssured

        public boolean isAssured()
        Tells if assured replication is enabled for this domain.
        Returns:
        True if assured replication is enabled for this domain.
      • getAssuredMode

        public AssuredMode getAssuredMode()
        Gives the mode for the assured replication of the domain. Only used when assured is true).
        Returns:
        The mode for the assured replication of the domain.
      • getAssuredSdLevel

        public byte getAssuredSdLevel()
        Gives the assured Safe Data level of the replication of the domain. (used when assuredMode is SAFE_DATA).
        Returns:
        The assured level of the replication of the domain.
      • getAssuredTimeout

        public long getAssuredTimeout()
        Gives the assured timeout of the replication of the domain (in ms).
        Returns:
        The assured timeout of the replication of the domain.
      • getGroupId

        public byte getGroupId()
        Gets the group id for this domain.
        Returns:
        The group id for this domain.
      • getRefUrls

        public Set<String> getRefUrls()
        Gets the referrals URLs this domain publishes. Referrals urls to be published to other servers of the topology.

        TODO: fill that with all currently opened urls if no urls configured

        Returns:
        The referrals URLs this domain publishes.
      • getReplicaInfos

        public Map<Integer,​DSInfo> getReplicaInfos()
        Gets the info for Replicas in the topology (except us).
        Returns:
        The info for Replicas in the topology (except us)
      • getReplicaStates

        public Map<Integer,​ServerState> getReplicaStates()
        Gets the States of all the Replicas currently in the Topology. When this method is called, a Monitoring message will be sent to the Replication Server to which this domain is currently connected so that it computes a table containing information about all Directory Servers in the topology. This Computation involves communications will all the servers currently connected and
        Returns:
        The States of all Replicas in the topology (except us)
      • getRsInfos

        public List<RSInfo> getRsInfos()
        Gets the info for RSs in the topology (except the one we are connected to).
        Returns:
        The info for RSs in the topology (except the one we are connected to)
      • getRsServerId

        public int getRsServerId()
        Gets the server ID of the Replication Server to which the domain is currently connected.
        Returns:
        The server ID of the Replication Server to which the domain is currently connected.
      • incProcessedUpdates

        protected final void incProcessedUpdates()
        Increment the number of processed updates.
      • decodeTarget

        public int decodeTarget​(String targetString)
                         throws DirectoryException
        Verifies that the given string represents a valid source from which this server can be initialized.
        Parameters:
        targetString - The string representing the source
        Returns:
        The source as a integer value
        Throws:
        DirectoryException - if the string is not valid
      • initializeRemote

        public void initializeRemote​(int target,
                                     Task initTask)
                              throws DirectoryException
        Initializes a remote server from this server.

        The exportBackend(OutputStream) will therefore be called on this server, and the importBackend(InputStream) will be called on the remote server.

        The InputStream and OutputStream given as a parameter to those methods will be connected through the replication protocol.

        Parameters:
        target - The server-id of the server that should be initialized. The target can be discovered using the getReplicaInfos() method.
        initTask - The task that triggers this initialization and that should be updated with its progress.
        Throws:
        DirectoryException - If it was not possible to publish the Initialization message to the Topology.
      • initializeRemote

        protected void initializeRemote​(int serverToInitialize,
                                        int serverRunningTheTask,
                                        Task initTask,
                                        int initWindow)
                                 throws DirectoryException
        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.
        Parameters:
        serverToInitialize - The target server that should be initialized.
        serverRunningTheTask - The server that initiated the export. It can be the serverID of this server, or the serverID of a remote server.
        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:
        DirectoryException - When an error occurs. No exception raised means success.
      • getServerState

        public ServerState getServerState()
        Get the ServerState maintained by the Concrete class.
        Returns:
        the ServerState maintained by the Concrete class.
      • receiveEntryBytes

        protected byte[] receiveEntryBytes()
        Receives bytes related to an entry in the context of an import to initialize the domain (called by ReplLDIFInputStream).
        Returns:
        The bytes. Null when the Done or Err message has been received
      • initializeFromRemote

        public void initializeFromRemote​(int source,
                                         Task initTask)
                                  throws DirectoryException
        Initializes asynchronously this domain from a remote source server. Before returning from this call, for the provided task : - the progressing counters are updated during the initialization using setTotal() and setLeft(). - the end of the initialization using updateTaskCompletionState().

        When this method is called, a request for initialization is sent to the remote source server requesting initialization.

        Parameters:
        source - The server-id of the source from which to initialize. The source can be discovered using the getReplicaInfos() method.
        initTask - The task that launched the initialization and should be updated of its progress.
        Throws:
        DirectoryException - If it was not possible to publish the Initialization message to the Topology. The task state is updated.
      • abortStalledInitializeFromRemote

        public boolean abortStalledInitializeFromRemote​(long stalledTimeoutMs)
        Fails the on-going initialization from a remote replica when the request published by initializeFromRemote(int, Task) has received no answer at all - neither the InitializeTargetMsg starting the import nor an ErrorMsg - within the provided delay. The request or its answer can be lost with no error ever coming back (issue #861), and nothing else bounds the wait: without this watchdog the initialize task hangs forever.
        Parameters:
        stalledTimeoutMs - delay in milliseconds after which the unanswered request is considered lost
        Returns:
        whether a stalled initialization was aborted by this call
      • signalNewStatus

        protected void signalNewStatus​(StatusMachineEvent event)
        Sets the status to a new value depending of the passed status machine event.
        Parameters:
        event - The event that may make the status be changed
      • ieRunning

        public boolean ieRunning()
        Returns a boolean indicating if an import or export is currently processed.
        Returns:
        The status
      • setImportClaimHook

        public void setImportClaimHook​(Runnable hook)
        Sets what the listener thread runs between the InitializeTargetMsg it took off the session and its claim of the import context - or, for a total update this replica asked for, its read of the context the request claimed.

        Only there for the tests which drive something else through that gap: it is a few statements wide, and nothing else can hold the listener thread there.

        Parameters:
        hook - what to run there, or null to run nothing
      • setServiceStopHook

        public void setServiceStopHook​(Runnable hook)
        Sets what disableService() runs, under its locks, before it stops the broker.

        Only there for the tests which drive something else through that gap: a total update which is claimed after the decision to stop the service and before the stop.

        Parameters:
        hook - what to run there, or null to run nothing
      • importInProgress

        protected boolean importInProgress()
        Returns a boolean indicating if a total update into this replica is currently processed, that is an import which is replacing the data of this domain.

        The other direction, an export which is initializing another replica from this one, leaves the data of this domain and its ServerState alone: it is reported by ieRunning() just the same, so anything which is guarding against the data being replaced has to ask this rather than that.

        Returns:
        true when an import is being processed, false when nothing is or when what is being processed is an export
      • resetGenerationId

        public void resetGenerationId​(Long generationIdNewValue)
                               throws DirectoryException
        Reset the generationId of this domain in the whole topology. A message is sent to the Replication Servers for them to reset their change dbs.
        Parameters:
        generationIdNewValue - The new value of the generation Id.
        Throws:
        DirectoryException - When an error occurs
      • isConnected

        public boolean isConnected()
        Check if the domain is connected to a ReplicationServer.
        Returns:
        true if the server is connected, false if not.
      • hasConnectionError

        public boolean hasConnectionError()
        Check if the domain has a connection error. A Connection error happens when the broker could not be created or when the broker could not find any ReplicationServer to connect to.
        Returns:
        true if the domain has a connection error.
      • getReplicationServer

        public HostPort getReplicationServer()
        Get the name of the replicationServer to which this domain is currently connected.
        Returns:
        the name of the replicationServer to which this domain is currently connected.
      • getAssuredSrSentUpdates

        public int getAssuredSrSentUpdates()
        Gets the number of updates sent in assured safe read mode.
        Returns:
        The number of updates sent in assured safe read mode.
      • getAssuredSrAcknowledgedUpdates

        public int getAssuredSrAcknowledgedUpdates()
        Gets the number of updates sent in assured safe read mode that have been acknowledged without errors.
        Returns:
        The number of updates sent in assured safe read mode that have been acknowledged without errors.
      • getAssuredSrNotAcknowledgedUpdates

        public int getAssuredSrNotAcknowledgedUpdates()
        Gets the number of updates sent in assured safe read mode that have not been acknowledged.
        Returns:
        The number of updates sent in assured safe read mode that have not been acknowledged.
      • getAssuredSrTimeoutUpdates

        public int getAssuredSrTimeoutUpdates()
        Gets the number of updates sent in assured safe read mode that have not been acknowledged due to timeout error.
        Returns:
        The number of updates sent in assured safe read mode that have not been acknowledged due to timeout error.
      • getAssuredSrWrongStatusUpdates

        public int getAssuredSrWrongStatusUpdates()
        Gets the number of updates sent in assured safe read mode that have not been acknowledged due to wrong status error.
        Returns:
        The number of updates sent in assured safe read mode that have not been acknowledged due to wrong status error.
      • getAssuredSrReplayErrorUpdates

        public int getAssuredSrReplayErrorUpdates()
        Gets the number of updates sent in assured safe read mode that have not been acknowledged due to replay error.
        Returns:
        The number of updates sent in assured safe read mode that have not been acknowledged due to replay error.
      • getAssuredSrServerNotAcknowledgedUpdates

        public Map<Integer,​Integer> getAssuredSrServerNotAcknowledgedUpdates()
        Gets the number of updates sent in assured safe read mode that have not been acknowledged per server.
        Returns:
        A copy of the map that contains the number of updates sent in assured safe read mode that have not been acknowledged per server.
      • getAssuredSrReceivedUpdates

        public int getAssuredSrReceivedUpdates()
        Gets the number of updates received in assured safe read mode request.
        Returns:
        The number of updates received in assured safe read mode request.
      • getAssuredSrReceivedUpdatesAcked

        public int getAssuredSrReceivedUpdatesAcked()
        Gets the number of updates received in assured safe read mode that we acked without error (no replay error).
        Returns:
        The number of updates received in assured safe read mode that we acked without error (no replay error).
      • getAssuredSrReceivedUpdatesNotAcked

        public int getAssuredSrReceivedUpdatesNotAcked()
        Gets the number of updates received in assured safe read mode that we did not ack due to error (replay error).
        Returns:
        The number of updates received in assured safe read mode that we did not ack due to error (replay error).
      • getAssuredSdSentUpdates

        public int getAssuredSdSentUpdates()
        Gets the number of updates sent in assured safe data mode.
        Returns:
        The number of updates sent in assured safe data mode.
      • getAssuredSdAcknowledgedUpdates

        public int getAssuredSdAcknowledgedUpdates()
        Gets the number of updates sent in assured safe data mode that have been acknowledged without errors.
        Returns:
        The number of updates sent in assured safe data mode that have been acknowledged without errors.
      • getAssuredSdTimeoutUpdates

        public int getAssuredSdTimeoutUpdates()
        Gets the number of updates sent in assured safe data mode that have not been acknowledged due to timeout error.
        Returns:
        The number of updates sent in assured safe data mode that have not been acknowledged due to timeout error.
      • getAssuredSdServerTimeoutUpdates

        public Map<Integer,​Integer> getAssuredSdServerTimeoutUpdates()
        Gets the number of updates sent in assured safe data mode that have not been acknowledged due to timeout error per server.
        Returns:
        A copy of the map that contains the number of updates sent in assured safe data mode that have not been acknowledged due to timeout error per server.
      • getLastStatusChangeDate

        public Date getLastStatusChangeDate()
        Gets the date of the last status change.
        Returns:
        The date of the last status change.
      • startPublishService

        public void startPublishService()
                                 throws ConfigException
        Start the publish mechanism of the Replication Service. After this method has been called, the publish service can be used by calling the publish(UpdateMsg) method.
        Throws:
        ConfigException - If the DirectoryServer configuration was incorrect.
      • startListenService

        public void startListenService()
        Starts the receiver side of the Replication Service.

        After this method has been called, the Replication Service will start calling the processUpdate(UpdateMsg).

        This method must be called once and must be called after the startPublishService().

      • disableService

        public final void disableService()
        Temporarily disable the Replication Service. The Replication Service can be enabled again using enableService().

        It can be useful to disable the Replication Service when the repository where the replicated information is stored becomes temporarily unavailable and replicated updates can therefore not be replayed during a while.

      • disableServiceUnlessImportInProgress

        protected final boolean disableServiceUnlessImportInProgress()
        Stops the Replication Service the way disableService() does, unless a total update into this replica owns the session.

        Whether one does is claimed rather than read (issue #1041): the listener thread claims the import context for an InitializeTargetMsg under no lock, so a read of it under serviceStateLock orders nothing. The claim is SESSION_BEING_STOPPED, held for the length of the stop and released once the listener thread is gone - it is the one thread which claims a total update this replica did not ask for, and disableService() waits for it. An export in the context is not an owner here: the session is stopped from under it and the exporter reports the cut, as it does for every other stop. The session restart a replay asks for does not get this far while a total update runs - runRequestedSessionRestarts() leaves the request standing until it is over (issue #1048) - so an export reaches this arm only when it begins between that read and the claim below. A total update which lands between the end of that export and the stop is refused by the listener when it reads the broker as stopping after its claim; a stop which lands after that read still has the import run over a session which is going down, and end as a failed import over the suffix it has replaced (issue #1039): the read narrows that window, it does not close it.

        Returns:
        true when the service was stopped, false when a total update into this replica owns the session and it was left alone
      • isListenerShuttingDown

        protected final boolean isListenerShuttingDown()
        Returns true if the listener thread is shutting down or has shutdown.
        Returns:
        true if the listener thread is shutting down or has shutdown.
      • getSessionGeneration

        @GuardedBy("serviceStateLock")
        protected final long getSessionGeneration()
        Returns the generation of the session of this domain: bumped by disableService() and enableService() under serviceStateLock, not by the starts at domain startup (see sessionGeneration).

        It only says anything while serviceStateLock is held, and is meant to be read under the lock which stopped a session and read again under the lock which starts it back: the session stopped is gone when the two differ.

        Returns:
        the generation of the session of this domain
      • enableService

        public final void enableService()
        Restart the Replication service after a disableService().

        The Replication Service will restart from the point indicated by the ServerState that was given as a parameter to the startPublishService() at startup time.

        If some data have changed in the repository during the period of time when the Replication Service was disabled, this ServerState should therefore be updated by the Replication Domain subclass before calling this method.

      • changeConfig

        protected void changeConfig​(ReplicationDomainCfg config)
        Change some ReplicationDomain parameters.

        The change and the restart it may call for are taken together under serviceStateLock, as readAssuredConfig(ReplicationDomainCfg, boolean) takes its own: a session brought up between the two would negotiate the broker properties which are half way through being changed.

        Parameters:
        config - The new configuration that this domain should now use.
      • changeConfig

        public void changeConfig​(Set<String> includeAttributes,
                                 Set<String> includeAttributesForDeletes)
        Applies a configuration change to the attributes which should be included in the ECL.

        Taken under serviceStateLock like every other configuration change: this one comes from the external changelog domain - from the entry of its own, or from the domain configuration change which reads that entry - and it restarts the session as well, so the attributes and the restart go together.

        Parameters:
        includeAttributes - attributes to be included with all change records.
        includeAttributesForDeletes - additional attributes to be included with delete change records.
      • restartService

        protected void restartService()
        Stops the session of this domain and starts it again, so that it comes up on the configuration which has just changed.

        The pair is taken under serviceStateLock, so that nothing starts a session back between the stop and the start, and both halves are counted by the session generation. A subclass may leave it alone: a domain which is shutting down, or which was disabled for a total update, owns its session and is not given one back by a configuration change, and a total update into this replica reads its entries over the session and starts the next one itself. One which does reports it through onSessionRestartSuppressed().

      • onSessionRestartSuppressed

        protected void onSessionRestartSuppressed()
        Called when what a change carries is negotiated as the session comes up, and the session was not restarted for it.

        The configuration is stored either way, and the session started next reads it - so this says that the change is not live yet rather than that it was lost. A domain which restarts its session for every change never reaches this; one whose session has an owner - itself while it is shutting down or disabled for a total update, or a total update into this replica reading it - overrides it to tell the administrator what is waiting for that session.

      • exportBackend

        protected abstract void exportBackend​(OutputStream output)
                                       throws DirectoryException
        This method should trigger an export of the replicated data. to the provided outputStream. When finished the outputStream should be flushed and closed.
        Parameters:
        output - The OutputStream where the export should be produced.
        Throws:
        DirectoryException - When needed.
      • importBackend

        protected abstract void importBackend​(InputStream input)
                                       throws DirectoryException
        This method should trigger an import of the replicated data.
        Parameters:
        input - The InputStream from which the import should be reading entries.
        Throws:
        DirectoryException - When needed.
      • countEntries

        public abstract long countEntries()
                                   throws DirectoryException
        This method should return the total number of objects in the replicated domain. This count will be used for reporting.
        Returns:
        The number of objects in the replication domain.
        Throws:
        DirectoryException - when needed.
      • processUpdate

        public abstract boolean processUpdate​(UpdateMsg updateMsg)
        This method should handle the processing of UpdateMsg receive from remote replication entities.

        This method will be called by a single thread and should therefore should not be blocking.

        Parameters:
        updateMsg - The UpdateMsg that was received.
        Returns:
        A boolean indicating if the processing is completed at return time. If true is returned, no further processing is necessary. If false is returned, the subclass should call the method processUpdateDone(UpdateMsg, String) and update the ServerState When this processing is complete.
      • processUpdateDone

        protected void processUpdateDone​(UpdateMsg msg,
                                         String replayErrorMsg)
        This method must be called after each call to processUpdate(UpdateMsg) when the processing of the update is completed.

        It is useful for implementation needing to process the update in an asynchronous way or using several threads, but must be called even by implementation doing it in a synchronous, single-threaded way.

        Parameters:
        msg - The UpdateMsg whose processing was completed.
        replayErrorMsg - if not null, this means an error occurred during the replay of this update, and this is the matching human readable message describing the problem.
      • prepareWaitForAckIfAssuredEnabled

        protected void prepareWaitForAckIfAssuredEnabled​(UpdateMsg msg)
        Prepare a message if it is to be sent in assured mode. If the assured mode is enabled, this method should be called before publish(UpdateMsg msg) method. This will configure the update accordingly before it is sent and will prepare the mechanism that will block until the matching ack is received. To wait for the ack after publish call, use the waitForAckIfAssuredEnabled() method. The expected typical usage in a service inheriting from this class is the following sequence: UpdateMsg msg = xxx; prepareWaitForAckIfAssuredEnabled(msg); publish(msg); waitForAckIfAssuredEnabled(msg); Note: prepareWaitForAckIfAssuredEnabled and waitForAckIfAssuredEnabled have no effect if assured replication is disabled. Note: this mechanism should not be used if using publish(byte[] msg) version as usage of these methods is already hidden inside.
        Parameters:
        msg - The update message to be sent soon.
      • waitForAckIfAssuredEnabled

        protected void waitForAckIfAssuredEnabled​(UpdateMsg msg)
                                           throws TimeoutException
        Wait for the processing of an assured message after it has been sent, if assured replication is configured, otherwise, do nothing. The prepareWaitForAckIfAssuredEnabled method should have been called before, see its comment for the full picture.
        Parameters:
        msg - The UpdateMsg for which we are waiting for an ack.
        Throws:
        TimeoutException - When the configured timeout occurs waiting for the ack.
      • publish

        public boolean publish​(UpdateMsg msg)
        Publish an UpdateMsg to the Replication Service.

        The Replication Service will handle the delivery of this UpdateMsg to all the participants of this Replication Domain. These members will be receive this UpdateMsg through a call of the processUpdate(UpdateMsg) message.

        Parameters:
        msg - The UpdateMsg that should be published.
        Returns:
        true if the message was written to the session of the Replication Service, false if the broker could not write it: it has no usable session, the changes which come before this one still have to be republished, or it was stopped in between.
      • publishReplicaOfflineMsg

        public void publishReplicaOfflineMsg()
        Publishes a replica offline message if all pending changes for current replica have been sent out.
      • getGenerationID

        public long getGenerationID()
        This method should return the generationID to use for this ReplicationDomain. This method can be called at any time after the ReplicationDomain has been started.
        Returns:
        The GenerationID.
      • setGenerationID

        public void setGenerationID​(long generationId)
        Sets the generationId for this replication domain.
        Parameters:
        generationId - the generationId to set
      • addAdditionalMonitoring

        public void addAdditionalMonitoring​(MonitorData monitorData)
        Subclasses should use this method to add additional monitoring information in the ReplicationDomain.
        Parameters:
        monitorData - where to additional monitoring attributes
      • getImportExportContext

        protected ReplicationDomain.ImportExportContext getImportExportContext()
        Returns the Import/Export context associated to this ReplicationDomain.
        Returns:
        the Import/Export context associated to this ReplicationDomain
      • setEclIncludes

        public boolean setEclIncludes​(int serverId,
                                      Set<String> includeAttributes,
                                      Set<String> includeAttributesForDeletes)
        Set the attributes configured on a server to be included in the ECL.
        Parameters:
        serverId - Server where these attributes are configured.
        includeAttributes - Attributes to be included with all change records, may include wild-cards.
        includeAttributesForDeletes - Additional attributes to be included with delete change records, may include wild-cards.
        Returns:
        true if the set of attributes was modified.
      • getEclIncludes

        public Set<String> getEclIncludes()
        Get the attributes to include in each change for the ECL.
        Returns:
        The attributes to include in each change for the ECL.
      • getEclIncludesForDeletes

        public Set<String> getEclIncludesForDeletes()
        Get the attributes to include in each delete change for the ECL.
        Returns:
        The attributes to include in each delete change for the ECL.
      • getLastLocalChange

        public CSN getLastLocalChange()
        Returns the CSN of the last Change that was fully processed by this ReplicationDomain.
        Returns:
        The CSN of the last Change that was fully processed by this ReplicationDomain.
      • readAssuredConfig

        protected void readAssuredConfig​(ReplicationDomainCfg config,
                                         boolean allowReconnection)
        Gets and stores the assured replication configuration parameters.

        The configuration is stored whether or not the session has to be restarted for it: the assured timeout is read off it as the acknowledgements are waited for, and needs no reconnection at all.

        Parameters:
        config - The configuration object
        allowReconnection - Tells if one must reconnect if significant changes occurred