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

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

public class SyncStateValueDecorator
extends ControlDecorator<SyncStateValue>
implements SyncStateValue

A syncStateValue object, as defined in RFC 4533

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.codec.controls.ControlDecorator
value, valueLength
 
Fields inherited from interface org.apache.directory.shared.ldap.extras.controls.SyncStateValue
OID
 
Constructor Summary
SyncStateValueDecorator(LdapCodecService codec)
           
SyncStateValueDecorator(LdapCodecService codec, SyncStateValue value)
           
 
Method Summary
 int computeLength()
          Compute the SyncStateValue length.
 Asn1Object decode(byte[] controlBytes)
          Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.
 ByteBuffer encode(ByteBuffer buffer)
          Encode the SyncStateValue control
 byte[] getCookie()
          
 byte[] getEntryUUID()
          
 SyncStateTypeEnum getSyncStateType()
          
 byte[] getValue()
          Get the control value
 void setCookie(byte[] cookie)
          
 void setEntryUUID(byte[] entryUUID)
          set the entryUUID
 void setSyncStateType(SyncStateTypeEnum syncStateType)
          set the syncState's type
 
Methods inherited from class org.apache.directory.shared.ldap.codec.controls.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

SyncStateValueDecorator

public SyncStateValueDecorator(LdapCodecService codec)

SyncStateValueDecorator

public SyncStateValueDecorator(LdapCodecService codec,
                               SyncStateValue value)
Method Detail

getCookie

public byte[] getCookie()

Specified by:
getCookie in interface SyncStateValue
Returns:
the cookie

setCookie

public void setCookie(byte[] cookie)

Specified by:
setCookie in interface SyncStateValue
Parameters:
cookie - the cookie to set

getSyncStateType

public SyncStateTypeEnum getSyncStateType()

Specified by:
getSyncStateType in interface SyncStateValue
Returns:
the syncState's type

setSyncStateType

public void setSyncStateType(SyncStateTypeEnum syncStateType)
set the syncState's type

Specified by:
setSyncStateType in interface SyncStateValue
Parameters:
syncStateType - the syncState's type

getEntryUUID

public byte[] getEntryUUID()

Specified by:
getEntryUUID in interface SyncStateValue
Returns:
the entryUUID

setEntryUUID

public void setEntryUUID(byte[] entryUUID)
set the entryUUID

Specified by:
setEntryUUID in interface SyncStateValue
Parameters:
entryUUID - the entryUUID

computeLength

public int computeLength()
Compute the SyncStateValue length. SyncStateValue : 0x30 L1 | +--> 0x0A 0x01 [0x00|0x01|0x02|0x03] (type) [+--> 0x04 L2 abcd... (entryUUID) [+--> 0x04 L3 abcd... (cookie)

Specified by:
computeLength in interface Asn1Object
Specified by:
computeLength in interface Decorator<SyncStateValue>
Overrides:
computeLength in class ControlDecorator<SyncStateValue>
Returns:
The object's computed length

encode

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

Specified by:
encode in interface Asn1Object
Specified by:
encode in interface Decorator<SyncStateValue>
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()
Get the control value

Specified by:
getValue in interface CodecControl<SyncStateValue>
Overrides:
getValue in class ControlDecorator<SyncStateValue>
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 interface CodecControl<SyncStateValue>
Parameters:
controlBytes - the encoded control bytes
Returns:
the decoded Asn1Object for the control
Throws:
DecoderException - if anything goes wrong


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