org.apache.directory.shared.ldap.codec.controls
Interface CodecControl

All Known Implementing Classes:
AbstractControl, CascadeControl, ControlImpl, EntryChangeControl, LdifControl, ManageDsaITControl, PagedResultsControl, PersistentSearchControl, SubentriesControl, SyncDoneValueControl, SyncInfoValueControl, SyncRequestValueControl, SyncStateValueControl

public interface CodecControl

Define the transform method to be implemented by all the codec Controls

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Method Summary
 int computeLength()
          Compute the Control length
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Generate the PDU which contains the Control.
 ControlDecoder getDecoder()
          Get the associated decoder
 

Method Detail

encode

java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws 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:
EncoderException - If anything goes wrong.

computeLength

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]
 


getDecoder

ControlDecoder getDecoder()
Get the associated decoder

Returns:
The Control decoder


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