Class AdDirSyncDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<AdDirSync>
-
- org.apache.directory.api.ldap.extras.controls.ad_impl.AdDirSyncDecorator
-
- All Implemented Interfaces:
Asn1Object
,CodecControl<AdDirSync>
,Decorator<AdDirSync>
,AdDirSync
,Control
public class AdDirSyncDecorator extends ControlDecorator<AdDirSync> implements AdDirSync
A decorator around AdDirSync control. It will encode and decode this control.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description AdDirSyncDecorator(LdapApiService codec)
Creates a new instance of AdDirSyncControlCodec.AdDirSyncDecorator(LdapApiService codec, AdDirSync control)
Creates a new instance of AdDirSyncDecorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFlag(AdDirSyncFlag flag)
int
computeLength()
Compute the AdDirSync length.Asn1Object
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.ByteBuffer
encode(ByteBuffer buffer)
Encode the AdDirSync control.byte[]
getCookie()
Set<AdDirSyncFlag>
getFlags()
int
getMaxReturnLength()
byte[]
getValue()
Get the control valuevoid
removeFlag(AdDirSyncFlag flag)
void
setCookie(byte[] cookie)
void
setFlags(Set<AdDirSyncFlag> flags)
void
setMaxReturnLength(int maxReturnLength)
-
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
-
AdDirSyncDecorator
public AdDirSyncDecorator(LdapApiService codec)
Creates a new instance of AdDirSyncControlCodec.- Parameters:
codec
- The LDAP Service to use
-
AdDirSyncDecorator
public AdDirSyncDecorator(LdapApiService codec, AdDirSync control)
Creates a new instance of AdDirSyncDecorator.- Parameters:
codec
- The LDAP Service to usecontrol
- The control to be decorated
-
-
Method Detail
-
getFlags
public Set<AdDirSyncFlag> getFlags()
-
setFlags
public void setFlags(Set<AdDirSyncFlag> flags)
-
addFlag
public void addFlag(AdDirSyncFlag flag)
-
removeFlag
public void removeFlag(AdDirSyncFlag flag)
- Specified by:
removeFlag
in interfaceAdDirSync
- Parameters:
flag
- The flag to be removed from the current collection of flags.
-
getMaxReturnLength
public int getMaxReturnLength()
- Specified by:
getMaxReturnLength
in interfaceAdDirSync
- Returns:
- The maximum length of attributes to be returned
-
setMaxReturnLength
public void setMaxReturnLength(int maxReturnLength)
- Specified by:
setMaxReturnLength
in interfaceAdDirSync
- Parameters:
maxReturnLength
- The maximum length of attributes to be returned
-
getCookie
public byte[] getCookie()
-
setCookie
public void setCookie(byte[] cookie)
-
computeLength
public int computeLength()
Compute the AdDirSync length. We use the client side control.0x30 L1 | +--> 0x02 0x0(1-4) nnn (flags) +--> 0x02 0x0(1-4) nnn (maxReturnLength) +--> 0x04 L2 xkcd!!!... (cookie)
- Specified by:
computeLength
in interfaceAsn1Object
- Returns:
- The object's computed length
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the AdDirSync control. We use the client side 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 while encoding.
-
getValue
public byte[] getValue()
Get the control value- Specified by:
getValue
in interfaceCodecControl<AdDirSync>
- Overrides:
getValue
in classControlDecorator<AdDirSync>
- Returns:
- The control value
-
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<AdDirSync>
- Parameters:
controlBytes
- the encoded control bytes- Returns:
- the decoded Asn1Object for the control
- Throws:
DecoderException
- if anything goes wrong
-
-