|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.olingo.odata2.api.processor.ODataResponse
public abstract class ODataResponse
An ODataResponse
is usually created by an ODataProcessor
during request handling.
The handler can use a serializer to create an OData body (== response entity) and can set various response headers. A response can be created using the builder pattern:
ODataResponse response = ODataResponse.entity("hello world").setStatus(HttpStatusCodes.OK).build();
Nested Class Summary | |
---|---|
static class |
ODataResponse.ODataResponseBuilder
Implementation of the builder pattern to create instances of this type of object. |
Constructor Summary | |
---|---|
protected |
ODataResponse()
Do not subclass ODataResponse! |
Method Summary | |
---|---|
abstract void |
close()
Close the underlying entity input stream (if such a stream is available) and release all with this repsonse associated resources. |
abstract boolean |
containsHeader(String header)
Case insensitive check if the header is available in this ODataResponse |
static ODataResponse.ODataResponseBuilder |
contentHeader(String value)
|
static ODataResponse.ODataResponseBuilder |
entity(Object entity)
|
static ODataResponse.ODataResponseBuilder |
fromResponse(ODataResponse response)
|
abstract String |
getContentHeader()
|
abstract Object |
getEntity()
|
InputStream |
getEntityAsStream()
|
abstract String |
getETag()
|
abstract String |
getHeader(String name)
|
abstract Set<String> |
getHeaderNames()
|
abstract String |
getIdLiteral()
|
abstract HttpStatusCodes |
getStatus()
|
static ODataResponse.ODataResponseBuilder |
header(String name,
String value)
|
static ODataResponse.ODataResponseBuilder |
newBuilder()
|
static ODataResponse.ODataResponseBuilder |
status(HttpStatusCodes status)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ODataResponse()
Method Detail |
---|
public abstract HttpStatusCodes getStatus()
public abstract Object getEntity()
public InputStream getEntityAsStream() throws ODataException
ODataException
- throws ODataException in case of entity is not a stream (internal ClassCastException)public abstract void close() throws IOException
IOException
- if something goes wrong during close of ODataResponse
public abstract String getHeader(String name)
name
- HTTP response header name
public abstract String getContentHeader()
public abstract String getIdLiteral()
public abstract String getETag()
public abstract Set<String> getHeaderNames()
public abstract boolean containsHeader(String header)
header
- header name
public static ODataResponse.ODataResponseBuilder status(HttpStatusCodes status)
status
- HTTP status code
public static ODataResponse.ODataResponseBuilder fromResponse(ODataResponse response)
response
-
public static ODataResponse.ODataResponseBuilder entity(Object entity)
entity
-
public static ODataResponse.ODataResponseBuilder header(String name, String value)
name
- HTTP header namevalue
- associated value
public static ODataResponse.ODataResponseBuilder contentHeader(String value)
value
- content header value
public static ODataResponse.ODataResponseBuilder newBuilder()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |