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
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<String> 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...
}
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.forgerock.opendj.ldap.messages.Request
Request.RequestType -
Method Summary
Modifier and TypeMethodDescriptiondefault <R,P, E extends Exception>
Raccept(RequestVisitor<R, P, E> v, P p) Applies aRequestVisitorto thisRequest.getOid()Returns the numeric OID associated with this extended request.Returns a decoder which can be used to decoded responses to this extended request.default Request.RequestTypegetType()Returns the type of this extended request to avoid expensiveinstanceofchecks.getValue()Returns the value, if any, associated with this extended request.booleanhasValue()Returnstrueif this extended request has a value.Methods inherited from interface org.forgerock.opendj.ldap.messages.ProtocolOp
addControl, addControls, containsControl, controls, getControl, getControl, removeControls
-
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
nullif there is no value.
-
hasValue
boolean hasValue()Returnstrueif 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:
trueif this extended request has a value, orfalseif there is no value.
-
getType
Returns the type of this extended request to avoid expensiveinstanceofchecks. -
accept
Description copied from interface:RequestApplies aRequestVisitorto thisRequest.- Specified by:
acceptin interfaceRequest- 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, orNeverThrowsExceptionif 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.
-