Class SpdyHeaders
java.lang.Object
org.jboss.netty.handler.codec.spdy.SpdyHeaders
- Direct Known Subclasses:
DefaultSpdyHeaders
Provides the constants for the standard SPDY HTTP header names and commonly
used utility methods that access a
SpdyHeadersFrame.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SpdyHeadersAdds a new header with the specified name and values.abstract SpdyHeadersAdds a new header with the specified name and value.static voidaddHeader(SpdyHeadersFrame frame, String name, Object value) Adds a new header with the specified name and value.abstract SpdyHeadersclear()Removes all headers from this frame.abstract booleanReturnstrueif and only if there is a header with the specified header name.entries()Returns all header names and values that this frame contains.abstract StringReturns the header value with the specified header name.Returns the header values with the specified header name.static StringgetHeader(SpdyHeadersFrame frame, String name) Returns the header value with the specified header name.static StringgetHeader(SpdyHeadersFrame frame, String name, String defaultValue) Returns the header value with the specified header name.static StringgetHost(SpdyHeadersFrame frame) Returns the SPDY host header.static HttpMethodgetMethod(int spdyVersion, SpdyHeadersFrame frame) Returns theHttpMethodrepresented by the HTTP method header.static StringgetScheme(int spdyVersion, SpdyHeadersFrame frame) Returns the value of the URL scheme header.static HttpResponseStatusgetStatus(int spdyVersion, SpdyHeadersFrame frame) Returns theHttpResponseStatusrepresented by the HTTP response status header.static StringgetUrl(int spdyVersion, SpdyHeadersFrame frame) Returns the value of the URL path header.static HttpVersiongetVersion(int spdyVersion, SpdyHeadersFrame frame) Returns theHttpVersionrepresented by the HTTP version header.abstract booleanisEmpty()Checks if no header exists.iterator()names()Returns theSetof all header names that this frame contains.abstract SpdyHeadersRemoves the header with the specified name.static voidremoveHost(SpdyHeadersFrame frame) Removes the SPDY host header.static voidremoveMethod(int spdyVersion, SpdyHeadersFrame frame) Removes the HTTP method header.static voidremoveScheme(int spdyVersion, SpdyHeadersFrame frame) Removes the URL scheme header.static voidremoveStatus(int spdyVersion, SpdyHeadersFrame frame) Removes the HTTP response status header.static voidremoveUrl(int spdyVersion, SpdyHeadersFrame frame) Removes the URL path header.static voidremoveVersion(int spdyVersion, SpdyHeadersFrame frame) Removes the HTTP version header.abstract SpdyHeadersSets a new header with the specified name and values.abstract SpdyHeadersSets a new header with the specified name and value.static voidsetHeader(SpdyHeadersFrame frame, String name, Iterable<?> values) Sets a new header with the specified name and values.static voidsetHeader(SpdyHeadersFrame frame, String name, Object value) Sets a new header with the specified name and value.static voidsetHost(SpdyHeadersFrame frame, String host) Set the SPDY host header.static voidsetMethod(int spdyVersion, SpdyHeadersFrame frame, HttpMethod method) Sets the HTTP method header.static voidsetScheme(int spdyVersion, SpdyHeadersFrame frame, String scheme) Sets the URL scheme header.static voidsetStatus(int spdyVersion, SpdyHeadersFrame frame, HttpResponseStatus status) Sets the HTTP response status header.static voidsetUrl(int spdyVersion, SpdyHeadersFrame frame, String path) Sets the URL path header.static voidsetVersion(int spdyVersion, SpdyHeadersFrame frame, HttpVersion httpVersion) Sets the HTTP version header.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY_HEADERS
-
-
Constructor Details
-
SpdyHeaders
public SpdyHeaders()
-
-
Method Details
-
getHeader
Returns the header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned.- Returns:
- the header value or
nullif there is no such header
-
getHeader
Returns the header value with the specified header name. If there are more than one header value for the specified header name, the first value is returned.- Returns:
- the header value or the
defaultValueif there is no such header
-
setHeader
Sets a new header with the specified name and value. If there is an existing header with the same name, the existing header is removed. -
setHeader
Sets a new header with the specified name and values. If there is an existing header with the same name, the existing header is removed. -
addHeader
Adds a new header with the specified name and value. -
removeHost
Removes the SPDY host header. -
getHost
Returns the SPDY host header. -
setHost
Set the SPDY host header. -
removeMethod
Removes the HTTP method header. -
getMethod
Returns theHttpMethodrepresented by the HTTP method header. -
setMethod
Sets the HTTP method header. -
removeScheme
Removes the URL scheme header. -
getScheme
Returns the value of the URL scheme header. -
setScheme
Sets the URL scheme header. -
removeStatus
Removes the HTTP response status header. -
getStatus
Returns theHttpResponseStatusrepresented by the HTTP response status header. -
setStatus
Sets the HTTP response status header. -
removeUrl
Removes the URL path header. -
getUrl
Returns the value of the URL path header. -
setUrl
Sets the URL path header. -
removeVersion
Removes the HTTP version header. -
getVersion
Returns theHttpVersionrepresented by the HTTP version header. -
setVersion
Sets the HTTP version header. -
iterator
-
get
Returns the header value with the specified header name. If there is more than one header value for the specified header name, the first value is returned.- Returns:
- the header value or
nullif there is no such header
-
getAll
Returns the header values with the specified header name.- Returns:
- the
Listof header values. An empty list if there is no such header.
-
entries
Returns all header names and values that this frame contains.- Returns:
- the
Listof the header name-value pairs. An empty list if there is no header in this message.
-
contains
Returnstrueif and only if there is a header with the specified header name. -
names
Returns theSetof all header names that this frame contains. -
add
Adds a new header with the specified name and value. -
add
Adds a new header with the specified name and values. If there is an existing header with the same name, the existing header is removed. -
set
Sets a new header with the specified name and value. If there is an existing header with the same name, the existing header is removed. -
set
Sets a new header with the specified name and values. If there is an existing header with the same name, the existing header is removed. -
remove
Removes the header with the specified name. -
clear
Removes all headers from this frame. -
isEmpty
public abstract boolean isEmpty()Checks if no header exists.
-