org.apache.directory.shared.ldap.codec.controls
Class ControlImpl

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.controls.AbstractControl
          extended by org.apache.directory.shared.ldap.codec.controls.ControlImpl
All Implemented Interfaces:
Asn1Object, CodecControl, Control

public class ControlImpl
extends AbstractControl

A genericcodec Control.

Version:
$Rev: 764131 $, $Date: 2009-04-11 03:03:00 +0200 (Sat, 11 Apr 2009) $,
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.codec.controls.AbstractControl
decoder, value, valueLength
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
ControlImpl(java.lang.String oid)
          Default constructor.
 
Method Summary
 int computeLength()
          Compute the object length, which is the sum of all inner length.
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the object to a PDU.
 byte[] getValue()
          Get the raw control encoded bytes
 void setValue(byte[] value)
          Set the encoded control value
 
Methods inherited from class org.apache.directory.shared.ldap.codec.controls.AbstractControl
computeLength, getDecoder, getOid, hasValue, isCritical, setCritical, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControlImpl

public ControlImpl(java.lang.String oid)
Default constructor.

Method Detail

setValue

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

Specified by:
setValue in interface Control
Overrides:
setValue in class AbstractControl
Parameters:
encodedValue - The encoded control value to store

getValue

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

Specified by:
getValue in interface Control
Overrides:
getValue in class AbstractControl
Returns:
the encoded bytes for the control

computeLength

public int computeLength()
Compute the object length, which is the sum of all inner length.

Specified by:
computeLength in interface Asn1Object
Specified by:
computeLength in interface CodecControl
Overrides:
computeLength in class AbstractControl
Returns:
The object's computed length

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws EncoderException
Encode the object to a PDU.

Specified by:
encode in interface Asn1Object
Specified by:
encode in interface CodecControl
Overrides:
encode in class AbstractControl
Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
EncoderException - if the buffer can't be encoded


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