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

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControlCodec
All Implemented Interfaces:
Asn1Object

public class SyncInfoValueControlCodec
extends AbstractAsn1Object

A syncInfoValue object, as defined in RFC 4533

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

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
SyncInfoValueControlCodec(SynchronizationInfoEnum type)
          The constructor for this codec.
 
Method Summary
 int computeLength()
          Compute the SyncInfoValue length.
 java.nio.ByteBuffer encode(java.nio.ByteBuffer bb)
          Encode the SyncInfoValue control
 byte[] getCookie()
           
 java.util.List<byte[]> getSyncUUIDs()
           
 SynchronizationInfoEnum getType()
          Get the control type.
 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()
           
 
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
 

Constructor Detail

SyncInfoValueControlCodec

public SyncInfoValueControlCodec(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

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 class AbstractAsn1Object

encode

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

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.