| | |
| | | { |
| | | lockDomain(false); // no timeout |
| | | |
| | | // Send start |
| | | ReplServerStartMsg outReplServerStartMsg = sendStartToRemote(); |
| | | |
| | | // Wait answer |
| | |
| | | // Remote replication server is probably shutting down or simultaneous |
| | | // cross-connect detected. |
| | | abortStart(null); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | Message message = ERR_REPLICATION_PROTOCOL_MESSAGE_TYPE.get(msg |
| | | .getClass().getCanonicalName(), "ReplServerStartMsg"); |
| | | abortStart(message); |
| | | return; |
| | | } |
| | | return; |
| | | } |
| | | |
| | | // Process hello from remote. |
| | | processStartFromRemote((ReplServerStartMsg)msg); |
| | | processStartFromRemote((ReplServerStartMsg) msg); |
| | | |
| | | // Duplicate server ? |
| | | if (!replicationServerDomain.checkForDuplicateRS(this)) |
| | | if (replicationServerDomain.isAlreadyConnectedToRS(this)) |
| | | { |
| | | // Simultaneous cross connect. |
| | | abortStart(null); |
| | |
| | | generationId, false); |
| | | } |
| | | |
| | | // Log |
| | | logStartHandshakeSNDandRCV(outReplServerStartMsg,(ReplServerStartMsg)msg); |
| | | |
| | | // Until here session is encrypted then it depends on the negociation |
| | | // Until here session is encrypted then it depends on the negotiation |
| | | // The session initiator decides whether to use SSL. |
| | | if (!this.sslEncryption) |
| | | session.stopEncryption(); |
| | |
| | | |
| | | logTopoHandshakeSNDandRCV(outTopoMsg, inTopoMsg); |
| | | |
| | | // Create the monitoring publisher for the domain if not already started |
| | | createMonitoringPublisher(); |
| | | replicationServerDomain.startMonitoringPublisher(); |
| | | |
| | | /* |
| | | FIXME: i think this should be done for all protocol version !! |
| | |
| | | } |
| | | finally |
| | | { |
| | | // Release domain |
| | | if (replicationServerDomain != null && |
| | | replicationServerDomain.hasLock()) |
| | | replicationServerDomain.release(); |
| | |
| | | // lock with timeout |
| | | lockDomain(true); |
| | | |
| | | // Duplicate server ? |
| | | if (!replicationServerDomain.checkForDuplicateRS(this)) |
| | | if (replicationServerDomain.isAlreadyConnectedToRS(this)) |
| | | { |
| | | abortStart(null); |
| | | return; |
| | |
| | | this.localGenerationId = replicationServerDomain.getGenerationId(); |
| | | ReplServerStartMsg outReplServerStartMsg = sendStartToRemote(); |
| | | |
| | | // log |
| | | logStartHandshakeRCVandSND(inReplServerStartMsg, outReplServerStartMsg); |
| | | |
| | | /* |
| | |
| | | .createTopologyMsgForRS(); |
| | | sendTopoInfo(outTopoMsg); |
| | | |
| | | // log |
| | | logTopoHandshakeRCVandSND(inTopoMsg, outTopoMsg); |
| | | } |
| | | else |
| | |
| | | */ |
| | | } |
| | | |
| | | |
| | | // Create the monitoring publisher for the domain if not already started |
| | | createMonitoringPublisher(); |
| | | replicationServerDomain.startMonitoringPublisher(); |
| | | |
| | | registerIntoDomain(); |
| | | |
| | |
| | | public void shutdown() |
| | | { |
| | | super.shutdown(); |
| | | /* |
| | | * Stop the remote LSHandler |
| | | */ |
| | | // Stop the remote LSHandler |
| | | synchronized (remoteDirectoryServers) |
| | | { |
| | | for (LightweightServerHandler lsh : remoteDirectoryServers.values()) |
| | |
| | | attributes.add(Attributes.create("missing-changes", |
| | | String.valueOf(md.getMissingChangesRS(serverId)))); |
| | | |
| | | /* get the Server State */ |
| | | // get the Server State |
| | | AttributeBuilder builder = new AttributeBuilder("server-state"); |
| | | ServerState state = md.getRSStates(serverId); |
| | | if (state != null) |
| | |
| | | |
| | | return attributes; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |