| | |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.replication.common.ChangeNumber; |
| | | import org.opends.server.replication.common.ServerState; |
| | | import org.opends.server.replication.protocol.ProtocolVersion; |
| | | import org.opends.server.replication.protocol.AckMessage; |
| | | import org.opends.server.replication.protocol.ReplServerStartMessage; |
| | | import org.opends.server.replication.protocol.HeartbeatThread; |
| | | import org.opends.server.replication.protocol.ProtocolSession; |
| | | import org.opends.server.replication.protocol.RoutableMessage; |
| | | import org.opends.server.replication.protocol.ServerStartMessage; |
| | | import org.opends.server.replication.protocol.ReplicationMessage; |
| | | import org.opends.server.replication.protocol.UpdateMessage; |
| | | import org.opends.server.replication.protocol.WindowMessage; |
| | | import org.opends.server.replication.protocol.WindowProbe; |
| | | import org.opends.server.replication.protocol.ReplServerInfoMessage; |
| | | import org.opends.server.replication.protocol.*; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | |
| | | * @param replicationServerURL The URL of the replicationServer that creates |
| | | * this server handler. |
| | | * @param windowSize the window size that this server handler must use. |
| | | * @param sslEncryption For outgoing connections indicates whether encryption |
| | | * should be used after the exchange of start messages. |
| | | * Ignored for incoming connections. |
| | | * @param replicationServer the ReplicationServer that created this server |
| | | * handler. |
| | | */ |
| | | public void start(DN baseDn, short replicationServerId, |
| | | String replicationServerURL, |
| | | int windowSize, ReplicationServer replicationServer) |
| | | int windowSize, boolean sslEncryption, |
| | | ReplicationServer replicationServer) |
| | | { |
| | | this.replicationServerId = replicationServerId; |
| | | rcvWindowSizeHalf = windowSize/2; |
| | |
| | | ReplServerStartMessage msg = |
| | | new ReplServerStartMessage(replicationServerId, replicationServerURL, |
| | | baseDn, windowSize, localServerState, |
| | | protocolVersion); |
| | | |
| | | protocolVersion, sslEncryption); |
| | | session.publish(msg); |
| | | } |
| | | |
| | |
| | | maxSendQueue = receivedMsg.getMaxSendQueue(); |
| | | heartbeatInterval = receivedMsg.getHeartbeatInterval(); |
| | | |
| | | // The session initiator decides whether to use SSL. |
| | | sslEncryption = receivedMsg.getSSLEncryption(); |
| | | |
| | | if (maxReceiveQueue > 0) |
| | | restartReceiveQueue = (maxReceiveQueue > 1000 ? |
| | | maxReceiveQueue - 200 : |
| | |
| | | ReplServerStartMessage myStartMsg = |
| | | new ReplServerStartMessage(replicationServerId, replicationServerURL, |
| | | this.baseDn, windowSize, localServerState, |
| | | protocolVersion); |
| | | protocolVersion, sslEncryption); |
| | | session.publish(myStartMsg); |
| | | sendWindowSize = receivedMsg.getWindowSize(); |
| | | } |
| | |
| | | replicationCache = replicationServer.getReplicationCache(this.baseDn); |
| | | ServerState serverState = replicationCache.getDbServerState(); |
| | | |
| | | // The session initiator decides whether to use SSL. |
| | | sslEncryption = receivedMsg.getSSLEncryption(); |
| | | |
| | | // Publish our start message |
| | | ReplServerStartMessage outMsg = |
| | | new ReplServerStartMessage(replicationServerId, |
| | | replicationServerURL, |
| | | this.baseDn, windowSize, serverState, |
| | | protocolVersion); |
| | | protocolVersion, sslEncryption); |
| | | session.publish(outMsg); |
| | | } |
| | | else |
| | |
| | | return; // we did not recognize the message, ignore it |
| | | } |
| | | |
| | | if (!sslEncryption) |
| | | { |
| | | session.stopEncryption(); |
| | | } |
| | | |
| | | replicationCache = replicationServer.getReplicationCache(this.baseDn); |
| | | |
| | | boolean started; |
| | |
| | | } |
| | | Attribute attr = new Attribute(type, ATTR_SERVER_STATE, values); |
| | | attributes.add(attr); |
| | | |
| | | attributes.add(new Attribute("ssl-encryption", |
| | | String.valueOf(session.isEncrypted()))); |
| | | |
| | | return attributes; |
| | | } |
| | | |