Class AbstractExtendedOperationFactory
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.AbstractExtendedOperationFactory
-
- All Implemented Interfaces:
ExtendedOperationFactory
- Direct Known Subclasses:
CancelFactory,CertGenerationFactory,EndTransactionFactory,GracefulDisconnectFactory,GracefulShutdownFactory,NoDFactory,PasswordModifyFactory,StartTlsFactory,StartTransactionFactory,StoredProcedureFactory,WhoAmIFactory
public abstract class AbstractExtendedOperationFactory extends Object implements ExtendedOperationFactory
A Factory to encode Extended Request and Response messages- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractExtendedOperationFactory(LdapApiService codec, String oid)Creates a new instance of AbstractExtendedOperationFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecodeValue(ExtendedRequest extendedRequest, byte[] requestValue)Decode the value part of the extended request operation.voiddecodeValue(ExtendedResponse extendedResponse, byte[] responseValue)Decode the value part of the extended response operation.voidencodeValue(Asn1Buffer buffer, ExtendedRequest extendedRequest)Encode the value part of the extended request operation.voidencodeValue(Asn1Buffer buffer, ExtendedResponse extendedResponse)Encode the value part of the extended response operation.StringgetOid()Gets the OID of the extended requests this factory generates.ExtendedRequestnewRequest(byte[] value)Returns a newExtendedRequestwith the following encoded value.ExtendedResponsenewResponse(byte[] value)Creates a new ExtendedResponse, for the ExtendedRequest with a specific encoded value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.codec.api.ExtendedOperationFactory
newRequest, newResponse
-
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
logger for reporting errors that might not be handled properly upstream
-
codec
protected LdapApiService codec
The LDAP codec responsible for encoding and decoding
-
oid
protected String oid
The extended operation OID
-
-
Constructor Detail
-
AbstractExtendedOperationFactory
protected AbstractExtendedOperationFactory(LdapApiService codec, String oid)
Creates a new instance of AbstractExtendedOperationFactory.- Parameters:
codec- The LdapApiService instanceoid- The extended operation OID
-
-
Method Detail
-
getOid
public String getOid()
Gets the OID of the extended requests this factory generates.- Specified by:
getOidin interfaceExtendedOperationFactory- Returns:
- the extended request OID
-
newRequest
public ExtendedRequest newRequest(byte[] value) throws DecoderException
Returns a newExtendedRequestwith the following encoded value.- Specified by:
newRequestin interfaceExtendedOperationFactory- Parameters:
value- the encoded value- Returns:
- the decorator for the extended request type
- Throws:
DecoderException- If we can't decode the response
-
newResponse
public ExtendedResponse newResponse(byte[] value) throws DecoderException
Creates a new ExtendedResponse, for the ExtendedRequest with a specific encoded value.- Specified by:
newResponsein interfaceExtendedOperationFactory- 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, ExtendedRequest extendedRequest)
Encode the value part of the extended request operation.- Specified by:
encodeValuein interfaceExtendedOperationFactory- Parameters:
buffer- The buffer into which to put the encoded valueextendedRequest- The ExtendedRequest Operation to encode
-
decodeValue
public void decodeValue(ExtendedRequest extendedRequest, byte[] requestValue) throws DecoderException
Decode the value part of the extended request operation.- Specified by:
decodeValuein interfaceExtendedOperationFactory- Parameters:
extendedRequest- The ExtendedRequest Operation to feedrequestValue- The request value to decode- Throws:
DecoderException- If the value cannot be decoded
-
encodeValue
public void encodeValue(Asn1Buffer buffer, ExtendedResponse extendedResponse)
Encode the value part of the extended response operation.- Specified by:
encodeValuein interfaceExtendedOperationFactory- Parameters:
buffer- The buffer into which to put the encoded valueextendedResponse- The ExtendedResponse Operation to encode
-
decodeValue
public void decodeValue(ExtendedResponse extendedResponse, byte[] responseValue) throws DecoderException
Decode the value part of the extended response operation.- Specified by:
decodeValuein interfaceExtendedOperationFactory- Parameters:
extendedResponse- The ExtendedResponse Operation to feedresponseValue- The response value to decode- Throws:
DecoderException- If the value cannot be decoded
-
-