org.apache.directory.shared.ldap.codec
Class LdapMessageContainer<E extends MessageDecorator<? extends Message>>

java.lang.Object
  extended by org.apache.directory.shared.asn1.ber.AbstractContainer
      extended by org.apache.directory.shared.ldap.codec.LdapMessageContainer<E>
All Implemented Interfaces:
Asn1Container

public class LdapMessageContainer<E extends MessageDecorator<? extends Message>>
extends AbstractContainer

The LdapMessage container stores all the messages decoded by the Asn1Decoder. When dealing with an encoding PDU, we will obtain a LdapMessage in the container.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.ber.AbstractContainer
decodeBytes, grammar, stateStack
 
Constructor Summary
LdapMessageContainer(LdapCodecService codec)
          Creates a new LdapMessageContainer object.
LdapMessageContainer(LdapCodecService codec, BinaryAttributeDetector binaryAttributeDetector)
          Creates a new LdapMessageContainer object.
 
Method Summary
 void clean()
          
 ControlDecorator<? extends Control> getCurrentControl()
           
 LdapCodecService getLdapCodecService()
          Gets the LdapCodecService associated with this Asn1Container.
 E getMessage()
           
 int getMessageId()
           
 boolean isBinary(String id)
           
 void setCurrentControl(ControlDecorator<? extends Control> currentControl)
          Store a newly created control
 void setMessage(E messageDecorator)
          Set a Message Object into the container.
 void setMessageId(int messageId)
          Set the message ID
 
Methods inherited from class org.apache.directory.shared.asn1.ber.AbstractContainer
getCurrentTLV, getDecodeBytes, getGrammar, getMaxPDUSize, getNewTlvId, getParentTLV, getState, getStream, getTlvId, getTransition, incrementDecodeBytes, isGathering, isGrammarEndAllowed, rewind, setCurrentTLV, setGathering, setGrammarEndAllowed, setMaxPDUSize, setParentTLV, setState, setStream, setTransition, updateParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapMessageContainer

public LdapMessageContainer(LdapCodecService codec)
Creates a new LdapMessageContainer object. We will store ten grammars, it's enough ...


LdapMessageContainer

public LdapMessageContainer(LdapCodecService codec,
                            BinaryAttributeDetector binaryAttributeDetector)
Creates a new LdapMessageContainer object. We will store ten grammars, it's enough ...

Parameters:
binaryAttributeDetector - checks if an attribute is binary
Method Detail

getLdapCodecService

public LdapCodecService getLdapCodecService()
Gets the LdapCodecService associated with this Asn1Container.

Returns:

getMessage

public E getMessage()
Returns:
Returns the ldapMessage.

setMessage

public void setMessage(E messageDecorator)
Set a Message Object into the container. It will be completed by the ldapDecoder.

Parameters:
message - The message to set.

clean

public void clean()

Overrides:
clean in class AbstractContainer

isBinary

public boolean isBinary(String id)
Parameters:
id - checks if an attribute id is binary
Returns:
Returns true if the attribute is binary.

getMessageId

public int getMessageId()
Returns:
The message ID

setMessageId

public void setMessageId(int messageId)
Set the message ID

Parameters:
messageId - the id of the message

getCurrentControl

public ControlDecorator<? extends Control> getCurrentControl()
Returns:
the current control being created

setCurrentControl

public void setCurrentControl(ControlDecorator<? extends Control> currentControl)
Store a newly created control

Parameters:
currentControl - The control to store


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