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

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

public class SyncModifyDnDecorator
extends ControlDecorator<SyncModifyDn>
implements SyncModifyDn

A SyncModifyDnControl object, to send the parameters used in a MODIFYDN operation that was carried out on a syncrepl provider server. The consumer will use the values present in this control to perform the same operation on its local data, which helps in avoiding huge number of updates to the consumer. NOTE: syncrepl, defined in RFC 4533, doesn't mention about this approach, this is a special extension provided by Apache Directory Server

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.SyncModifyDn
OID
 
Constructor Summary
SyncModifyDnDecorator(LdapCodecService codec)
           
SyncModifyDnDecorator(LdapCodecService codec, SyncModifyDn control)
           
SyncModifyDnDecorator(LdapCodecService codec, SyncModifyDnType type)
           
 
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
 String getEntryDn()
          
 SyncModifyDnType getModDnType()
          
 String getNewRdn()
          
 String getNewSuperiorDn()
          
 byte[] getValue()
          Get the control value
 boolean isDeleteOldRdn()
          
 void setDeleteOldRdn(boolean deleteOldRdn)
          
 void setEntryDn(String entryDn)
          
 void setModDnType(SyncModifyDnType modDnType)
          
 void setNewRdn(String newRdn)
          
 void setNewSuperiorDn(String newSuperiorDn)
          
 
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

SyncModifyDnDecorator

public SyncModifyDnDecorator(LdapCodecService codec)

SyncModifyDnDecorator

public SyncModifyDnDecorator(LdapCodecService codec,
                             SyncModifyDnType type)

SyncModifyDnDecorator

public SyncModifyDnDecorator(LdapCodecService codec,
                             SyncModifyDn control)
Method Detail

computeLength

public int computeLength()
Compute the SyncStateValue length. SyncStateValue : 0x30 L1 | +--> 0x04 L2 uid=jim... (entryDn) [+--> 0x04 L3 ou=system... (newSuperior) [+--> 0x04 L4 uid=jack... (newRdn) [+--> 0x04 0x01 [0x00|0x01]... (deleteOldRdn)

Specified by:
computeLength in interface Asn1Object
Specified by:
computeLength in interface Decorator<SyncModifyDn>
Overrides:
computeLength in class ControlDecorator<SyncModifyDn>
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<SyncModifyDn>
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<SyncModifyDn>
Overrides:
getValue in class ControlDecorator<SyncModifyDn>
Returns:
The control value

getEntryDn

public String getEntryDn()

Specified by:
getEntryDn in interface SyncModifyDn

setEntryDn

public void setEntryDn(String entryDn)

Specified by:
setEntryDn in interface SyncModifyDn

getNewSuperiorDn

public String getNewSuperiorDn()

Specified by:
getNewSuperiorDn in interface SyncModifyDn

setNewSuperiorDn

public void setNewSuperiorDn(String newSuperiorDn)

Specified by:
setNewSuperiorDn in interface SyncModifyDn

getNewRdn

public String getNewRdn()

Specified by:
getNewRdn in interface SyncModifyDn

setNewRdn

public void setNewRdn(String newRdn)

Specified by:
setNewRdn in interface SyncModifyDn

isDeleteOldRdn

public boolean isDeleteOldRdn()

Specified by:
isDeleteOldRdn in interface SyncModifyDn

setDeleteOldRdn

public void setDeleteOldRdn(boolean deleteOldRdn)

Specified by:
setDeleteOldRdn in interface SyncModifyDn

getModDnType

public SyncModifyDnType getModDnType()

Specified by:
getModDnType in interface SyncModifyDn

setModDnType

public void setModDnType(SyncModifyDnType modDnType)

Specified by:
setModDnType in interface SyncModifyDn

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<SyncModifyDn>
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.