| | |
| | | import java.io.Closeable; |
| | | import java.io.IOException; |
| | | import java.net.InetAddress; |
| | | import java.net.Socket; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.channels.*; |
| | | import java.security.cert.Certificate; |
| | |
| | | SocketChannel clientChannel, String protocol) throws DirectoryException |
| | | { |
| | | this.connectionHandler = connectionHandler; |
| | | if (connectionHandler.isAdminConnectionHandler()) |
| | | { |
| | | setNetworkGroup(NetworkGroup.getAdminNetworkGroup()); |
| | | } |
| | | |
| | | this.clientChannel = clientChannel; |
| | | timeoutClientChannel = new TimeoutWriteByteChannel(); |
| | | opsInProgressLock = new Object(); |
| | |
| | | keepStats = connectionHandler.keepStats(); |
| | | this.protocol = protocol; |
| | | writeSelector = new AtomicReference<Selector>(); |
| | | clientAddress = |
| | | clientChannel.socket().getInetAddress().getHostAddress(); |
| | | clientPort = clientChannel.socket().getPort(); |
| | | serverAddress = |
| | | clientChannel.socket().getLocalAddress().getHostAddress(); |
| | | serverPort = clientChannel.socket().getLocalPort(); |
| | | |
| | | statTracker = |
| | | this.connectionHandler.getStatTracker(); |
| | | final Socket socket = clientChannel.socket(); |
| | | clientAddress = socket.getInetAddress().getHostAddress(); |
| | | clientPort = socket.getPort(); |
| | | serverAddress = socket.getLocalAddress().getHostAddress(); |
| | | serverPort = socket.getLocalPort(); |
| | | |
| | | statTracker = this.connectionHandler.getStatTracker(); |
| | | |
| | | if (keepStats) |
| | | { |
| | |
| | | connectionID = DirectoryServer.newConnectionAccepted(this); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public NetworkGroup getNetworkGroup() |
| | | { |
| | | if (connectionHandler.isAdminConnectionHandler()) |
| | | { |
| | | return NetworkGroup.getAdminNetworkGroup(); |
| | | } |
| | | return NetworkGroup.getDefaultNetworkGroup(); |
| | | } |
| | | |
| | | /** |
| | | * Retrieves the connection ID assigned to this connection. |
| | | * |