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 ProcessStateawareHttpResponseHeaders.- Author:
- Daniel Sagenschneider
 
- 
- 
Constructor SummaryConstructors Constructor Description ProcessAwareHttpResponseHeaders(ManagedObjectContext context)Instantiate.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpHeaderaddHeader(java.lang.String name, java.lang.String value)Adds aHttpHeaderfor the response.HttpHeaderaddHeader(java.lang.String name, HttpHeaderValue value)Adds aHttpHeader.HttpHeaderaddHeader(HttpHeaderName name, java.lang.String value)Adds aHttpHeader.HttpHeaderaddHeader(HttpHeaderName name, HttpHeaderValue value)Adds aHttpHeader.HttpHeadergetHeader(java.lang.String name)Obtains the firstHttpHeaderby the name.java.lang.Iterable<HttpHeader>getHeaders(java.lang.String name)Obtains all theHttpHeaderinstances by the name.WritableHttpHeadergetWritableHttpHeaders()Obtains the headWritableHttpHeaderto the linked list ofWritableHttpHeaderinstances for theHttpResponseWriter.java.util.Iterator<HttpHeader>iterator()booleanremoveHeader(HttpHeader header)Removes the particularHttpHeaderfrom the response.booleanremoveHeaders(java.lang.String name)Removes allHttpHeaderinstances by the name.
 
- 
- 
- 
Constructor Detail- 
ProcessAwareHttpResponseHeaderspublic ProcessAwareHttpResponseHeaders(ManagedObjectContext context) Instantiate.- Parameters:
- context-- ManagedObjectContext.
 
 
- 
 - 
Method Detail- 
getWritableHttpHeaderspublic WritableHttpHeader getWritableHttpHeaders() Obtains the headWritableHttpHeaderto the linked list ofWritableHttpHeaderinstances for theHttpResponseWriter.- Returns:
- Head WritableHttpHeaderto the linked list ofWritableHttpHeaderinstances for theHttpResponseWriter. May benull.
 
 - 
iteratorpublic java.util.Iterator<HttpHeader> iterator() - Specified by:
- iteratorin interface- java.lang.Iterable<HttpHeader>
 
 - 
addHeaderpublic HttpHeader addHeader(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException Description copied from interface:HttpResponseHeadersAdds a HttpHeaderfor the response.HttpHeaderinstances are provided on the response in the order they are added.- Specified by:
- addHeaderin interface- HttpResponseHeaders
- Parameters:
- name- Name of- HttpHeader.
- value- Value of- HttpHeader.
- Returns:
- Added HttpHeader.
- Throws:
- java.lang.IllegalArgumentException- Should the- HttpHeaderbe managed by the- HttpResponse.
 
 - 
addHeaderpublic HttpHeader addHeader(HttpHeaderName name, java.lang.String value) throws java.lang.IllegalArgumentException Description copied from interface:HttpResponseHeadersAdds aHttpHeader.- Specified by:
- addHeaderin interface- HttpResponseHeaders
- Parameters:
- name-- HttpHeaderName.
- value- Value of- HttpHeader.
- Returns:
- Added HttpHeader
- Throws:
- java.lang.IllegalArgumentException- Should the- HttpHeaderbe managed by the- HttpResponse.
 
 - 
addHeaderpublic HttpHeader addHeader(java.lang.String name, HttpHeaderValue value) throws java.lang.IllegalArgumentException Description copied from interface:HttpResponseHeadersAdds aHttpHeader.- Specified by:
- addHeaderin interface- HttpResponseHeaders
- Parameters:
- name- Name of- HttpHeader.
- value-- HttpHeaderValue.
- Returns:
- Added HttpHeader.
- Throws:
- java.lang.IllegalArgumentException- Should the- HttpHeaderbe managed by the- HttpResponse.
 
 - 
addHeaderpublic HttpHeader addHeader(HttpHeaderName name, HttpHeaderValue value) throws java.lang.IllegalArgumentException Description copied from interface:HttpResponseHeadersAdds aHttpHeader.- Specified by:
- addHeaderin interface- HttpResponseHeaders
- Parameters:
- name-- HttpHeaderName.
- value-- HttpHeaderValue.
- Returns:
- Added HttpHeader.
- Throws:
- java.lang.IllegalArgumentException- Should the- HttpHeaderbe managed by the- HttpResponse.
 
 - 
removeHeaderpublic boolean removeHeader(HttpHeader header) Description copied from interface:HttpResponseHeadersRemoves the particularHttpHeaderfrom the response.- Specified by:
- removeHeaderin interface- HttpResponseHeaders
- Parameters:
- header-- HttpHeaderto be removed from the response.
- Returns:
- trueif the- HttpHeaderwas removed.
 
 - 
removeHeaderspublic boolean removeHeaders(java.lang.String name) 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 interface- HttpResponseHeaders
- Parameters:
- name- Name of the- HttpHeaderinstances to remove.
- Returns:
- trueif- HttpHeaderinstances were removed by the name.
 
 - 
getHeaderpublic HttpHeader getHeader(java.lang.String name) Description copied from interface:HttpResponseHeadersObtains the firstHttpHeaderby the name.- Specified by:
- getHeaderin interface- HttpResponseHeaders
- Parameters:
- name- Name of the- HttpHeader.
- Returns:
- First HttpHeaderornullif notHttpHeader.
 
 - 
getHeaderspublic java.lang.Iterable<HttpHeader> getHeaders(java.lang.String name) Description copied from interface:HttpResponseHeadersObtains all theHttpHeaderinstances by the name.- Specified by:
- getHeadersin interface- HttpResponseHeaders
- Parameters:
- name- Name of the- HttpHeaderinstances.
- Returns:
- All HttpHeaderinstances by the name.
 
 
- 
 
-