Class LdapMessageContainer<E extends Message>

  • 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 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 instance
        binaryAttributeDetector - checks if an attribute is binary
    • Method Detail

      • getLdapCodecService

        public LdapApiService getLdapCodecService()
        Gets the LdapApiService 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 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 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 response
        extendedResponse - The newly created ExtendedResponse
      • getTopFilter

        public Filter getTopFilter()
        Returns:
        the topFilter
      • setTopFilter

        public void setTopFilter​(Filter topFilter)
        Parameters:
        topFilter - the topFilter to set
      • setIntermediateFactory

        public void setIntermediateFactory​(IntermediateOperationFactory intermediateFactory)
        Parameters:
        intermediateFactory - the intermediateFactory to set
      • setExtendedFactory

        public void setExtendedFactory​(ExtendedOperationFactory extendedFactory)
        Parameters:
        extendedFactory - the extendedFactory to set