Class Olingo4AppImpl

java.lang.Object
org.apache.camel.component.olingo4.api.impl.Olingo4AppImpl
All Implemented Interfaces:
Olingo4App

public final class Olingo4AppImpl extends Object implements Olingo4App
Application API used by Olingo4 Component.
  • Constructor Details

    • Olingo4AppImpl

      public Olingo4AppImpl(String serviceUri)
      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

      public Olingo4AppImpl(String serviceUri, org.apache.http.impl.client.HttpClientBuilder builder)
      Create Olingo4 Application with custom HTTP Synchronous client builder.
      Parameters:
      serviceUri - Service Application base URI.
      builder - Custom HTTP Synchronous client builder.
  • Method Details

    • setServiceUri

      public void setServiceUri(String serviceUri)
      Description copied from interface: Olingo4App
      Sets Service base URI.
      Specified by:
      setServiceUri in interface Olingo4App
      Parameters:
      serviceUri -
    • getServiceUri

      public String getServiceUri()
      Description copied from interface: Olingo4App
      Returns Service base URI.
      Specified by:
      getServiceUri in interface Olingo4App
      Returns:
      service base URI.
    • getHttpHeaders

      public Map<String,String> getHttpHeaders()
      Description copied from interface: Olingo4App
      Returns custom Http headers.
      Specified by:
      getHttpHeaders in interface Olingo4App
      Returns:
      custom Http headers.
    • setHttpHeaders

      public void setHttpHeaders(Map<String,String> httpHeaders)
      Description copied from interface: Olingo4App
      Sets custom Http headers to add to every service request.
      Specified by:
      setHttpHeaders in interface Olingo4App
      Parameters:
      httpHeaders - custom Http headers.
    • getContentType

      public String getContentType()
      Description copied from interface: Olingo4App
      Returns content type for service calls. Defaults to application/json;charset=utf-8.
      Specified by:
      getContentType in interface Olingo4App
      Returns:
      content type.
    • setContentType

      public void setContentType(String contentType)
      Description copied from interface: Olingo4App
      Set default service call content type.
      Specified by:
      setContentType in interface Olingo4App
      Parameters:
      contentType - content type.
    • close

      public void close()
      Description copied from interface: Olingo4App
      Closes resources.
      Specified by:
      close in interface Olingo4App
    • 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: Olingo4App
      Reads an OData resource and invokes callback with appropriate result.
      Specified by:
      read in interface Olingo4App
      Parameters:
      edm - Service Edm, read from calling read(null, "$metdata", null, responseHandler)
      resourcePath - OData Resource path
      queryParams - OData query params http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_Toc453752288
      endpointHttpHeaders - HTTP Headers to add/override the component versions
      responseHandler - 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: Olingo4App
      Reads an OData resource and invokes callback with the unparsed input stream.
      Specified by:
      uread in interface Olingo4App
      Parameters:
      edm - Service Edm, read from calling read(null, "$metdata", null, responseHandler)
      resourcePath - OData Resource path
      queryParams - OData query params http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_Toc453752288
      endpointHttpHeaders - HTTP Headers to add/override the component versions
      responseHandler - 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: Olingo4App
      Creates a new OData resource.
      Specified by:
      create in interface Olingo4App
      Parameters:
      edm - service Edm
      resourcePath - resource path to create
      endpointHttpHeaders - HTTP Headers to add/override the component versions
      data - request data
      responseHandler - 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: Olingo4App
      Updates an OData resource.
      Specified by:
      update in interface Olingo4App
      Parameters:
      edm - service Edm
      resourcePath - resource path to update
      endpointHttpHeaders - HTTP Headers to add/override the component versions
      data - updated data
      responseHandler - ClientEntity callback handler
    • delete

      public void delete(String resourcePath, Map<String,String> endpointHttpHeaders, Olingo4ResponseHandler<org.apache.olingo.commons.api.http.HttpStatusCode> responseHandler)
      Description copied from interface: Olingo4App
      Deletes an OData resource and invokes callback with HttpStatusCode on success, or with exception on failure.
      Specified by:
      delete in interface Olingo4App
      Parameters:
      resourcePath - resource path for Entry
      endpointHttpHeaders - HTTP Headers to add/override the component versions
      responseHandler - HttpStatusCode callback 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: Olingo4App
      Patches/merges an OData resource using HTTP PATCH.
      Specified by:
      patch in interface Olingo4App
      Parameters:
      edm - service Edm
      resourcePath - resource path to update
      endpointHttpHeaders - HTTP Headers to add/override the component versions
      data - patch/merge data
      responseHandler - ClientEntity callback 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: Olingo4App
      Patches/merges an OData resource using HTTP MERGE.
      Specified by:
      merge in interface Olingo4App
      Parameters:
      edm - service Edm
      resourcePath - resource path to update
      endpointHttpHeaders - HTTP Headers to add/override the component versions
      data - patch/merge data
      responseHandler - ClientEntity callback 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: Olingo4App
      Executes a batch request.
      Specified by:
      batch in interface Olingo4App
      Parameters:
      edm - service Edm
      endpointHttpHeaders - HTTP Headers to add/override the component versions
      data - ordered Olingo4BatchRequest list
      responseHandler - 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: Olingo4App
      Calls a OData action
      Specified by:
      action in interface Olingo4App
      Parameters:
      edm - service Edm
      resourcePath - resource path to action
      endpointHttpHeaders - HTTP Headers to add/override the component versions
      data - action data
      responseHandler - ClientEntity callback handler
    • execute

      public void execute(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)