org.apache.directory.shared.ldap.codec
Class Control

java.lang.Object
  extended byorg.apache.directory.shared.asn1.Asn1Object
      extended byorg.apache.directory.shared.ldap.codec.Control

public class Control
extends org.apache.directory.shared.asn1.Asn1Object

A Asn1Object to store a Control.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.Asn1Object
parent
 
Constructor Summary
Control()
           
 
Method Summary
 int computeLength()
          Compute the Control length Control : 0x30 L1 | +--> 0x04 L2 controlType [+--> 0x01 0x01 criticality] [+--> 0x04 L3 controlValue] Control length = Length(0x30) + length(L1) + Length(0x04) + Length(L2) + L2 [+ Length(0x01) + 1 + 1] [+ Length(0x04) + Length(L3) + L3]
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Generate the PDU which contains the Control.
 java.lang.String getControlType()
          Get the control type
 java.lang.Object getControlValue()
          Get the control value
 boolean getCriticality()
          Get the criticality
 byte[] getEncodedValue()
          Get the raw control encoded bytes
 void setControlType(LdapString controlType)
          Set the control type
 void setControlValue(java.lang.Object controlValue)
          Set the control value
 void setCriticality(boolean criticality)
          Set the criticality
 void setEncodedValue(byte[] encodedValue)
          Set the encoded control value
 java.lang.String toString()
          Return a String representing a Control
 
Methods inherited from class org.apache.directory.shared.asn1.Asn1Object
addLength, getCurrentLength, getExpectedLength, getParent, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Control

public Control()
Method Detail

getControlType

public java.lang.String getControlType()
Get the control type

Returns:
A string which represent the control type

setControlType

public void setControlType(LdapString controlType)
Set the control type

Parameters:
controlType - An OID to store

getControlValue

public java.lang.Object getControlValue()
Get the control value

Returns:
The control value

setEncodedValue

public void setEncodedValue(byte[] encodedValue)
Set the encoded control value

Parameters:
encodedValue - The encoded control value to store

getEncodedValue

public byte[] getEncodedValue()
Get the raw control encoded bytes

Returns:
the encoded bytes for the control

setControlValue

public void setControlValue(java.lang.Object controlValue)
Set the control value

Parameters:
controlValue - The control value to store

getCriticality

public boolean getCriticality()
Get the criticality

Returns:
true if the criticality flag is true.

setCriticality

public void setCriticality(boolean criticality)
Set the criticality

Parameters:
criticality - The criticality value

computeLength

public int computeLength()
Compute the Control length Control : 0x30 L1 | +--> 0x04 L2 controlType [+--> 0x01 0x01 criticality] [+--> 0x04 L3 controlValue] Control length = Length(0x30) + length(L1) + Length(0x04) + Length(L2) + L2 [+ Length(0x01) + 1 + 1] [+ Length(0x04) + Length(L3) + L3]


encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws org.apache.directory.shared.asn1.codec.EncoderException
Generate the PDU which contains the Control. Control : 0x30 LL 0x04 LL type [0x01 0x01 criticality] [0x04 LL value]

Parameters:
buffer - The encoded PDU
Returns:
A ByteBuffer that contaons the PDU
Throws:
org.apache.directory.shared.asn1.codec.EncoderException - If anything goes wrong.

toString

public java.lang.String toString()
Return a String representing a Control



Copyright © 2003-2006 . All Rights Reserved.