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.api.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.api.ControlDecorator
value, valueLength
 
Fields inherited from interface org.apache.directory.shared.ldap.extras.controls.SyncStateValue
OID
 
Constructor Summary
SyncStateValueDecorator(LdapApiService codec)
           
SyncStateValueDecorator(LdapApiService codec, SyncStateValue value)
           
 
Method Summary
 int computeLength()
          Compute the SyncStateValue length.
 Asn1Object decode(byte[] controlBytes)
          
 ByteBuffer encode(ByteBuffer buffer)
          Encode the SyncStateValue control
 byte[] getCookie()
          
 byte[] getEntryUUID()
          
 SyncStateTypeEnum getSyncStateType()
          
 byte[] getValue()
          
 void setCookie(byte[] cookie)
          
 void setEntryUUID(byte[] entryUUID)
          
 void setSyncStateType(SyncStateTypeEnum syncStateType)
          
 
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

SyncStateValueDecorator

public SyncStateValueDecorator(LdapApiService codec)

SyncStateValueDecorator

public SyncStateValueDecorator(LdapApiService codec,
                               SyncStateValue value)
Method Detail

getCookie

public byte[] getCookie()

Specified by:
getCookie in interface SyncStateValue

setCookie

public void setCookie(byte[] cookie)

Specified by:
setCookie in interface SyncStateValue

getSyncStateType

public SyncStateTypeEnum getSyncStateType()

Specified by:
getSyncStateType in interface SyncStateValue

setSyncStateType

public void setSyncStateType(SyncStateTypeEnum syncStateType)

Specified by:
setSyncStateType in interface SyncStateValue

getEntryUUID

public byte[] getEntryUUID()

Specified by:
getEntryUUID in interface SyncStateValue

setEntryUUID

public void setEntryUUID(byte[] entryUUID)

Specified by:
setEntryUUID in interface SyncStateValue

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>

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()

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

decode

public Asn1Object decode(byte[] controlBytes)
                  throws DecoderException

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


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