Class SyncStateValueDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<SyncStateValue>
-
- org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueDecorator
-
- All Implemented Interfaces:
Asn1Object
,CodecControl<SyncStateValue>
,Decorator<SyncStateValue>
,SyncStateValue
,Control
public class SyncStateValueDecorator extends ControlDecorator<SyncStateValue> implements SyncStateValue
A syncStateValue object, as defined in RFC 4533- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from interface org.apache.directory.api.ldap.extras.controls.syncrepl.syncState.SyncStateValue
OID
-
-
Constructor Summary
Constructors Constructor Description SyncStateValueDecorator(LdapApiService codec)
Creates a new instance of SyncStateValueDecorator.SyncStateValueDecorator(LdapApiService codec, SyncStateValue value)
Creates a new instance of SyncStateValueDecorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the SyncStateValue length.Asn1Object
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.ByteBuffer
encode(ByteBuffer buffer)
Encode the SyncStateValue controlbyte[]
getCookie()
byte[]
getEntryUUID()
SyncStateTypeEnum
getSyncStateType()
byte[]
getValue()
Get the control valuevoid
setCookie(byte[] cookie)
void
setEntryUUID(byte[] entryUUID)
set the entryUUIDvoid
setSyncStateType(SyncStateTypeEnum syncStateType)
set the syncState's type-
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
-
SyncStateValueDecorator
public SyncStateValueDecorator(LdapApiService codec)
Creates a new instance of SyncStateValueDecorator.- Parameters:
codec
- The LDAP Service to use
-
SyncStateValueDecorator
public SyncStateValueDecorator(LdapApiService codec, SyncStateValue value)
Creates a new instance of SyncStateValueDecorator.- Parameters:
codec
- The LDAP Service to usevalue
- The SyncState value to use
-
-
Method Detail
-
getCookie
public byte[] getCookie()
- Specified by:
getCookie
in interfaceSyncStateValue
- Returns:
- the cookie
-
setCookie
public void setCookie(byte[] cookie)
- Specified by:
setCookie
in interfaceSyncStateValue
- Parameters:
cookie
- the cookie to set
-
getSyncStateType
public SyncStateTypeEnum getSyncStateType()
- Specified by:
getSyncStateType
in interfaceSyncStateValue
- Returns:
- the syncState's type
-
setSyncStateType
public void setSyncStateType(SyncStateTypeEnum syncStateType)
set the syncState's type- Specified by:
setSyncStateType
in interfaceSyncStateValue
- Parameters:
syncStateType
- the syncState's type
-
getEntryUUID
public byte[] getEntryUUID()
- Specified by:
getEntryUUID
in interfaceSyncStateValue
- Returns:
- the entryUUID
-
setEntryUUID
public void setEntryUUID(byte[] entryUUID)
set the entryUUID- Specified by:
setEntryUUID
in interfaceSyncStateValue
- Parameters:
entryUUID
- the entryUUID
-
computeLength
public int computeLength()
Compute the SyncStateValue length.
SyncStateValue :0x30 L1 | +--> 0x0A 0x01 [0x00|0x01|0x02|0x03] (type) [+--> 0x04 L2 abcd... (entryUUID) [+--> 0x04 L3 abcd... (cookie)
- Specified by:
computeLength
in interfaceAsn1Object
- Returns:
- The computed length
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the SyncStateValue 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<SyncStateValue>
- Overrides:
getValue
in classControlDecorator<SyncStateValue>
- 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<SyncStateValue>
- Parameters:
controlBytes
- the encoded control bytes- Returns:
- the decoded Asn1Object for the control
- Throws:
DecoderException
- if anything goes wrong
-
-