Class AbstractODataRequest
java.lang.Object
org.apache.olingo.client.core.communication.request.AbstractRequest
org.apache.olingo.client.core.communication.request.AbstractODataRequest
- All Implemented Interfaces:
ODataRequest
- Direct Known Subclasses:
AbstractODataBasicRequest,AbstractODataStreamedRequest,ODataRawRequestImpl
Abstract representation of an OData request. Get instance by using factories.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.http.client.HttpClientHTTP client.protected final HttpMethodOData request method.protected final ODataClientprotected final ODataHeadersOData request header.protected org.apache.http.client.methods.HttpUriRequestHTTP request.protected URITarget URI.Fields inherited from class org.apache.olingo.client.core.communication.request.AbstractRequest
LOG -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractODataRequest(ODataClient odataClient, HttpMethod method, URI uri) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddCustomHeader(String name, String value) Adds a custom OData request header.protected org.apache.http.HttpResponseBuilds the request and execute it.Gets Accept OData request header.Gets contentType OData request header.abstract ContentTypeGets request headers.Gets the value of the OData request header identified by the given name.Gets all OData request header names.org.apache.http.client.methods.HttpUriRequestReturns Http request Object.Gets If-Match OData request header.Gets If-None-Match OData request header.Returns HTTP request method.Gets Prefer OData request header.<V extends ODataResponse>
VGets an empty response that can be initialized by a stream.getURI()Returns OData request target URI.Request raw execute.Adds Accept OData request header.setContentType(String value) Adds contentType OData request header.setIfMatch(String value) Adds If-Match OData request header.setIfNoneMatch(String value) Adds If-None-Match OData request header.Adds Prefer OData request header.voidSets OData request target URI.setXHTTPMethod(String value) Adds X-HTTP-METHOD OData request header.byte[]Gets byte array representation of the full request header.Methods inherited from class org.apache.olingo.client.core.communication.request.AbstractRequest
checkRequest, checkResponse
-
Field Details
-
odataClient
-
method
OData request method. -
odataHeaders
OData request header. -
uri
Target URI. -
httpClient
protected org.apache.http.client.HttpClient httpClientHTTP client. -
request
protected org.apache.http.client.methods.HttpUriRequest requestHTTP request.
-
-
Constructor Details
-
AbstractODataRequest
Constructor.- Parameters:
odataClient- client instance getting this requestmethod- HTTP request method. If configured X-HTTP-METHOD header will be used.uri- OData request URI.
-
-
Method Details
-
getDefaultFormat
-
getURI
Description copied from interface:ODataRequestReturns OData request target URI.- Specified by:
getURIin interfaceODataRequest- Returns:
- OData request target URI.
-
getHttpRequest
public org.apache.http.client.methods.HttpUriRequest getHttpRequest()Description copied from interface:ODataRequestReturns Http request Object.- Specified by:
getHttpRequestin interfaceODataRequest- Returns:
- HttpUriRequest.
-
setURI
Description copied from interface:ODataRequestSets OData request target URI.- Specified by:
setURIin interfaceODataRequest- Parameters:
uri- target URI.
-
getHeaderNames
Description copied from interface:ODataRequestGets all OData request header names.- Specified by:
getHeaderNamesin interfaceODataRequest- Returns:
- all request header names.
-
getHeader
Description copied from interface:ODataRequestGets the value of the OData request header identified by the given name.- Specified by:
getHeaderin interfaceODataRequest- Parameters:
name- name of the OData request header to be retrieved.- Returns:
- header value.
-
setAccept
Description copied from interface:ODataRequestAdds Accept OData request header.- Specified by:
setAcceptin interfaceODataRequest- Parameters:
value- header value.- Returns:
- current object
- See Also:
-
setIfMatch
Description copied from interface:ODataRequestAdds If-Match OData request header.- Specified by:
setIfMatchin interfaceODataRequest- Parameters:
value- header value.- Returns:
- current object
- See Also:
-
setIfNoneMatch
Description copied from interface:ODataRequestAdds If-None-Match OData request header.- Specified by:
setIfNoneMatchin interfaceODataRequest- Parameters:
value- header value.- Returns:
- current object
- See Also:
-
setPrefer
Description copied from interface:ODataRequestAdds Prefer OData request header.- Specified by:
setPreferin interfaceODataRequest- Parameters:
value- header value.- Returns:
- current object
- See Also:
-
setXHTTPMethod
Description copied from interface:ODataRequestAdds X-HTTP-METHOD OData request header.- Specified by:
setXHTTPMethodin interfaceODataRequest- Parameters:
value- header value.- Returns:
- current object
- See Also:
-
setContentType
Description copied from interface:ODataRequestAdds contentType OData request header.- Specified by:
setContentTypein interfaceODataRequest- Parameters:
value- header value.- Returns:
- current object
- See Also:
-
addCustomHeader
Description copied from interface:ODataRequestAdds a custom OData request header.- Specified by:
addCustomHeaderin interfaceODataRequest- Parameters:
name- header name.value- header value.- Returns:
- current object
-
getAccept
Description copied from interface:ODataRequestGets Accept OData request header.- Specified by:
getAcceptin interfaceODataRequest- Returns:
- header value.
- See Also:
-
getIfMatch
Description copied from interface:ODataRequestGets If-Match OData request header.- Specified by:
getIfMatchin interfaceODataRequest- Returns:
- header value.
- See Also:
-
getIfNoneMatch
Description copied from interface:ODataRequestGets If-None-Match OData request header.- Specified by:
getIfNoneMatchin interfaceODataRequest- Returns:
- header value.
- See Also:
-
getPrefer
Description copied from interface:ODataRequestGets Prefer OData request header.- Specified by:
getPreferin interfaceODataRequest- Returns:
- header value.
- See Also:
-
getContentType
Description copied from interface:ODataRequestGets contentType OData request header.- Specified by:
getContentTypein interfaceODataRequest- Returns:
- header value.
- See Also:
-
getMethod
Description copied from interface:ODataRequestReturns HTTP request method.- Specified by:
getMethodin interfaceODataRequest- Returns:
- HTTP request method.
-
getHeader
Gets request headers.- Returns:
- request headers.
-
toByteArray
public byte[] toByteArray()Description copied from interface:ODataRequestGets byte array representation of the full request header.- Specified by:
toByteArrayin interfaceODataRequest- Returns:
- full request header.
-
rawExecute
Description copied from interface:ODataRequestRequest raw execute.- Specified by:
rawExecutein interfaceODataRequest- Returns:
- raw input stream response.
-
doExecute
protected org.apache.http.HttpResponse doExecute()Builds the request and execute it.- Returns:
- HttpReponse object.
-
getResponseTemplate
Gets an empty response that can be initialized by a stream.
This method has to be used to build response items about a batch request.- Type Parameters:
V- ODataResponse type.- Returns:
- empty OData response instance.
-