com.oracle.bmc.oda.OdaAsyncClient Maven / Gradle / Ivy
/**
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/
package com.oracle.bmc.oda;
import com.oracle.bmc.oda.internal.http.*;
import com.oracle.bmc.oda.requests.*;
import com.oracle.bmc.oda.responses.*;
/**
* Async client implementation for Oda service.
* There are two ways to use async client:
* 1. Use AsyncHandler: using AsyncHandler, if the response to the call is an {@link java.io.InputStream}, 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
*/
@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20190506")
public class OdaAsyncClient implements OdaAsync {
/**
* Service instance for Oda.
*/
public static final com.oracle.bmc.Service SERVICE =
com.oracle.bmc.Services.serviceBuilder()
.serviceName("ODA")
.serviceEndpointPrefix("")
.serviceEndpointTemplate(
"https://digitalassistant-api.{region}.oci.{secondLevelDomain}")
.build();
private static final org.slf4j.Logger LOG =
org.slf4j.LoggerFactory.getLogger(OdaAsyncClient.class);
private final com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider
authenticationDetailsProvider;
private final org.glassfish.jersey.apache.connector.ApacheConnectionClosingStrategy
apacheConnectionClosingStrategy;
private final com.oracle.bmc.http.internal.RestClientFactory restClientFactory;
private final com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory;
private final java.util.Map<
com.oracle.bmc.http.signing.SigningStrategy,
com.oracle.bmc.http.signing.RequestSignerFactory>
signingStrategyRequestSignerFactories;
private final boolean isNonBufferingApacheClient;
private final com.oracle.bmc.ClientConfiguration clientConfigurationToUse;
private String regionId;
/**
* Used to synchronize any updates on the `this.client` object.
*/
private final Object clientUpdate = new Object();
/**
* Stores the actual client object used to make the API calls.
* Note: This object can get refreshed periodically, hence it's important to keep any updates synchronized.
* For any writes to the object, please synchronize on `this.clientUpdate`.
*/
private volatile com.oracle.bmc.http.internal.RestClient client;
/**
* Keeps track of the last endpoint that was assigned to the client, which in turn can be used when the client is refreshed.
* Note: Always synchronize on `this.clientUpdate` when reading/writing this field.
*/
private volatile String overrideEndpoint = null;
/**
* Creates a new service instance using the given authentication provider.
* @param authenticationDetailsProvider The authentication details provider, required.
*/
public OdaAsyncClient(
com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider) {
this(authenticationDetailsProvider, null);
}
/**
* Creates a new service instance using the given authentication provider and client configuration.
* @param authenticationDetailsProvider The authentication details provider, required.
* @param configuration The client configuration, optional.
*/
public OdaAsyncClient(
com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider,
com.oracle.bmc.ClientConfiguration configuration) {
this(authenticationDetailsProvider, configuration, null);
}
/**
* Creates a new service instance using the given authentication provider and client configuration. Additionally,
* a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization.
* @param authenticationDetailsProvider The authentication details provider, required.
* @param configuration The client configuration, optional.
* @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional.
*/
public OdaAsyncClient(
com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider,
com.oracle.bmc.ClientConfiguration configuration,
com.oracle.bmc.http.ClientConfigurator clientConfigurator) {
this(
authenticationDetailsProvider,
configuration,
clientConfigurator,
new com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory(
com.oracle.bmc.http.signing.SigningStrategy.STANDARD));
}
/**
* Creates a new service instance using the given authentication provider and client configuration. Additionally,
* a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization.
*
* This is an advanced constructor for clients that want to take control over how requests are signed.
* @param authenticationDetailsProvider The authentication details provider, required.
* @param configuration The client configuration, optional.
* @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional.
* @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service.
*/
public OdaAsyncClient(
com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider,
com.oracle.bmc.ClientConfiguration configuration,
com.oracle.bmc.http.ClientConfigurator clientConfigurator,
com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory) {
this(
authenticationDetailsProvider,
configuration,
clientConfigurator,
defaultRequestSignerFactory,
new java.util.ArrayList());
}
/**
* Creates a new service instance using the given authentication provider and client configuration. Additionally,
* a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization.
*
* This is an advanced constructor for clients that want to take control over how requests are signed.
* @param authenticationDetailsProvider The authentication details provider, required.
* @param configuration The client configuration, optional.
* @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional.
* @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service.
* @param additionalClientConfigurators Additional client configurators to be run after the primary configurator.
*/
public OdaAsyncClient(
com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider,
com.oracle.bmc.ClientConfiguration configuration,
com.oracle.bmc.http.ClientConfigurator clientConfigurator,
com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory,
java.util.List additionalClientConfigurators) {
this(
authenticationDetailsProvider,
configuration,
clientConfigurator,
defaultRequestSignerFactory,
additionalClientConfigurators,
null);
}
/**
* Creates a new service instance using the given authentication provider and client configuration. Additionally,
* a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization.
*
* This is an advanced constructor for clients that want to take control over how requests are signed.
* @param authenticationDetailsProvider The authentication details provider, required.
* @param configuration The client configuration, optional.
* @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional.
* @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service.
* @param additionalClientConfigurators Additional client configurators to be run after the primary configurator.
* @param endpoint Endpoint, or null to leave unset (note, may be overridden by {@code authenticationDetailsProvider})
*/
public OdaAsyncClient(
com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider,
com.oracle.bmc.ClientConfiguration configuration,
com.oracle.bmc.http.ClientConfigurator clientConfigurator,
com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory,
java.util.List additionalClientConfigurators,
String endpoint) {
this(
authenticationDetailsProvider,
configuration,
clientConfigurator,
defaultRequestSignerFactory,
com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory
.createDefaultRequestSignerFactories(),
additionalClientConfigurators,
endpoint);
}
/**
* Creates a new service instance using the given authentication provider and client configuration. Additionally,
* a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization.
*
* This is an advanced constructor for clients that want to take control over how requests are signed.
* @param authenticationDetailsProvider The authentication details provider, required.
* @param configuration The client configuration, optional.
* @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional.
* @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service.
* @param signingStrategyRequestSignerFactories The request signer factories for each signing strategy used to create the request signer
* @param additionalClientConfigurators Additional client configurators to be run after the primary configurator.
* @param endpoint Endpoint, or null to leave unset (note, may be overridden by {@code authenticationDetailsProvider})
*/
public OdaAsyncClient(
com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider,
com.oracle.bmc.ClientConfiguration configuration,
com.oracle.bmc.http.ClientConfigurator clientConfigurator,
com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory,
java.util.Map<
com.oracle.bmc.http.signing.SigningStrategy,
com.oracle.bmc.http.signing.RequestSignerFactory>
signingStrategyRequestSignerFactories,
java.util.List additionalClientConfigurators,
String endpoint) {
this(
authenticationDetailsProvider,
configuration,
clientConfigurator,
defaultRequestSignerFactory,
signingStrategyRequestSignerFactories,
additionalClientConfigurators,
endpoint,
com.oracle.bmc.http.internal.RestClientFactoryBuilder.builder());
}
/**
* Creates a new service instance using the given authentication provider and client configuration. Additionally,
* a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization.
*
* This is an advanced constructor for clients that want to take control over how requests are signed.
* @param authenticationDetailsProvider The authentication details provider, required.
* @param configuration The client configuration, optional.
* @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional.
* @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service.
* @param signingStrategyRequestSignerFactories The request signer factories for each signing strategy used to create the request signer
* @param additionalClientConfigurators Additional client configurators to be run after the primary configurator.
* @param endpoint Endpoint, or null to leave unset (note, may be overridden by {@code authenticationDetailsProvider})
* @param restClientFactoryBuilder the builder for the {@link com.oracle.bmc.http.internal.RestClientFactory}
*/
public OdaAsyncClient(
com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider,
com.oracle.bmc.ClientConfiguration configuration,
com.oracle.bmc.http.ClientConfigurator clientConfigurator,
com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory,
java.util.Map<
com.oracle.bmc.http.signing.SigningStrategy,
com.oracle.bmc.http.signing.RequestSignerFactory>
signingStrategyRequestSignerFactories,
java.util.List additionalClientConfigurators,
String endpoint,
com.oracle.bmc.http.internal.RestClientFactoryBuilder restClientFactoryBuilder) {
this.authenticationDetailsProvider = authenticationDetailsProvider;
java.util.List authenticationDetailsConfigurators =
new java.util.ArrayList<>();
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.ProvidesClientConfigurators) {
authenticationDetailsConfigurators.addAll(
((com.oracle.bmc.auth.ProvidesClientConfigurators)
this.authenticationDetailsProvider)
.getClientConfigurators());
}
java.util.List allConfigurators =
new java.util.ArrayList<>(additionalClientConfigurators);
allConfigurators.addAll(authenticationDetailsConfigurators);
this.restClientFactory =
restClientFactoryBuilder
.clientConfigurator(clientConfigurator)
.additionalClientConfigurators(allConfigurators)
.build();
this.isNonBufferingApacheClient =
com.oracle.bmc.http.ApacheUtils.isNonBufferingClientConfigurator(
restClientFactory.getClientConfigurator());
this.apacheConnectionClosingStrategy =
com.oracle.bmc.http.ApacheUtils.getApacheConnectionClosingStrategy(
restClientFactory.getClientConfigurator());
this.defaultRequestSignerFactory = defaultRequestSignerFactory;
this.signingStrategyRequestSignerFactories = signingStrategyRequestSignerFactories;
this.clientConfigurationToUse = configuration;
this.refreshClient();
if (this.authenticationDetailsProvider instanceof com.oracle.bmc.auth.RegionProvider) {
com.oracle.bmc.auth.RegionProvider provider =
(com.oracle.bmc.auth.RegionProvider) this.authenticationDetailsProvider;
if (provider.getRegion() != null) {
this.regionId = provider.getRegion().getRegionId();
this.setRegion(provider.getRegion());
if (endpoint != null) {
LOG.info(
"Authentication details provider configured for region '{}', but endpoint specifically set to '{}'. Using endpoint setting instead of region.",
provider.getRegion(),
endpoint);
}
}
}
if (endpoint != null) {
setEndpoint(endpoint);
}
}
/**
* Create a builder for this client.
* @return builder
*/
public static Builder builder() {
return new Builder(SERVICE);
}
/**
* Builder class for this client. The "authenticationDetailsProvider" is required and must be passed to the
* {@link #build(AbstractAuthenticationDetailsProvider)} method.
*/
public static class Builder
extends com.oracle.bmc.common.RegionalClientBuilder {
private Builder(com.oracle.bmc.Service service) {
super(service);
requestSignerFactory =
new com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory(
com.oracle.bmc.http.signing.SigningStrategy.STANDARD);
}
/**
* Build the client.
* @param authenticationDetailsProvider authentication details provider
* @return the client
*/
public OdaAsyncClient build(
@javax.annotation.Nonnull
com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider
authenticationDetailsProvider) {
if (authenticationDetailsProvider == null) {
throw new NullPointerException(
"authenticationDetailsProvider is marked non-null but is null");
}
return new OdaAsyncClient(
authenticationDetailsProvider,
configuration,
clientConfigurator,
requestSignerFactory,
signingStrategyRequestSignerFactories,
additionalClientConfigurators,
endpoint);
}
}
com.oracle.bmc.http.internal.RestClient getClient() {
return client;
}
@Override
public void refreshClient() {
LOG.info("Refreshing client '{}'.", this.client != null ? this.client.getClass() : null);
com.oracle.bmc.http.signing.RequestSigner defaultRequestSigner =
this.defaultRequestSignerFactory.createRequestSigner(
SERVICE, this.authenticationDetailsProvider);
java.util.Map<
com.oracle.bmc.http.signing.SigningStrategy,
com.oracle.bmc.http.signing.RequestSigner>
requestSigners = new java.util.HashMap<>();
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.BasicAuthenticationDetailsProvider) {
for (com.oracle.bmc.http.signing.SigningStrategy s :
com.oracle.bmc.http.signing.SigningStrategy.values()) {
requestSigners.put(
s,
this.signingStrategyRequestSignerFactories
.get(s)
.createRequestSigner(SERVICE, authenticationDetailsProvider));
}
}
com.oracle.bmc.http.internal.RestClient refreshedClient =
this.restClientFactory.create(
defaultRequestSigner,
requestSigners,
this.clientConfigurationToUse,
this.isNonBufferingApacheClient);
synchronized (clientUpdate) {
if (this.overrideEndpoint != null) {
refreshedClient.setEndpoint(this.overrideEndpoint);
}
this.client = refreshedClient;
}
LOG.info("Refreshed client '{}'.", this.client != null ? this.client.getClass() : null);
}
@Override
public void setEndpoint(String endpoint) {
LOG.info("Setting endpoint to {}", endpoint);
synchronized (clientUpdate) {
this.overrideEndpoint = endpoint;
client.setEndpoint(endpoint);
}
}
@Override
public String getEndpoint() {
String endpoint = null;
java.net.URI uri = client.getBaseTarget().getUri();
if (uri != null) {
endpoint = uri.toString();
}
return endpoint;
}
@Override
public void setRegion(com.oracle.bmc.Region region) {
this.regionId = region.getRegionId();
java.util.Optional endpoint =
com.oracle.bmc.internal.GuavaUtils.adaptFromGuava(region.getEndpoint(SERVICE));
if (endpoint.isPresent()) {
setEndpoint(endpoint.get());
} else {
throw new IllegalArgumentException(
"Endpoint for " + SERVICE + " is not known in region " + region);
}
}
@Override
public void setRegion(String regionId) {
regionId = regionId.toLowerCase(java.util.Locale.ENGLISH);
this.regionId = regionId;
try {
com.oracle.bmc.Region region = com.oracle.bmc.Region.fromRegionId(regionId);
setRegion(region);
} catch (IllegalArgumentException e) {
LOG.info("Unknown regionId '{}', falling back to default endpoint format", regionId);
String endpoint = com.oracle.bmc.Region.formatDefaultRegionEndpoint(SERVICE, regionId);
setEndpoint(endpoint);
}
}
/**
* 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
*
* @param useOfRealmSpecificEndpointTemplateEnabled This flag can be set to true or false to
* enable or disable the use of realm-specific endpoint template respectively
*/
public synchronized void useRealmSpecificEndpointTemplate(
boolean useOfRealmSpecificEndpointTemplateEnabled) {
setEndpoint(
com.oracle.bmc.util.RealmSpecificEndpointTemplateUtils
.getRealmSpecificEndpointTemplate(
useOfRealmSpecificEndpointTemplateEnabled, this.regionId, SERVICE));
}
@Override
public void close() {
client.close();
}
@Override
public java.util.concurrent.Future
changeOdaInstanceCompartment(
ChangeOdaInstanceCompartmentRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ChangeOdaInstanceCompartmentRequest,
ChangeOdaInstanceCompartmentResponse>
handler) {
LOG.trace("Called async changeOdaInstanceCompartment");
final ChangeOdaInstanceCompartmentRequest interceptedRequest =
ChangeOdaInstanceCompartmentConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ChangeOdaInstanceCompartmentConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"ChangeOdaInstanceCompartment",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstance/ChangeOdaInstanceCompartment");
final java.util.function.Function<
javax.ws.rs.core.Response, ChangeOdaInstanceCompartmentResponse>
transformer =
ChangeOdaInstanceCompartmentConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler<
ChangeOdaInstanceCompartmentRequest, ChangeOdaInstanceCompartmentResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ChangeOdaInstanceCompartmentRequest,
ChangeOdaInstanceCompartmentResponse>,
java.util.concurrent.Future>
futureSupplier =
client.postFutureSupplier(
interceptedRequest,
interceptedRequest.getChangeOdaInstanceCompartmentDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
ChangeOdaInstanceCompartmentRequest, ChangeOdaInstanceCompartmentResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future createOdaInstance(
CreateOdaInstanceRequest request,
final com.oracle.bmc.responses.AsyncHandler<
CreateOdaInstanceRequest, CreateOdaInstanceResponse>
handler) {
LOG.trace("Called async createOdaInstance");
final CreateOdaInstanceRequest interceptedRequest =
CreateOdaInstanceConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
CreateOdaInstanceConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda", "CreateOdaInstance", ib.getRequestUri().toString(), "");
final java.util.function.Function
transformer =
CreateOdaInstanceConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
CreateOdaInstanceRequest, CreateOdaInstanceResponse>,
java.util.concurrent.Future>
futureSupplier =
client.postFutureSupplier(
interceptedRequest,
interceptedRequest.getCreateOdaInstanceDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
CreateOdaInstanceRequest, CreateOdaInstanceResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future
createOdaInstanceAttachment(
CreateOdaInstanceAttachmentRequest request,
final com.oracle.bmc.responses.AsyncHandler<
CreateOdaInstanceAttachmentRequest,
CreateOdaInstanceAttachmentResponse>
handler) {
LOG.trace("Called async createOdaInstanceAttachment");
final CreateOdaInstanceAttachmentRequest interceptedRequest =
CreateOdaInstanceAttachmentConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
CreateOdaInstanceAttachmentConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"CreateOdaInstanceAttachment",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstanceAttachment/CreateOdaInstanceAttachment");
final java.util.function.Function<
javax.ws.rs.core.Response, CreateOdaInstanceAttachmentResponse>
transformer =
CreateOdaInstanceAttachmentConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler<
CreateOdaInstanceAttachmentRequest, CreateOdaInstanceAttachmentResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
CreateOdaInstanceAttachmentRequest,
CreateOdaInstanceAttachmentResponse>,
java.util.concurrent.Future>
futureSupplier =
client.postFutureSupplier(
interceptedRequest,
interceptedRequest.getCreateOdaInstanceAttachmentDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
CreateOdaInstanceAttachmentRequest, CreateOdaInstanceAttachmentResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future deleteOdaInstance(
DeleteOdaInstanceRequest request,
final com.oracle.bmc.responses.AsyncHandler<
DeleteOdaInstanceRequest, DeleteOdaInstanceResponse>
handler) {
LOG.trace("Called async deleteOdaInstance");
final DeleteOdaInstanceRequest interceptedRequest =
DeleteOdaInstanceConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
DeleteOdaInstanceConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"DeleteOdaInstance",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstance/DeleteOdaInstance");
final java.util.function.Function
transformer =
DeleteOdaInstanceConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
DeleteOdaInstanceRequest, DeleteOdaInstanceResponse>,
java.util.concurrent.Future>
futureSupplier = client.deleteFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
DeleteOdaInstanceRequest, DeleteOdaInstanceResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future
deleteOdaInstanceAttachment(
DeleteOdaInstanceAttachmentRequest request,
final com.oracle.bmc.responses.AsyncHandler<
DeleteOdaInstanceAttachmentRequest,
DeleteOdaInstanceAttachmentResponse>
handler) {
LOG.trace("Called async deleteOdaInstanceAttachment");
final DeleteOdaInstanceAttachmentRequest interceptedRequest =
DeleteOdaInstanceAttachmentConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
DeleteOdaInstanceAttachmentConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"DeleteOdaInstanceAttachment",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstanceAttachment/DeleteOdaInstanceAttachment");
final java.util.function.Function<
javax.ws.rs.core.Response, DeleteOdaInstanceAttachmentResponse>
transformer =
DeleteOdaInstanceAttachmentConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler<
DeleteOdaInstanceAttachmentRequest, DeleteOdaInstanceAttachmentResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
DeleteOdaInstanceAttachmentRequest,
DeleteOdaInstanceAttachmentResponse>,
java.util.concurrent.Future>
futureSupplier = client.deleteFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
DeleteOdaInstanceAttachmentRequest, DeleteOdaInstanceAttachmentResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future getOdaInstance(
GetOdaInstanceRequest request,
final com.oracle.bmc.responses.AsyncHandler<
GetOdaInstanceRequest, GetOdaInstanceResponse>
handler) {
LOG.trace("Called async getOdaInstance");
final GetOdaInstanceRequest interceptedRequest =
GetOdaInstanceConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
GetOdaInstanceConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"GetOdaInstance",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstance/GetOdaInstance");
final java.util.function.Function
transformer =
GetOdaInstanceConverter.fromResponse(java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
GetOdaInstanceRequest, GetOdaInstanceResponse>,
java.util.concurrent.Future>
futureSupplier = client.getFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
GetOdaInstanceRequest, GetOdaInstanceResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future getOdaInstanceAttachment(
GetOdaInstanceAttachmentRequest request,
final com.oracle.bmc.responses.AsyncHandler<
GetOdaInstanceAttachmentRequest, GetOdaInstanceAttachmentResponse>
handler) {
LOG.trace("Called async getOdaInstanceAttachment");
final GetOdaInstanceAttachmentRequest interceptedRequest =
GetOdaInstanceAttachmentConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
GetOdaInstanceAttachmentConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"GetOdaInstanceAttachment",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstanceAttachment/GetOdaInstanceAttachment");
final java.util.function.Function<
javax.ws.rs.core.Response, GetOdaInstanceAttachmentResponse>
transformer =
GetOdaInstanceAttachmentConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler<
GetOdaInstanceAttachmentRequest, GetOdaInstanceAttachmentResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
GetOdaInstanceAttachmentRequest, GetOdaInstanceAttachmentResponse>,
java.util.concurrent.Future>
futureSupplier = client.getFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
GetOdaInstanceAttachmentRequest, GetOdaInstanceAttachmentResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future getWorkRequest(
GetWorkRequestRequest request,
final com.oracle.bmc.responses.AsyncHandler<
GetWorkRequestRequest, GetWorkRequestResponse>
handler) {
LOG.trace("Called async getWorkRequest");
final GetWorkRequestRequest interceptedRequest =
GetWorkRequestConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
GetWorkRequestConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"GetWorkRequest",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/WorkRequest/GetWorkRequest");
final java.util.function.Function
transformer =
GetWorkRequestConverter.fromResponse(java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
GetWorkRequestRequest, GetWorkRequestResponse>,
java.util.concurrent.Future>
futureSupplier = client.getFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
GetWorkRequestRequest, GetWorkRequestResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future
listOdaInstanceAttachments(
ListOdaInstanceAttachmentsRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ListOdaInstanceAttachmentsRequest,
ListOdaInstanceAttachmentsResponse>
handler) {
LOG.trace("Called async listOdaInstanceAttachments");
final ListOdaInstanceAttachmentsRequest interceptedRequest =
ListOdaInstanceAttachmentsConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ListOdaInstanceAttachmentsConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"ListOdaInstanceAttachments",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstanceAttachmentCollection/ListOdaInstanceAttachments");
final java.util.function.Function<
javax.ws.rs.core.Response, ListOdaInstanceAttachmentsResponse>
transformer =
ListOdaInstanceAttachmentsConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler<
ListOdaInstanceAttachmentsRequest, ListOdaInstanceAttachmentsResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ListOdaInstanceAttachmentsRequest,
ListOdaInstanceAttachmentsResponse>,
java.util.concurrent.Future>
futureSupplier = client.getFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
ListOdaInstanceAttachmentsRequest, ListOdaInstanceAttachmentsResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future listOdaInstances(
ListOdaInstancesRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ListOdaInstancesRequest, ListOdaInstancesResponse>
handler) {
LOG.trace("Called async listOdaInstances");
final ListOdaInstancesRequest interceptedRequest =
ListOdaInstancesConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ListOdaInstancesConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"ListOdaInstances",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstanceSummary/ListOdaInstances");
final java.util.function.Function
transformer =
ListOdaInstancesConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ListOdaInstancesRequest, ListOdaInstancesResponse>,
java.util.concurrent.Future>
futureSupplier = client.getFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
ListOdaInstancesRequest, ListOdaInstancesResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future listWorkRequestErrors(
ListWorkRequestErrorsRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestErrorsRequest, ListWorkRequestErrorsResponse>
handler) {
LOG.trace("Called async listWorkRequestErrors");
final ListWorkRequestErrorsRequest interceptedRequest =
ListWorkRequestErrorsConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ListWorkRequestErrorsConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"ListWorkRequestErrors",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/WorkRequestError/ListWorkRequestErrors");
final java.util.function.Function
transformer =
ListWorkRequestErrorsConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestErrorsRequest, ListWorkRequestErrorsResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestErrorsRequest, ListWorkRequestErrorsResponse>,
java.util.concurrent.Future>
futureSupplier = client.getFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
ListWorkRequestErrorsRequest, ListWorkRequestErrorsResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future listWorkRequestLogs(
ListWorkRequestLogsRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestLogsRequest, ListWorkRequestLogsResponse>
handler) {
LOG.trace("Called async listWorkRequestLogs");
final ListWorkRequestLogsRequest interceptedRequest =
ListWorkRequestLogsConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ListWorkRequestLogsConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"ListWorkRequestLogs",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/WorkRequestLogEntry/ListWorkRequestLogs");
final java.util.function.Function
transformer =
ListWorkRequestLogsConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestLogsRequest, ListWorkRequestLogsResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestLogsRequest, ListWorkRequestLogsResponse>,
java.util.concurrent.Future>
futureSupplier = client.getFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
ListWorkRequestLogsRequest, ListWorkRequestLogsResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future listWorkRequests(
ListWorkRequestsRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestsRequest, ListWorkRequestsResponse>
handler) {
LOG.trace("Called async listWorkRequests");
final ListWorkRequestsRequest interceptedRequest =
ListWorkRequestsConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ListWorkRequestsConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"ListWorkRequests",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/WorkRequest/ListWorkRequests");
final java.util.function.Function
transformer =
ListWorkRequestsConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestsRequest, ListWorkRequestsResponse>,
java.util.concurrent.Future>
futureSupplier = client.getFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
ListWorkRequestsRequest, ListWorkRequestsResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future startOdaInstance(
StartOdaInstanceRequest request,
final com.oracle.bmc.responses.AsyncHandler<
StartOdaInstanceRequest, StartOdaInstanceResponse>
handler) {
LOG.trace("Called async startOdaInstance");
final StartOdaInstanceRequest interceptedRequest =
StartOdaInstanceConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
StartOdaInstanceConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"StartOdaInstance",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstance/StartOdaInstance");
final java.util.function.Function
transformer =
StartOdaInstanceConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
StartOdaInstanceRequest, StartOdaInstanceResponse>,
java.util.concurrent.Future>
futureSupplier = client.postFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
StartOdaInstanceRequest, StartOdaInstanceResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future stopOdaInstance(
StopOdaInstanceRequest request,
final com.oracle.bmc.responses.AsyncHandler<
StopOdaInstanceRequest, StopOdaInstanceResponse>
handler) {
LOG.trace("Called async stopOdaInstance");
final StopOdaInstanceRequest interceptedRequest =
StopOdaInstanceConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
StopOdaInstanceConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"StopOdaInstance",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstance/StopOdaInstance");
final java.util.function.Function
transformer =
StopOdaInstanceConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
StopOdaInstanceRequest, StopOdaInstanceResponse>,
java.util.concurrent.Future>
futureSupplier = client.postFutureSupplier(interceptedRequest, ib, transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
StopOdaInstanceRequest, StopOdaInstanceResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future updateOdaInstance(
UpdateOdaInstanceRequest request,
final com.oracle.bmc.responses.AsyncHandler<
UpdateOdaInstanceRequest, UpdateOdaInstanceResponse>
handler) {
LOG.trace("Called async updateOdaInstance");
final UpdateOdaInstanceRequest interceptedRequest =
UpdateOdaInstanceConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
UpdateOdaInstanceConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"UpdateOdaInstance",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstance/UpdateOdaInstance");
final java.util.function.Function
transformer =
UpdateOdaInstanceConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
UpdateOdaInstanceRequest, UpdateOdaInstanceResponse>,
java.util.concurrent.Future>
futureSupplier =
client.putFutureSupplier(
interceptedRequest,
interceptedRequest.getUpdateOdaInstanceDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
UpdateOdaInstanceRequest, UpdateOdaInstanceResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future
updateOdaInstanceAttachment(
UpdateOdaInstanceAttachmentRequest request,
final com.oracle.bmc.responses.AsyncHandler<
UpdateOdaInstanceAttachmentRequest,
UpdateOdaInstanceAttachmentResponse>
handler) {
LOG.trace("Called async updateOdaInstanceAttachment");
final UpdateOdaInstanceAttachmentRequest interceptedRequest =
UpdateOdaInstanceAttachmentConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
UpdateOdaInstanceAttachmentConverter.fromRequest(client, interceptedRequest);
com.oracle.bmc.ServiceDetails serviceDetails =
new com.oracle.bmc.ServiceDetails(
"Oda",
"UpdateOdaInstanceAttachment",
ib.getRequestUri().toString(),
"https://docs.oracle.com/iaas/api/#/en/digital-assistant/20190506/OdaInstanceAttachment/UpdateOdaInstanceAttachment");
final java.util.function.Function<
javax.ws.rs.core.Response, UpdateOdaInstanceAttachmentResponse>
transformer =
UpdateOdaInstanceAttachmentConverter.fromResponse(
java.util.Optional.of(serviceDetails));
com.oracle.bmc.responses.AsyncHandler<
UpdateOdaInstanceAttachmentRequest, UpdateOdaInstanceAttachmentResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
UpdateOdaInstanceAttachmentRequest,
UpdateOdaInstanceAttachmentResponse>,
java.util.concurrent.Future>
futureSupplier =
client.putFutureSupplier(
interceptedRequest,
interceptedRequest.getUpdateOdaInstanceAttachmentDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
UpdateOdaInstanceAttachmentRequest, UpdateOdaInstanceAttachmentResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
}