Class AbstractMessageParser<T extends HttpMessage>

    • Constructor Detail

      • AbstractMessageParser

        public AbstractMessageParser​(Http1Config http1Config,
                                     LineParser lineParser)
        Constructs a new instance for a subclass.
        Parameters:
        http1Config - HTTP/1.1 protocol parameters.
        lineParser - How to parse lines in an HTTP message.
        Since:
        5.3
      • AbstractMessageParser

        @Deprecated
        public AbstractMessageParser​(LineParser lineParser,
                                     Http1Config messageConstraints)
        Constructs a new instance for a subclass.
        Parameters:
        lineParser - How to parse lines in an HTTP message.
        messageConstraints - HTTP/1.1 protocol parameters.
    • Method Detail

      • createMessage

        protected abstract T createMessage​(CharArrayBuffer buffer)
                                    throws HttpException
        Creates HttpMessage instance based on the content of the input buffer containing the first line of the incoming HTTP message.
        Parameters:
        buffer - the line buffer.
        Returns:
        HTTP message.
        Throws:
        HttpException - in case of HTTP protocol violation
      • parseHeader

        private void parseHeader()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • parse

        public T parse​(SessionInputBuffer sessionBuffer,
                       boolean endOfStream)
                throws java.io.IOException,
                       HttpException
        Description copied from interface: NHttpMessageParser
        Attempts to parse a complete message head from the content of the internal buffer. If the message in the input buffer is incomplete this method will return null.
        Specified by:
        parse in interface NHttpMessageParser<T extends HttpMessage>
        Parameters:
        sessionBuffer - session input buffer.
        endOfStream - end of stream flag
        Returns:
        HTTP message head, if available, null otherwise.
        Throws:
        java.io.IOException - in case of an I/O error.
        HttpException - in case the HTTP message is malformed or violates the HTTP protocol.