Class CompressedHeadersBuilder

java.lang.Object
org.glassfish.grizzly.spdy.frames.CompressedHeadersBuilder

public final class CompressedHeadersBuilder extends Object
The builder for compressed headers used by SynStreamFrame, SynReplyFrame, HeadersFrame.
Author:
Alexey Stashok
See Also:
  • Method Details

    • createSpdyDeflater

      public static Deflater createSpdyDeflater()
      Utility method, which helps to create Spdy Deflater with predefined Spdy compression dictionary.
    • newInstance

      public static CompressedHeadersBuilder newInstance()
      Returns the CompressedHeadersBuilder instance.
    • contentLength

      public final CompressedHeadersBuilder contentLength(long contentLength)
      Set the content-length of this header. Applicable only in case of fixed-length HTTP message.
      Parameters:
      contentLength - the content-length of this HttpPacket. Applicable only in case of fixed-length HTTP message.
    • contentType

      public final CompressedHeadersBuilder contentType(String contentType)
      Set the content-type of this header.
      Parameters:
      contentType - the content-type of this HttpPacket.
    • method

      public final CompressedHeadersBuilder method(org.glassfish.grizzly.http.Method method)
      Set the the HTTP method for this request. (e.g. "GET", "POST", "HEAD", etc).
      Parameters:
      method - the method of this header.
    • method

      public final CompressedHeadersBuilder method(String method)
      Set the the HTTP method for this request. (e.g. "GET", "POST", "HEAD", etc).
      Parameters:
      method - the method of this header.
    • path

      public final CompressedHeadersBuilder path(String path)
      Set the url-path for required url with "/" prefixed. (See RFC1738 [RFC1738]). For example, for "http://www.google.com/search?q=dogs" the path would be "/search?q=dogs".
      Parameters:
      path - the path of this header.
    • version

      public final CompressedHeadersBuilder version(org.glassfish.grizzly.http.Protocol version)
      Set the the HTTP version of this request (e.g. "HTTP/1.1").
      Parameters:
      version - the HTTP version of this header.
    • version

      public final CompressedHeadersBuilder version(String version)
      Set the the HTTP version of this request (e.g. "HTTP/1.1").
      Parameters:
      version - the HTTP version of this header.
    • host

      public final CompressedHeadersBuilder host(String host)
      Set the the hostport (See RFC1738 [RFC1738]) portion of the URL for this request header (e.g. "www.google.com:1234"). This header is the same as the HTTP 'Host' header.
      Parameters:
      host - the hostport.
    • scheme

      public final CompressedHeadersBuilder scheme(String scheme)
      Set the scheme portion of the URL for this request header (e.g. "https").
      Parameters:
      path - the path of this header.
    • status

      public final CompressedHeadersBuilder status(int status)
      Set the HTTP response status code (e.g. 200 or 404).
      Parameters:
      path - the path of this header.
    • status

      public final CompressedHeadersBuilder status(org.glassfish.grizzly.http.util.HttpStatus status)
      Set the HTTP response status code (e.g. "200" or "200 OK")
      Parameters:
      path - the path of this header.
    • status

      public final CompressedHeadersBuilder status(String status)
      Set the HTTP response status code (e.g. "200" or "200 OK")
      Parameters:
      path - the path of this header.
    • header

      public final CompressedHeadersBuilder header(String name, String value)
      Add the SPDY/HTTP mime header.
      Parameters:
      name - the mime header name.
      value - the mime header value.
    • header

      public final CompressedHeadersBuilder header(org.glassfish.grizzly.http.util.Header header, String value)
      Add the SPDY/HTTP mime header.
      Parameters:
      header - the mime Header.
      value - the mime header value.
    • build

      public org.glassfish.grizzly.Buffer build(Deflater deflater) throws IOException
      Throws:
      IOException