Class SyncRequestValueDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<SyncRequestValue>
-
- org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueDecorator
-
- All Implemented Interfaces:
Asn1Object
,CodecControl<SyncRequestValue>
,Decorator<SyncRequestValue>
,SyncRequestValue
,Control
public class SyncRequestValueDecorator extends ControlDecorator<SyncRequestValue> implements SyncRequestValue
A syncRequestValue object, as defined in RFC 4533- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from interface org.apache.directory.api.ldap.extras.controls.syncrepl.syncRequest.SyncRequestValue
OID
-
-
Constructor Summary
Constructors Constructor Description SyncRequestValueDecorator(LdapApiService codec)
Create a new SyncRequestValueDecorator instanceSyncRequestValueDecorator(LdapApiService codec, SyncRequestValue control)
Create a new SyncRequestValueDecorator instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the SyncRequestValue length.Asn1Object
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.ByteBuffer
encode(ByteBuffer buffer)
Encode the SyncRequestValue controlbyte[]
getCookie()
SynchronizationModeEnum
getMode()
byte[]
getValue()
Get the control valueboolean
isReloadHint()
void
setCookie(byte[] cookie)
void
setMode(SynchronizationModeEnum mode)
void
setReloadHint(boolean reloadHint)
-
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
-
SyncRequestValueDecorator
public SyncRequestValueDecorator(LdapApiService codec)
Create a new SyncRequestValueDecorator instance- Parameters:
codec
- The LDAP API service to use
-
SyncRequestValueDecorator
public SyncRequestValueDecorator(LdapApiService codec, SyncRequestValue control)
Create a new SyncRequestValueDecorator instance- Parameters:
codec
- The LDAP API service to usecontrol
- The decorated SyncRequestValue control
-
-
Method Detail
-
getMode
public SynchronizationModeEnum getMode()
- Specified by:
getMode
in interfaceSyncRequestValue
- Returns:
- the mode
-
setMode
public void setMode(SynchronizationModeEnum mode)
- Specified by:
setMode
in interfaceSyncRequestValue
- Parameters:
mode
- the syncMode to set
-
getCookie
public byte[] getCookie()
- Specified by:
getCookie
in interfaceSyncRequestValue
- Returns:
- the cookie
-
setCookie
public void setCookie(byte[] cookie)
- Specified by:
setCookie
in interfaceSyncRequestValue
- Parameters:
cookie
- the cookie to set
-
isReloadHint
public boolean isReloadHint()
- Specified by:
isReloadHint
in interfaceSyncRequestValue
- Returns:
- the reloadHint
-
setReloadHint
public void setReloadHint(boolean reloadHint)
- Specified by:
setReloadHint
in interfaceSyncRequestValue
- Parameters:
reloadHint
- the reloadHint to set
-
computeLength
public int computeLength()
Compute the SyncRequestValue length.
SyncRequestValue :0x30 L1 | +--> 0x0A 0x01 [0x00|0x01|0x02|0x03] (mode) [+--> 0x04 L2 abcd... (cookie) +--> 0x01 0x01 [0x00|0xFF] (reloadHint)
- Specified by:
computeLength
in interfaceAsn1Object
- Returns:
- The computed length
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the SyncRequestValue 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<SyncRequestValue>
- Overrides:
getValue
in classControlDecorator<SyncRequestValue>
- 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<SyncRequestValue>
- Parameters:
controlBytes
- the encoded control bytes- Returns:
- the decoded Asn1Object for the control
- Throws:
DecoderException
- if anything goes wrong
-
-