Class SdkConnectionAdapter

    • Constructor Detail

      • SdkConnectionAdapter

        public SdkConnectionAdapter​(org.opends.server.protocols.http.HTTPClientConnection clientConnection)
        Constructor.
        Parameters:
        clientConnection - the HTTP client connection being "adapted"
    • Method Detail

      • abandonAsync

        public LdapPromise<Void> abandonAsync​(AbandonRequest request)
        Description copied from interface: Connection
        Abandons the unfinished operation identified in the provided abandon request.

        Abandon requests do not have a response, so invoking the method get() on the returned promise will not block, nor return anything (it is Void), but may throw an exception if a problem occurred while sending the abandon request. In addition the returned promise may be used in order to determine the message ID of the abandon request.

        Note: a more convenient approach to abandoning unfinished asynchronous operations is provided via the Promise.cancel(boolean) method.

        Parameters:
        request - The request identifying the operation to be abandoned.
        Returns:
        A promise whose result is Void.
      • addAsync

        public LdapPromise<Result> addAsync​(AddRequest request,
                                            IntermediateResponseHandler intermediateResponseHandler)
        Description copied from interface: Connection
        Asynchronously adds an entry to the Directory Server using the provided add request.
        Parameters:
        request - The add request.
        intermediateResponseHandler - An intermediate response handler which can be used to process any intermediate responses as they are received, may be null.
        Returns:
        A promise representing the result of the operation.
      • addConnectionEventListener

        public void addConnectionEventListener​(ConnectionEventListener listener)
        Description copied from interface: Connection
        Registers the provided connection event listener so that it will be notified when this connection is closed by the application, receives an unsolicited notification, or experiences a fatal error.

        A listener registered once this connection has already failed and/or been closed is notified of the events it has missed before this method returns.

        Parameters:
        listener - The listener which wants to be notified when events occur on this connection.
      • bindAsync

        public LdapPromise<BindResult> bindAsync​(BindRequest request,
                                                 IntermediateResponseHandler intermediateResponseHandler)
        Description copied from interface: Connection
        Asynchronously authenticates to the Directory Server using the provided bind request.
        Parameters:
        request - The bind request.
        intermediateResponseHandler - An intermediate response handler which can be used to process any intermediate responses as they are received, may be null.
        Returns:
        A promise representing the result of the operation.
      • close

        public void close​(UnbindRequest request,
                          String reason)
        Description copied from interface: Connection
        Releases any resources associated with this connection. For physical connections to a Directory Server this will mean that the provided unbind request is sent and the underlying socket is closed.

        Other connection implementations may behave differently, and may choose to ignore the provided unbind request if its use is inappropriate (for example a pooled connection will be released and returned to its connection pool without ever issuing an unbind request).

        Calling close on a connection that is already closed has no effect.

        Parameters:
        request - The unbind request to use in the case where a physical connection is closed.
        reason - A reason describing why the connection was closed.
      • compareAsync

        public LdapPromise<CompareResult> compareAsync​(CompareRequest request,
                                                       IntermediateResponseHandler intermediateResponseHandler)
        Description copied from interface: Connection
        Asynchronously compares an entry in the Directory Server using the provided compare request.
        Parameters:
        request - The compare request.
        intermediateResponseHandler - An intermediate response handler which can be used to process any intermediate responses as they are received, may be null.
        Returns:
        A promise representing the result of the operation.
      • deleteAsync

        public LdapPromise<Result> deleteAsync​(DeleteRequest request,
                                               IntermediateResponseHandler intermediateResponseHandler)
        Description copied from interface: Connection
        Asynchronously deletes an entry from the Directory Server using the provided delete request.
        Parameters:
        request - The delete request.
        intermediateResponseHandler - An intermediate response handler which can be used to process any intermediate responses as they are received, may be null.
        Returns:
        A promise representing the result of the operation.
      • extendedRequestAsync

        public <R extends ExtendedResult> LdapPromise<R> extendedRequestAsync​(ExtendedRequest<R> request,
                                                                              IntermediateResponseHandler intermediateResponseHandler)
        Description copied from interface: Connection
        Asynchronously performs the provided extended request in the Directory Server.
        Type Parameters:
        R - The type of result returned by the extended request.
        Parameters:
        request - The extended request.
        intermediateResponseHandler - An intermediate response handler which can be used to process any intermediate responses as they are received, may be null.
        Returns:
        A promise representing the result of the operation.
      • getQueueingStrategy

        public QueueingStrategy getQueueingStrategy()
        Return the queueing strategy used by this connection.
        Returns:
        The queueing strategy used by this connection
      • isClosed

        public boolean isClosed()
        Description copied from interface: Connection
        Indicates whether this connection has been explicitly closed by calling close. This method will not return true if a fatal error has occurred on the connection unless close has been called.
        Returns:
        true if this connection has been explicitly closed by calling close, or false otherwise.
      • isValid

        public boolean isValid()
        Description copied from interface: Connection
        Returns true if this connection has not been closed and no fatal errors have been detected. This method is guaranteed to return false only when it is called after the method close has been called.
        Returns:
        true if this connection is valid, false otherwise.
      • modifyAsync

        public LdapPromise<Result> modifyAsync​(ModifyRequest request,
                                               IntermediateResponseHandler intermediateResponseHandler)
        Description copied from interface: Connection
        Asynchronously modifies an entry in the Directory Server using the provided modify request.
        Parameters:
        request - The modify request.
        intermediateResponseHandler - An intermediate response handler which can be used to process any intermediate responses as they are received, may be null.
        Returns:
        A promise representing the result of the operation.
      • modifyDNAsync

        public LdapPromise<Result> modifyDNAsync​(ModifyDNRequest request,
                                                 IntermediateResponseHandler intermediateResponseHandler)
        Description copied from interface: Connection
        Asynchronously renames an entry in the Directory Server using the provided modify DN request.
        Parameters:
        request - The modify DN request.
        intermediateResponseHandler - An intermediate response handler which can be used to process any intermediate responses as they are received, may be null.
        Returns:
        A promise representing the result of the operation.
      • removeConnectionEventListener

        public void removeConnectionEventListener​(ConnectionEventListener listener)
        Description copied from interface: Connection
        Removes the provided connection event listener from this connection so that it will no longer be notified when this connection is closed by the application, receives an unsolicited notification, or experiences a fatal error.
        Parameters:
        listener - The listener which no longer wants to be notified when events occur on this connection.
      • searchAsync

        public LdapPromise<Result> searchAsync​(SearchRequest request,
                                               IntermediateResponseHandler intermediateResponseHandler,
                                               SearchResultHandler entryHandler)
        Description copied from interface: Connection
        Asynchronously searches the Directory Server using the provided search request.
        Parameters:
        request - The search request.
        intermediateResponseHandler - An intermediate response handler which can be used to process any intermediate responses as they are received, may be null.
        entryHandler - A search result handler which can be used to asynchronously process the search result entries and references as they are received, may be null.
        Returns:
        A promise representing the result of the operation.
      • toString

        public String toString()
        Description copied from class: AbstractConnection

        Sub-classes should provide an implementation which returns an appropriate description of the connection which may be used for debugging purposes.

        Specified by:
        toString in class AbstractConnection