mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jcduff
23.04.2008 f73b655466092169abac34833fb628fce1fcdebe
opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java
@@ -139,6 +139,13 @@
  // 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;
@@ -251,6 +258,8 @@
    connectionValid      = true;
    disconnectRequested  = false;
    operationsInProgress = new ConcurrentHashMap<Integer,AbstractOperation>();
    operationsPerformed = 0;
    operationsPerformedLock = new Object();
    keepStats            = connectionHandler.keepStats();
    protocol             = "LDAP";
    writeSelector        = new AtomicReference<Selector>();
@@ -297,7 +306,7 @@
   *
   * @return  The connection handler that accepted this client connection.
   */
  public ConnectionHandler getConnectionHandler()
  public ConnectionHandler<?> getConnectionHandler()
  {
    return connectionHandler;
  }
@@ -385,18 +394,6 @@
  /**
   * 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.
   *
@@ -423,18 +420,6 @@
  /**
   * 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.
   *
@@ -738,7 +723,7 @@
                              SearchResultEntry searchEntry)
  {
    SearchResultEntryProtocolOp protocolOp =
         new SearchResultEntryProtocolOp(searchEntry);
         new SearchResultEntryProtocolOp(searchEntry,ldapVersion);
    List<Control> entryControls = searchEntry.getControls();
    ArrayList<LDAPControl> controls;
@@ -1199,8 +1184,9 @@
        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)
      {
@@ -1481,6 +1467,20 @@
  /**
   * 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
@@ -1793,6 +1793,9 @@
    {
      statTracker.updateMessageRead(message);
    }
    synchronized (operationsPerformedLock) {
      operationsPerformed++;
    }
    ArrayList<Control> opControls;
    ArrayList<LDAPControl> ldapControls = message.getControls();
@@ -2807,6 +2810,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public DN getKeyManagerProviderDN()
  {
    return connectionHandler.getKeyManagerProviderDN();
@@ -2817,6 +2821,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public DN getTrustManagerProviderDN()
  {
    return connectionHandler.getTrustManagerProviderDN();
@@ -2834,6 +2839,7 @@
   *          for operations requring a server certificate, or
   *          {@code null} if any alias is acceptable.
   */
  @Override
  public String getCertificateAlias()
  {
    return connectionHandler.getSSLServerCertNickname();
@@ -2853,6 +2859,7 @@
   * @return  The length of time in milliseconds that this client
   *          connection has been idle.
   */
  @Override
  public long getIdleTime()
  {
    if (operationsInProgress.isEmpty() && getPersistentSearches().isEmpty())