org.apache.directory.api.ldap.extras.controls.syncrepl_impl
Class SyncRequestValueDecorator

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

public class SyncRequestValueDecorator
extends ControlDecorator<SyncRequestValue>
implements SyncRequestValue

A syncRequestValue object, as defined in RFC 4533

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.api.ldap.codec.api.ControlDecorator
value, valueLength
 
Fields inherited from interface org.apache.directory.api.ldap.extras.controls.SyncRequestValue
OID
 
Constructor Summary
SyncRequestValueDecorator(LdapApiService codec)
           
SyncRequestValueDecorator(LdapApiService codec, SyncRequestValue control)
           
 
Method Summary
 int computeLength()
          Compute the SyncRequestValue length.
 Asn1Object decode(byte[] controlBytes)
          Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.
 ByteBuffer encode(ByteBuffer buffer)
          Encode the SyncRequestValue control
 byte[] getCookie()
          
 SynchronizationModeEnum getMode()
          
 byte[] getValue()
          Get the control value
 boolean isReloadHint()
          
 void setCookie(byte[] cookie)
          
 void setMode(SynchronizationModeEnum mode)
          
 void setReloadHint(boolean reloadHint)
          
 
Methods inherited from class org.apache.directory.api.ldap.codec.api.ControlDecorator
equals, getCodecService, getDecorated, getOid, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
 
Methods inherited from class org.apache.directory.api.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.api.ldap.model.message.Control
getOid, isCritical, setCritical
 

Constructor Detail

SyncRequestValueDecorator

public SyncRequestValueDecorator(LdapApiService codec)

SyncRequestValueDecorator

public SyncRequestValueDecorator(LdapApiService codec,
                                 SyncRequestValue control)
Method Detail

getMode

public SynchronizationModeEnum getMode()

Specified by:
getMode in interface SyncRequestValue
Returns:
the mode

setMode

public void setMode(SynchronizationModeEnum mode)

Specified by:
setMode in interface SyncRequestValue

getCookie

public byte[] getCookie()

Specified by:
getCookie in interface SyncRequestValue
Returns:
the cookie

setCookie

public void setCookie(byte[] cookie)

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

isReloadHint

public boolean isReloadHint()

Specified by:
isReloadHint in interface SyncRequestValue
Returns:
the reloadHint

setReloadHint

public void setReloadHint(boolean reloadHint)

Specified by:
setReloadHint in interface SyncRequestValue
Parameters:
reloadHint - the reloadHint to set

computeLength

public int computeLength()
Compute the SyncRequestValue length. SyncRequestValue : 0x30 L1 | +--> 0x0A 0x01 [0x00|0x01|0x02|0x03] (mode) [+--> 0x04 L2 abcd... (cookie) +--> 0x01 0x01 [0x00|0xFF] (reloadHint)

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

encode

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

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


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