org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue
Class SyncInfoValueControl

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.controls.AbstractControl
          extended by org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControl
All Implemented Interfaces:
Asn1Object, CodecControl, Control

public class SyncInfoValueControl
extends AbstractControl

A syncInfoValue object, as defined in RFC 4533

Version:
$Rev:$, $Date:
Author:
Apache Directory Project

Field Summary
static java.lang.String CONTROL_OID
          This control OID
 
Fields inherited from class org.apache.directory.shared.ldap.codec.controls.AbstractControl
decoder, value, valueLength
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
SyncInfoValueControl(SynchronizationInfoEnum type)
          The constructor for this codec.
 
Method Summary
 void addSyncUUID(byte[] syncUUID)
           
 int computeLength()
          Compute the SyncInfoValue length.
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the SyncInfoValue control
 byte[] getCookie()
           
 java.util.List<byte[]> getSyncUUIDs()
           
 SynchronizationInfoEnum getType()
          Get the control type.
 byte[] getValue()
          Get the control value
 boolean isRefreshDeletes()
           
 boolean isRefreshDone()
           
 void setCookie(byte[] cookie)
           
 void setRefreshDeletes(boolean refreshDeletes)
           
 void setRefreshDone(boolean refreshDone)
           
 void setSyncUUIDs(java.util.List<byte[]> syncUUIDs)
           
 void setType(SynchronizationInfoEnum type)
           
 java.lang.String toString()
          Return a String representing a Control
 
Methods inherited from class org.apache.directory.shared.ldap.codec.controls.AbstractControl
computeLength, getDecoder, getOid, hasValue, isCritical, setCritical, setValue
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTROL_OID

public static final java.lang.String CONTROL_OID
This control OID

See Also:
Constant Field Values
Constructor Detail

SyncInfoValueControl

public SyncInfoValueControl(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()
Get the control type.

Returns:
the type : one of newCookie, refreshDelete, refreshPresent or syncIdSet

setType

public void setType(SynchronizationInfoEnum type)
Parameters:
syncMode - the syncMode to set

getCookie

public byte[] getCookie()
Returns:
the cookie

setCookie

public void setCookie(byte[] cookie)
Parameters:
cookie - the cookie to set

isRefreshDone

public boolean isRefreshDone()
Returns:
the refreshDone

setRefreshDone

public void setRefreshDone(boolean refreshDone)
Parameters:
refreshDone - the refreshDone to set

isRefreshDeletes

public boolean isRefreshDeletes()
Returns:
the refreshDeletes

setRefreshDeletes

public void setRefreshDeletes(boolean refreshDeletes)
Parameters:
refreshDeletes - the refreshDeletes to set

getSyncUUIDs

public java.util.List<byte[]> getSyncUUIDs()
Returns:
the syncUUIDs

setSyncUUIDs

public void setSyncUUIDs(java.util.List<byte[]> syncUUIDs)
Parameters:
syncUUIDs - the syncUUIDs to set

addSyncUUID

public void addSyncUUID(byte[] syncUUID)
Parameters:
syncUUIDs - 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 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 CodecControl
Overrides:
computeLength in class AbstractControl
Returns:
The object's computed length

encode

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

Specified by:
encode in interface Asn1Object
Specified by:
encode in interface CodecControl
Overrides:
encode in class AbstractControl
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 interface Control
Overrides:
getValue in class AbstractControl
Returns:
The control value

toString

public java.lang.String toString()
Description copied from class: AbstractControl
Return a String representing a Control

Overrides:
toString in class AbstractControl
See Also:
Object.toString()


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