org.apache.directory.shared.asn1.ber
Interface IAsn1Container

All Known Implementing Classes:
AbstractContainer, CancelContainer, CertGenerationContainer, EntryChangeControlContainer, GracefulDisconnectContainer, GracefulShutdownContainer, LdapMessageContainer, PagedResultsControlContainer, PersistentSearchControlContainer, StoredProcedureContainer, SubentriesControlContainer, SyncDoneValueControlContainer, SyncInfoValueControlContainer, SyncRequestValueControlContainer, SyncStateValueControlContainer

public interface IAsn1Container

Every ASN1 container must implement this interface.

Version:
$Rev: 725712 $, $Date: 2008-12-11 16:32:04 +0100 (Thu, 11 Dec 2008) $
Author:
Apache Directory Project

Method Summary
 TLV getCurrentTLV()
          Get the currentTLV
 int getDecodeBytes()
           
 IGrammar getGrammar()
          Get the grammar
 int getMaxPDUSize()
           
 int getNewTlvId()
          Get a new TLV id
 TLV getParentTLV()
           
 int getState()
          Get the current grammar state
 IStates getStates()
           
 int getTlvId()
          Get the current TLV id
 int getTransition()
          Get the transition
 void grammarEndAllowed(boolean grammarEndAllowed)
          Set the flag to allow a end transition
 void incrementDecodeBytes(int nb)
          Increment the decodedBytes by the latest received buffer's size.
 boolean isGrammarEndAllowed()
          Check that we can have a end state after this transition
 void setCurrentTLV(TLV tlv)
          Set the current TLV
 void setMaxPDUSize(int maxPDUSize)
          Set the maximum PDU size.
 void setParentTLV(TLV parentTLV)
          Set the parent TLV
 void setState(int state)
          Set the new current state
 void setTransition(int transition)
          Update the transition from a state to another
 

Method Detail

getState

int getState()
Get the current grammar state

Returns:
Returns the current grammar state

setState

void setState(int state)
Set the new current state

Parameters:
state - The new state

setCurrentTLV

void setCurrentTLV(TLV tlv)
Set the current TLV

Parameters:
tlv - The current TLV

getCurrentTLV

TLV getCurrentTLV()
Get the currentTLV

Returns:
Returns the current TLV being decoded

getGrammar

IGrammar getGrammar()
Get the grammar

Returns:
Returns the grammar used to decode a LdapMessage.

getTransition

int getTransition()
Get the transition

Returns:
Returns the transition from the previous state to the new state

setTransition

void setTransition(int transition)
Update the transition from a state to another

Parameters:
transition - The transition to set

getStates

IStates getStates()
Returns:
Returns the states.

getParentTLV

TLV getParentTLV()
Returns:
get the parent TLV.

setParentTLV

void setParentTLV(TLV parentTLV)
Set the parent TLV

Parameters:
parentTLV - The new parent TLV

isGrammarEndAllowed

boolean isGrammarEndAllowed()
Check that we can have a end state after this transition

Returns:
true if this can be the last transition

grammarEndAllowed

void grammarEndAllowed(boolean grammarEndAllowed)
Set the flag to allow a end transition

Parameters:
grammarEndAllowed - true or false, depending on the next transition being an end or not.

getNewTlvId

int getNewTlvId()
Get a new TLV id

Returns:
a unique value representing the current TLV id

getTlvId

int getTlvId()
Get the current TLV id

Returns:
a unique value representing the current TLV id

getDecodeBytes

int getDecodeBytes()
Returns:
The number of decoded bytes for this message. This is used to control the PDU size and avoid PDU exceeding the maximum allowed size to break the server.

incrementDecodeBytes

void incrementDecodeBytes(int nb)
Increment the decodedBytes by the latest received buffer's size.

Parameters:
nb - The buffer size.

getMaxPDUSize

int getMaxPDUSize()
Returns:
The maximum PDU size.

setMaxPDUSize

void setMaxPDUSize(int maxPDUSize)
Set the maximum PDU size.

Parameters:
maxPDUSize - The maximum PDU size (if negative or null, will be replaced by the max integer value)


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