Interface ExtendedRequest<S extends ExtendedResult>

Type Parameters:
S - The type of result.
All Superinterfaces:
ProtocolOp, Request
All Known Implementing Classes:
CancelExtendedRequest, GenericExtendedRequest, PasswordModifyExtendedRequest, StartTlsExtendedRequest, WhoAmIExtendedRequest

public interface ExtendedRequest<S extends ExtendedResult> extends Request
The Extended operation allows additional operations to be defined for services not already available in the protocol; for example, to implement an operation which installs transport layer security (see StartTlsExtendedRequest).

To determine whether a directory server supports a given extension, read the list of supported extensions from the root DSE to get a collection of extension OIDs, and then check for a match. For example:

 
 Connection connection = ...;
 Collection&lt;String&gt; supported =
     RootDSE.readRootDSE(connection).getSupportedExtendedOperations();

 ExtendedRequest extension = ...;
 String OID = extension.getOID();
 if (supported != null && !supported.isEmpty() && supported.contains(OID)) {
     // The extension is supported. Use it here...
 }
 
 
  • Method Details

    • getOid

      String getOid()
      Returns the numeric OID associated with this extended request.
      Returns:
      The numeric OID associated with this extended request.
    • getResultDecoder

      ExtendedResultDecoder<S> getResultDecoder()
      Returns a decoder which can be used to decoded responses to this extended request.
      Returns:
      A decoder which can be used to decoded responses to this extended request.
    • getValue

      ByteString getValue()
      Returns the value, if any, associated with this extended request. Its format is defined by the specification of this extended request.
      Returns:
      The value associated with this extended request, or null if there is no value.
    • hasValue

      boolean hasValue()
      Returns true if this extended request has a value. In some circumstances it may be useful to determine if an extended request has a value, without actually calculating the value and incurring any performance costs.
      Returns:
      true if this extended request has a value, or false if there is no value.
    • getType

      default Request.RequestType getType()
      Returns the type of this extended request to avoid expensive instanceof checks.
      Specified by:
      getType in interface Request
      Returns:
      the type of this extended request
    • accept

      default <R, P, E extends Exception> R accept(RequestVisitor<R,P,E> v, P p) throws E
      Description copied from interface: Request
      Applies a RequestVisitor to this Request.
      Specified by:
      accept in interface Request
      Type Parameters:
      R - The return type of the visitor's methods.
      P - The type of the additional parameters to the visitor's methods.
      E - The type of the exception thrown by the visitor method if it fails, or NeverThrowsException if the visitor cannot fail.
      Parameters:
      v - The request visitor.
      p - Optional additional visitor parameter.
      Returns:
      A result as specified by the visitor.
      Throws:
      E - If the visitor failed.