All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.bmc.waf.WafClient Maven / Gradle / Ivy

There is a newer version: 3.49.0
Show newest version
/**
 * Copyright (c) 2016, 2022, 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.waf;

import com.oracle.bmc.waf.internal.http.*;
import com.oracle.bmc.waf.requests.*;
import com.oracle.bmc.waf.responses.*;
import com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration;
import com.oracle.bmc.util.CircuitBreakerUtils;

@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20210930")
public class WafClient implements Waf {
    /**
     * Service instance for Waf.
     */
    public static final com.oracle.bmc.Service SERVICE =
            com.oracle.bmc.Services.serviceBuilder()
                    .serviceName("WAF")
                    .serviceEndpointPrefix("")
                    .serviceEndpointTemplate("https://waf.{region}.oci.{secondLevelDomain}")
                    .build();
    // attempt twice if it's instance principals, immediately failures will try to refresh the token
    private static final int MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS = 2;

    private static final org.slf4j.Logger LOG =
            org.slf4j.LoggerFactory.getLogger(WafAsyncClient.class);

    com.oracle.bmc.http.internal.RestClient getClient() {
        return client;
    }

    private final WafWaiters waiters;

    private final WafPaginators paginators;
    private final com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider
            authenticationDetailsProvider;
    private final com.oracle.bmc.retrier.RetryConfiguration retryConfiguration;
    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 final com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration
            circuitBreakerConfiguration;

    /**
     * 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 WafClient(
            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 WafClient(
            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 WafClient(
            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 WafClient( 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 WafClient( 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 WafClient( 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 WafClient( 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, 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 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 executorService ExecutorService used by the client, or null to use the default configured ThreadPoolExecutor */ public WafClient( 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, java.util.concurrent.ExecutorService executorService) { this( authenticationDetailsProvider, configuration, clientConfigurator, defaultRequestSignerFactory, signingStrategyRequestSignerFactories, additionalClientConfigurators, endpoint, executorService, 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. * Use the {@link Builder} to get access to all these parameters. * * @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 executorService ExecutorService used by the client, or null to use the default configured ThreadPoolExecutor * @param restClientFactoryBuilder the builder for the {@link com.oracle.bmc.http.internal.RestClientFactory} */ protected WafClient( 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, java.util.concurrent.ExecutorService executorService, 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( this.restClientFactory.getClientConfigurator()); this.apacheConnectionClosingStrategy = com.oracle.bmc.http.ApacheUtils.getApacheConnectionClosingStrategy( restClientFactory.getClientConfigurator()); this.clientConfigurationToUse = (configuration != null) ? configuration : com.oracle.bmc.ClientConfiguration.builder().build(); this.defaultRequestSignerFactory = defaultRequestSignerFactory; this.signingStrategyRequestSignerFactories = signingStrategyRequestSignerFactories; this.retryConfiguration = clientConfigurationToUse.getRetryConfiguration(); final com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration userCircuitBreakerConfiguration = CircuitBreakerUtils.getUserDefinedCircuitBreakerConfiguration( configuration); if (userCircuitBreakerConfiguration == null) { this.circuitBreakerConfiguration = CircuitBreakerUtils.DEFAULT_CIRCUIT_BREAKER_CONFIGURATION; } else { this.circuitBreakerConfiguration = userCircuitBreakerConfiguration; } this.refreshClient(); if (executorService == null) { // up to 50 (core) threads, time out after 60s idle, all daemon java.util.concurrent.ThreadPoolExecutor threadPoolExecutor = new java.util.concurrent.ThreadPoolExecutor( 50, 50, 60L, java.util.concurrent.TimeUnit.SECONDS, new java.util.concurrent.LinkedBlockingQueue(), com.oracle.bmc.internal.ClientThreadFactory.builder() .isDaemon(true) .nameFormat("Waf-waiters-%d") .build()); threadPoolExecutor.allowCoreThreadTimeOut(true); executorService = threadPoolExecutor; } this.waiters = new WafWaiters(executorService, this); this.paginators = new WafPaginators(this); 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 java.util.concurrent.ExecutorService executorService; 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); } /** * Set the ExecutorService for the client to be created. * @param executorService executorService * @return this builder */ public Builder executorService(java.util.concurrent.ExecutorService executorService) { this.executorService = executorService; return this; } /** * Build the client. * @param authenticationDetailsProvider authentication details provider * @return the client */ public WafClient 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 WafClient( authenticationDetailsProvider, configuration, clientConfigurator, requestSignerFactory, signingStrategyRequestSignerFactories, additionalClientConfigurators, endpoint, executorService); } } @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, this.authenticationDetailsProvider)); } } com.oracle.bmc.http.internal.RestClient refreshedClient = this.restClientFactory.create( defaultRequestSigner, requestSigners, this.clientConfigurationToUse, this.isNonBufferingApacheClient, null, this.circuitBreakerConfiguration); 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) { 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); 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 ChangeNetworkAddressListCompartmentResponse changeNetworkAddressListCompartment( ChangeNetworkAddressListCompartmentRequest request) { LOG.trace("Called changeNetworkAddressListCompartment"); final ChangeNetworkAddressListCompartmentRequest interceptedRequest = ChangeNetworkAddressListCompartmentConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ChangeNetworkAddressListCompartmentConverter.fromRequest( client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ChangeNetworkAddressListCompartment", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/NetworkAddressList/ChangeNetworkAddressListCompartment"); java.util.function.Function< javax.ws.rs.core.Response, ChangeNetworkAddressListCompartmentResponse> transformer = ChangeNetworkAddressListCompartmentConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest .getChangeNetworkAddressListCompartmentDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public ChangeWebAppFirewallCompartmentResponse changeWebAppFirewallCompartment( ChangeWebAppFirewallCompartmentRequest request) { LOG.trace("Called changeWebAppFirewallCompartment"); final ChangeWebAppFirewallCompartmentRequest interceptedRequest = ChangeWebAppFirewallCompartmentConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ChangeWebAppFirewallCompartmentConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ChangeWebAppFirewallCompartment", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewall/ChangeWebAppFirewallCompartment"); java.util.function.Function< javax.ws.rs.core.Response, ChangeWebAppFirewallCompartmentResponse> transformer = ChangeWebAppFirewallCompartmentConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest .getChangeWebAppFirewallCompartmentDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public ChangeWebAppFirewallPolicyCompartmentResponse changeWebAppFirewallPolicyCompartment( ChangeWebAppFirewallPolicyCompartmentRequest request) { LOG.trace("Called changeWebAppFirewallPolicyCompartment"); final ChangeWebAppFirewallPolicyCompartmentRequest interceptedRequest = ChangeWebAppFirewallPolicyCompartmentConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ChangeWebAppFirewallPolicyCompartmentConverter.fromRequest( client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ChangeWebAppFirewallPolicyCompartment", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewallPolicy/ChangeWebAppFirewallPolicyCompartment"); java.util.function.Function< javax.ws.rs.core.Response, ChangeWebAppFirewallPolicyCompartmentResponse> transformer = ChangeWebAppFirewallPolicyCompartmentConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest .getChangeWebAppFirewallPolicyCompartmentDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public CreateNetworkAddressListResponse createNetworkAddressList( CreateNetworkAddressListRequest request) { LOG.trace("Called createNetworkAddressList"); final CreateNetworkAddressListRequest interceptedRequest = CreateNetworkAddressListConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = CreateNetworkAddressListConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "CreateNetworkAddressList", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/NetworkAddressList/CreateNetworkAddressList"); java.util.function.Function transformer = CreateNetworkAddressListConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest.getCreateNetworkAddressListDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public CreateWebAppFirewallResponse createWebAppFirewall(CreateWebAppFirewallRequest request) { LOG.trace("Called createWebAppFirewall"); final CreateWebAppFirewallRequest interceptedRequest = CreateWebAppFirewallConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = CreateWebAppFirewallConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "CreateWebAppFirewall", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewall/CreateWebAppFirewall"); java.util.function.Function transformer = CreateWebAppFirewallConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest.getCreateWebAppFirewallDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public CreateWebAppFirewallPolicyResponse createWebAppFirewallPolicy( CreateWebAppFirewallPolicyRequest request) { LOG.trace("Called createWebAppFirewallPolicy"); final CreateWebAppFirewallPolicyRequest interceptedRequest = CreateWebAppFirewallPolicyConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = CreateWebAppFirewallPolicyConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "CreateWebAppFirewallPolicy", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewallPolicy/CreateWebAppFirewallPolicy"); java.util.function.Function transformer = CreateWebAppFirewallPolicyConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest .getCreateWebAppFirewallPolicyDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public DeleteNetworkAddressListResponse deleteNetworkAddressList( DeleteNetworkAddressListRequest request) { LOG.trace("Called deleteNetworkAddressList"); final DeleteNetworkAddressListRequest interceptedRequest = DeleteNetworkAddressListConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = DeleteNetworkAddressListConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "DeleteNetworkAddressList", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/NetworkAddressList/DeleteNetworkAddressList"); java.util.function.Function transformer = DeleteNetworkAddressListConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.delete(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public DeleteWebAppFirewallResponse deleteWebAppFirewall(DeleteWebAppFirewallRequest request) { LOG.trace("Called deleteWebAppFirewall"); final DeleteWebAppFirewallRequest interceptedRequest = DeleteWebAppFirewallConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = DeleteWebAppFirewallConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "DeleteWebAppFirewall", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewall/DeleteWebAppFirewall"); java.util.function.Function transformer = DeleteWebAppFirewallConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.delete(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public DeleteWebAppFirewallPolicyResponse deleteWebAppFirewallPolicy( DeleteWebAppFirewallPolicyRequest request) { LOG.trace("Called deleteWebAppFirewallPolicy"); final DeleteWebAppFirewallPolicyRequest interceptedRequest = DeleteWebAppFirewallPolicyConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = DeleteWebAppFirewallPolicyConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "DeleteWebAppFirewallPolicy", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewallPolicy/DeleteWebAppFirewallPolicy"); java.util.function.Function transformer = DeleteWebAppFirewallPolicyConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.delete(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetNetworkAddressListResponse getNetworkAddressList( GetNetworkAddressListRequest request) { LOG.trace("Called getNetworkAddressList"); final GetNetworkAddressListRequest interceptedRequest = GetNetworkAddressListConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetNetworkAddressListConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "GetNetworkAddressList", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/NetworkAddressList/GetNetworkAddressList"); java.util.function.Function transformer = GetNetworkAddressListConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetWebAppFirewallResponse getWebAppFirewall(GetWebAppFirewallRequest request) { LOG.trace("Called getWebAppFirewall"); final GetWebAppFirewallRequest interceptedRequest = GetWebAppFirewallConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetWebAppFirewallConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "GetWebAppFirewall", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewall/GetWebAppFirewall"); java.util.function.Function transformer = GetWebAppFirewallConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetWebAppFirewallPolicyResponse getWebAppFirewallPolicy( GetWebAppFirewallPolicyRequest request) { LOG.trace("Called getWebAppFirewallPolicy"); final GetWebAppFirewallPolicyRequest interceptedRequest = GetWebAppFirewallPolicyConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetWebAppFirewallPolicyConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "GetWebAppFirewallPolicy", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewallPolicy/GetWebAppFirewallPolicy"); java.util.function.Function transformer = GetWebAppFirewallPolicyConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetWorkRequestResponse getWorkRequest(GetWorkRequestRequest request) { LOG.trace("Called getWorkRequest"); final GetWorkRequestRequest interceptedRequest = GetWorkRequestConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetWorkRequestConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "GetWorkRequest", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WorkRequest/GetWorkRequest"); java.util.function.Function transformer = GetWorkRequestConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListNetworkAddressListsResponse listNetworkAddressLists( ListNetworkAddressListsRequest request) { LOG.trace("Called listNetworkAddressLists"); final ListNetworkAddressListsRequest interceptedRequest = ListNetworkAddressListsConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListNetworkAddressListsConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ListNetworkAddressLists", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/NetworkAddressList/ListNetworkAddressLists"); java.util.function.Function transformer = ListNetworkAddressListsConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListProtectionCapabilitiesResponse listProtectionCapabilities( ListProtectionCapabilitiesRequest request) { LOG.trace("Called listProtectionCapabilities"); final ListProtectionCapabilitiesRequest interceptedRequest = ListProtectionCapabilitiesConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListProtectionCapabilitiesConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ListProtectionCapabilities", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/ProtectionCapability/ListProtectionCapabilities"); java.util.function.Function transformer = ListProtectionCapabilitiesConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListProtectionCapabilityGroupTagsResponse listProtectionCapabilityGroupTags( ListProtectionCapabilityGroupTagsRequest request) { LOG.trace("Called listProtectionCapabilityGroupTags"); final ListProtectionCapabilityGroupTagsRequest interceptedRequest = ListProtectionCapabilityGroupTagsConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListProtectionCapabilityGroupTagsConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ListProtectionCapabilityGroupTags", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/ProtectionCapability/ListProtectionCapabilityGroupTags"); java.util.function.Function< javax.ws.rs.core.Response, ListProtectionCapabilityGroupTagsResponse> transformer = ListProtectionCapabilityGroupTagsConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListWebAppFirewallPoliciesResponse listWebAppFirewallPolicies( ListWebAppFirewallPoliciesRequest request) { LOG.trace("Called listWebAppFirewallPolicies"); final ListWebAppFirewallPoliciesRequest interceptedRequest = ListWebAppFirewallPoliciesConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListWebAppFirewallPoliciesConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ListWebAppFirewallPolicies", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewallPolicy/ListWebAppFirewallPolicies"); java.util.function.Function transformer = ListWebAppFirewallPoliciesConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListWebAppFirewallsResponse listWebAppFirewalls(ListWebAppFirewallsRequest request) { LOG.trace("Called listWebAppFirewalls"); final ListWebAppFirewallsRequest interceptedRequest = ListWebAppFirewallsConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListWebAppFirewallsConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ListWebAppFirewalls", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewall/ListWebAppFirewalls"); java.util.function.Function transformer = ListWebAppFirewallsConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListWorkRequestErrorsResponse listWorkRequestErrors( ListWorkRequestErrorsRequest request) { LOG.trace("Called listWorkRequestErrors"); final ListWorkRequestErrorsRequest interceptedRequest = ListWorkRequestErrorsConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListWorkRequestErrorsConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ListWorkRequestErrors", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WorkRequestError/ListWorkRequestErrors"); java.util.function.Function transformer = ListWorkRequestErrorsConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListWorkRequestLogsResponse listWorkRequestLogs(ListWorkRequestLogsRequest request) { LOG.trace("Called listWorkRequestLogs"); final ListWorkRequestLogsRequest interceptedRequest = ListWorkRequestLogsConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListWorkRequestLogsConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ListWorkRequestLogs", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WorkRequestLogEntry/ListWorkRequestLogs"); java.util.function.Function transformer = ListWorkRequestLogsConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListWorkRequestsResponse listWorkRequests(ListWorkRequestsRequest request) { LOG.trace("Called listWorkRequests"); final ListWorkRequestsRequest interceptedRequest = ListWorkRequestsConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListWorkRequestsConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "ListWorkRequests", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WorkRequest/ListWorkRequests"); java.util.function.Function transformer = ListWorkRequestsConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public UpdateNetworkAddressListResponse updateNetworkAddressList( UpdateNetworkAddressListRequest request) { LOG.trace("Called updateNetworkAddressList"); final UpdateNetworkAddressListRequest interceptedRequest = UpdateNetworkAddressListConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = UpdateNetworkAddressListConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "UpdateNetworkAddressList", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/NetworkAddressList/UpdateNetworkAddressList"); java.util.function.Function transformer = UpdateNetworkAddressListConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.put( ib, retriedRequest.getUpdateNetworkAddressListDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public UpdateWebAppFirewallResponse updateWebAppFirewall(UpdateWebAppFirewallRequest request) { LOG.trace("Called updateWebAppFirewall"); final UpdateWebAppFirewallRequest interceptedRequest = UpdateWebAppFirewallConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = UpdateWebAppFirewallConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "UpdateWebAppFirewall", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewall/UpdateWebAppFirewall"); java.util.function.Function transformer = UpdateWebAppFirewallConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.put( ib, retriedRequest.getUpdateWebAppFirewallDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public UpdateWebAppFirewallPolicyResponse updateWebAppFirewallPolicy( UpdateWebAppFirewallPolicyRequest request) { LOG.trace("Called updateWebAppFirewallPolicy"); final UpdateWebAppFirewallPolicyRequest interceptedRequest = UpdateWebAppFirewallPolicyConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = UpdateWebAppFirewallPolicyConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "Waf", "UpdateWebAppFirewallPolicy", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/waf/20210930/WebAppFirewallPolicy/UpdateWebAppFirewallPolicy"); java.util.function.Function transformer = UpdateWebAppFirewallPolicyConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.put( ib, retriedRequest .getUpdateWebAppFirewallPolicyDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public WafWaiters getWaiters() { return waiters; } @Override public WafPaginators getPaginators() { return paginators; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy