Class AbstractExtendedResultDecoder<S extends ExtendedResult>
java.lang.Object
org.forgerock.opendj.ldap.responses.AbstractExtendedResultDecoder<S>
- Type Parameters:
S- The type of result.
- All Implemented Interfaces:
ExtendedResultDecoder<S>
public abstract class AbstractExtendedResultDecoder<S extends ExtendedResult>
extends Object
implements ExtendedResultDecoder<S>
This class provides a skeletal implementation of the
ExtendedResultDecoder interface, to minimize the effort required to
implement this interface.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new abstract extended result decoder. -
Method Summary
Modifier and TypeMethodDescriptionadaptDecodeException(DecodeException exception) Creates a new extended operation error result using the provided decoding exception.<R extends ExtendedResult>
LdapResultHandler<S> adaptExtendedResultHandler(ExtendedRequest<R> request, LdapResultHandler<? super R> resultHandler, DecodeOptions options) Adapts the provided extended result handler into a result handler which is compatible with this extended result decoder.abstract SdecodeExtendedResult(ExtendedResult result, DecodeOptions options) Decodes the provided extended operation result as aResultof typeS.abstract SnewExtendedErrorResult(ResultCode resultCode, String matchedDN, String diagnosticMessage) Creates a new extended error result using the provided result code, matched DN, and diagnostic message.
-
Constructor Details
-
AbstractExtendedResultDecoder
protected AbstractExtendedResultDecoder()Creates a new abstract extended result decoder.
-
-
Method Details
-
adaptDecodeException
Description copied from interface:ExtendedResultDecoderCreates a new extended operation error result using the provided decoding exception. This method should be used to adaptDecodeExceptionencountered while decoding an extended request or result. The returned error result will have the result codeResultCode.PROTOCOL_ERROR.- Specified by:
adaptDecodeExceptionin interfaceExtendedResultDecoder<S extends ExtendedResult>- Parameters:
exception- The decoding exception to be adapted.- Returns:
- An extended operation error result representing the decoding exception.
-
adaptExtendedResultHandler
public <R extends ExtendedResult> LdapResultHandler<S> adaptExtendedResultHandler(ExtendedRequest<R> request, LdapResultHandler<? super R> resultHandler, DecodeOptions options) Description copied from interface:ExtendedResultDecoderAdapts the provided extended result handler into a result handler which is compatible with this extended result decoder. Extended results handled by the returned handler will be automatically converted and passed to the provided result handler. Decoding errors encountered while decoding the extended result will be converted into protocol errors.- Specified by:
adaptExtendedResultHandlerin interfaceExtendedResultDecoder<S extends ExtendedResult>- Type Parameters:
R- The type of result handler to be adapted.- Parameters:
request- The extended request whose result handler is to be adapted.resultHandler- The extended result handler which is to be adapted.options- The set of decode options which should be used when decoding the extended operation result.- Returns:
- A result handler which is compatible with this extended result decoder.
-
decodeExtendedResult
public abstract S decodeExtendedResult(ExtendedResult result, DecodeOptions options) throws DecodeException Description copied from interface:ExtendedResultDecoderDecodes the provided extended operation result as aResultof typeS. This method is called when an extended result is received from the server. The result may indicate success or failure of the extended request.- Specified by:
decodeExtendedResultin interfaceExtendedResultDecoder<S extends ExtendedResult>- Parameters:
result- The extended operation result to be decoded.options- The set of decode options which should be used when decoding the extended operation result.- Returns:
- The decoded extended operation result.
- Throws:
DecodeException- If the provided extended operation result could not be decoded. For example, if the request name was wrong, or if the request value was invalid.
-
newExtendedErrorResult
public abstract S newExtendedErrorResult(ResultCode resultCode, String matchedDN, String diagnosticMessage) Description copied from interface:ExtendedResultDecoderCreates a new extended error result using the provided result code, matched DN, and diagnostic message. This method is called when a generic failure occurs, such as a connection failure, and the error result needs to be converted to aResultof typeS.- Specified by:
newExtendedErrorResultin interfaceExtendedResultDecoder<S extends ExtendedResult>- Parameters:
resultCode- The result code.matchedDN- The matched DN, which may be empty if none was provided.diagnosticMessage- The diagnostic message, which may be empty if none was provided.- Returns:
- The decoded extended operation error result.
-