com.oracle.bmc.apigateway.ApiGatewayAsyncClient Maven / Gradle / Ivy
Show all versions of oci-java-sdk-apigateway Show documentation
/**
* Copyright (c) 2016, 2021, 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.apigateway;
import com.oracle.bmc.apigateway.internal.http.*;
import com.oracle.bmc.apigateway.requests.*;
import com.oracle.bmc.apigateway.responses.*;
/**
* Async client implementation for ApiGateway 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: 20190501")
@lombok.extern.slf4j.Slf4j
public class ApiGatewayAsyncClient implements ApiGatewayAsync {
/**
* Service instance for ApiGateway.
*/
public static final com.oracle.bmc.Service SERVICE =
com.oracle.bmc.Services.serviceBuilder()
.serviceName("APIGATEWAY")
.serviceEndpointPrefix("")
.serviceEndpointTemplate("https://apigateway.{region}.oci.{secondLevelDomain}")
.build();
@lombok.Getter(value = lombok.AccessLevel.PACKAGE)
private final com.oracle.bmc.http.internal.RestClient client;
private final com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider
authenticationDetailsProvider;
private final org.glassfish.jersey.apache.connector.ApacheConnectionClosingStrategy
apacheConnectionClosingStrategy;
/**
* Creates a new service instance using the given authentication provider.
* @param authenticationDetailsProvider The authentication details provider, required.
*/
public ApiGatewayAsyncClient(
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 ApiGatewayAsyncClient(
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 ApiGatewayAsyncClient(
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 ApiGatewayAsyncClient(
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 ApiGatewayAsyncClient(
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 ApiGatewayAsyncClient(
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 ApiGatewayAsyncClient(
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 ApiGatewayAsyncClient(
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);
com.oracle.bmc.http.internal.RestClientFactory restClientFactory =
restClientFactoryBuilder
.clientConfigurator(clientConfigurator)
.additionalClientConfigurators(allConfigurators)
.build();
boolean isNonBufferingApacheClient =
com.oracle.bmc.http.ApacheUtils.isNonBufferingClientConfigurator(
restClientFactory.getClientConfigurator());
this.apacheConnectionClosingStrategy =
com.oracle.bmc.http.ApacheUtils.getApacheConnectionClosingStrategy(
restClientFactory.getClientConfigurator());
com.oracle.bmc.http.signing.RequestSigner defaultRequestSigner =
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,
signingStrategyRequestSignerFactories
.get(s)
.createRequestSigner(SERVICE, authenticationDetailsProvider));
}
}
this.client =
restClientFactory.create(
defaultRequestSigner,
requestSigners,
configuration,
isNonBufferingApacheClient);
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.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 ApiGatewayAsyncClient build(
@lombok.NonNull
com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider
authenticationDetailsProvider) {
return new ApiGatewayAsyncClient(
authenticationDetailsProvider,
configuration,
clientConfigurator,
requestSignerFactory,
signingStrategyRequestSignerFactories,
additionalClientConfigurators,
endpoint);
}
}
@Override
public void setEndpoint(String endpoint) {
LOG.info("Setting endpoint to {}", 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) {
com.google.common.base.Optional endpoint = 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);
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);
}
}
@Override
public void close() {
client.close();
}
@Override
public java.util.concurrent.Future changeApiCompartment(
ChangeApiCompartmentRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ChangeApiCompartmentRequest, ChangeApiCompartmentResponse>
handler) {
LOG.trace("Called async changeApiCompartment");
final ChangeApiCompartmentRequest interceptedRequest =
ChangeApiCompartmentConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ChangeApiCompartmentConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function<
javax.ws.rs.core.Response, ChangeApiCompartmentResponse>
transformer = ChangeApiCompartmentConverter.fromResponse();
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.responses.AsyncHandler<
ChangeApiCompartmentRequest, ChangeApiCompartmentResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ChangeApiCompartmentRequest, ChangeApiCompartmentResponse>,
java.util.concurrent.Future>
futureSupplier =
client.postFutureSupplier(
interceptedRequest,
interceptedRequest.getChangeApiCompartmentDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
ChangeApiCompartmentRequest, ChangeApiCompartmentResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future
changeCertificateCompartment(
ChangeCertificateCompartmentRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ChangeCertificateCompartmentRequest,
ChangeCertificateCompartmentResponse>
handler) {
LOG.trace("Called async changeCertificateCompartment");
final ChangeCertificateCompartmentRequest interceptedRequest =
ChangeCertificateCompartmentConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ChangeCertificateCompartmentConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function<
javax.ws.rs.core.Response, ChangeCertificateCompartmentResponse>
transformer = ChangeCertificateCompartmentConverter.fromResponse();
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.responses.AsyncHandler<
ChangeCertificateCompartmentRequest, ChangeCertificateCompartmentResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ChangeCertificateCompartmentRequest,
ChangeCertificateCompartmentResponse>,
java.util.concurrent.Future>
futureSupplier =
client.postFutureSupplier(
interceptedRequest,
interceptedRequest.getChangeCertificateCompartmentDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
ChangeCertificateCompartmentRequest, ChangeCertificateCompartmentResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future createApi(
CreateApiRequest request,
final com.oracle.bmc.responses.AsyncHandler
handler) {
LOG.trace("Called async createApi");
final CreateApiRequest interceptedRequest = CreateApiConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
CreateApiConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = CreateApiConverter.fromResponse();
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.responses.AsyncHandler handlerToUse =
handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
java.util.concurrent.Future>
futureSupplier =
client.postFutureSupplier(
interceptedRequest,
interceptedRequest.getCreateApiDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
CreateApiRequest, CreateApiResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future createCertificate(
CreateCertificateRequest request,
final com.oracle.bmc.responses.AsyncHandler<
CreateCertificateRequest, CreateCertificateResponse>
handler) {
LOG.trace("Called async createCertificate");
final CreateCertificateRequest interceptedRequest =
CreateCertificateConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
CreateCertificateConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = CreateCertificateConverter.fromResponse();
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
CreateCertificateRequest, CreateCertificateResponse>,
java.util.concurrent.Future>
futureSupplier =
client.postFutureSupplier(
interceptedRequest,
interceptedRequest.getCreateCertificateDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
CreateCertificateRequest, CreateCertificateResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future createSdk(
CreateSdkRequest request,
final com.oracle.bmc.responses.AsyncHandler
handler) {
LOG.trace("Called async createSdk");
final CreateSdkRequest interceptedRequest = CreateSdkConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
CreateSdkConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = CreateSdkConverter.fromResponse();
com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib);
com.oracle.bmc.responses.AsyncHandler handlerToUse =
handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
java.util.concurrent.Future>
futureSupplier =
client.postFutureSupplier(
interceptedRequest,
interceptedRequest.getCreateSdkDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
CreateSdkRequest, CreateSdkResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future deleteApi(
DeleteApiRequest request,
final com.oracle.bmc.responses.AsyncHandler
handler) {
LOG.trace("Called async deleteApi");
final DeleteApiRequest interceptedRequest = DeleteApiConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
DeleteApiConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = DeleteApiConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler handlerToUse =
handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
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<
DeleteApiRequest, DeleteApiResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future deleteCertificate(
DeleteCertificateRequest request,
final com.oracle.bmc.responses.AsyncHandler<
DeleteCertificateRequest, DeleteCertificateResponse>
handler) {
LOG.trace("Called async deleteCertificate");
final DeleteCertificateRequest interceptedRequest =
DeleteCertificateConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
DeleteCertificateConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = DeleteCertificateConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
DeleteCertificateRequest, DeleteCertificateResponse>,
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<
DeleteCertificateRequest, DeleteCertificateResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future deleteSdk(
DeleteSdkRequest request,
final com.oracle.bmc.responses.AsyncHandler
handler) {
LOG.trace("Called async deleteSdk");
final DeleteSdkRequest interceptedRequest = DeleteSdkConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
DeleteSdkConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = DeleteSdkConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler handlerToUse =
handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
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<
DeleteSdkRequest, DeleteSdkResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future getApi(
GetApiRequest request,
final com.oracle.bmc.responses.AsyncHandler handler) {
LOG.trace("Called async getApi");
final GetApiRequest interceptedRequest = GetApiConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
GetApiConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = GetApiConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
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<
GetApiRequest, GetApiResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future getApiContent(
GetApiContentRequest request,
final com.oracle.bmc.responses.AsyncHandler
handler) {
LOG.trace("Called async getApiContent");
if (com.oracle.bmc.http.ApacheUtils.isExtraStreamLogsEnabled()) {
LOG.warn(
"getApiContent returns a stream, please make sure to close the stream to avoid any indefinite hangs");
if (this.apacheConnectionClosingStrategy != null) {
LOG.warn(
"ApacheConnectionClosingStrategy set to {}. For large streams with partial reads of stream, please use ImmediateClosingStrategy. "
+ "For small streams with partial reads of stream, please use GracefulClosingStrategy. More info in ApacheConnectorProperties",
this.apacheConnectionClosingStrategy);
}
}
final GetApiContentRequest interceptedRequest =
GetApiContentConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
GetApiContentConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = GetApiContentConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
GetApiContentRequest, GetApiContentResponse>,
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<
GetApiContentRequest, GetApiContentResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future
getApiDeploymentSpecification(
GetApiDeploymentSpecificationRequest request,
final com.oracle.bmc.responses.AsyncHandler<
GetApiDeploymentSpecificationRequest,
GetApiDeploymentSpecificationResponse>
handler) {
LOG.trace("Called async getApiDeploymentSpecification");
final GetApiDeploymentSpecificationRequest interceptedRequest =
GetApiDeploymentSpecificationConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
GetApiDeploymentSpecificationConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function<
javax.ws.rs.core.Response, GetApiDeploymentSpecificationResponse>
transformer = GetApiDeploymentSpecificationConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler<
GetApiDeploymentSpecificationRequest, GetApiDeploymentSpecificationResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
GetApiDeploymentSpecificationRequest,
GetApiDeploymentSpecificationResponse>,
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<
GetApiDeploymentSpecificationRequest, GetApiDeploymentSpecificationResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future getApiValidations(
GetApiValidationsRequest request,
final com.oracle.bmc.responses.AsyncHandler<
GetApiValidationsRequest, GetApiValidationsResponse>
handler) {
LOG.trace("Called async getApiValidations");
final GetApiValidationsRequest interceptedRequest =
GetApiValidationsConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
GetApiValidationsConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = GetApiValidationsConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
GetApiValidationsRequest, GetApiValidationsResponse>,
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<
GetApiValidationsRequest, GetApiValidationsResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future getCertificate(
GetCertificateRequest request,
final com.oracle.bmc.responses.AsyncHandler<
GetCertificateRequest, GetCertificateResponse>
handler) {
LOG.trace("Called async getCertificate");
final GetCertificateRequest interceptedRequest =
GetCertificateConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
GetCertificateConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = GetCertificateConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
GetCertificateRequest, GetCertificateResponse>,
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<
GetCertificateRequest, GetCertificateResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future getSdk(
GetSdkRequest request,
final com.oracle.bmc.responses.AsyncHandler handler) {
LOG.trace("Called async getSdk");
final GetSdkRequest interceptedRequest = GetSdkConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
GetSdkConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = GetSdkConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
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<
GetSdkRequest, GetSdkResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future listApis(
ListApisRequest request,
final com.oracle.bmc.responses.AsyncHandler
handler) {
LOG.trace("Called async listApis");
final ListApisRequest interceptedRequest = ListApisConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ListApisConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = ListApisConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler handlerToUse =
handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
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<
ListApisRequest, ListApisResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future listCertificates(
ListCertificatesRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ListCertificatesRequest, ListCertificatesResponse>
handler) {
LOG.trace("Called async listCertificates");
final ListCertificatesRequest interceptedRequest =
ListCertificatesConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ListCertificatesConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = ListCertificatesConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ListCertificatesRequest, ListCertificatesResponse>,
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<
ListCertificatesRequest, ListCertificatesResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future listSdkLanguageTypes(
ListSdkLanguageTypesRequest request,
final com.oracle.bmc.responses.AsyncHandler<
ListSdkLanguageTypesRequest, ListSdkLanguageTypesResponse>
handler) {
LOG.trace("Called async listSdkLanguageTypes");
final ListSdkLanguageTypesRequest interceptedRequest =
ListSdkLanguageTypesConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ListSdkLanguageTypesConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function<
javax.ws.rs.core.Response, ListSdkLanguageTypesResponse>
transformer = ListSdkLanguageTypesConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler<
ListSdkLanguageTypesRequest, ListSdkLanguageTypesResponse>
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
ListSdkLanguageTypesRequest, ListSdkLanguageTypesResponse>,
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<
ListSdkLanguageTypesRequest, ListSdkLanguageTypesResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future listSdks(
ListSdksRequest request,
final com.oracle.bmc.responses.AsyncHandler
handler) {
LOG.trace("Called async listSdks");
final ListSdksRequest interceptedRequest = ListSdksConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
ListSdksConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = ListSdksConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler handlerToUse =
handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
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<
ListSdksRequest, ListSdksResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future updateApi(
UpdateApiRequest request,
final com.oracle.bmc.responses.AsyncHandler
handler) {
LOG.trace("Called async updateApi");
final UpdateApiRequest interceptedRequest = UpdateApiConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
UpdateApiConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = UpdateApiConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler handlerToUse =
handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
java.util.concurrent.Future>
futureSupplier =
client.putFutureSupplier(
interceptedRequest,
interceptedRequest.getUpdateApiDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
UpdateApiRequest, UpdateApiResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future updateCertificate(
UpdateCertificateRequest request,
final com.oracle.bmc.responses.AsyncHandler<
UpdateCertificateRequest, UpdateCertificateResponse>
handler) {
LOG.trace("Called async updateCertificate");
final UpdateCertificateRequest interceptedRequest =
UpdateCertificateConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
UpdateCertificateConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = UpdateCertificateConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler
handlerToUse = handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler<
UpdateCertificateRequest, UpdateCertificateResponse>,
java.util.concurrent.Future>
futureSupplier =
client.putFutureSupplier(
interceptedRequest,
interceptedRequest.getUpdateCertificateDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
UpdateCertificateRequest, UpdateCertificateResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
@Override
public java.util.concurrent.Future updateSdk(
UpdateSdkRequest request,
final com.oracle.bmc.responses.AsyncHandler
handler) {
LOG.trace("Called async updateSdk");
final UpdateSdkRequest interceptedRequest = UpdateSdkConverter.interceptRequest(request);
final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib =
UpdateSdkConverter.fromRequest(client, interceptedRequest);
final com.google.common.base.Function
transformer = UpdateSdkConverter.fromResponse();
com.oracle.bmc.responses.AsyncHandler handlerToUse =
handler;
java.util.function.Function<
com.oracle.bmc.responses.AsyncHandler,
java.util.concurrent.Future>
futureSupplier =
client.putFutureSupplier(
interceptedRequest,
interceptedRequest.getUpdateSdkDetails(),
ib,
transformer);
if (this.authenticationDetailsProvider
instanceof com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider) {
return new com.oracle.bmc.util.internal.RefreshAuthTokenWrapper<
UpdateSdkRequest, UpdateSdkResponse>(
(com.oracle.bmc.auth.RefreshableOnNotAuthenticatedProvider)
this.authenticationDetailsProvider,
handlerToUse,
futureSupplier) {
@Override
protected void beforeRetryAction() {}
};
} else {
return futureSupplier.apply(handlerToUse);
}
}
}