Package org.glassfish.grizzly.http
Class HttpTrailer
- java.lang.Object
-
- org.glassfish.grizzly.http.HttpPacket
-
- org.glassfish.grizzly.http.HttpContent
-
- org.glassfish.grizzly.http.HttpTrailer
-
- All Implemented Interfaces:
org.glassfish.grizzly.Appendable<HttpContent>,org.glassfish.grizzly.Cacheable,MimeHeadersPacket
public class HttpTrailer extends HttpContent implements MimeHeadersPacket
HttpContentmessage, which represents HTTP trailer message. Applicable only for chunked HTTP messages.- Author:
- Alexey Stashok
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpTrailer.BuilderHttpTrailer message builder.
-
Field Summary
-
Fields inherited from class org.glassfish.grizzly.http.HttpContent
content, httpHeader, isLast
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHttpTrailer(HttpHeader httpHeader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(String name, String value)Add the HTTP mime header.voidaddHeader(String name, HeaderValue value)Add the HTTP mime header.voidaddHeader(Header header, String value)Add the HTTP mime header.voidaddHeader(Header header, HeaderValue value)Add the HTTP mime header.static HttpTrailer.Builderbuilder(HttpHeader httpHeader)ReturnsHttpTrailerbuilder.booleancontainsHeader(String name)Returns true, if the mime header with the specific name is present among the HttpHeader mime headers, or false otherwise.booleancontainsHeader(Header header)Returns true, if the mimeHeaderis present among the HttpHeader mime headers, otherwise returns false.static HttpTrailercreate()static HttpTrailercreate(HttpHeader httpHeader)StringgetHeader(String name)Get the value, of the specific HTTP mime header.StringgetHeader(Header header)Get the value, of the specific HTTP mime header.MimeHeadersgetHeaders()Get allMimeHeaders, associated with the HttpHeader.booleanisLast()Always true true for the trailer message.static booleanisTrailer(HttpContent httpContent)voidrecycle()protected voidreset()Reset the internal state.voidsetHeader(String name, String value)Set the value, of the specific HTTP mime header.voidsetHeader(String name, HeaderValue value)Set the value, of the specific HTTP mime header.voidsetHeader(Header header, String value)Set the value, of the specific HTTP mime header.voidsetHeader(Header header, HeaderValue value)Set the value, of the specific HTTP mime header.protected voidsetTrailers(MimeHeaders trailers)Set the mime trailers.-
Methods inherited from class org.glassfish.grizzly.http.HttpContent
append, create, create, getContent, getHttpHeader, isBroken, isContent, isHeader, setContent, setLast
-
Methods inherited from class org.glassfish.grizzly.http.HttpPacket
isHttp
-
-
-
-
Constructor Detail
-
HttpTrailer
protected HttpTrailer(HttpHeader httpHeader)
-
-
Method Detail
-
isTrailer
public static boolean isTrailer(HttpContent httpContent)
- Returns:
- true if passed
HttpContentis a HttpTrailder.
-
create
public static HttpTrailer create()
-
create
public static HttpTrailer create(HttpHeader httpHeader)
-
builder
public static HttpTrailer.Builder builder(HttpHeader httpHeader)
ReturnsHttpTrailerbuilder.- Returns:
HttpTrailer.Builder.
-
isLast
public final boolean isLast()
Always true true for the trailer message.- Overrides:
isLastin classHttpContent- Returns:
- Always true true for the trailer message.
-
getHeaders
public MimeHeaders getHeaders()
Get allMimeHeaders, associated with the HttpHeader.- Specified by:
getHeadersin interfaceMimeHeadersPacket- Returns:
- all
MimeHeaders, associated with the HttpHeader
-
getHeader
public String getHeader(String name)
Get the value, of the specific HTTP mime header.- Specified by:
getHeaderin interfaceMimeHeadersPacket- 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:
getHeaderin interfaceMimeHeadersPacket- Parameters:
header- the mimeHeader- 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:
setHeaderin interfaceMimeHeadersPacket- Parameters:
name- the mime header namevalue- the mime header value
-
setHeader
public void setHeader(String name, HeaderValue value)
Set the value, of the specific HTTP mime header.- Specified by:
setHeaderin interfaceMimeHeadersPacket- Parameters:
name- the mime header namevalue- the mime header value
-
setHeader
public void setHeader(Header header, String value)
Set the value, of the specific HTTP mime header.- Specified by:
setHeaderin interfaceMimeHeadersPacket- Parameters:
header- the mimeHeadervalue- the mime header value
-
setHeader
public void setHeader(Header header, HeaderValue value)
Set the value, of the specific HTTP mime header.- Specified by:
setHeaderin interfaceMimeHeadersPacket- Parameters:
header- the mimeHeadervalue- the mime header value
-
addHeader
public void addHeader(String name, String value)
Add the HTTP mime header.- Specified by:
addHeaderin interfaceMimeHeadersPacket- Parameters:
name- the mime header namevalue- the mime header value
-
addHeader
public void addHeader(String name, HeaderValue value)
Add the HTTP mime header.- Specified by:
addHeaderin interfaceMimeHeadersPacket- Parameters:
name- the mime header namevalue- the mime header value
-
addHeader
public void addHeader(Header header, String value)
Add the HTTP mime header.- Specified by:
addHeaderin interfaceMimeHeadersPacket- Parameters:
header- the mimeHeadervalue- the mime header value
-
addHeader
public void addHeader(Header header, HeaderValue value)
Add the HTTP mime header.- Specified by:
addHeaderin interfaceMimeHeadersPacket- Parameters:
header- the mimeHeadervalue- 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:
containsHeaderin interfaceMimeHeadersPacket- 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 mimeHeaderis present among the HttpHeader mime headers, otherwise returns false.- Specified by:
containsHeaderin interfaceMimeHeadersPacket- Parameters:
header- the mimeHeader- Returns:
- true, if the mime
Headeris 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:
resetin classHttpContent
-
recycle
public void recycle()
- Specified by:
recyclein interfaceorg.glassfish.grizzly.Cacheable- Overrides:
recyclein classHttpContent
-
-