Interface ExtendedResultDecoder<S extends ExtendedResult>
-
- Type Parameters:
S
- The type of result.
- All Known Implementing Classes:
AbstractExtendedResultDecoder
public interface ExtendedResultDecoder<S extends ExtendedResult>
A factory interface for decoding a generic extended result as an extended result of specific type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description S
adaptDecodeException(DecodeException exception)
Creates a new extended operation error result using the provided decoding exception.S
decodeExtendedResult(ExtendedResult result, DecodeOptions options)
Decodes the provided extended operation result as aResult
of typeS
.Class<S>
getExtendedResultClass()
Returns the typeS
of theExtendedResult
.S
newExtendedErrorResult(ResultCode resultCode, String matchedDN, CharSequence diagnosticMessage)
Creates a new extended error result using the provided result code, matched DN, and diagnostic message.
-
-
-
Method Detail
-
adaptDecodeException
S adaptDecodeException(DecodeException exception)
Creates a new extended operation error result using the provided decoding exception. This method should be used to adaptDecodeException
encountered while decoding an extended request or result. The returned error result will have the result codeResultCode.PROTOCOL_ERROR
.- Parameters:
exception
- The decoding exception to be adapted.- Returns:
- An extended operation error result representing the decoding exception.
- Throws:
NullPointerException
- Ifexception
wasnull
.
-
decodeExtendedResult
S decodeExtendedResult(ExtendedResult result, DecodeOptions options) throws DecodeException
Decodes the provided extended operation result as aResult
of 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.- 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
S newExtendedErrorResult(ResultCode resultCode, String matchedDN, CharSequence diagnosticMessage)
Creates 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 aResult
of typeS
.- 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.
- Throws:
NullPointerException
- IfresultCode
,matchedDN
, ordiagnosticMessage
werenull
.
-
-