| | |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | | import java.util.Iterator; |
| | | |
| | | import org.opends.server.replication.common.ExternalChangeLogSession; |
| | | import org.opends.server.replication.common.MultiDomainServerState; |
| | | import org.opends.server.replication.protocol.ECLUpdateMsg; |
| | | import org.opends.server.replication.protocol.StartECLSessionMsg; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.util.ServerConstants; |
| | | |
| | | /** |
| | | * This interface defines a session used to search the external changelog |
| | |
| | | /** |
| | | * Create a new external changelog session. |
| | | * @param rs The replication server to which we will request the log. |
| | | * @throws DirectoryException When an error occurs. |
| | | */ |
| | | public ExternalChangeLogSessionImpl(ReplicationServer rs) |
| | | throws DirectoryException |
| | | { |
| | | this.rs = rs; |
| | | } |
| | | |
| | | /** |
| | | * Create a new external changelog session. |
| | | * @param rs The replication server to which we will request the log. |
| | | * @param startECLSessionMsg The start session message containing the |
| | | * details of the search request on the ECL. |
| | | * @throws DirectoryException When an error occurs. |
| | |
| | | { |
| | | handler.getDomain().stopServer(handler); |
| | | } |
| | | |
| | | /** |
| | | * Returns the last (newest) cookie value. |
| | | * @return the last cookie value. |
| | | */ |
| | | public MultiDomainServerState getLastCookie() |
| | | { |
| | | MultiDomainServerState result = new MultiDomainServerState(); |
| | | // Initialize start state for all running domains with empty state |
| | | Iterator<ReplicationServerDomain> rsdk = this.rs.getCacheIterator(); |
| | | if (rsdk != null) |
| | | { |
| | | while (rsdk.hasNext()) |
| | | { |
| | | // process a domain |
| | | ReplicationServerDomain rsd = rsdk.next(); |
| | | if (rsd.getBaseDn().compareToIgnoreCase( |
| | | ServerConstants.DN_EXTERNAL_CHANGELOG_ROOT)==0) |
| | | continue; |
| | | result.update(rsd.getBaseDn(), rsd.getCLElligibleState()); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | } |