public interface ODataResponse
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying message entity input stream (if available and open) as well as releases any other resources
associated with the response.
|
String |
getContentType()
Gets the content type.
|
String |
getETag()
Gets 'ETag' header value.
|
Collection<String> |
getHeader(String name)
Gets header value of the given header.
|
Collection<String> |
getHeaderNames()
Gets header names.
|
InputStream |
getRawResponse()
Gets response body as InputStream.
|
int |
getStatusCode()
Gets status code.
|
String |
getStatusMessage()
Gets status message.
|
ODataResponse |
initFromBatch(Map.Entry<Integer,String> responseLine,
Map<String,Collection<String>> headers,
ODataBatchLineIterator batchLineIterator,
String boundary)
Initializes response from batch response item.
|
ODataResponse |
initFromEnclosedPart(InputStream part)
Initializes response from an enclosed HTTP response.
|
ODataResponse |
initFromHttpResponse(org.apache.http.HttpResponse res)
Initializes OData response from HTTP response.
|
Collection<String> getHeaderNames()
Collection<String> getHeader(String name)
name
- header to be retrieved.String getETag()
String getContentType()
int getStatusCode()
String getStatusMessage()
InputStream getRawResponse()
ODataResponse initFromHttpResponse(org.apache.http.HttpResponse res)
res
- HTTP response.ODataResponse initFromBatch(Map.Entry<Integer,String> responseLine, Map<String,Collection<String>> headers, ODataBatchLineIterator batchLineIterator, String boundary)
responseLine
- response line.headers
- response headers.batchLineIterator
- batch line iterator.boundary
- batch boundary.ODataResponse initFromEnclosedPart(InputStream part)
part
- enclosed HTTP response.void close()
This operation is idempotent, i.e. it can be invoked multiple times with the same effect which also means that calling the close() method on an already closed message instance is legal and has no further effect.
The close() method should be invoked on all instances that contain an un-consumed entity input stream to ensure the resources associated with the instance are properly cleaned-up and prevent potential memory leaks. This is typical for client-side scenarios where application layer code processes only the response headers and ignores the response entity.
Copyright © 2013–2018 The Apache Software Foundation. All rights reserved.