| | |
| | | if (getProtocolVersion() < ProtocolVersion.REPLICATION_PROTOCOL_V4) |
| | | { |
| | | // Peer DS uses protocol < V4 : send it a ReplServerStartMsg |
| | | startMsg = new ReplServerStartMsg(getReplicationServerId(), |
| | | getReplicationServerURL(), getBaseDN(), maxRcvWindow, |
| | | replicationServerDomain.getDbServerState(), |
| | | localGenerationId, sslEncryption, getLocalGroupId(), |
| | | replicationServerDomain.getReplicationServer() |
| | | .getDegradedStatusThreshold()); |
| | | startMsg = new ReplServerStartMsg(getReplicationServerId(), |
| | | getReplicationServerURL(), getBaseDN(), maxRcvWindow, |
| | | replicationServerDomain.getDbServerState(), |
| | | localGenerationId, sslEncryption, getLocalGroupId(), |
| | | replicationServer.getDegradedStatusThreshold()); |
| | | } |
| | | else |
| | | { |
| | | // Peer DS uses protocol V4 : send it a ReplServerStartDSMsg |
| | | startMsg = new ReplServerStartDSMsg(getReplicationServerId(), |
| | | getReplicationServerURL(), getBaseDN(), maxRcvWindow, |
| | | new ServerState(), localGenerationId, sslEncryption, |
| | | getLocalGroupId(), 0, replicationServer.getWeight(), 0); |
| | | startMsg = new ReplServerStartDSMsg(getReplicationServerId(), |
| | | getReplicationServerURL(), getBaseDN(), maxRcvWindow, |
| | | new ServerState(), localGenerationId, sslEncryption, |
| | | getLocalGroupId(), 0, replicationServer.getWeight(), 0); |
| | | } |
| | | |
| | | send(startMsg); |
| | |
| | | catch(DirectoryException de) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | if (draftCNDbIter != null) |
| | | draftCNDbIter.releaseCursor(); |
| | | releaseIterator(); |
| | | throw de; |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | if (draftCNDbIter != null) |
| | | draftCNDbIter.releaseCursor(); |
| | | releaseIterator(); |
| | | throw new DirectoryException( |
| | | ResultCode.OPERATIONS_ERROR, |
| | | Message.raw(Category.SYNC, |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | TRACER.debugInfo(this + " shutdown()" + draftCNDbIter); |
| | | if (this.draftCNDbIter != null) |
| | | { |
| | | draftCNDbIter.releaseCursor(); |
| | | draftCNDbIter = null; |
| | | } |
| | | releaseIterator(); |
| | | for (DomainContext domainCtxt : domainCtxts) { |
| | | if (!domainCtxt.unRegisterHandler()) { |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | |
| | | domainCtxts = null; |
| | | } |
| | | |
| | | private void releaseIterator() |
| | | { |
| | | if (this.draftCNDbIter != null) |
| | | { |
| | | this.draftCNDbIter.releaseCursor(); |
| | | this.draftCNDbIter = null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Request to shutdown the associated writer. |
| | | */ |
| | |
| | | { |
| | | session.publish( |
| | | new ErrorMsg( |
| | | replicationServerDomain.getReplicationServer().getServerId(), |
| | | replicationServer.getServerId(), |
| | | serverId, |
| | | Message.raw(Category.SYNC, Severity.INFORMATION, |
| | | "Exception raised: " + e.getMessage()))); |
| | |
| | | registerIntoDomain(); |
| | | |
| | | if (debugEnabled()) |
| | | TRACER.debugInfo( |
| | | this.getClass().getCanonicalName()+ " " + operationId + |
| | | " initialized: " + |
| | | " " + dumpState() + " " + |
| | | " " + clDomCtxtsToString("")); |
| | | TRACER.debugInfo(getClass().getCanonicalName() + " " + operationId |
| | | + " initialized: " + " " + dumpState() + " " + " " |
| | | + clDomCtxtsToString("")); |
| | | } |
| | | |
| | | private void initializeChangelogSearch(StartECLSessionMsg msg) |
| | |
| | | searchPhase = UNDEFINED_PHASE; |
| | | } |
| | | |
| | | if (draftCNDbIter!=null) |
| | | { |
| | | // End of INIT_PHASE => always release the iterator |
| | | draftCNDbIter.releaseCursor(); |
| | | draftCNDbIter = null; |
| | | } |
| | | // End of INIT_PHASE => always release the iterator |
| | | releaseIterator(); |
| | | } |
| | | |
| | | /** |