| | |
| | | // The set of all operations currently in progress on this connection. |
| | | private ConcurrentHashMap<Integer,AbstractOperation> operationsInProgress; |
| | | |
| | | // The number of operations performed on this connection. |
| | | // Used to compare with the resource limits of the network group. |
| | | private long operationsPerformed; |
| | | |
| | | // Lock on the number of operations |
| | | private Object operationsPerformedLock; |
| | | |
| | | // The connection security provider that was in use for the client connection |
| | | // before switching to a TLS-based provider. |
| | | private ConnectionSecurityProvider clearSecurityProvider; |
| | |
| | | connectionValid = true; |
| | | disconnectRequested = false; |
| | | operationsInProgress = new ConcurrentHashMap<Integer,AbstractOperation>(); |
| | | operationsPerformed = 0; |
| | | operationsPerformedLock = new Object(); |
| | | keepStats = connectionHandler.keepStats(); |
| | | protocol = "LDAP"; |
| | | writeSelector = new AtomicReference<Selector>(); |
| | |
| | | * |
| | | * @return The connection handler that accepted this client connection. |
| | | */ |
| | | public ConnectionHandler getConnectionHandler() |
| | | public ConnectionHandler<?> getConnectionHandler() |
| | | { |
| | | return connectionHandler; |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the address and port of the client system, separated by a colon. |
| | | * |
| | | * @return The address and port of the client system, separated by a colon. |
| | | */ |
| | | public String getClientHostPort() |
| | | { |
| | | return clientAddress + ":" + clientPort; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a string representation of the address on the server to which the |
| | | * client connected. |
| | | * |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the address and port of the server system, separated by a colon. |
| | | * |
| | | * @return The address and port of the server system, separated by a colon. |
| | | */ |
| | | public String getServerHostPort() |
| | | { |
| | | return serverAddress + ":" + serverPort; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the <CODE>java.net.InetAddress</CODE> associated with the remote |
| | | * client system. |
| | | * |
| | |
| | | SearchResultEntry searchEntry) |
| | | { |
| | | SearchResultEntryProtocolOp protocolOp = |
| | | new SearchResultEntryProtocolOp(searchEntry); |
| | | new SearchResultEntryProtocolOp(searchEntry,ldapVersion); |
| | | |
| | | List<Control> entryControls = searchEntry.getControls(); |
| | | ArrayList<LDAPControl> controls; |
| | |
| | | operationsInProgress.put(messageID, operation); |
| | | |
| | | |
| | | // Try to add the operation to the work queue. |
| | | DirectoryServer.enqueueRequest(operation); |
| | | // Try to add the operation to the work queue, |
| | | // or run it synchronously (typically for the administration connector) |
| | | connectionHandler.getQueueingStrategy().enqueueRequest(operation); |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * Returns the total number of operations initiated on this connection. |
| | | * |
| | | * @return the total number of operations on this connection |
| | | */ |
| | | public long getNumberOfOperations() { |
| | | long tmpNumberOfOperations; |
| | | synchronized (operationsPerformedLock) { |
| | | tmpNumberOfOperations = operationsPerformed; |
| | | } |
| | | return tmpNumberOfOperations; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Process the information contained in the provided byte buffer as an ASN.1 |
| | | * element. It may take several calls to this method in order to get all the |
| | | * information necessary to decode a single ASN.1 element, but it may also be |
| | |
| | | { |
| | | statTracker.updateMessageRead(message); |
| | | } |
| | | synchronized (operationsPerformedLock) { |
| | | operationsPerformed++; |
| | | } |
| | | |
| | | ArrayList<Control> opControls; |
| | | ArrayList<LDAPControl> ldapControls = message.getControls(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public DN getKeyManagerProviderDN() |
| | | { |
| | | return connectionHandler.getKeyManagerProviderDN(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public DN getTrustManagerProviderDN() |
| | | { |
| | | return connectionHandler.getTrustManagerProviderDN(); |
| | |
| | | * for operations requring a server certificate, or |
| | | * {@code null} if any alias is acceptable. |
| | | */ |
| | | @Override |
| | | public String getCertificateAlias() |
| | | { |
| | | return connectionHandler.getSSLServerCertNickname(); |
| | |
| | | * @return The length of time in milliseconds that this client |
| | | * connection has been idle. |
| | | */ |
| | | @Override |
| | | public long getIdleTime() |
| | | { |
| | | if (operationsInProgress.isEmpty() && getPersistentSearches().isEmpty()) |