Class LdapMessageContainer<E extends Message>
- java.lang.Object
-
- org.apache.directory.api.asn1.ber.AbstractContainer
-
- org.apache.directory.api.ldap.codec.api.LdapMessageContainer<E>
-
- Type Parameters:
E
- The decorated message
- All Implemented Interfaces:
Asn1Container
public class LdapMessageContainer<E 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
-
-
Constructor Summary
Constructors Constructor Description LdapMessageContainer(LdapApiService codec)
Creates a new LdapMessageContainer object.LdapMessageContainer(LdapApiService codec, BinaryAttributeDetector binaryAttributeDetector)
Creates a new LdapMessageContainer object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCurrentFilter(Filter localFilter)
Add a current filter.void
clean()
Clean the container for the next usage.static void
copyLdapResult(ResultResponse resultResponse, ExtendedResponse extendedResponse)
Copy the LdapResult element from a opaque response to a newly created extendedResponseBinaryAttributeDetector
getBinaryAttributeDetector()
ControlFactory<?>
getControlFactory()
Attribute
getCurrentAttribute()
Control
getCurrentControl()
Filter
getCurrentFilter()
Modification
getCurrentModification()
ExtendedOperationFactory
getExtendedFactory()
IntermediateOperationFactory
getIntermediateFactory()
LdapApiService
getLdapCodecService()
Gets theLdapApiService
associated with this Container.LdapResult
getLdapResult()
E
getMessage()
int
getMessageId()
Filter
getTerminalFilter()
int
getTlvId()
Gets the current TLV idFilter
getTopFilter()
boolean
isBinary(String id)
void
setBinaryAttributeDetector(BinaryAttributeDetector binaryAttributeDetector)
Sets the binary attribute detectorvoid
setControlFactory(ControlFactory<?> controlFactory)
void
setCurrentAttribute(Attribute currentAttribute)
void
setCurrentControl(Control currentControl)
Store a newly created controlvoid
setCurrentFilter(Filter currentFilter)
void
setCurrentModification(Modification currentModification)
void
setExtendedFactory(ExtendedOperationFactory extendedFactory)
void
setIntermediateFactory(IntermediateOperationFactory intermediateFactory)
void
setLdapResult(LdapResult ldapResult)
void
setMessage(E message)
Set a Message Object into the container.void
setMessageId(int messageId)
Set the message IDvoid
setTerminalFilter(Filter terminalFilter)
void
setTlvId(int tlvId)
Set the SearchRequest PDU TLV's Idvoid
setTopFilter(Filter topFilter)
void
unstackFilters()
This method is used to clear the filter's stack for terminated elements.-
Methods inherited from class org.apache.directory.api.asn1.ber.AbstractContainer
getCurrentTLV, getDecodedBytes, getGrammar, getMaxPDUSize, getNewTlvId, getParentTLV, getState, getStream, getTransition, incrementDecodedBytes, isGathering, isGrammarEndAllowed, rewind, setCurrentTLV, setDecodedBytes, setGathering, setGrammar, setGrammarEndAllowed, setMaxPDUSize, setParentTLV, setState, setStream, setTransition, updateParent
-
-
-
-
Constructor Detail
-
LdapMessageContainer
public LdapMessageContainer(LdapApiService codec)
Creates a new LdapMessageContainer object. We will store ten grammars, it's enough ...- Parameters:
codec
- The LDAP service instance
-
LdapMessageContainer
public LdapMessageContainer(LdapApiService codec, BinaryAttributeDetector binaryAttributeDetector)
Creates a new LdapMessageContainer object.- Parameters:
codec
- The LDAP service instancebinaryAttributeDetector
- checks if an attribute is binary
-
-
Method Detail
-
getLdapCodecService
public LdapApiService getLdapCodecService()
Gets theLdapApiService
associated with this Container.- Returns:
- The LDAP service instance
-
getMessage
public E getMessage()
- Returns:
- Returns the ldapMessage.
-
setMessage
public void setMessage(E message)
Set a Message Object into the container. It will be completed by the ldapDecoder.- Parameters:
message
- The message to set.
-
clean
public void clean()
Clean the container for the next usage.- Overrides:
clean
in classAbstractContainer
-
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 Control getCurrentControl()
- Returns:
- the current control being created
-
setCurrentControl
public void setCurrentControl(Control currentControl)
Store a newly created control- Parameters:
currentControl
- The control to store
-
setBinaryAttributeDetector
public void setBinaryAttributeDetector(BinaryAttributeDetector binaryAttributeDetector)
Sets the binary attribute detector- Parameters:
binaryAttributeDetector
- the binary attribute detector
-
getBinaryAttributeDetector
public BinaryAttributeDetector getBinaryAttributeDetector()
- Returns:
- the binary attribute detector
-
getLdapResult
public LdapResult getLdapResult()
- Returns:
- the ldapResult
-
setLdapResult
public void setLdapResult(LdapResult ldapResult)
- Parameters:
ldapResult
- the ldapResult to set
-
getControlFactory
public ControlFactory<?> getControlFactory()
- Returns:
- the controlFactory
-
setControlFactory
public void setControlFactory(ControlFactory<?> controlFactory)
- Parameters:
controlFactory
- the controlFactory to set
-
getCurrentAttribute
public Attribute getCurrentAttribute()
- Returns:
- the currentAttribute
-
setCurrentAttribute
public void setCurrentAttribute(Attribute currentAttribute)
- Parameters:
currentAttribute
- the currentAttribute to set
-
getCurrentModification
public Modification getCurrentModification()
- Returns:
- the currentModification
-
setCurrentModification
public void setCurrentModification(Modification currentModification)
- Parameters:
currentModification
- the currentModification to set
-
setTlvId
public void setTlvId(int tlvId)
Set the SearchRequest PDU TLV's Id- Parameters:
tlvId
- The TLV id
-
getTerminalFilter
public Filter getTerminalFilter()
- Returns:
- the terminalFilter
-
setTerminalFilter
public void setTerminalFilter(Filter terminalFilter)
- Parameters:
terminalFilter
- the terminalFilter to set
-
getCurrentFilter
public Filter getCurrentFilter()
- Returns:
- the currentFilter
-
setCurrentFilter
public void setCurrentFilter(Filter currentFilter)
- Parameters:
currentFilter
- the currentFilter to set
-
addCurrentFilter
public void addCurrentFilter(Filter localFilter) throws DecoderException
Add a current filter. We have two cases : - there is no previous current filter : the filter is the top level filter - there is a previous current filter : the filter is added to the currentFilter set, and the current filter is changed In any case, the previous current filter will always be a ConnectorFilter when this method is called.- Parameters:
localFilter
- The filter to set.- Throws:
DecoderException
- If the filter is invalid
-
unstackFilters
public void unstackFilters()
This method is used to clear the filter's stack for terminated elements. An element is considered as terminated either if : - it's a final element (ie an element which cannot contains a Filter) - its current length equals its expected length.
-
copyLdapResult
public static void copyLdapResult(ResultResponse resultResponse, ExtendedResponse extendedResponse)
Copy the LdapResult element from a opaque response to a newly created extendedResponse- Parameters:
resultResponse
- The original responseextendedResponse
- The newly created ExtendedResponse
-
getTopFilter
public Filter getTopFilter()
- Returns:
- the topFilter
-
setTopFilter
public void setTopFilter(Filter topFilter)
- Parameters:
topFilter
- the topFilter to set
-
getTlvId
public int getTlvId()
Description copied from class:AbstractContainer
Gets the current TLV id- Specified by:
getTlvId
in interfaceAsn1Container
- Overrides:
getTlvId
in classAbstractContainer
- Returns:
- the tlvId
-
getIntermediateFactory
public IntermediateOperationFactory getIntermediateFactory()
- Returns:
- the intermediateFactory
-
setIntermediateFactory
public void setIntermediateFactory(IntermediateOperationFactory intermediateFactory)
- Parameters:
intermediateFactory
- the intermediateFactory to set
-
getExtendedFactory
public ExtendedOperationFactory getExtendedFactory()
- Returns:
- the extendedFactory
-
setExtendedFactory
public void setExtendedFactory(ExtendedOperationFactory extendedFactory)
- Parameters:
extendedFactory
- the extendedFactory to set
-
-