| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | |
| | | /** |
| | | * ReplicationServer Listener. This singleton is the main object of the |
| | | * replication server It waits for the incoming connections and create listener |
| | | * replication server. It waits for the incoming connections and create listener |
| | | * and publisher objects for connection with LDAP servers and with replication |
| | | * servers It is responsible for creating the replication server |
| | | * replicationServerDomain and managing it |
| | |
| | | { |
| | | backendConfigEntryDN = DN.decode( |
| | | "ds-cfg-backend-id=" + backendId + ",cn=Backends,cn=config"); |
| | | } catch (Exception e) {} |
| | | } catch (Exception e) { /* do nothing */ } |
| | | |
| | | // Creates the backend associated to this ReplicationServer |
| | | // if it does not exist. |
| | |
| | | listenSocket.getLocalPort()); |
| | | logError(listenMsg); |
| | | |
| | | while ((shutdown == false) && (stopListen == false)) |
| | | while (!shutdown && !stopListen) |
| | | { |
| | | // Wait on the replicationServer port. |
| | | // Read incoming messages and create LDAP or ReplicationServer listener |
| | |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | if (shutdown == false) { |
| | | if (!shutdown) { |
| | | Message message = |
| | | ERR_EXCEPTION_LISTENING.get(e.getLocalizedMessage()); |
| | | logError(message); |
| | |
| | | public ExternalChangeLogSession createECLSession(StartECLSessionMsg msg) |
| | | throws DirectoryException |
| | | { |
| | | ExternalChangeLogSessionImpl session = |
| | | new ExternalChangeLogSessionImpl(this, msg); |
| | | return session; |
| | | return new ExternalChangeLogSessionImpl(this, msg); |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | InetAddress localAddr = InetAddress.getLocalHost(); |
| | | |
| | | if (localPorts.contains(port) |
| | | return localPorts.contains(port) |
| | | && (InetAddress.getByName(hostname).isLoopbackAddress() || |
| | | InetAddress.getByName(hostname).equals(localAddr))) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | InetAddress.getByName(hostname).equals(localAddr)); |
| | | |
| | | } catch (UnknownHostException e) |
| | | { |