Class WhoAmIFactory
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.AbstractExtendedOperationFactory
-
- org.apache.directory.api.ldap.extras.extended.ads_impl.whoAmI.WhoAmIFactory
-
- All Implemented Interfaces:
ExtendedOperationFactory
public class WhoAmIFactory extends AbstractExtendedOperationFactory
AnExtendedOperationFactoryfor creating WhoAmI extended request response pairs.- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from class org.apache.directory.api.ldap.codec.api.AbstractExtendedOperationFactory
codec, oid
-
-
Constructor Summary
Constructors Constructor Description WhoAmIFactory(LdapApiService codec)Creates a new instance of WhoAmIFactory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WhoAmIResponsedecode(WhoAmIResponse whoAmIResponse, byte[] data)Decode a PDU which must contain a WhoAmIResponse extended operation.voiddecodeValue(ExtendedResponse extendedResponse, byte[] responseValue)Decode the value part of the extended response operation.voidencodeValue(Asn1Buffer buffer, ExtendedResponse extendedResponse)Encode the value part of the extended response operation.WhoAmIRequestnewRequest()Returns a newExtendedRequestwith no valueWhoAmIRequestnewRequest(byte[] value)Returns a newExtendedRequestwith the following encoded value.WhoAmIResponsenewResponse()Creates a new ExtendedResponse, for the ExtendedRequest with no valueWhoAmIResponsenewResponse(byte[] value)Creates a new ExtendedResponse, for the ExtendedRequest with a specific encoded value.-
Methods inherited from class org.apache.directory.api.ldap.codec.api.AbstractExtendedOperationFactory
decodeValue, encodeValue, getOid
-
-
-
-
Constructor Detail
-
WhoAmIFactory
public WhoAmIFactory(LdapApiService codec)
Creates a new instance of WhoAmIFactory.- Parameters:
codec- The codec for this factory.
-
-
Method Detail
-
newRequest
public WhoAmIRequest newRequest()
Returns a newExtendedRequestwith no value- Returns:
- the decorator for the extended request type
-
newRequest
public WhoAmIRequest newRequest(byte[] value) throws DecoderException
Returns a newExtendedRequestwith the following encoded value.- Specified by:
newRequestin interfaceExtendedOperationFactory- Overrides:
newRequestin classAbstractExtendedOperationFactory- Parameters:
value- the encoded value- Returns:
- the decorator for the extended request type
- Throws:
DecoderException- If we can't decode the response
-
newResponse
public WhoAmIResponse newResponse() throws DecoderException
Creates a new ExtendedResponse, for the ExtendedRequest with no value- Returns:
- The new ExtendedResponse.
- Throws:
DecoderException- If the response cannot be decoded
-
newResponse
public WhoAmIResponse newResponse(byte[] value) throws DecoderException
Creates a new ExtendedResponse, for the ExtendedRequest with a specific encoded value.- Specified by:
newResponsein interfaceExtendedOperationFactory- Overrides:
newResponsein classAbstractExtendedOperationFactory- Parameters:
value- The encoded value for the ExtendedResponse instance.- Returns:
- The new ExtendedResponse.
- Throws:
DecoderException- If we can't decode the response
-
encodeValue
public void encodeValue(Asn1Buffer buffer, ExtendedResponse extendedResponse)
Encode the value part of the extended response operation.- Specified by:
encodeValuein interfaceExtendedOperationFactory- Overrides:
encodeValuein classAbstractExtendedOperationFactory- Parameters:
buffer- The buffer into which to put the encoded valueextendedResponse- The ExtendedResponse Operation to encode
-
decode
public static WhoAmIResponse decode(WhoAmIResponse whoAmIResponse, byte[] data) throws DecoderException
Decode a PDU which must contain a WhoAmIResponse extended operation. Note that the stream of bytes much contain a full PDU, not a partial one.- Parameters:
whoAmIResponse- The WhoAmI extended response that will be feeddata- The bytes to be decoded- Returns:
- a WhoAmIRequest object
- Throws:
DecoderException- If the decoding failed
-
decodeValue
public void decodeValue(ExtendedResponse extendedResponse, byte[] responseValue) throws DecoderException
Decode the value part of the extended response operation.- Specified by:
decodeValuein interfaceExtendedOperationFactory- Overrides:
decodeValuein classAbstractExtendedOperationFactory- Parameters:
extendedResponse- The ExtendedResponse Operation to feedresponseValue- The response value to decode- Throws:
DecoderException- If the value cannot be decoded
-
-