Class BasicControlDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<Control>
-
- org.apache.directory.api.ldap.codec.BasicControlDecorator
-
- All Implemented Interfaces:
Asn1Object
,CodecControl<Control>
,Decorator<Control>
,Control
public class BasicControlDecorator extends ControlDecorator<Control>
A decorator for handling opaque Control objects where we know nothing about their encoded value. These Controls are generated by default when a ControlFactory for them has not been registered with theLdapApiService
.- Version:
- $Rev$, $Date$
- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description BasicControlDecorator(LdapApiService codec, Control control)
Creates a new instance of BasicControlDecorator, decorating aControl
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the object length, which is the sum of all inner length.Asn1Object
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.ByteBuffer
encode(ByteBuffer buffer)
Encode the object to a PDU.-
Methods inherited from class org.apache.directory.api.ldap.codec.api.ControlDecorator
equals, getCodecService, getDecorated, getOid, getValue, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
-
-
-
-
Constructor Detail
-
BasicControlDecorator
public BasicControlDecorator(LdapApiService codec, Control control)
Creates a new instance of BasicControlDecorator, decorating aControl
.- Parameters:
codec
- The LDAP codec service.control
- TheControl
to decorate.
-
-
Method Detail
-
decode
public Asn1Object decode(byte[] controlBytes) throws DecoderException
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.- Parameters:
controlBytes
- the encoded control bytes- Returns:
- the decoded Asn1Object for the control
- Throws:
DecoderException
- if anything goes wrong
-
computeLength
public int computeLength()
Compute the object length, which is the sum of all inner length.- Returns:
- The object's computed length
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the object to a PDU.- Parameters:
buffer
- The buffer where to put the PDU- Returns:
- The encoded PDU.
- Throws:
EncoderException
- if the buffer can't be encoded
-
-