org.apache.directory.shared.ldap.codec
Class BasicControlDecorator<E>
java.lang.Object
org.apache.directory.shared.asn1.AbstractAsn1Object
org.apache.directory.shared.ldap.codec.controls.ControlDecorator<Control>
org.apache.directory.shared.ldap.codec.BasicControlDecorator<E>
- All Implemented Interfaces:
- Asn1Object, CodecControl<Control>, Decorator<Control>, Control
public class BasicControlDecorator<E>
- 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 an
ControlFactory for them has not been registered with the
LdapCodecService.
- Version:
- $Rev$, $Date$
- Author:
- Apache Directory Project
| Methods inherited from class org.apache.directory.shared.ldap.codec.controls.ControlDecorator |
equals, getCodecService, getDecorated, getOid, getValue, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString |
BasicControlDecorator
public BasicControlDecorator(LdapCodecService codec,
Control control)
- Creates a new instance of BasicControlDecorator, decorating a
AbstractControl.
- Parameters:
codec - The LDAP codec service.control - The AbstractControl to decorate.
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.
- Specified by:
computeLength in interface Asn1Object- Specified by:
computeLength in interface Decorator<Control>- Overrides:
computeLength in class ControlDecorator<Control>
- Returns:
- The object's computed length
encode
public ByteBuffer encode(ByteBuffer buffer)
throws EncoderException
- Encode the object to a PDU.
- Specified by:
encode in interface Asn1Object- Specified by:
encode in interface Decorator<Control>- Overrides:
encode in class AbstractAsn1Object
- Parameters:
buffer - The buffer where to put the PDU
- Returns:
- The PDU.
- Throws:
EncoderException - if the buffer can't be encoded
Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.