Class ODataClientBuilder

java.lang.Object
org.apache.olingo.client.api.ODataClientBuilder

public final class ODataClientBuilder extends Object

Builder to create an ODataClient for the API client library. This builder is dependent that an according implementation for the ODataClient and or EdmEnabledODataClient is available in class path.

This Builder should only be used in use cases were a direct access to the client-core library is not possible. If direct access is possible it is highly recommended to use the ODataClientFactory provided in the client-core library.

By default the ODataClientBuilder use the default Olingo V4 client core implementations (org.apache.olingo.client.core.ODataClientImpl and org.apache.olingo.client.core.EdmEnabledODataClientImpl) which can be overwritten via the System properties ODATA_CLIENT_IMPL_SYS_PROPERTY and ODATA_EMD_CLIENT_IMPL_SYS_PROPERTY.

  • Field Details

  • Method Details

    • createClient

      public static ODataClient createClient()
      Create an new ODataClient based on via system property ODATA_CLIENT_IMPL_SYS_PROPERTY class name or if not net the default ODATA_CLIENT_IMPL_CLASS set class.
      Returns:
      create ODataClient
    • with

      public static ODataClientBuilder.ClientBuilder with(String serviceRoot)
      Initiate the builder for an EdmEnabledODataClient.
      Parameters:
      serviceRoot - service root to use
      Returns:
      initiated client builder