Class Olingo4AppImpl
java.lang.Object
org.apache.camel.component.olingo4.api.impl.Olingo4AppImpl
- All Implemented Interfaces:
Olingo4App
Application API used by Olingo4 Component.
-
Constructor Summary
ConstructorsConstructorDescriptionOlingo4AppImpl(String serviceUri) Create Olingo4 Application with default HTTP configuration.Olingo4AppImpl(String serviceUri, org.apache.http.impl.client.HttpClientBuilder builder) Create Olingo4 Application with custom HTTP Synchronous client builder.Olingo4AppImpl(String serviceUri, org.apache.http.impl.nio.client.HttpAsyncClientBuilder builder) Create Olingo4 Application with custom HTTP Asynchronous client builder. -
Method Summary
Modifier and TypeMethodDescription<T> voidaction(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Calls a OData actionvoidbatch(org.apache.olingo.commons.api.edm.Edm edm, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<List<Olingo4BatchResponse>> responseHandler) Executes a batch request.voidclose()Closes resources.<T> voidcreate(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Creates a new OData resource.voiddelete(String resourcePath, Map<String, String> endpointHttpHeaders, Olingo4ResponseHandler<org.apache.olingo.commons.api.http.HttpStatusCode> responseHandler) Deletes an OData resource and invokes callback withHttpStatusCodeon success, or with exception on failure.voidexecute(org.apache.http.client.methods.HttpUriRequest httpUriRequest, org.apache.olingo.commons.api.format.ContentType contentType, Map<String, String> endpointHttpHeaders, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback) Returns content type for service calls.Returns custom Http headers.Returns Service base URI.<T> voidmerge(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Patches/merges an OData resource using HTTP MERGE.<T> voidpatch(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Patches/merges an OData resource using HTTP PATCH.<T> voidread(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> queryParams, Map<String, String> endpointHttpHeaders, Olingo4ResponseHandler<T> responseHandler) Reads an OData resource and invokes callback with appropriate result.voidsetContentType(String contentType) Set default service call content type.voidsetHttpHeaders(Map<String, String> httpHeaders) Sets custom Http headers to add to every service request.voidsetServiceUri(String serviceUri) Sets Service base URI.<T> voidupdate(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Updates an OData resource.voiduread(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> queryParams, Map<String, String> endpointHttpHeaders, Olingo4ResponseHandler<InputStream> responseHandler) Reads an OData resource and invokes callback with the unparsed input stream.
-
Constructor Details
-
Olingo4AppImpl
Create Olingo4 Application with default HTTP configuration. -
Olingo4AppImpl
public Olingo4AppImpl(String serviceUri, org.apache.http.impl.nio.client.HttpAsyncClientBuilder builder) Create Olingo4 Application with custom HTTP Asynchronous client builder.- Parameters:
serviceUri- Service Application base URI.builder- custom HTTP client builder.
-
Olingo4AppImpl
Create Olingo4 Application with custom HTTP Synchronous client builder.- Parameters:
serviceUri- Service Application base URI.builder- Custom HTTP Synchronous client builder.
-
-
Method Details
-
setServiceUri
Description copied from interface:Olingo4AppSets Service base URI.- Specified by:
setServiceUriin interfaceOlingo4App- Parameters:
serviceUri-
-
getServiceUri
Description copied from interface:Olingo4AppReturns Service base URI.- Specified by:
getServiceUriin interfaceOlingo4App- Returns:
- service base URI.
-
getHttpHeaders
Description copied from interface:Olingo4AppReturns custom Http headers.- Specified by:
getHttpHeadersin interfaceOlingo4App- Returns:
- custom Http headers.
-
setHttpHeaders
Description copied from interface:Olingo4AppSets custom Http headers to add to every service request.- Specified by:
setHttpHeadersin interfaceOlingo4App- Parameters:
httpHeaders- custom Http headers.
-
getContentType
Description copied from interface:Olingo4AppReturns content type for service calls. Defaults toapplication/json;charset=utf-8.- Specified by:
getContentTypein interfaceOlingo4App- Returns:
- content type.
-
setContentType
Description copied from interface:Olingo4AppSet default service call content type.- Specified by:
setContentTypein interfaceOlingo4App- Parameters:
contentType- content type.
-
close
public void close()Description copied from interface:Olingo4AppCloses resources.- Specified by:
closein interfaceOlingo4App
-
read
public <T> void read(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> queryParams, Map<String, String> endpointHttpHeaders, Olingo4ResponseHandler<T> responseHandler) Description copied from interface:Olingo4AppReads an OData resource and invokes callback with appropriate result.- Specified by:
readin interfaceOlingo4App- Parameters:
edm- Service Edm, read from callingread(null, "$metdata", null, responseHandler)resourcePath- OData Resource pathqueryParams- OData query params http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_Toc453752288endpointHttpHeaders- HTTP Headers to add/override the component versionsresponseHandler- callback handler
-
uread
public void uread(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> queryParams, Map<String, String> endpointHttpHeaders, Olingo4ResponseHandler<InputStream> responseHandler) Description copied from interface:Olingo4AppReads an OData resource and invokes callback with the unparsed input stream.- Specified by:
ureadin interfaceOlingo4App- Parameters:
edm- Service Edm, read from callingread(null, "$metdata", null, responseHandler)resourcePath- OData Resource pathqueryParams- OData query params http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_Toc453752288endpointHttpHeaders- HTTP Headers to add/override the component versionsresponseHandler- callback handler
-
create
public <T> void create(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Description copied from interface:Olingo4AppCreates a new OData resource.- Specified by:
createin interfaceOlingo4App- Parameters:
edm- service EdmresourcePath- resource path to createendpointHttpHeaders- HTTP Headers to add/override the component versionsdata- request dataresponseHandler- callback handler
-
update
public <T> void update(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Description copied from interface:Olingo4AppUpdates an OData resource.- Specified by:
updatein interfaceOlingo4App- Parameters:
edm- service EdmresourcePath- resource path to updateendpointHttpHeaders- HTTP Headers to add/override the component versionsdata- updated dataresponseHandler-ClientEntitycallback handler
-
delete
public void delete(String resourcePath, Map<String, String> endpointHttpHeaders, Olingo4ResponseHandler<org.apache.olingo.commons.api.http.HttpStatusCode> responseHandler) Description copied from interface:Olingo4AppDeletes an OData resource and invokes callback withHttpStatusCodeon success, or with exception on failure.- Specified by:
deletein interfaceOlingo4App- Parameters:
resourcePath- resource path for EntryendpointHttpHeaders- HTTP Headers to add/override the component versionsresponseHandler-HttpStatusCodecallback handler
-
patch
public <T> void patch(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Description copied from interface:Olingo4AppPatches/merges an OData resource using HTTP PATCH.- Specified by:
patchin interfaceOlingo4App- Parameters:
edm- service EdmresourcePath- resource path to updateendpointHttpHeaders- HTTP Headers to add/override the component versionsdata- patch/merge dataresponseHandler-ClientEntitycallback handler
-
merge
public <T> void merge(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Description copied from interface:Olingo4AppPatches/merges an OData resource using HTTP MERGE.- Specified by:
mergein interfaceOlingo4App- Parameters:
edm- service EdmresourcePath- resource path to updateendpointHttpHeaders- HTTP Headers to add/override the component versionsdata- patch/merge dataresponseHandler-ClientEntitycallback handler
-
batch
public void batch(org.apache.olingo.commons.api.edm.Edm edm, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<List<Olingo4BatchResponse>> responseHandler) Description copied from interface:Olingo4AppExecutes a batch request.- Specified by:
batchin interfaceOlingo4App- Parameters:
edm- service EdmendpointHttpHeaders- HTTP Headers to add/override the component versionsdata- orderedOlingo4BatchRequestlistresponseHandler- callback handler
-
action
public <T> void action(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, Map<String, String> endpointHttpHeaders, Object data, Olingo4ResponseHandler<T> responseHandler) Description copied from interface:Olingo4AppCalls a OData action- Specified by:
actionin interfaceOlingo4App- Parameters:
edm- service EdmresourcePath- resource path to actionendpointHttpHeaders- HTTP Headers to add/override the component versionsdata- action dataresponseHandler-ClientEntitycallback handler
-
execute
-