Class SyncInfoValueDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.MessageDecorator<M>
-
- org.apache.directory.api.ldap.codec.decorators.ResponseDecorator<I>
-
- org.apache.directory.api.ldap.codec.decorators.IntermediateResponseDecorator<SyncInfoValue>
-
- org.apache.directory.api.ldap.extras.intermediate.syncrepl_impl.SyncInfoValueDecorator
-
- All Implemented Interfaces:
Asn1Object
,Decorator<SyncInfoValue>
,SyncInfoValue
,IntermediateResponse
,Message
,Response
,ResultResponse
public class SyncInfoValueDecorator extends IntermediateResponseDecorator<SyncInfoValue> implements SyncInfoValue
A syncInfoValue object, as defined in RFC 4533- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from interface org.apache.directory.api.ldap.extras.intermediate.syncrepl.SyncInfoValue
OID
-
-
Constructor Summary
Constructors Constructor Description SyncInfoValueDecorator(LdapApiService codec)
The constructor for this codec.SyncInfoValueDecorator(LdapApiService codec, SynchronizationInfoEnum type)
The constructor for this codec.SyncInfoValueDecorator(LdapApiService codec, SyncInfoValue syncInfoValue)
The constructor for this codec.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSyncUUID(byte[] syncUUID)
int
computeLength()
Compute the SyncInfoValue length.Asn1Object
decode(byte[] responseBytes)
ByteBuffer
encode(ByteBuffer buffer)
Encode the SyncInfoValue responsebyte[]
getCookie()
SynchronizationInfoEnum
getSyncInfoValueType()
Get the value type.List<byte[]>
getSyncUUIDs()
byte[]
getValue()
boolean
isRefreshDeletes()
boolean
isRefreshDone()
void
setCookie(byte[] cookie)
void
setRefreshDeletes(boolean refreshDeletes)
void
setRefreshDone(boolean refreshDone)
void
setSyncInfoValueType(SynchronizationInfoEnum syncInfoValueType)
void
setSyncUUIDs(List<byte[]> syncUUIDs)
String
toString()
Delegates to the toString() method of the decorated Message.-
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.IntermediateResponseDecorator
getResponseName, getResponseValue, setResponseName, setResponseValue
-
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.ResponseDecorator
getLdapResult, setLdapResult
-
Methods inherited from class org.apache.directory.api.ldap.codec.api.MessageDecorator
addAllControls, addControl, get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, removeControl, setControlsLength, setMessageId, setMessageLength
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.IntermediateResponse
getResponseName, getResponseValue, setResponseName, setResponseValue
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponse
getLdapResult
-
-
-
-
Constructor Detail
-
SyncInfoValueDecorator
public SyncInfoValueDecorator(LdapApiService codec)
The constructor for this codec. Dont't forget to set the type.- Parameters:
codec
- The LDAP Service to use
-
SyncInfoValueDecorator
public SyncInfoValueDecorator(LdapApiService codec, SyncInfoValue syncInfoValue)
The constructor for this codec. Dont't forget to set the type.- Parameters:
codec
- The LDAP Service to usesyncInfoValue
- The SyncInfoValue to decorate
-
SyncInfoValueDecorator
public SyncInfoValueDecorator(LdapApiService codec, SynchronizationInfoEnum type)
The constructor for this codec.- Parameters:
codec
- The LDAP Service to usetype
- The kind of syncInfo we will store. Can be newCookie, refreshPresent, refreshDelete or syncIdSet
-
-
Method Detail
-
getSyncInfoValueType
public SynchronizationInfoEnum getSyncInfoValueType()
Get the value type.- Specified by:
getSyncInfoValueType
in interfaceSyncInfoValue
- Returns:
- the type : one of newCookie, refreshDelete, refreshPresent or syncIdSet
-
setSyncInfoValueType
public void setSyncInfoValueType(SynchronizationInfoEnum syncInfoValueType)
- Specified by:
setSyncInfoValueType
in interfaceSyncInfoValue
- Parameters:
syncInfoValueType
- the synchronization type to set
-
getCookie
public byte[] getCookie()
- Specified by:
getCookie
in interfaceSyncInfoValue
- Returns:
- the cookie
-
setCookie
public void setCookie(byte[] cookie)
- Specified by:
setCookie
in interfaceSyncInfoValue
- Parameters:
cookie
- the cookie to set
-
isRefreshDone
public boolean isRefreshDone()
- Specified by:
isRefreshDone
in interfaceSyncInfoValue
- Returns:
- the refreshDone
-
setRefreshDone
public void setRefreshDone(boolean refreshDone)
- Specified by:
setRefreshDone
in interfaceSyncInfoValue
- Parameters:
refreshDone
- the refreshDone to set
-
isRefreshDeletes
public boolean isRefreshDeletes()
- Specified by:
isRefreshDeletes
in interfaceSyncInfoValue
- Returns:
- the refreshDeletes
-
setRefreshDeletes
public void setRefreshDeletes(boolean refreshDeletes)
- Specified by:
setRefreshDeletes
in interfaceSyncInfoValue
- Parameters:
refreshDeletes
- the refreshDeletes to set
-
getSyncUUIDs
public List<byte[]> getSyncUUIDs()
- Specified by:
getSyncUUIDs
in interfaceSyncInfoValue
- Returns:
- the syncUUIDs
-
setSyncUUIDs
public void setSyncUUIDs(List<byte[]> syncUUIDs)
- Specified by:
setSyncUUIDs
in interfaceSyncInfoValue
- Parameters:
syncUUIDs
- the syncUUIDs to set
-
addSyncUUID
public void addSyncUUID(byte[] syncUUID)
- Specified by:
addSyncUUID
in interfaceSyncInfoValue
- Parameters:
syncUUID
- the syncUUIDs to set
-
computeLength
public int computeLength()
Compute the SyncInfoValue length.
SyncInfoValue :0xA0 L1 abcd // newCookie 0xA1 L2 // refreshDelete | [+--> 0x04 L3 abcd] // cookie [+--> 0x01 0x01 (0x00|0xFF) // refreshDone 0xA2 L4 // refreshPresent | [+--> 0x04 L5 abcd] // cookie [+--> 0x01 0x01 (0x00|0xFF) // refreshDone 0xA3 L6 // syncIdSet | [+--> 0x04 L7 abcd] // cookie [+--> 0x01 0x01 (0x00|0xFF) // refreshDeletes +--> 0x31 L8 // SET OF syncUUIDs | [+--> 0x04 L9 abcd] // syncUUID
- Specified by:
computeLength
in interfaceAsn1Object
- Overrides:
computeLength
in classIntermediateResponseDecorator<SyncInfoValue>
- Returns:
- The computed length
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the SyncInfoValue response- Specified by:
encode
in interfaceAsn1Object
- Overrides:
encode
in classIntermediateResponseDecorator<SyncInfoValue>
- Parameters:
buffer
- The encoded sink- Returns:
- A ByteBuffer that contains the encoded PDU
- Throws:
EncoderException
- If anything goes wrong.
-
getValue
public byte[] getValue()
-
decode
public Asn1Object decode(byte[] responseBytes) throws DecoderException
- Throws:
DecoderException
-
toString
public String toString()
Description copied from class:MessageDecorator
Delegates to the toString() method of the decorated Message.- Overrides:
toString
in classMessageDecorator<SyncInfoValue>
- See Also:
Object.toString()
-
-