Class SubentriesDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<Subentries>
-
- org.apache.directory.api.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 interface org.apache.directory.api.ldap.model.message.controls.Subentries
OID
-
-
Constructor Summary
Constructors Constructor Description SubentriesDecorator(LdapApiService codec)
Default constructorSubentriesDecorator(LdapApiService codec, Subentries control)
Creates a Subentries decorating implementation for use with the codec, while decorating the supplied Subentries control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the SubEntryControl lengthAsn1Object
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 valueboolean
isVisible()
Check if the subEntry is visiblevoid
setVisibility(boolean visibility)
Set the visibility flag-
Methods inherited from class org.apache.directory.api.ldap.codec.api.ControlDecorator
equals, getCodecService, getDecorated, getOid, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Control
getOid, isCritical, setCritical
-
-
-
-
Constructor Detail
-
SubentriesDecorator
public SubentriesDecorator(LdapApiService codec)
Default constructor- Parameters:
codec
- The LDAP service instance
-
SubentriesDecorator
public SubentriesDecorator(LdapApiService codec, Subentries control)
Creates a Subentries decorating implementation for use with the codec, while decorating the supplied Subentries control.- Parameters:
codec
- The LDAP service instancecontrol
- The Subentries Control to wrap with this decorator.
-
-
Method Detail
-
computeLength
public int computeLength()
Compute the SubEntryControl length0x01 0x01 [0x00|0xFF]
- Specified by:
computeLength
in interfaceAsn1Object
- Returns:
- the control length.
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encodes the Subentries control.- Specified by:
encode
in interfaceAsn1Object
- 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 interfaceCodecControl<Subentries>
- Overrides:
getValue
in classControlDecorator<Subentries>
- Returns:
- The control value
-
isVisible
public boolean isVisible()
Check if the subEntry is visible- Specified by:
isVisible
in interfaceSubentries
- Returns:
- true or false.
-
setVisibility
public void setVisibility(boolean visibility)
Set the visibility flag- Specified by:
setVisibility
in interfaceSubentries
- Parameters:
visibility
- The visibility flag : true or false
-
decode
public Asn1Object decode(byte[] controlBytes) throws DecoderException
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.- Specified by:
decode
in interfaceCodecControl<Subentries>
- Parameters:
controlBytes
- the encoded control bytes- Returns:
- the decoded Asn1Object for the control
- Throws:
DecoderException
- if anything goes wrong
-
-