Package org.apache.olingo.client.core
Class ConfigurationImpl
java.lang.Object
org.apache.olingo.client.core.ConfigurationImpl
- All Implemented Interfaces:
Configuration
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the configured default Accept header value format for a batch request.Gets the configured OData format.Gets the configured OData media format.Gets the configured OData format for AtomPub exchanges.Gets the configured OData value format.Retrieves request executor service.Gets the HttpClient factory to be used for executing requests.Gets the HttpUriRequest factory for generating requests to be executed.protected ObjectgetProperty(String key, Object defaultValue) Gets given configuration property.booleanGets whether query URIs in request should contain fully qualified type name.booleanWhen processing a set of requests (in batch requests, for example), checks if the execution will be aborted after first error encountered or not.booleanChecks whether Gzip compression (e.g.booleanChecks whether URIs contain entity key between parentheses (standard) or instead as additional segment (non-standard).booleanChecks whether chunk HTTP encoding is being used.booleanChecks 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.booleanGets whether PUT, MERGE, PATCH, DELETE HTTP methods need to be translated to POST with additional X-HTTTP-Method header.voidsetAddressingDerivedTypes(boolean value) Sets whether query URIs in request should contain fully qualified type name.voidsetContinueOnError(boolean value) When processing a set of requests (in batch requests, for example), sets if the execution will be aborted after first error encountered or not.voidsetDefaultBatchAcceptFormat(ContentType contentType) Set the default Accept header value format for a batch request.voidsetDefaultMediaFormat(ContentType contentType) Sets the default OData media format.voidsetDefaultPubFormat(ContentType contentType) Sets the default OData format for AtomPub exchanges.voidsetDefaultValueFormat(ContentType contentType) Sets the default OData value format.voidsetExecutor(ExecutorService executorService) Sets request executor service.voidsetGzipCompression(boolean value) Sets Gzip compression (e.g.voidsetHttpClientFactory(HttpClientFactory factory) Sets the HttpClient factory to be used for executing requests.voidSets the HttpUriRequest factory generating requests to be executed.voidsetKeyAsSegment(boolean value) Sets whether URIs shall be built with entity key between parentheses (standard) or instead as additional segment (non-standard).protected ObjectsetProperty(String key, Object value) Sets new configuration property.voidsetUseChuncked(boolean value) Sets chunk HTTP encoding enabled or disabled.voidsetUseUrlOperationFQN(boolean value) 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.voidsetUseXHTTPMethod(boolean value) Sets whether PUT, MERGE, PATCH, DELETE HTTP methods need to be translated to POST with additional X-HTTTP-Method header.
-
Field Details
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE- See Also:
-
-
Constructor Details
-
ConfigurationImpl
public ConfigurationImpl()
-
-
Method Details
-
getProperty
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
Sets new configuration property.- Parameters:
key- configuration property key.value- configuration property value.- Returns:
- given value.
-
getDefaultBatchAcceptFormat
Description copied from interface:ConfigurationGets the configured default Accept header value format for a batch request.- Specified by:
getDefaultBatchAcceptFormatin interfaceConfiguration- Returns:
- configured default Accept header value for a batch request.
-
setDefaultBatchAcceptFormat
Description copied from interface:ConfigurationSet the default Accept header value format for a batch request.- Specified by:
setDefaultBatchAcceptFormatin interfaceConfiguration- Parameters:
contentType- default Accept header value.
-
getDefaultPubFormat
Description copied from interface:ConfigurationGets 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:
getDefaultPubFormatin interfaceConfiguration- Returns:
- configured OData format for AtomPub if specified; JSON_FULL_METADATA format otherwise.
-
setDefaultPubFormat
Description copied from interface:ConfigurationSets the default OData format for AtomPub exchanges.- Specified by:
setDefaultPubFormatin interfaceConfiguration- Parameters:
contentType- default format.
-
getDefaultFormat
Description copied from interface:ConfigurationGets the configured OData format. This value depends on what is returned from getDefaultPubFormat().- Specified by:
getDefaultFormatin interfaceConfiguration- Returns:
- configured OData format
- See Also:
-
getDefaultValueFormat
Description copied from interface:ConfigurationGets the configured OData value format. If this configuration parameter doesn't exist the TEXT format will be used as default.- Specified by:
getDefaultValueFormatin interfaceConfiguration- Returns:
- configured OData value format if specified; TEXT_PLAIN format otherwise.
-
setDefaultValueFormat
Description copied from interface:ConfigurationSets the default OData value format.- Specified by:
setDefaultValueFormatin interfaceConfiguration- Parameters:
contentType- default format.
-
getDefaultMediaFormat
Description copied from interface:ConfigurationGets the configured OData media format. If this configuration parameter doesn't exist the APPLICATION_OCTET_STREAM format will be used as default.- Specified by:
getDefaultMediaFormatin interfaceConfiguration- Returns:
- configured OData media format if specified; APPLICATION_OCTET_STREAM format otherwise.
-
setDefaultMediaFormat
Description copied from interface:ConfigurationSets the default OData media format.- Specified by:
setDefaultMediaFormatin interfaceConfiguration- Parameters:
contentType- default format.
-
getHttpClientFactory
Description copied from interface:ConfigurationGets the HttpClient factory to be used for executing requests.- Specified by:
getHttpClientFactoryin interfaceConfiguration- Returns:
- provided implementation (if configured via setHttpClientFactory or default.
-
setHttpClientFactory
Description copied from interface:ConfigurationSets the HttpClient factory to be used for executing requests.- Specified by:
setHttpClientFactoryin interfaceConfiguration- Parameters:
factory- implementation of HttpClientFactory.- See Also:
-
getHttpUriRequestFactory
Description copied from interface:ConfigurationGets the HttpUriRequest factory for generating requests to be executed.- Specified by:
getHttpUriRequestFactoryin interfaceConfiguration- Returns:
- provided implementation (if configured via setHttpUriRequestFactory or default.
-
setHttpUriRequestFactory
Description copied from interface:ConfigurationSets the HttpUriRequest factory generating requests to be executed.- Specified by:
setHttpUriRequestFactoryin interfaceConfiguration- Parameters:
factory- implementation of HttpUriRequestFactory.- See Also:
-
isUseXHTTPMethod
public boolean isUseXHTTPMethod()Description copied from interface:ConfigurationGets whether PUT, MERGE, PATCH, DELETE HTTP methods need to be translated to POST with additional X-HTTTP-Method header.- Specified by:
isUseXHTTPMethodin interfaceConfiguration- Returns:
- whether X-HTTTP-Method header is to be used
-
setUseXHTTPMethod
public void setUseXHTTPMethod(boolean value) Description copied from interface:ConfigurationSets whether PUT, MERGE, PATCH, DELETE HTTP methods need to be translated to POST with additional X-HTTTP-Method header.- Specified by:
setUseXHTTPMethodin interfaceConfiguration- Parameters:
value- 'TRUE' to use tunneling.
-
isGzipCompression
public boolean isGzipCompression()Description copied from interface:ConfigurationChecks whether Gzip compression (e.g. support for Accept-Encoding: gzip and Content-Encoding: gzip HTTP headers) is enabled.- Specified by:
isGzipCompressionin interfaceConfiguration- Returns:
- whether HTTP Gzip compression is enabled
-
setGzipCompression
public void setGzipCompression(boolean value) Description copied from interface:ConfigurationSets Gzip compression (e.g. support for Accept-Encoding: gzip and Content-Encoding: gzip HTTP headers) enabled or disabled.- Specified by:
setGzipCompressionin interfaceConfiguration- Parameters:
value- whether to use Gzip compression.
-
isUseChuncked
public boolean isUseChuncked()Description copied from interface:ConfigurationChecks whether chunk HTTP encoding is being used.- Specified by:
isUseChunckedin interfaceConfiguration- Returns:
- whether chunk HTTP encoding is being used
-
setUseChuncked
public void setUseChuncked(boolean value) Description copied from interface:ConfigurationSets chunk HTTP encoding enabled or disabled.- Specified by:
setUseChunckedin interfaceConfiguration- Parameters:
value- whether to use chunk HTTP encoding.
-
isKeyAsSegment
public boolean isKeyAsSegment()Description copied from interface:ConfigurationChecks 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:
isKeyAsSegmentin interfaceConfiguration- 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:ConfigurationSets 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:
setKeyAsSegmentin interfaceConfiguration- Parameters:
value- 'TRUE' to use this feature.
-
isAddressingDerivedTypes
public boolean isAddressingDerivedTypes()Description copied from interface:ConfigurationGets 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:
isAddressingDerivedTypesin interfaceConfiguration- Returns:
- whether query URIs in request should contain fully qualified type name. segment.
-
setAddressingDerivedTypes
public void setAddressingDerivedTypes(boolean value) Description copied from interface:ConfigurationSets 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:
setAddressingDerivedTypesin interfaceConfiguration- Parameters:
value- 'TRUE' to use this feature.
-
isUseUrlOperationFQN
public boolean isUseUrlOperationFQN()Description copied from interface:ConfigurationChecks 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:
isUseUrlOperationFQNin interfaceConfiguration- Returns:
- wheter operation name in request URI should be fully qualified name. segment.
-
setUseUrlOperationFQN
public void setUseUrlOperationFQN(boolean value) Description copied from interface:ConfigurationSets 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:
setUseUrlOperationFQNin interfaceConfiguration- Parameters:
value- 'TRUE' to use this feature.
-
isContinueOnError
public boolean isContinueOnError()Description copied from interface:ConfigurationWhen 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:
isContinueOnErrorin interfaceConfiguration- Returns:
- whether execution of a set of requests will be aborted after first error
-
setContinueOnError
public void setContinueOnError(boolean value) Description copied from interface:ConfigurationWhen 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:
setContinueOnErrorin interfaceConfiguration- Parameters:
value- 'TRUE' to use this feature.
-
getExecutor
Description copied from interface:ConfigurationRetrieves request executor service.- Specified by:
getExecutorin interfaceConfiguration- Returns:
- request executor service.
-
setExecutor
Description copied from interface:ConfigurationSets request executor service.- Specified by:
setExecutorin interfaceConfiguration- Parameters:
executorService- new executor services.
-