| | |
| | | public class ReplicationServerHandler extends ServerHandler |
| | | { |
| | | |
| | | /* |
| | | * Properties filled only if remote server is a RS |
| | | /** |
| | | * Properties filled only if remote server is a RS. |
| | | */ |
| | | private String serverAddressURL; |
| | | /** |
| | |
| | | serverAddressURL = |
| | | session.getRemoteAddress() + ":" + serverURL.substring(separator + |
| | | 1); |
| | | setServiceIdAndDomain(inReplServerStartMsg.getBaseDn(), false); |
| | | setBaseDNAndDomain(inReplServerStartMsg.getBaseDn(), false); |
| | | setInitialServerState(inReplServerStartMsg.getServerState()); |
| | | setSendWindowSize(inReplServerStartMsg.getWindowSize()); |
| | | if (protocolVersion > ProtocolVersion.REPLICATION_PROTOCOL_V1) |
| | |
| | | private ReplServerStartMsg sendStartToRemote() throws IOException |
| | | { |
| | | ReplServerStartMsg outReplServerStartMsg = new ReplServerStartMsg( |
| | | replicationServerId, replicationServerURL, getServiceId(), |
| | | replicationServerId, replicationServerURL, getBaseDN(), |
| | | maxRcvWindow, replicationServerDomain.getDbServerState(), |
| | | localGenerationId, sslEncryption, |
| | | getLocalGroupId(), replicationServerDomain.getReplicationServer() |
| | |
| | | /** |
| | | * Connect the hosting RS to the RS represented by THIS handler |
| | | * on an outgoing connection. |
| | | * @param serviceId The serviceId (usually baseDn). |
| | | * @param baseDN The baseDN |
| | | * @param sslEncryption The sslEncryption requested to the remote RS. |
| | | * @throws DirectoryException when an error occurs. |
| | | */ |
| | | public void connect(String serviceId, boolean sslEncryption) |
| | | public void connect(String baseDN, boolean sslEncryption) |
| | | throws DirectoryException |
| | | { |
| | | // we are the initiator and decides of the encryption |
| | | this.sslEncryption = sslEncryption; |
| | | |
| | | setServiceIdAndDomain(serviceId, false); |
| | | setBaseDNAndDomain(baseDN, false); |
| | | |
| | | localGenerationId = replicationServerDomain.getGenerationId(); |
| | | oldGenerationId = localGenerationId; |
| | |
| | | */ |
| | | public void startFromRemoteRS(ReplServerStartMsg inReplServerStartMsg) |
| | | { |
| | | // |
| | | localGenerationId = -1; |
| | | oldGenerationId = -100; |
| | | try |
| | |
| | | */ |
| | | Message message = WARN_BAD_GENERATION_ID_FROM_RS.get( |
| | | serverId, session.getReadableRemoteAddress(), generationId, |
| | | getServiceId(), getReplicationServerId(), localGenerationId); |
| | | getBaseDN(), getReplicationServerId(), localGenerationId); |
| | | logError(message); |
| | | } |
| | | } |
| | |
| | | ArrayList<Attribute> attributes = super.getMonitorData(); |
| | | |
| | | // Add the specific RS ones |
| | | attributes.add(Attributes.create("Replication-Server", |
| | | serverURL)); |
| | | attributes.add(Attributes.create("Replication-Server", serverURL)); |
| | | |
| | | MonitorData md = replicationServerDomain.getDomainMonitorData(); |
| | | |