Class TransportConnection

    • Field Detail

      • LOGGER

        private static final Logger LOGGER
        Logger for this class.
      • openLock

        protected final ReentrantLock openLock
        Only one invocation of open can occur at a time.
      • closeLock

        protected final ReentrantLock closeLock
        Only one invocation of close can occur at a time.
      • connectionConfig

        protected final ConnectionConfig connectionConfig
        Provides host connection configuration.
      • lastSuccessfulOpen

        protected Instant lastSuccessfulOpen
        Time of the last successful open for this connection.
    • Constructor Detail

      • TransportConnection

        public TransportConnection​(ConnectionConfig config)
        Creates a new transport connection.
        Parameters:
        config - connection configuration
    • Method Detail

      • reopen

        protected void reopen​(RetryMetadata metadata)
                       throws LdapException
        Method to support reopening a connection that was previously established. This method differs from open() in that the autoReconnectCondition is tested before the open is attempted.
        Parameters:
        metadata - associated with this reopen
        Throws:
        LdapException - if the open fails
      • strategyOpen

        protected void strategyOpen​(RetryMetadata metadata)
                             throws LdapException
        Retrieves URLs from the connection strategy and attempts each one, in order, until a connection is made or the list is exhausted.
        Parameters:
        metadata - to track URL success and failure
        Throws:
        LdapException - if a connection cannot be established
      • test

        protected abstract boolean test​(LdapURL url)
        Determine whether the supplied URL is acceptable for use.
        Parameters:
        url - LDAP URL to test
        Returns:
        whether URL can be become active
      • open

        protected abstract void open​(LdapURL url)
                              throws LdapException
        Attempt to open a connection to the supplied LDAP URL.
        Parameters:
        url - LDAP URL to connect to
        Throws:
        LdapException - if opening the connection fails
      • operation

        protected abstract void operation​(UnbindRequest request)
        Executes an unbind operation. Clients should close connections using Connection.close().
        Parameters:
        request - unbind request
      • write

        protected abstract void write​(DefaultOperationHandle handle)
        Write the request in the supplied handle to the LDAP server. This method does not throw, it should report exceptions to the handle.
        Parameters:
        handle - for the operation write
      • complete

        protected abstract void complete​(DefaultOperationHandle handle)
        Report that the supplied handle has completed. Allows the connection to clean up any resources associated with the handle.
        Parameters:
        handle - that has completed