Interface Response
- All Known Subinterfaces:
BindResult,CompareResult,ExtendedResult,GenericExtendedResult,GenericIntermediateResponse,IntermediateResponse,PasswordModifyExtendedResult,Result,SearchResultEntry,SearchResultReference,WhoAmIExtendedResult
- All Known Implementing Classes:
AbstractExtendedResult,AbstractIntermediateResponse
public interface Response
The base class of all Responses provides methods for querying and
manipulating the set of Controls included with a Response.
-
Method Summary
Modifier and TypeMethodDescriptionaddControl(Control control) Adds the provided control to this response.booleancontainsControl(String oid) Returnstrueif this response contains the specified response control.<C extends Control>
CgetControl(ControlDecoder<C> decoder, DecodeOptions options) Decodes and returns the first control in this response having an OID corresponding to the provided control decoder.Returns aListcontaining the controls included with this response.
-
Method Details
-
addControl
Adds the provided control to this response.- Parameters:
control- The control to be added.- Returns:
- This response.
- Throws:
UnsupportedOperationException- If this response does not permit controls to be added.NullPointerException- Ifcontrolwasnull.
-
containsControl
Returnstrueif this response contains the specified response control.- Parameters:
oid- The numeric OID of the response control.- Returns:
trueif this response contains the specified response control.
-
getControl
<C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException Decodes and returns the first control in this response having an OID corresponding to the provided control decoder.- Type Parameters:
C- The type of control to be decoded and returned.- Parameters:
decoder- The control decoder.options- The set of decode options which should be used when decoding the control.- Returns:
- The decoded control, or
nullif the control is not included with this response. - Throws:
DecodeException- If the control could not be decoded because it was malformed in some way (e.g. the control value was missing, or its content could not be decoded).NullPointerException- Ifdecoderoroptionswasnull.
-
getControls
Returns aListcontaining the controls included with this response. The returnedListmay be modified if permitted by this response.- Returns:
- A
Listcontaining the controls.
-