org.apache.mina.http

## Class HttpServerDecoder

- java.lang.Object
- - org.apache.mina.http.HttpServerDecoder

- All Implemented Interfaces:
    ProtocolDecoder

      public class HttpServerDecoder
      extends Object
      implements ProtocolDecoder

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Pattern` | `COOKIE_SEPARATOR_PATTERN` Regex to split cookie header following RFC6265 Section 5.4
    `static Pattern` | `HEADER_VALUE_PATTERN` Regex to parse header name and value
    `static Pattern` | `HEADERS_BODY_PATTERN` Regex to parse raw headers from body
    `static Pattern` | `KEY_VALUE_PATTERN` Regex to parse out key/value pairs
    `static Pattern` | `PARAM_STRING_PATTERN` Regex to parse out parameters from query string
    `static Pattern` | `QUERY_STRING_PATTERN` Regex to parse out QueryString from HttpRequest
    `static Pattern` | `RAW_VALUE_PATTERN` Regex to parse raw headers and body
    `static Pattern` | `REQUEST_LINE_PATTERN` Regex to parse HttpRequest Request Line

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpServerDecoder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `decode(IoSession session, IoBuffer msg, ProtocolDecoderOutput out)` Decodes binary or protocol-specific content into higher-level message objects.
    `void` | `dispose(IoSession session)` Releases all resources related with this decoder.
    `void` | `finishDecode(IoSession session, ProtocolDecoderOutput out)` Invoked when the specified `session` is closed.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### REQUEST_LINE_PATTERN

          public static final Pattern REQUEST_LINE_PATTERN

      Regex to parse HttpRequest Request Line

    - #### QUERY_STRING_PATTERN

          public static final Pattern QUERY_STRING_PATTERN

      Regex to parse out QueryString from HttpRequest

    - #### PARAM_STRING_PATTERN

          public static final Pattern PARAM_STRING_PATTERN

      Regex to parse out parameters from query string

    - #### KEY_VALUE_PATTERN

          public static final Pattern KEY_VALUE_PATTERN

      Regex to parse out key/value pairs

    - #### RAW_VALUE_PATTERN

          public static final Pattern RAW_VALUE_PATTERN

      Regex to parse raw headers and body

    - #### HEADERS_BODY_PATTERN

          public static final Pattern HEADERS_BODY_PATTERN

      Regex to parse raw headers from body

    - #### HEADER_VALUE_PATTERN

          public static final Pattern HEADER_VALUE_PATTERN

      Regex to parse header name and value

    - #### COOKIE_SEPARATOR_PATTERN

          public static final Pattern COOKIE_SEPARATOR_PATTERN

      Regex to split cookie header following RFC6265 Section 5.4

  - ### Constructor Detail

    - #### HttpServerDecoder

          public HttpServerDecoder()

  - ### Method Detail

    - #### decode

          public void decode(IoSession session,
                    IoBuffer msg,
                    ProtocolDecoderOutput out)

      Description copied from interface: `ProtocolDecoder`
      Decodes binary or protocol-specific content into higher-level message objects. MINA invokes `ProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)` method with read data, and then the decoder implementation puts decoded messages into `ProtocolDecoderOutput`.
      Specified by:
        `decode` in interface `ProtocolDecoder`

    - #### finishDecode

          public void finishDecode(IoSession session,
                          ProtocolDecoderOutput out)
                            throws Exception

      Description copied from interface: `ProtocolDecoder`
      Invoked when the specified `session` is closed. This method is useful when you deal with the protocol which doesn't specify the length of a message such as HTTP response without `content-length` header. Implement this method to process the remaining data that `ProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)` method didn't process completely.
      Specified by:
        `finishDecode` in interface `ProtocolDecoder`
      Throws:
        `Exception` - if the read data violated protocol specification

    - #### dispose

          public void dispose(IoSession session)
                       throws Exception

      Description copied from interface: `ProtocolDecoder`
      Releases all resources related with this decoder.
      Specified by:
        `dispose` in interface `ProtocolDecoder`
      Throws:
        `Exception` - if failed to dispose all resources

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.