| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | } |
| | | |
| | | oldGenerationId = -100; |
| | | |
| | | // Duplicate server ? |
| | | if (!replicationServerDomain.checkForDuplicateRS(this)) |
| | | { |
| | | abortStart(null); |
| | | return false; |
| | | } |
| | | } |
| | | catch(Exception e) |
| | | { |
| | |
| | | public void connect(String serviceId, boolean sslEncryption) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // |
| | | // the encryption we will request to the peer as we are the session creator |
| | | this.initSslEncryption = sslEncryption; |
| | | // we are the initiator and decides of the encryption |
| | | this.sslEncryption = sslEncryption; |
| | | |
| | | setServiceIdAndDomain(serviceId, false); |
| | | |
| | |
| | | // |
| | | lockDomain(false); // no timeout |
| | | |
| | | // we are the initiator and decides of the encryption |
| | | boolean sessionInitiatorSSLEncryption = this.initSslEncryption; |
| | | |
| | | // Send start |
| | | ReplServerStartMsg outReplServerStartMsg = |
| | | sendStartToRemote(ProtocolVersion.getCurrentVersion()); |
| | |
| | | // Process hello from remote |
| | | processStartFromRemote((ReplServerStartMsg)msg); |
| | | |
| | | // Duplicate server ? |
| | | if (!replicationServerDomain.checkForDuplicateRS(this)) |
| | | { |
| | | abortStart(null); |
| | | return; |
| | | } |
| | | |
| | | // Log |
| | | logStartHandshakeSNDandRCV(outReplServerStartMsg,(ReplServerStartMsg)msg); |
| | | |
| | | // Until here session is encrypted then it depends on the negociation |
| | | // The session initiator decides whether to use SSL. |
| | | if (!sessionInitiatorSSLEncryption) |
| | | if (!this.sslEncryption) |
| | | session.stopEncryption(); |
| | | |
| | | if (protocolVersion > ProtocolVersion.REPLICATION_PROTOCOL_V1) |
| | |
| | | oldGenerationId = -100; |
| | | try |
| | | { |
| | | // Process start from remote |
| | | boolean sessionInitiatorSSLEncryption = |
| | | processStartFromRemote(inReplServerStartMsg); |
| | | // The initiator decides if the session is encrypted |
| | | sslEncryption = processStartFromRemote(inReplServerStartMsg); |
| | | |
| | | // lock with timeout |
| | | lockDomain(true); |
| | | |
| | | // Duplicate server ? |
| | | if (!replicationServerDomain.checkForDuplicateRS(this)) |
| | | { |
| | | abortStart(null); |
| | | return; |
| | | } |
| | | |
| | | this.localGenerationId = replicationServerDomain.getGenerationId(); |
| | | ReplServerStartMsg outReplServerStartMsg = |
| | | sendStartToRemote(protocolVersion); |
| | |
| | | |
| | | // until here session is encrypted then it depends on the negotiation |
| | | // The session initiator decides whether to use SSL. |
| | | if (!sessionInitiatorSSLEncryption) |
| | | if (!sslEncryption) |
| | | session.stopEncryption(); |
| | | |
| | | TopologyMsg inTopoMsg = null; |