Class SyncDoneValueDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<SyncDoneValue>
-
- org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueDecorator
-
- All Implemented Interfaces:
Asn1Object
,CodecControl<SyncDoneValue>
,Decorator<SyncDoneValue>
,SyncDoneValue
,Control
public class SyncDoneValueDecorator extends ControlDecorator<SyncDoneValue> implements SyncDoneValue
A syncDoneValue object as described in rfc4533.- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from interface org.apache.directory.api.ldap.extras.controls.syncrepl.syncDone.SyncDoneValue
OID
-
-
Constructor Summary
Constructors Constructor Description SyncDoneValueDecorator(LdapApiService codec)
Creates a new instance of SyncDoneValueControlCodec.SyncDoneValueDecorator(LdapApiService codec, SyncDoneValue control)
Creates a new instance of SyncDoneValueDecorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the syncDoneValue length.Asn1Object
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.ByteBuffer
encode(ByteBuffer buffer)
Encode the SyncDoneValue controlbyte[]
getCookie()
byte[]
getValue()
Get the control valueboolean
isRefreshDeletes()
void
setCookie(byte[] cookie)
void
setRefreshDeletes(boolean refreshDeletes)
-
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
-
SyncDoneValueDecorator
public SyncDoneValueDecorator(LdapApiService codec)
Creates a new instance of SyncDoneValueControlCodec.- Parameters:
codec
- The LDAP Service to use
-
SyncDoneValueDecorator
public SyncDoneValueDecorator(LdapApiService codec, SyncDoneValue control)
Creates a new instance of SyncDoneValueDecorator.- Parameters:
codec
- The LDAP codeccontrol
- The control to be decorated
-
-
Method Detail
-
computeLength
public int computeLength()
Compute the syncDoneValue length.0x30 L1 | +--> 0x04 L2 xkcd!!!... (cookie) +--> 0x01 0x01 [0x00|0xFF] (refreshDeletes)
- Specified by:
computeLength
in interfaceAsn1Object
- Returns:
- The computed length
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the SyncDoneValue 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<SyncDoneValue>
- Overrides:
getValue
in classControlDecorator<SyncDoneValue>
- Returns:
- The control value
-
getCookie
public byte[] getCookie()
- Specified by:
getCookie
in interfaceSyncDoneValue
- Returns:
- the cookie
-
setCookie
public void setCookie(byte[] cookie)
- Specified by:
setCookie
in interfaceSyncDoneValue
- Parameters:
cookie
- cookie to be set
-
isRefreshDeletes
public boolean isRefreshDeletes()
- Specified by:
isRefreshDeletes
in interfaceSyncDoneValue
- Returns:
- true, if refreshDeletes flag is set, false otherwise
-
setRefreshDeletes
public void setRefreshDeletes(boolean refreshDeletes)
- Specified by:
setRefreshDeletes
in interfaceSyncDoneValue
- Parameters:
refreshDeletes
- set the refreshDeletes flag
-
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<SyncDoneValue>
- Parameters:
controlBytes
- the encoded control bytes- Returns:
- the decoded Asn1Object for the control
- Throws:
DecoderException
- if anything goes wrong
-
-