org.apache.directory.shared.ldap.codec.controls.search.subentries
Class SubentriesDecorator

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.controls.ControlDecorator<Subentries>
          extended by org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesDecorator
All Implemented Interfaces:
Asn1Object, CodecControl<Subentries>, Decorator<Subentries>, Control, Subentries

public class SubentriesDecorator
extends ControlDecorator<Subentries>
implements Subentries

A Subentries Control implementation which wraps and decorates Subentries Controls to enable them to be encoded and decoded by the codec.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.codec.controls.ControlDecorator
value, valueLength
 
Fields inherited from interface org.apache.directory.shared.ldap.model.message.controls.Subentries
OID
 
Constructor Summary
SubentriesDecorator(LdapCodecService codec)
          Default constructor
SubentriesDecorator(LdapCodecService codec, Subentries control)
          Creates a Subentries decorating implementation for use with the codec, while decorating the supplied Subentries control.
 
Method Summary
 int computeLength()
          Compute the SubEntryControl length 0x01 0x01 [0x00|0xFF]
 Asn1Object decode(byte[] controlBytes)
          Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.
 ByteBuffer encode(ByteBuffer buffer)
          Encodes the Subentries control.
 byte[] getValue()
          Get the control value
 boolean isVisible()
           
 void setVisibility(boolean visibility)
           
 
Methods inherited from class org.apache.directory.shared.ldap.codec.controls.ControlDecorator
equals, getCodecService, getDecorated, getOid, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.Control
getOid, isCritical, setCritical
 

Constructor Detail

SubentriesDecorator

public SubentriesDecorator(LdapCodecService codec)
Default constructor


SubentriesDecorator

public SubentriesDecorator(LdapCodecService codec,
                           Subentries control)
Creates a Subentries decorating implementation for use with the codec, while decorating the supplied Subentries control.

Parameters:
control - The Subentries Control to wrap with this decorator.
Method Detail

computeLength

public int computeLength()
Compute the SubEntryControl length 0x01 0x01 [0x00|0xFF]

Specified by:
computeLength in interface Asn1Object
Specified by:
computeLength in interface Decorator<Subentries>
Overrides:
computeLength in class ControlDecorator<Subentries>
Returns:
The object's computed length

encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws EncoderException
Encodes the Subentries control.

Specified by:
encode in interface Asn1Object
Specified by:
encode in interface Decorator<Subentries>
Overrides:
encode in class AbstractAsn1Object
Parameters:
buffer - The encoded sink
Returns:
A ByteBuffer that contains the encoded PDU
Throws:
EncoderException - If anything goes wrong.

getValue

public byte[] getValue()
Get the control value

Specified by:
getValue in interface CodecControl<Subentries>
Overrides:
getValue in class ControlDecorator<Subentries>
Returns:
The control value

isVisible

public boolean isVisible()
Specified by:
isVisible in interface Subentries

setVisibility

public void setVisibility(boolean visibility)
Specified by:
setVisibility in interface Subentries

decode

public Asn1Object decode(byte[] controlBytes)
                  throws DecoderException
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.

Specified by:
decode in interface CodecControl<Subentries>
Parameters:
controlBytes - the encoded control bytes
Returns:
the decoded Asn1Object for the control
Throws:
DecoderException - if anything goes wrong


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.