Interface RequestHandler<C>

Type Parameters:
C - The type of request context.
All Known Subinterfaces:
ServerConnection<C>
All Known Implementing Classes:
MemoryBackend

public interface RequestHandler<C>
A handler interface for processing client requests.

Implementations must always return results using the provided LdapResultHandler unless explicitly permitted.

For example, an LDAPListener does not require RequestHandler implementations to return results, which may be useful when implementing abandon operation functionality. Conversely, an access logger implemented as a RequestHandler wrapper will require wrapped RequestHandlers to always return results, even abandoned results, in order for it to log the result status.

See Also:
  • Method Details

    • handleAdd

      void handleAdd(C requestContext, AddRequest request, IntermediateResponseHandler intermediateResponseHandler, LdapResultHandler<Result> resultHandler)
      Invoked when an add request is received from a client.
      Parameters:
      requestContext - The request context.
      request - The add request.
      intermediateResponseHandler - The handler which should be used to send back any intermediate responses to the client.
      resultHandler - The handler which should be used to send back the result to the client.
      Throws:
      UnsupportedOperationException - If this request handler does not handle add requests.
    • handleBind

      void handleBind(C requestContext, int version, BindRequest request, IntermediateResponseHandler intermediateResponseHandler, LdapResultHandler<BindResult> resultHandler)
      Invoked when a bind request is received from a client.
      Parameters:
      requestContext - The request context.
      version - The protocol version included with the bind request.
      request - The bind request.
      intermediateResponseHandler - The handler which should be used to send back any intermediate responses to the client.
      resultHandler - The handler which should be used to send back the result to the client.
      Throws:
      UnsupportedOperationException - If this request handler does not handle bind requests.
    • handleCompare

      void handleCompare(C requestContext, CompareRequest request, IntermediateResponseHandler intermediateResponseHandler, LdapResultHandler<CompareResult> resultHandler)
      Invoked when a compare request is received from a client.
      Parameters:
      requestContext - The request context.
      request - The compare request.
      intermediateResponseHandler - The handler which should be used to send back any intermediate responses to the client.
      resultHandler - The handler which should be used to send back the result to the client.
      Throws:
      UnsupportedOperationException - If this request handler does not handle compare requests.
    • handleDelete

      void handleDelete(C requestContext, DeleteRequest request, IntermediateResponseHandler intermediateResponseHandler, LdapResultHandler<Result> resultHandler)
      Invoked when a delete request is received from a client.
      Parameters:
      requestContext - The request context.
      request - The delete request.
      intermediateResponseHandler - The handler which should be used to send back any intermediate responses to the client.
      resultHandler - The handler which should be used to send back the result to the client.
      Throws:
      UnsupportedOperationException - If this request handler does not handle delete requests.
    • handleExtendedRequest

      <R extends ExtendedResult> void handleExtendedRequest(C requestContext, ExtendedRequest<R> request, IntermediateResponseHandler intermediateResponseHandler, LdapResultHandler<R> resultHandler)
      Invoked when an extended request is received from a client.
      Type Parameters:
      R - The type of result returned by the extended request.
      Parameters:
      requestContext - The request context.
      request - The extended request.
      intermediateResponseHandler - The handler which should be used to send back any intermediate responses to the client.
      resultHandler - The handler which should be used to send back the result to the client.
      Throws:
      UnsupportedOperationException - If this request handler does not handle extended requests.
    • handleModify

      void handleModify(C requestContext, ModifyRequest request, IntermediateResponseHandler intermediateResponseHandler, LdapResultHandler<Result> resultHandler)
      Invoked when a modify request is received from a client.
      Parameters:
      requestContext - The request context.
      request - The modify request.
      intermediateResponseHandler - The handler which should be used to send back any intermediate responses to the client.
      resultHandler - The handler which should be used to send back the result to the client.
      Throws:
      UnsupportedOperationException - If this request handler does not handle modify requests.
    • handleModifyDN

      void handleModifyDN(C requestContext, ModifyDNRequest request, IntermediateResponseHandler intermediateResponseHandler, LdapResultHandler<Result> resultHandler)
      Invoked when a modify DN request is received from a client.
      Parameters:
      requestContext - The request context.
      request - The modify DN request.
      intermediateResponseHandler - The handler which should be used to send back any intermediate responses to the client.
      resultHandler - The handler which should be used to send back the result to the client.
      Throws:
      UnsupportedOperationException - If this request handler does not handle modify DN requests.
    • handleSearch

      void handleSearch(C requestContext, SearchRequest request, IntermediateResponseHandler intermediateResponseHandler, SearchResultHandler entryHandler, LdapResultHandler<Result> resultHandler)
      Invoked when a search request is received from a client.
      Parameters:
      requestContext - The request context.
      request - The search request.
      intermediateResponseHandler - The handler which should be used to send back any intermediate responses to the client.
      entryHandler - The entry handler which should be used to send back the search entries results to the client.
      resultHandler - The handler which should be used to send back the result to the client.
      Throws:
      UnsupportedOperationException - If this request handler does not handle search requests.