public class ServiceResponse extends Object implements CommunicationObjectWithSoapHeader
Modifier and Type | Field and Description |
---|---|
private ByteArrayOutputStream |
byteArrayOutputStream
output stream of document
|
private MediaType |
contentType
the content type of this response
|
private Map<String,String> |
headerMap
the header field and values to be set in the
HttpServletResponse |
private static org.slf4j.Logger |
LOGGER |
private List<SoapHeader> |
soapHeaderMap |
private HTTPStatus |
status
the HTTP response code as specified in
HttpServletResponse |
private boolean |
supportsGZip
whether the service response should be gzipped
|
Constructor and Description |
---|
ServiceResponse(ByteArrayOutputStream baos,
MediaType contentType)
constructor with content but not specified response code
|
ServiceResponse(ByteArrayOutputStream baos,
MediaType contentType,
HTTPStatus status)
constructor with content and response code
|
ServiceResponse(MediaType contentType,
HTTPStatus status)
constructor without content type but with specified response code
|
Modifier and Type | Method and Description |
---|---|
int |
getContentLength()
Get the content length of the byte stream
|
MediaType |
getContentType() |
Map<String,String> |
getHeaderMap() |
List<SoapHeader> |
getSoapHeader() |
HTTPStatus |
getStatus() |
boolean |
isContentLess()
Check, if this response contains content to be written.
|
boolean |
isSetHeaderMap() |
boolean |
isSetSoapHeader()
Convenience method to check if the SoapHeader is set.
|
void |
setHeader(String headerIdentifier,
String headerValue) |
void |
setSoapHeader(List<SoapHeader> header) |
void |
setStatus(HTTPStatus status) |
void |
setSupportsGZip(boolean supportsGZip) |
boolean |
supportsGZip() |
String |
toString() |
void |
writeToOutputStream(OutputStream outputStream) |
private static final org.slf4j.Logger LOGGER
private final ByteArrayOutputStream byteArrayOutputStream
private HTTPStatus status
HttpServletResponse
private MediaType contentType
private boolean supportsGZip
private final Map<String,String> headerMap
HttpServletResponse
private final List<SoapHeader> soapHeaderMap
public ServiceResponse(ByteArrayOutputStream baos, MediaType contentType, HTTPStatus status)
baos
- Output stream of the SOS responsecontentType
- Content typestatus
- the HTTP response code as specified in
HttpServletResponse
public ServiceResponse(ByteArrayOutputStream baos, MediaType contentType)
baos
- Output stream of the SOS responsecontentType
- Content typepublic ServiceResponse(MediaType contentType, HTTPStatus status)
contentType
- Content typestatus
- the HTTP response code as specified in
HttpServletResponse
public MediaType getContentType()
public boolean isSetHeaderMap()
public void writeToOutputStream(OutputStream outputStream)
outputStream
- The stream the content of this response is written toisContentLess()
public boolean isContentLess()
true
, if content is NOT available,false
, if content is availablewriteToOutputStream(OutputStream).
public int getContentLength()
public HTTPStatus getStatus()
public void setStatus(HTTPStatus status)
public List<SoapHeader> getSoapHeader()
getSoapHeader
in interface CommunicationObjectWithSoapHeader
public void setSoapHeader(List<SoapHeader> header)
setSoapHeader
in interface CommunicationObjectWithSoapHeader
header
- the SoapHeader encoded as an InputStream containing XML.public boolean isSetSoapHeader()
CommunicationObjectWithSoapHeader
isSetSoapHeader
in interface CommunicationObjectWithSoapHeader
public boolean supportsGZip()
public void setSupportsGZip(boolean supportsGZip)
Copyright © 2012-2015 52north.org. All Rights Reserved.