public class ServiceResponse extends Object implements CommunicationObjectWithSoapHeader
| 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) |
public ServiceResponse(ByteArrayOutputStream baos, MediaType contentType, HTTPStatus status)
baos - Output stream of the service responsecontentType - Content typestatus - the HTTP response code as specified in
HttpServletResponsepublic ServiceResponse(ByteArrayOutputStream baos, MediaType contentType)
baos - Output stream of the service responsecontentType - Content typepublic ServiceResponse(MediaType contentType, HTTPStatus status)
contentType - Content typestatus - the HTTP response code as specified in
HttpServletResponsepublic 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,
else false, if content is availablewriteToOutputStream(java.io.OutputStream)public int getContentLength()
public HTTPStatus getStatus()
public void setStatus(HTTPStatus status)
public List<SoapHeader> getSoapHeader()
getSoapHeader in interface CommunicationObjectWithSoapHeaderpublic void setSoapHeader(List<SoapHeader> header)
setSoapHeader in interface CommunicationObjectWithSoapHeaderheader - the SoapHeader encoded as an InputStream containing XML.public boolean isSetSoapHeader()
CommunicationObjectWithSoapHeaderisSetSoapHeader in interface CommunicationObjectWithSoapHeaderpublic boolean supportsGZip()
public void setSupportsGZip(boolean supportsGZip)
Copyright © 2015–2020 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.