Class ConfigAsyncClient
- java.lang.Object
-
- com.oracle.bmc.http.internal.BaseAsyncClient
-
- com.oracle.bmc.apmconfig.ConfigAsyncClient
-
- All Implemented Interfaces:
ConfigAsync
,AutoCloseable
@Generated(value="OracleSDKGenerator", comments="API Version: 20210201") public class ConfigAsyncClient extends BaseAsyncClient implements ConfigAsync
Async client implementation for Config service.
There are two ways to use async client: 1. Use AsyncHandler: using AsyncHandler, if the response to the call is anInputStream
, like getObject Api in object storage service, developers need to process the stream in AsyncHandler, and not anywhere else, because the stream will be closed right after the AsyncHandler is invoked.
2. Use Java Future: using Java Future, developers need to close the stream after they are done with the Java Future.
Accessing the result should be done in a mutually exclusive manner, either through the Future or the AsyncHandler, but not both. If the Future is used, the caller should pass in null as the AsyncHandler. If the AsyncHandler is used, it is still safe to use the Future to determine whether or not the request was completed via Future.isDone/isCancelled.
Please refer to https://github.com/oracle/oci-java-sdk/blob/master/bmc-examples/src/main/java/ResteasyClientWithObjectStorageExample.java
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConfigAsyncClient.Builder
Builder class for this client.
-
Field Summary
Fields Modifier and Type Field Description String
clientCommonLibraryVersion
Compatible SDK version, provided by the codegen.Optional<String>
minimumClientCommonLibraryVersionFromClient
Minimum compatible SDK version, maybe provided by the codegen.static Service
SERVICE
Service instance for Config.
-
Constructor Summary
Constructors Constructor Description ConfigAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory)
Deprecated.Use thebuilder
instead.ConfigAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators)
Deprecated.Use thebuilder
instead.ConfigAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilder
instead.ConfigAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, Map<SigningStrategy,RequestSignerFactory> signingStrategyRequestSignerFactories, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilder
instead.ConfigAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider)
Deprecated.Use thebuilder
instead.ConfigAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration)
Deprecated.Use thebuilder
instead.ConfigAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator)
Deprecated.Use thebuilder
instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConfigAsyncClient.Builder
builder()
Create a builder for this client.protected <REQ extends BmcRequest<?>,RESP extends BmcResponse,RESP_BUILDER extends BmcResponse.Builder<RESP>>
ClientCall<REQ,RESP,RESP_BUILDER>clientCall(REQ request, Supplier<RESP_BUILDER> responseBuilder)
void
close()
Future<CopyConfigurationResponse>
copyConfiguration(CopyConfigurationRequest request, AsyncHandler<CopyConfigurationRequest,CopyConfigurationResponse> handler)
Fast importing configuration items to a destination APM domain ID.Future<CreateConfigResponse>
createConfig(CreateConfigRequest request, AsyncHandler<CreateConfigRequest,CreateConfigResponse> handler)
Creates a new configuration item.Future<DeleteConfigResponse>
deleteConfig(DeleteConfigRequest request, AsyncHandler<DeleteConfigRequest,DeleteConfigResponse> handler)
Deletes the configuration item identified by the OCID.Future<ExportConfigurationResponse>
exportConfiguration(ExportConfigurationRequest request, AsyncHandler<ExportConfigurationRequest,ExportConfigurationResponse> handler)
Exports configurations for the whole domain by domainId.String
getClientCommonLibraryVersion()
Future<GetConfigResponse>
getConfig(GetConfigRequest request, AsyncHandler<GetConfigRequest,GetConfigResponse> handler)
Gets the configuration item identified by the OCID.protected ClientConfigurator
getDefaultConfigurator()
String
getEndpoint()
Optional<String>
getMinimumClientCommonLibraryVersionFromClient()
Future<ImportConfigurationResponse>
importConfiguration(ImportConfigurationRequest request, AsyncHandler<ImportConfigurationRequest,ImportConfigurationResponse> handler)
Import configurations Item(s) with its dependencies into a destination domain.Future<ListConfigsResponse>
listConfigs(ListConfigsRequest request, AsyncHandler<ListConfigsRequest,ListConfigsResponse> handler)
Returns all configuration items, which can optionally be filtered by configuration type.void
populateServiceParametersInEndpoint(String endpoint, Map<String,Object> requiredParametersMap)
Populate the parameters in the endpoint with its corresponding value and update the base endpoint.void
refreshClient()
Rebuild the backingHttpClient
.Future<RetrieveNamespaceMetricsResponse>
retrieveNamespaceMetrics(RetrieveNamespaceMetricsRequest request, AsyncHandler<RetrieveNamespaceMetricsRequest,RetrieveNamespaceMetricsResponse> handler)
Returns all metrics associated with the specified namespace.Future<RetrieveNamespacesResponse>
retrieveNamespaces(RetrieveNamespacesRequest request, AsyncHandler<RetrieveNamespacesRequest,RetrieveNamespacesResponse> handler)
Returns all namespaces available in APM.void
setEndpoint(String endpoint)
void
setRegion(Region region)
Sets the region to call (ex, Region.US_PHOENIX_1).void
setRegion(String regionId)
Sets the region to call (ex, ‘us-phoenix-1’).Future<TestResponse>
test(TestRequest request, AsyncHandler<TestRequest,TestResponse> handler)
Tests a data processing operation on the provided input, returning the potentially modified input as output.void
updateBaseEndpoint(String endpoint)
This method should be used for parameterized endpoint templates only.Future<UpdateConfigResponse>
updateConfig(UpdateConfigRequest request, AsyncHandler<UpdateConfigRequest,UpdateConfigResponse> handler)
Updates the details of the configuration item identified by the OCID.void
useRealmSpecificEndpointTemplate(boolean useOfRealmSpecificEndpointTemplateEnabled)
This method should be used to enable or disable the use of realm-specific endpoint template.Future<ValidateSpanFilterPatternResponse>
validateSpanFilterPattern(ValidateSpanFilterPatternRequest request, AsyncHandler<ValidateSpanFilterPatternRequest,ValidateSpanFilterPatternResponse> handler)
Validates the Span Filter pattern (filterText) for syntactic correctness.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.AutoCloseable
close
-
Methods inherited from interface com.oracle.bmc.apmconfig.ConfigAsync
getEndpoint, refreshClient, setEndpoint, useRealmSpecificEndpointTemplate
-
-
-
-
Constructor Detail
-
ConfigAsyncClient
@Deprecated public ConfigAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeConfigAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)
-
ConfigAsyncClient
@Deprecated public ConfigAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeConfigAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
-
ConfigAsyncClient
@Deprecated public ConfigAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeConfigAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
-
ConfigAsyncClient
@Deprecated public ConfigAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeConfigAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
-ClientBuilderBase.requestSignerFactory
-
ConfigAsyncClient
@Deprecated public ConfigAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeConfigAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
-ClientBuilderBase.requestSignerFactory
additionalClientConfigurators
-ClientBuilderBase.additionalClientConfigurators
-
ConfigAsyncClient
@Deprecated public ConfigAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeConfigAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
-ClientBuilderBase.requestSignerFactory
additionalClientConfigurators
-ClientBuilderBase.additionalClientConfigurators
endpoint
-ClientBuilderBase.endpoint(java.lang.String)
-
ConfigAsyncClient
@Deprecated public ConfigAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, Map<SigningStrategy,RequestSignerFactory> signingStrategyRequestSignerFactories, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeConfigAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
-ClientBuilderBase.requestSignerFactory
additionalClientConfigurators
-ClientBuilderBase.additionalClientConfigurators
endpoint
-ClientBuilderBase.endpoint(java.lang.String)
signingStrategyRequestSignerFactories
-ClientBuilderBase.signingStrategyRequestSignerFactories
-
-
Method Detail
-
builder
public static ConfigAsyncClient.Builder builder()
Create a builder for this client.- Returns:
- builder
-
setRegion
public void setRegion(Region region)
Description copied from interface:ConfigAsync
Sets the region to call (ex, Region.US_PHOENIX_1).Note, this will call
setEndpoint
after resolving the endpoint. If the service is not available in this region, however, an IllegalArgumentException will be raised.- Specified by:
setRegion
in interfaceConfigAsync
- Parameters:
region
- The region of the service.
-
setRegion
public void setRegion(String regionId)
Description copied from interface:ConfigAsync
Sets the region to call (ex, ‘us-phoenix-1’).Note, this will first try to map the region ID to a known Region and call
setRegion
.If no known Region could be determined, it will create an endpoint based on the default endpoint format (
Region.formatDefaultRegionEndpoint(Service, String)
and then callsetEndpoint
.- Specified by:
setRegion
in interfaceConfigAsync
- Parameters:
regionId
- The public region ID.
-
copyConfiguration
public Future<CopyConfigurationResponse> copyConfiguration(CopyConfigurationRequest request, AsyncHandler<CopyConfigurationRequest,CopyConfigurationResponse> handler)
Description copied from interface:ConfigAsync
Fast importing configuration items to a destination APM domain ID.- Specified by:
copyConfiguration
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
createConfig
public Future<CreateConfigResponse> createConfig(CreateConfigRequest request, AsyncHandler<CreateConfigRequest,CreateConfigResponse> handler)
Description copied from interface:ConfigAsync
Creates a new configuration item.- Specified by:
createConfig
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
deleteConfig
public Future<DeleteConfigResponse> deleteConfig(DeleteConfigRequest request, AsyncHandler<DeleteConfigRequest,DeleteConfigResponse> handler)
Description copied from interface:ConfigAsync
Deletes the configuration item identified by the OCID.- Specified by:
deleteConfig
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
exportConfiguration
public Future<ExportConfigurationResponse> exportConfiguration(ExportConfigurationRequest request, AsyncHandler<ExportConfigurationRequest,ExportConfigurationResponse> handler)
Description copied from interface:ConfigAsync
Exports configurations for the whole domain by domainId.- Specified by:
exportConfiguration
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getConfig
public Future<GetConfigResponse> getConfig(GetConfigRequest request, AsyncHandler<GetConfigRequest,GetConfigResponse> handler)
Description copied from interface:ConfigAsync
Gets the configuration item identified by the OCID.- Specified by:
getConfig
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
importConfiguration
public Future<ImportConfigurationResponse> importConfiguration(ImportConfigurationRequest request, AsyncHandler<ImportConfigurationRequest,ImportConfigurationResponse> handler)
Description copied from interface:ConfigAsync
Import configurations Item(s) with its dependencies into a destination domain.- Specified by:
importConfiguration
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listConfigs
public Future<ListConfigsResponse> listConfigs(ListConfigsRequest request, AsyncHandler<ListConfigsRequest,ListConfigsResponse> handler)
Description copied from interface:ConfigAsync
Returns all configuration items, which can optionally be filtered by configuration type.- Specified by:
listConfigs
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
retrieveNamespaceMetrics
public Future<RetrieveNamespaceMetricsResponse> retrieveNamespaceMetrics(RetrieveNamespaceMetricsRequest request, AsyncHandler<RetrieveNamespaceMetricsRequest,RetrieveNamespaceMetricsResponse> handler)
Description copied from interface:ConfigAsync
Returns all metrics associated with the specified namespace.- Specified by:
retrieveNamespaceMetrics
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
retrieveNamespaces
public Future<RetrieveNamespacesResponse> retrieveNamespaces(RetrieveNamespacesRequest request, AsyncHandler<RetrieveNamespacesRequest,RetrieveNamespacesResponse> handler)
Description copied from interface:ConfigAsync
Returns all namespaces available in APM.- Specified by:
retrieveNamespaces
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
test
public Future<TestResponse> test(TestRequest request, AsyncHandler<TestRequest,TestResponse> handler)
Description copied from interface:ConfigAsync
Tests a data processing operation on the provided input, returning the potentially modified input as output.Returns 200 on success, 422 when the input can not be processed.
- Specified by:
test
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
updateConfig
public Future<UpdateConfigResponse> updateConfig(UpdateConfigRequest request, AsyncHandler<UpdateConfigRequest,UpdateConfigResponse> handler)
Description copied from interface:ConfigAsync
Updates the details of the configuration item identified by the OCID.- Specified by:
updateConfig
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
validateSpanFilterPattern
public Future<ValidateSpanFilterPatternResponse> validateSpanFilterPattern(ValidateSpanFilterPatternRequest request, AsyncHandler<ValidateSpanFilterPatternRequest,ValidateSpanFilterPatternResponse> handler)
Description copied from interface:ConfigAsync
Validates the Span Filter pattern (filterText) for syntactic correctness.Returns 204 on success, 422 when validation fails.
- Specified by:
validateSpanFilterPattern
in interfaceConfigAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getDefaultConfigurator
protected ClientConfigurator getDefaultConfigurator()
-
useRealmSpecificEndpointTemplate
public void useRealmSpecificEndpointTemplate(boolean useOfRealmSpecificEndpointTemplateEnabled)
This method should be used to enable or disable the use of realm-specific endpoint template.The default value is null. To enable the use of endpoint template defined for the realm in use, set the flag to true To disable the use of endpoint template defined for the realm in use, set the flag to false
- Parameters:
useOfRealmSpecificEndpointTemplateEnabled
- This flag can be set to true or false to enable or disable the use of realm-specific endpoint template respectively
-
populateServiceParametersInEndpoint
public final void populateServiceParametersInEndpoint(String endpoint, Map<String,Object> requiredParametersMap)
Populate the parameters in the endpoint with its corresponding value and update the base endpoint.The value will be populated iff the parameter in endpoint is a required request path parameter or a required request query parameter. If not, the parameter in the endpoint will be ignored and left blank.
- Parameters:
endpoint
- The endpoint template in userequiredParametersMap
- Map of parameter name as key and value set in request path or query parameter as value
-
updateBaseEndpoint
public final void updateBaseEndpoint(String endpoint)
This method should be used for parameterized endpoint templates only.This does not include {region} and {secondLevelDomain} parameters.
- Parameters:
endpoint
- The updated endpoint to use
-
setEndpoint
public final void setEndpoint(String endpoint)
-
getEndpoint
public final String getEndpoint()
-
refreshClient
public final void refreshClient()
Rebuild the backingHttpClient
.This will call
ClientConfigurator
s again, and can be used to e.g. refresh the SSL certificate.
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
getClientCommonLibraryVersion
public String getClientCommonLibraryVersion()
-
getMinimumClientCommonLibraryVersionFromClient
public Optional<String> getMinimumClientCommonLibraryVersionFromClient()
-
clientCall
protected <REQ extends BmcRequest<?>,RESP extends BmcResponse,RESP_BUILDER extends BmcResponse.Builder<RESP>> ClientCall<REQ,RESP,RESP_BUILDER> clientCall(REQ request, Supplier<RESP_BUILDER> responseBuilder)
-
-