Package net.officefloor.server.http
Interface HttpResponseHeaders
-
- All Superinterfaces:
java.lang.Iterable<HttpHeader>
- All Known Implementing Classes:
ProcessAwareHttpResponseHeaders
public interface HttpResponseHeaders extends java.lang.Iterable<HttpHeader>
HttpHeader
instances for theHttpResponse
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpHeader
addHeader(java.lang.String name, java.lang.String value)
Adds aHttpHeader
for the response.HttpHeader
addHeader(java.lang.String name, HttpHeaderValue value)
Adds aHttpHeader
.HttpHeader
addHeader(HttpHeaderName name, java.lang.String value)
Adds aHttpHeader
.HttpHeader
addHeader(HttpHeaderName name, HttpHeaderValue value)
Adds aHttpHeader
.HttpHeader
getHeader(java.lang.String name)
Obtains the firstHttpHeader
by the name.java.lang.Iterable<HttpHeader>
getHeaders(java.lang.String name)
Obtains all theHttpHeader
instances by the name.boolean
removeHeader(HttpHeader header)
Removes the particularHttpHeader
from the response.boolean
removeHeaders(java.lang.String name)
Removes allHttpHeader
instances by the name.
-
-
-
Method Detail
-
addHeader
HttpHeader addHeader(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException
Adds a
HttpHeader
for the response.HttpHeader
instances are provided on the response in the order they are added.- Parameters:
name
- Name ofHttpHeader
.value
- Value ofHttpHeader
.- Returns:
- Added
HttpHeader
. - Throws:
java.lang.IllegalArgumentException
- Should theHttpHeader
be managed by theHttpResponse
.
-
addHeader
HttpHeader addHeader(HttpHeaderName name, java.lang.String value) throws java.lang.IllegalArgumentException
Adds aHttpHeader
.- Parameters:
name
-HttpHeaderName
.value
- Value ofHttpHeader
.- Returns:
- Added
HttpHeader
- Throws:
java.lang.IllegalArgumentException
- Should theHttpHeader
be managed by theHttpResponse
.
-
addHeader
HttpHeader addHeader(java.lang.String name, HttpHeaderValue value) throws java.lang.IllegalArgumentException
Adds aHttpHeader
.- Parameters:
name
- Name ofHttpHeader
.value
-HttpHeaderValue
.- Returns:
- Added
HttpHeader
. - Throws:
java.lang.IllegalArgumentException
- Should theHttpHeader
be managed by theHttpResponse
.
-
addHeader
HttpHeader addHeader(HttpHeaderName name, HttpHeaderValue value) throws java.lang.IllegalArgumentException
Adds aHttpHeader
.- Parameters:
name
-HttpHeaderName
.value
-HttpHeaderValue
.- Returns:
- Added
HttpHeader
. - Throws:
java.lang.IllegalArgumentException
- Should theHttpHeader
be managed by theHttpResponse
.
-
removeHeader
boolean removeHeader(HttpHeader header)
Removes the particularHttpHeader
from the response.- Parameters:
header
-HttpHeader
to be removed from the response.- Returns:
true
if theHttpHeader
was removed.
-
removeHeaders
boolean removeHeaders(java.lang.String name)
Removes all
HttpHeader
instances by the name.This method compliments
addHeader(String, String)
to allow adding a new singleHttpHeader
instance by name.- Parameters:
name
- Name of theHttpHeader
instances to remove.- Returns:
true
ifHttpHeader
instances were removed by the name.
-
getHeader
HttpHeader getHeader(java.lang.String name)
Obtains the firstHttpHeader
by the name.- Parameters:
name
- Name of theHttpHeader
.- Returns:
- First
HttpHeader
ornull
if notHttpHeader
.
-
getHeaders
java.lang.Iterable<HttpHeader> getHeaders(java.lang.String name)
Obtains all theHttpHeader
instances by the name.- Parameters:
name
- Name of theHttpHeader
instances.- Returns:
- All
HttpHeader
instances by the name.
-
-