org.apache.directory.shared.asn1
Interface Asn1Object

All Known Implementing Classes:
AbandonRequest, AbstractAsn1Object, AddRequest, AddResponse, AndFilter, AttributeValueAssertionFilter, BindRequest, BindResponse, CascadeControlCodec, CompareRequest, CompareResponse, ConnectorFilter, Control, DelRequest, DelResponse, EntryChangeControlCodec, ExtendedRequest, ExtendedResponse, ExtensibleMatchFilter, Filter, GracefulAction, GracefulDisconnect, GracefulShutdown, LdapAuthentication, LdapMessage, LdapResponse, LdapResult, ManageDsaITControlCodec, ModifyDNRequest, ModifyDNResponse, ModifyRequest, ModifyResponse, NotFilter, OrFilter, PresentFilter, PSearchControlCodec, SaslCredentials, SearchRequest, SearchResultDone, SearchResultEntry, SearchResultReference, SimpleAuthentication, StoredProcedure, SubEntryControlCodec, SubstringFilter, UnBindRequest

public interface Asn1Object

An abstract class which implements basic TLV operations.

Version:
$Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sa, 07 Jun 2008) $
Author:
Apache Directory Project

Method Summary
 void addLength(int length)
          Add a length to the object
 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.
 int getCurrentLength()
          Get the current object length, which is the sum of all inner length already decoded.
 int getExpectedLength()
          Get the expected object length.
 Asn1Object getParent()
          Get the parent
 void setCurrentLength(int currentLength)
          Set the current length
 void setExpectedLength(int expectedLength)
          Set the expected length
 

Method Detail

getCurrentLength

int getCurrentLength()
Get the current object length, which is the sum of all inner length already decoded.

Returns:
The current object's length

computeLength

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

Returns:
The object's computed length

encode

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

Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
EncoderException - if the buffer can't be encoded

getExpectedLength

int getExpectedLength()
Get the expected object length.

Returns:
The expected object's length

addLength

void addLength(int length)
               throws DecoderException
Add a length to the object

Parameters:
length - The length to add.
Throws:
DecoderException - Thrown if the current length exceed the expected length

setExpectedLength

void setExpectedLength(int expectedLength)
Set the expected length

Parameters:
expectedLength - The expectedLength to set.

setCurrentLength

void setCurrentLength(int currentLength)
Set the current length

Parameters:
currentLength - The currentLength to set.

getParent

Asn1Object getParent()
Get the parent

Returns:
Returns the parent.


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