Class HttpTrailer

All Implemented Interfaces:
org.glassfish.grizzly.Appendable<HttpContent>, org.glassfish.grizzly.Cacheable, MimeHeadersPacket

public class HttpTrailer extends HttpContent implements MimeHeadersPacket
HttpContent message, which represents HTTP trailer message. Applicable only for chunked HTTP messages.
Author:
Alexey Stashok
  • Constructor Details

    • HttpTrailer

      protected HttpTrailer(HttpHeader httpHeader)
  • Method Details

    • isTrailer

      public static boolean isTrailer(HttpContent httpContent)
      Returns:
      true if passed HttpContent is a HttpTrailder.
    • create

      public static HttpTrailer create()
    • create

      public static HttpTrailer create(HttpHeader httpHeader)
    • builder

      public static HttpTrailer.Builder builder(HttpHeader httpHeader)
      Returns HttpTrailer builder.
      Returns:
      HttpTrailer.Builder.
    • isLast

      public final boolean isLast()
      Always true true for the trailer message.
      Overrides:
      isLast in class HttpContent
      Returns:
      Always true true for the trailer message.
    • getHeaders

      public MimeHeaders getHeaders()
      Get all MimeHeaders, associated with the HttpHeader.
      Specified by:
      getHeaders in interface MimeHeadersPacket
      Returns:
      all MimeHeaders, associated with the HttpHeader
    • getHeader

      public String getHeader(String name)
      Get the value, of the specific HTTP mime header.
      Specified by:
      getHeader in interface MimeHeadersPacket
      Parameters:
      name - the mime header name
      Returns:
      the value, of the specific HTTP mime header
    • getHeader

      public String getHeader(Header header)
      Get the value, of the specific HTTP mime header.
      Specified by:
      getHeader in interface MimeHeadersPacket
      Parameters:
      header - the mime Header
      Returns:
      the value, of the specific HTTP mime header
    • setHeader

      public void setHeader(String name, String value)
      Set the value, of the specific HTTP mime header.
      Specified by:
      setHeader in interface MimeHeadersPacket
      Parameters:
      name - the mime header name
      value - the mime header value
    • setHeader

      public void setHeader(String name, HeaderValue value)
      Set the value, of the specific HTTP mime header.
      Specified by:
      setHeader in interface MimeHeadersPacket
      Parameters:
      name - the mime header name
      value - the mime header value
    • setHeader

      public void setHeader(Header header, String value)
      Set the value, of the specific HTTP mime header.
      Specified by:
      setHeader in interface MimeHeadersPacket
      Parameters:
      header - the mime Header
      value - the mime header value
    • setHeader

      public void setHeader(Header header, HeaderValue value)
      Set the value, of the specific HTTP mime header.
      Specified by:
      setHeader in interface MimeHeadersPacket
      Parameters:
      header - the mime Header
      value - the mime header value
    • addHeader

      public void addHeader(String name, String value)
      Add the HTTP mime header.
      Specified by:
      addHeader in interface MimeHeadersPacket
      Parameters:
      name - the mime header name
      value - the mime header value
    • addHeader

      public void addHeader(String name, HeaderValue value)
      Add the HTTP mime header.
      Specified by:
      addHeader in interface MimeHeadersPacket
      Parameters:
      name - the mime header name
      value - the mime header value
    • addHeader

      public void addHeader(Header header, String value)
      Add the HTTP mime header.
      Specified by:
      addHeader in interface MimeHeadersPacket
      Parameters:
      header - the mime Header
      value - the mime header value
    • addHeader

      public void addHeader(Header header, HeaderValue value)
      Add the HTTP mime header.
      Specified by:
      addHeader in interface MimeHeadersPacket
      Parameters:
      header - the mime Header
      value - the mime header value
    • containsHeader

      public boolean containsHeader(String name)
      Returns true, if the mime header with the specific name is present among the HttpHeader mime headers, or false otherwise.
      Specified by:
      containsHeader in interface MimeHeadersPacket
      Parameters:
      name - the mime header name
      Returns:
      true, if the mime header with the specific name is present among the HttpHeader mime headers, or false otherwise
    • containsHeader

      public boolean containsHeader(Header header)
      Returns true, if the mime Header is present among the HttpHeader mime headers, otherwise returns false.
      Specified by:
      containsHeader in interface MimeHeadersPacket
      Parameters:
      header - the mime Header
      Returns:
      true, if the mime Header is present among the HttpHeader mime headers, otherwise returns false
    • setTrailers

      protected void setTrailers(MimeHeaders trailers)
      Set the mime trailers.
      Parameters:
      trailers - MimeHeaders.
    • reset

      protected void reset()
      Reset the internal state.
      Overrides:
      reset in class HttpContent
    • recycle

      public void recycle()
      Specified by:
      recycle in interface org.glassfish.grizzly.Cacheable
      Overrides:
      recycle in class HttpContent