org.apache.directory.shared.ldap.extras.controls.syncrepl_impl
Class SyncInfoValueDecorator

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.api.ControlDecorator<SyncInfoValue>
          extended by org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncInfoValueDecorator
All Implemented Interfaces:
Asn1Object, CodecControl<SyncInfoValue>, Decorator<SyncInfoValue>, SyncInfoValue, Control

public class SyncInfoValueDecorator
extends ControlDecorator<SyncInfoValue>
implements SyncInfoValue

A syncInfoValue object, as defined in RFC 4533

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.codec.api.ControlDecorator
value, valueLength
 
Fields inherited from interface org.apache.directory.shared.ldap.extras.controls.SyncInfoValue
OID
 
Constructor Summary
SyncInfoValueDecorator(LdapApiService codec)
          The constructor for this codec.
SyncInfoValueDecorator(LdapApiService codec, SynchronizationInfoEnum type)
          The constructor for this codec.
SyncInfoValueDecorator(LdapApiService codec, SyncInfoValue control)
          The constructor for this codec.
 
Method Summary
 void addSyncUUID(byte[] syncUUID)
          
 int computeLength()
          Compute the SyncInfoValue length.
 Asn1Object decode(byte[] controlBytes)
          
 ByteBuffer encode(ByteBuffer buffer)
          Encode the SyncInfoValue control
 byte[] getCookie()
          
 List<byte[]> getSyncUUIDs()
          
 SynchronizationInfoEnum getType()
          
 byte[] getValue()
          
 boolean isRefreshDeletes()
          
 boolean isRefreshDone()
          
 void setCookie(byte[] cookie)
          
 void setRefreshDeletes(boolean refreshDeletes)
          
 void setRefreshDone(boolean refreshDone)
          
 void setSyncUUIDs(List<byte[]> syncUUIDs)
          
 void setType(SynchronizationInfoEnum type)
          
 
Methods inherited from class org.apache.directory.shared.ldap.codec.api.ControlDecorator
equals, getCodecService, getDecorated, getOid, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.Control
getOid, isCritical, setCritical
 

Constructor Detail

SyncInfoValueDecorator

public SyncInfoValueDecorator(LdapApiService codec)
The constructor for this codec. Dont't forget to set the type.


SyncInfoValueDecorator

public SyncInfoValueDecorator(LdapApiService codec,
                              SyncInfoValue control)
The constructor for this codec. Dont't forget to set the type.


SyncInfoValueDecorator

public SyncInfoValueDecorator(LdapApiService codec,
                              SynchronizationInfoEnum type)
The constructor for this codec.

Parameters:
type - The kind of syncInfo we will store. Can be newCookie, refreshPresent, refreshDelete or syncIdSet
Method Detail

getType

public SynchronizationInfoEnum getType()

Specified by:
getType in interface SyncInfoValue

setType

public void setType(SynchronizationInfoEnum type)

Specified by:
setType in interface SyncInfoValue

getCookie

public byte[] getCookie()

Specified by:
getCookie in interface SyncInfoValue

setCookie

public void setCookie(byte[] cookie)

Specified by:
setCookie in interface SyncInfoValue

isRefreshDone

public boolean isRefreshDone()

Specified by:
isRefreshDone in interface SyncInfoValue

setRefreshDone

public void setRefreshDone(boolean refreshDone)

Specified by:
setRefreshDone in interface SyncInfoValue

isRefreshDeletes

public boolean isRefreshDeletes()

Specified by:
isRefreshDeletes in interface SyncInfoValue

setRefreshDeletes

public void setRefreshDeletes(boolean refreshDeletes)

Specified by:
setRefreshDeletes in interface SyncInfoValue

getSyncUUIDs

public List<byte[]> getSyncUUIDs()

Specified by:
getSyncUUIDs in interface SyncInfoValue

setSyncUUIDs

public void setSyncUUIDs(List<byte[]> syncUUIDs)

Specified by:
setSyncUUIDs in interface SyncInfoValue

addSyncUUID

public void addSyncUUID(byte[] syncUUID)

Specified by:
addSyncUUID in interface SyncInfoValue

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 public static final int AND_FILTER_TAG = 0xA0; public static final int OR_FILTER_TAG = 0xA1; public static final int NOT_FILTER_TAG = 0xA2; public static final int BIND_REQUEST_SASL_TAG = 0xA3;

Specified by:
computeLength in interface Asn1Object
Specified by:
computeLength in interface Decorator<SyncInfoValue>
Overrides:
computeLength in class ControlDecorator<SyncInfoValue>

encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws EncoderException
Encode the SyncInfoValue control

Specified by:
encode in interface Asn1Object
Specified by:
encode in interface Decorator<SyncInfoValue>
Overrides:
encode in class AbstractAsn1Object
Parameters:
buffer - The encoded sink
Returns:
A ByteBuffer that contains the encoded PDU
Throws:
EncoderException - If anything goes wrong.

getValue

public byte[] getValue()

Specified by:
getValue in interface CodecControl<SyncInfoValue>
Overrides:
getValue in class ControlDecorator<SyncInfoValue>

decode

public Asn1Object decode(byte[] controlBytes)
                  throws DecoderException

Specified by:
decode in interface CodecControl<SyncInfoValue>
Throws:
DecoderException


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.