Package net.officefloor.server.http.impl
Class ProcessAwareHttpResponseHeaders
java.lang.Object
net.officefloor.server.http.impl.ProcessAwareHttpResponseHeaders
- All Implemented Interfaces:
Iterable<HttpHeader>,HttpResponseHeaders
ProcessState aware HttpResponseHeaders.- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds aHttpHeaderfor the response.addHeader(String name, HttpHeaderValue value) Adds aHttpHeader.addHeader(HttpHeaderName name, String value) Adds aHttpHeader.addHeader(HttpHeaderName name, HttpHeaderValue value) Adds aHttpHeader.Obtains the firstHttpHeaderby the name.getHeaders(String name) Obtains all theHttpHeaderinstances by the name.Obtains the headWritableHttpHeaderto the linked list ofWritableHttpHeaderinstances for theHttpResponseWriter.iterator()booleanremoveHeader(HttpHeader header) Removes the particularHttpHeaderfrom the response.booleanremoveHeaders(String name) Removes allHttpHeaderinstances by the name.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
-
Constructor Details
-
ProcessAwareHttpResponseHeaders
Instantiate.- Parameters:
context-ManagedObjectContext.
-
-
Method Details
-
getWritableHttpHeaders
Obtains the headWritableHttpHeaderto the linked list ofWritableHttpHeaderinstances for theHttpResponseWriter.- Returns:
- Head
WritableHttpHeaderto the linked list ofWritableHttpHeaderinstances for theHttpResponseWriter. May benull.
-
iterator
- Specified by:
iteratorin interfaceIterable<HttpHeader>
-
addHeader
Description copied from interface:HttpResponseHeadersAdds a
HttpHeaderfor the response.HttpHeaderinstances are provided on the response in the order they are added.- Specified by:
addHeaderin interfaceHttpResponseHeaders- Parameters:
name- Name ofHttpHeader.value- Value ofHttpHeader.- Returns:
- Added
HttpHeader. - Throws:
IllegalArgumentException- Should theHttpHeaderbe managed by theHttpResponse.
-
addHeader
Description copied from interface:HttpResponseHeadersAdds aHttpHeader.- Specified by:
addHeaderin interfaceHttpResponseHeaders- Parameters:
name-HttpHeaderName.value- Value ofHttpHeader.- Returns:
- Added
HttpHeader - Throws:
IllegalArgumentException- Should theHttpHeaderbe managed by theHttpResponse.
-
addHeader
Description copied from interface:HttpResponseHeadersAdds aHttpHeader.- Specified by:
addHeaderin interfaceHttpResponseHeaders- Parameters:
name- Name ofHttpHeader.value-HttpHeaderValue.- Returns:
- Added
HttpHeader. - Throws:
IllegalArgumentException- Should theHttpHeaderbe managed by theHttpResponse.
-
addHeader
public HttpHeader addHeader(HttpHeaderName name, HttpHeaderValue value) throws IllegalArgumentException Description copied from interface:HttpResponseHeadersAdds aHttpHeader.- Specified by:
addHeaderin interfaceHttpResponseHeaders- Parameters:
name-HttpHeaderName.value-HttpHeaderValue.- Returns:
- Added
HttpHeader. - Throws:
IllegalArgumentException- Should theHttpHeaderbe managed by theHttpResponse.
-
removeHeader
Description copied from interface:HttpResponseHeadersRemoves the particularHttpHeaderfrom the response.- Specified by:
removeHeaderin interfaceHttpResponseHeaders- Parameters:
header-HttpHeaderto be removed from the response.- Returns:
trueif theHttpHeaderwas removed.
-
removeHeaders
Description copied from interface:HttpResponseHeadersRemoves all
HttpHeaderinstances by the name.This method compliments
HttpResponseHeaders.addHeader(String, String)to allow adding a new singleHttpHeaderinstance by name.- Specified by:
removeHeadersin interfaceHttpResponseHeaders- Parameters:
name- Name of theHttpHeaderinstances to remove.- Returns:
trueifHttpHeaderinstances were removed by the name.
-
getHeader
Description copied from interface:HttpResponseHeadersObtains the firstHttpHeaderby the name.- Specified by:
getHeaderin interfaceHttpResponseHeaders- Parameters:
name- Name of theHttpHeader.- Returns:
- First
HttpHeaderornullif notHttpHeader.
-
getHeaders
Description copied from interface:HttpResponseHeadersObtains all theHttpHeaderinstances by the name.- Specified by:
getHeadersin interfaceHttpResponseHeaders- Parameters:
name- Name of theHttpHeaderinstances.- Returns:
- All
HttpHeaderinstances by the name.
-