Package net.officefloor.server.http.impl
Class ProcessAwareHttpResponseHeaders
- java.lang.Object
-
- net.officefloor.server.http.impl.ProcessAwareHttpResponseHeaders
-
- All Implemented Interfaces:
java.lang.Iterable<HttpHeader>
,HttpResponseHeaders
public class ProcessAwareHttpResponseHeaders extends java.lang.Object implements HttpResponseHeaders
ProcessState
awareHttpResponseHeaders
.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description ProcessAwareHttpResponseHeaders(ManagedObjectContext context)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete 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.WritableHttpHeader
getWritableHttpHeaders()
Obtains the headWritableHttpHeader
to the linked list ofWritableHttpHeader
instances for theHttpResponseWriter
.java.util.Iterator<HttpHeader>
iterator()
boolean
removeHeader(HttpHeader header)
Removes the particularHttpHeader
from the response.boolean
removeHeaders(java.lang.String name)
Removes allHttpHeader
instances by the name.
-
-
-
Constructor Detail
-
ProcessAwareHttpResponseHeaders
public ProcessAwareHttpResponseHeaders(ManagedObjectContext context)
Instantiate.- Parameters:
context
-ManagedObjectContext
.
-
-
Method Detail
-
getWritableHttpHeaders
public WritableHttpHeader getWritableHttpHeaders()
Obtains the headWritableHttpHeader
to the linked list ofWritableHttpHeader
instances for theHttpResponseWriter
.- Returns:
- Head
WritableHttpHeader
to the linked list ofWritableHttpHeader
instances for theHttpResponseWriter
. May benull
.
-
iterator
public java.util.Iterator<HttpHeader> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<HttpHeader>
-
addHeader
public HttpHeader addHeader(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException
Description copied from interface:HttpResponseHeaders
Adds a
HttpHeader
for the response.HttpHeader
instances are provided on the response in the order they are added.- Specified by:
addHeader
in interfaceHttpResponseHeaders
- Parameters:
name
- Name ofHttpHeader
.value
- Value ofHttpHeader
.- Returns:
- Added
HttpHeader
. - Throws:
java.lang.IllegalArgumentException
- Should theHttpHeader
be managed by theHttpResponse
.
-
addHeader
public HttpHeader addHeader(HttpHeaderName name, java.lang.String value) throws java.lang.IllegalArgumentException
Description copied from interface:HttpResponseHeaders
Adds aHttpHeader
.- Specified by:
addHeader
in interfaceHttpResponseHeaders
- Parameters:
name
-HttpHeaderName
.value
- Value ofHttpHeader
.- Returns:
- Added
HttpHeader
- Throws:
java.lang.IllegalArgumentException
- Should theHttpHeader
be managed by theHttpResponse
.
-
addHeader
public HttpHeader addHeader(java.lang.String name, HttpHeaderValue value) throws java.lang.IllegalArgumentException
Description copied from interface:HttpResponseHeaders
Adds aHttpHeader
.- Specified by:
addHeader
in interfaceHttpResponseHeaders
- Parameters:
name
- Name ofHttpHeader
.value
-HttpHeaderValue
.- Returns:
- Added
HttpHeader
. - Throws:
java.lang.IllegalArgumentException
- Should theHttpHeader
be managed by theHttpResponse
.
-
addHeader
public HttpHeader addHeader(HttpHeaderName name, HttpHeaderValue value) throws java.lang.IllegalArgumentException
Description copied from interface:HttpResponseHeaders
Adds aHttpHeader
.- Specified by:
addHeader
in interfaceHttpResponseHeaders
- Parameters:
name
-HttpHeaderName
.value
-HttpHeaderValue
.- Returns:
- Added
HttpHeader
. - Throws:
java.lang.IllegalArgumentException
- Should theHttpHeader
be managed by theHttpResponse
.
-
removeHeader
public boolean removeHeader(HttpHeader header)
Description copied from interface:HttpResponseHeaders
Removes the particularHttpHeader
from the response.- Specified by:
removeHeader
in interfaceHttpResponseHeaders
- Parameters:
header
-HttpHeader
to be removed from the response.- Returns:
true
if theHttpHeader
was removed.
-
removeHeaders
public boolean removeHeaders(java.lang.String name)
Description copied from interface:HttpResponseHeaders
Removes all
HttpHeader
instances by the name.This method compliments
HttpResponseHeaders.addHeader(String, String)
to allow adding a new singleHttpHeader
instance by name.- Specified by:
removeHeaders
in interfaceHttpResponseHeaders
- Parameters:
name
- Name of theHttpHeader
instances to remove.- Returns:
true
ifHttpHeader
instances were removed by the name.
-
getHeader
public HttpHeader getHeader(java.lang.String name)
Description copied from interface:HttpResponseHeaders
Obtains the firstHttpHeader
by the name.- Specified by:
getHeader
in interfaceHttpResponseHeaders
- Parameters:
name
- Name of theHttpHeader
.- Returns:
- First
HttpHeader
ornull
if notHttpHeader
.
-
getHeaders
public java.lang.Iterable<HttpHeader> getHeaders(java.lang.String name)
Description copied from interface:HttpResponseHeaders
Obtains all theHttpHeader
instances by the name.- Specified by:
getHeaders
in interfaceHttpResponseHeaders
- Parameters:
name
- Name of theHttpHeader
instances.- Returns:
- All
HttpHeader
instances by the name.
-
-