Class ConfigurationImpl

java.lang.Object
org.apache.olingo.client.core.ConfigurationImpl
All Implemented Interfaces:
Configuration

public class ConfigurationImpl extends Object implements Configuration
  • Field Details

  • Constructor Details

    • ConfigurationImpl

      public ConfigurationImpl()
  • Method Details

    • getProperty

      protected Object getProperty(String key, Object defaultValue)
      Gets given configuration property.
      Parameters:
      key - key value of the property to be retrieved.
      defaultValue - default value to be used in case of the given key doesn't exist.
      Returns:
      property value if exists; default value if does not exist.
    • setProperty

      protected Object setProperty(String key, Object value)
      Sets new configuration property.
      Parameters:
      key - configuration property key.
      value - configuration property value.
      Returns:
      given value.
    • getDefaultBatchAcceptFormat

      public ContentType getDefaultBatchAcceptFormat()
      Description copied from interface: Configuration
      Gets the configured default Accept header value format for a batch request.
      Specified by:
      getDefaultBatchAcceptFormat in interface Configuration
      Returns:
      configured default Accept header value for a batch request.
    • setDefaultBatchAcceptFormat

      public void setDefaultBatchAcceptFormat(ContentType contentType)
      Description copied from interface: Configuration
      Set the default Accept header value format for a batch request.
      Specified by:
      setDefaultBatchAcceptFormat in interface Configuration
      Parameters:
      contentType - default Accept header value.
    • getDefaultPubFormat

      public ContentType getDefaultPubFormat()
      Description copied from interface: Configuration
      Gets the configured OData format for AtomPub exchanges. If this configuration parameter doesn't exist the JSON_FULL_METADATA format will be used as default.
      Specified by:
      getDefaultPubFormat in interface Configuration
      Returns:
      configured OData format for AtomPub if specified; JSON_FULL_METADATA format otherwise.
    • setDefaultPubFormat

      public void setDefaultPubFormat(ContentType contentType)
      Description copied from interface: Configuration
      Sets the default OData format for AtomPub exchanges.
      Specified by:
      setDefaultPubFormat in interface Configuration
      Parameters:
      contentType - default format.
    • getDefaultFormat

      public ContentType getDefaultFormat()
      Description copied from interface: Configuration
      Gets the configured OData format. This value depends on what is returned from getDefaultPubFormat().
      Specified by:
      getDefaultFormat in interface Configuration
      Returns:
      configured OData format
      See Also:
    • getDefaultValueFormat

      public ContentType getDefaultValueFormat()
      Description copied from interface: Configuration
      Gets the configured OData value format. If this configuration parameter doesn't exist the TEXT format will be used as default.
      Specified by:
      getDefaultValueFormat in interface Configuration
      Returns:
      configured OData value format if specified; TEXT_PLAIN format otherwise.
    • setDefaultValueFormat

      public void setDefaultValueFormat(ContentType contentType)
      Description copied from interface: Configuration
      Sets the default OData value format.
      Specified by:
      setDefaultValueFormat in interface Configuration
      Parameters:
      contentType - default format.
    • getDefaultMediaFormat

      public ContentType getDefaultMediaFormat()
      Description copied from interface: Configuration
      Gets the configured OData media format. If this configuration parameter doesn't exist the APPLICATION_OCTET_STREAM format will be used as default.
      Specified by:
      getDefaultMediaFormat in interface Configuration
      Returns:
      configured OData media format if specified; APPLICATION_OCTET_STREAM format otherwise.
    • setDefaultMediaFormat

      public void setDefaultMediaFormat(ContentType contentType)
      Description copied from interface: Configuration
      Sets the default OData media format.
      Specified by:
      setDefaultMediaFormat in interface Configuration
      Parameters:
      contentType - default format.
    • getHttpClientFactory

      public HttpClientFactory getHttpClientFactory()
      Description copied from interface: Configuration
      Gets the HttpClient factory to be used for executing requests.
      Specified by:
      getHttpClientFactory in interface Configuration
      Returns:
      provided implementation (if configured via setHttpClientFactory or default.
    • setHttpClientFactory

      public void setHttpClientFactory(HttpClientFactory factory)
      Description copied from interface: Configuration
      Sets the HttpClient factory to be used for executing requests.
      Specified by:
      setHttpClientFactory in interface Configuration
      Parameters:
      factory - implementation of HttpClientFactory.
      See Also:
    • getHttpUriRequestFactory

      public HttpUriRequestFactory getHttpUriRequestFactory()
      Description copied from interface: Configuration
      Gets the HttpUriRequest factory for generating requests to be executed.
      Specified by:
      getHttpUriRequestFactory in interface Configuration
      Returns:
      provided implementation (if configured via setHttpUriRequestFactory or default.
    • setHttpUriRequestFactory

      public void setHttpUriRequestFactory(HttpUriRequestFactory factory)
      Description copied from interface: Configuration
      Sets the HttpUriRequest factory generating requests to be executed.
      Specified by:
      setHttpUriRequestFactory in interface Configuration
      Parameters:
      factory - implementation of HttpUriRequestFactory.
      See Also:
    • isUseXHTTPMethod

      public boolean isUseXHTTPMethod()
      Description copied from interface: Configuration
      Gets whether PUT, MERGE, PATCH, DELETE HTTP methods need to be translated to POST with additional X-HTTTP-Method header.
      Specified by:
      isUseXHTTPMethod in interface Configuration
      Returns:
      whether X-HTTTP-Method header is to be used
    • setUseXHTTPMethod

      public void setUseXHTTPMethod(boolean value)
      Description copied from interface: Configuration
      Sets whether PUT, MERGE, PATCH, DELETE HTTP methods need to be translated to POST with additional X-HTTTP-Method header.
      Specified by:
      setUseXHTTPMethod in interface Configuration
      Parameters:
      value - 'TRUE' to use tunneling.
    • isGzipCompression

      public boolean isGzipCompression()
      Description copied from interface: Configuration
      Checks whether Gzip compression (e.g. support for Accept-Encoding: gzip and Content-Encoding: gzip HTTP headers) is enabled.
      Specified by:
      isGzipCompression in interface Configuration
      Returns:
      whether HTTP Gzip compression is enabled
    • setGzipCompression

      public void setGzipCompression(boolean value)
      Description copied from interface: Configuration
      Sets Gzip compression (e.g. support for Accept-Encoding: gzip and Content-Encoding: gzip HTTP headers) enabled or disabled.
      Specified by:
      setGzipCompression in interface Configuration
      Parameters:
      value - whether to use Gzip compression.
    • isUseChuncked

      public boolean isUseChuncked()
      Description copied from interface: Configuration
      Checks whether chunk HTTP encoding is being used.
      Specified by:
      isUseChuncked in interface Configuration
      Returns:
      whether chunk HTTP encoding is being used
    • setUseChuncked

      public void setUseChuncked(boolean value)
      Description copied from interface: Configuration
      Sets chunk HTTP encoding enabled or disabled.
      Specified by:
      setUseChuncked in interface Configuration
      Parameters:
      value - whether to use chunk HTTP encoding.
    • isKeyAsSegment

      public boolean isKeyAsSegment()
      Description copied from interface: Configuration
      Checks whether URIs contain entity key between parentheses (standard) or instead as additional segment (non-standard).
      Example: http://services.odata.org/V4/OData/OData.svc/Products(0) or http://services.odata.org/V4/OData/OData.svc/Products/0
      Specified by:
      isKeyAsSegment in interface Configuration
      Returns:
      whether URIs shall be built with entity key between parentheses (standard) or instead as additional segment.
    • setKeyAsSegment

      public void setKeyAsSegment(boolean value)
      Description copied from interface: Configuration
      Sets whether URIs shall be built with entity key between parentheses (standard) or instead as additional segment (non-standard).
      Example: http://services.odata.org/V4/OData/OData.svc/Products(0) or http://services.odata.org/V4/OData/OData.svc/Products/0
      Specified by:
      setKeyAsSegment in interface Configuration
      Parameters:
      value - 'TRUE' to use this feature.
    • isAddressingDerivedTypes

      public boolean isAddressingDerivedTypes()
      Description copied from interface: Configuration
      Gets whether query URIs in request should contain fully qualified type name. - OData Intermediate Conformance Level: MUST support casting to a derived type according to [OData-URL] if derived types are present in the model.
      Example: http://host/service/Customers/Model.VipCustomer(102) or http://host/service/Customers/Model.VipCustomer
      Specified by:
      isAddressingDerivedTypes in interface Configuration
      Returns:
      whether query URIs in request should contain fully qualified type name. segment.
    • setAddressingDerivedTypes

      public void setAddressingDerivedTypes(boolean value)
      Description copied from interface: Configuration
      Sets whether query URIs in request should contain fully qualified type name. - OData Intermediate Conformance Level: MUST support casting to a derived type according to [OData-URL] if derived types are present in the model.
      Example: http://host/service/Customers/Model.VipCustomer(102) or http://host/service/Customers/Model.VipCustomer
      Specified by:
      setAddressingDerivedTypes in interface Configuration
      Parameters:
      value - 'TRUE' to use this feature.
    • isUseUrlOperationFQN

      public boolean isUseUrlOperationFQN()
      Description copied from interface: Configuration
      Checks whether operation name in request URI should be fully qualified name, which is required by OData V4 protocol, but some service may still choose to support shorter name.
      Example: http://host/service/Customers(2)/NS1.Model.IncreaseSalary VS http://host/service/Customers(2)/IncreaseSalary
      Specified by:
      isUseUrlOperationFQN in interface Configuration
      Returns:
      wheter operation name in request URI should be fully qualified name. segment.
    • setUseUrlOperationFQN

      public void setUseUrlOperationFQN(boolean value)
      Description copied from interface: Configuration
      Sets whether operation name in request URI should be fully qualified name, which is required by OData V4 protocol, but some service may still choose to support shorter name.
      Example: http://host/service/Customers(2)/NS1.Model.IncreaseSalary VS http://host/service/Customers(2)/IncreaseSalary
      Specified by:
      setUseUrlOperationFQN in interface Configuration
      Parameters:
      value - 'TRUE' to use this feature.
    • isContinueOnError

      public boolean isContinueOnError()
      Description copied from interface: Configuration
      When processing a set of requests (in batch requests, for example), checks if the execution will be aborted after first error encountered or not.
      Specified by:
      isContinueOnError in interface Configuration
      Returns:
      whether execution of a set of requests will be aborted after first error
    • setContinueOnError

      public void setContinueOnError(boolean value)
      Description copied from interface: Configuration
      When processing a set of requests (in batch requests, for example), sets if the execution will be aborted after first error encountered or not.
      Specified by:
      setContinueOnError in interface Configuration
      Parameters:
      value - 'TRUE' to use this feature.
    • getExecutor

      public ExecutorService getExecutor()
      Description copied from interface: Configuration
      Retrieves request executor service.
      Specified by:
      getExecutor in interface Configuration
      Returns:
      request executor service.
    • setExecutor

      public void setExecutor(ExecutorService executorService)
      Description copied from interface: Configuration
      Sets request executor service.
      Specified by:
      setExecutor in interface Configuration
      Parameters:
      executorService - new executor services.