diff --git a/CHANGELOG.md b/CHANGELOG.md index dbeeaf2de11..77f29468559 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added - N/A +## 1.2.37 - 2018-05-03 + +### Fixed +- `RestClientFactory` now uses the `JerseyClientBuilder` to create clients [issue#56](https://github.com/oracle/oci-java-sdk/issues/56) +- Shaded artifact now includes pom.xml [issue#57](https://github.com/oracle/oci-java-sdk/issues/57) + +### Added +- Support for returning names for events in the Audit service +- Support for multiple hostnames per listener in the Load Balancing service + ## 1.2.35 - 2018-04-19 ### Fixed @@ -22,6 +32,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added - Support for tagging DbSystem and Database resources in the Database Service - Support for filtering by `dbSystemId` in `listDbVersions` operation in Database Service +- Support waiting on multiple target states in `Waiter` ## 1.2.34 - 2018-04-05 diff --git a/bmc-audit/pom.xml b/bmc-audit/pom.xml index 77469cd6b2a..34af9a3248c 100644 --- a/bmc-audit/pom.xml +++ b/bmc-audit/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 diff --git a/bmc-audit/src/main/java/com/oracle/bmc/audit/AuditAsyncClient.java b/bmc-audit/src/main/java/com/oracle/bmc/audit/AuditAsyncClient.java index 6910faa2f04..d0b440d4cdd 100644 --- a/bmc-audit/src/main/java/com/oracle/bmc/audit/AuditAsyncClient.java +++ b/bmc-audit/src/main/java/com/oracle/bmc/audit/AuditAsyncClient.java @@ -178,13 +178,16 @@ public AuditAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-audit/src/main/java/com/oracle/bmc/audit/AuditClient.java b/bmc-audit/src/main/java/com/oracle/bmc/audit/AuditClient.java index fa0bfad0396..e4e9262dd11 100644 --- a/bmc-audit/src/main/java/com/oracle/bmc/audit/AuditClient.java +++ b/bmc-audit/src/main/java/com/oracle/bmc/audit/AuditClient.java @@ -182,13 +182,16 @@ public AuditClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-audit/src/main/java/com/oracle/bmc/audit/model/AuditEvent.java b/bmc-audit/src/main/java/com/oracle/bmc/audit/model/AuditEvent.java index d1f57a43c90..2c9a334e344 100644 --- a/bmc-audit/src/main/java/com/oracle/bmc/audit/model/AuditEvent.java +++ b/bmc-audit/src/main/java/com/oracle/bmc/audit/model/AuditEvent.java @@ -48,6 +48,15 @@ public Builder eventId(String eventId) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("eventName") + private String eventName; + + public Builder eventName(String eventName) { + this.eventName = eventName; + this.__explicitlySet__.add("eventName"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("eventSource") private String eventSource; @@ -204,6 +213,7 @@ public AuditEvent build() { tenantId, compartmentId, eventId, + eventName, eventSource, eventType, eventTime, @@ -230,6 +240,7 @@ public Builder copy(AuditEvent o) { tenantId(o.getTenantId()) .compartmentId(o.getCompartmentId()) .eventId(o.getEventId()) + .eventName(o.getEventName()) .eventSource(o.getEventSource()) .eventType(o.getEventType()) .eventTime(o.getEventTime()) @@ -277,6 +288,14 @@ public static Builder builder() { @com.fasterxml.jackson.annotation.JsonProperty("eventId") String eventId; + /** + * The name of the event. + * Example: `LaunchInstance` + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("eventName") + String eventName; + /** * The source of the event. **/ diff --git a/bmc-bom/pom.xml b/bmc-bom/pom.xml index 9dfd9af7db0..d3daf395c06 100644 --- a/bmc-bom/pom.xml +++ b/bmc-bom/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml oci-java-sdk-bom @@ -19,62 +19,62 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 false com.oracle.oci.sdk oci-java-sdk-audit - 1.2.35 + 1.2.37 false com.oracle.oci.sdk oci-java-sdk-core - 1.2.35 + 1.2.37 false com.oracle.oci.sdk oci-java-sdk-database - 1.2.35 + 1.2.37 false com.oracle.oci.sdk oci-java-sdk-dns - 1.2.35 + 1.2.37 false com.oracle.oci.sdk oci-java-sdk-email - 1.2.35 + 1.2.37 false com.oracle.oci.sdk oci-java-sdk-filestorage - 1.2.35 + 1.2.37 false com.oracle.oci.sdk oci-java-sdk-identity - 1.2.35 + 1.2.37 false com.oracle.oci.sdk oci-java-sdk-loadbalancer - 1.2.35 + 1.2.37 false com.oracle.oci.sdk oci-java-sdk-objectstorage - 1.2.35 + 1.2.37 false pom diff --git a/bmc-common/pom.xml b/bmc-common/pom.xml index 6d49c2ccc11..ab20124a54e 100644 --- a/bmc-common/pom.xml +++ b/bmc-common/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/RestClientUtils.java b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/RestClientUtils.java index be168e47923..e02e7af0c5a 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/RestClientUtils.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/RestClientUtils.java @@ -118,7 +118,7 @@ private static RestClient createRestClient( RestClientFactory restClientFactory = RestClientFactoryBuilder.builder().clientConfigurator(clientConfigurator).build(); - RestClient restClient = restClientFactory.create(requestSigner, null); + RestClient restClient = restClientFactory.create(requestSigner); restClient.setEndpoint(endpoint); return restClient; } diff --git a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/X509FederationClient.java b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/X509FederationClient.java index 5db3482e2e2..6bf1d0cb5cc 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/auth/internal/X509FederationClient.java +++ b/bmc-common/src/main/java/com/oracle/bmc/auth/internal/X509FederationClient.java @@ -3,8 +3,6 @@ */ package com.oracle.bmc.auth.internal; -import javax.security.auth.RefreshFailedException; -import javax.security.auth.Refreshable; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Function; @@ -14,7 +12,12 @@ import com.oracle.bmc.auth.SessionKeySupplier; import com.oracle.bmc.auth.X509CertificateSupplier; import com.oracle.bmc.http.ClientConfigurator; -import com.oracle.bmc.http.internal.*; +import com.oracle.bmc.http.internal.ResponseConversionFunctionFactory; +import com.oracle.bmc.http.internal.RestClient; +import com.oracle.bmc.http.internal.RestClientFactory; +import com.oracle.bmc.http.internal.RestClientFactoryBuilder; +import com.oracle.bmc.http.internal.WithHeaders; +import com.oracle.bmc.http.internal.WrappedInvocationBuilder; import com.oracle.bmc.http.signing.RequestSigner; import com.oracle.bmc.http.signing.internal.Constants; import com.oracle.bmc.http.signing.internal.KeySupplier; @@ -27,6 +30,8 @@ import lombok.extern.slf4j.Slf4j; import javax.annotation.concurrent.Immutable; +import javax.security.auth.RefreshFailedException; +import javax.security.auth.Refreshable; import javax.ws.rs.client.Invocation.Builder; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Response; @@ -34,7 +39,11 @@ import java.security.cert.X509Certificate; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * This class gets a security token from the auth service by signing the request with a PKI issued leaf certificate, @@ -216,7 +225,7 @@ public String get() { new RequestSignerImpl(keySupplier, signingConfiguration, keyIdSupplier); RestClientFactory restClientFactory = RestClientFactoryBuilder.builder().build(); - RestClient restClient = restClientFactory.create(requestSigner, null); + RestClient restClient = restClientFactory.create(requestSigner); restClient.setEndpoint(endpoint); return restClient; } diff --git a/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClientFactory.java b/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClientFactory.java index e9163930850..7ff6a6e6e06 100644 --- a/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClientFactory.java +++ b/bmc-common/src/main/java/com/oracle/bmc/http/internal/RestClientFactory.java @@ -17,10 +17,12 @@ import com.oracle.bmc.http.signing.SigningStrategy; import lombok.Getter; import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.JerseyClientBuilder; import javax.annotation.Nonnull; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; +import java.util.Collections; import java.util.Map; /** @@ -66,6 +68,40 @@ public RestClientFactory(@Nonnull ClientConfigurator clientConfigurator) { this.clientConfigurator = clientConfigurator; } + /** + * Creates a new client that will use the given + * {@link AuthenticationDetailsProvider}. + * + * @param requestSigner The strategy used to sign requests. + * @return A new RestClient instance. + * + * @deprecated use {@link RestClientFactory#create(RequestSigner, Map)} instead + */ + @Deprecated + public RestClient create(RequestSigner requestSigner) { + return this.create(requestSigner, Collections.emptyMap()); + } + + /** + * Creates a new client that will use the given + * {@link AuthenticationDetailsProvider} and {@link ClientConfiguration}. + * + * @param requestSigner The strategy used to sign requests. + * @param configuration + * The client configuration to use, or null for default + * configuration. + * @return A new RestClient instance. + * + * @deprecated use {@link RestClientFactory#create(RequestSigner, Map, ClientConfiguration)} instead + */ + @Deprecated + public RestClient create(RequestSigner requestSigner, ClientConfiguration configuration) { + return this.create( + requestSigner, + Collections.emptyMap(), + configuration); + } + /** * Creates a new client that will use the given * {@link AuthenticationDetailsProvider}. @@ -81,6 +117,7 @@ public RestClient create( Map requestSigners) { return this.create(defaultRequestSigner, requestSigners, null); } + /** * Creates a new client that will use the given * {@link AuthenticationDetailsProvider} and {@link ClientConfiguration}. @@ -114,7 +151,7 @@ private static Client createClient( Map requestSigners, ClientConfiguration configuration, ClientConfigurator clientConfigurator) { - ClientBuilder builder = ClientBuilder.newBuilder(); + ClientBuilder builder = JerseyClientBuilder.newBuilder(); clientConfigurator.customizeBuilder(builder); Client client = diff --git a/bmc-core/pom.xml b/bmc-core/pom.xml index 332a978233f..2a4b85a2723 100644 --- a/bmc-core/pom.xml +++ b/bmc-core/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageAsyncClient.java b/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageAsyncClient.java index 5764fb984ef..2a5cad29b1e 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageAsyncClient.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageAsyncClient.java @@ -178,13 +178,16 @@ public BlockstorageAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageClient.java b/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageClient.java index 1b662584acf..642210a4934 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageClient.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageClient.java @@ -183,13 +183,16 @@ public BlockstorageClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); // up to 50 (core) threads, time out after 60s idle, all daemon diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageWaiters.java b/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageWaiters.java index 189640f3d4c..048e68151f2 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageWaiters.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/BlockstorageWaiters.java @@ -22,14 +22,19 @@ public class BlockstorageWaiters { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forBootVolume( GetBootVolumeRequest request, - com.oracle.bmc.core.model.BootVolume.LifecycleState targetState) { + com.oracle.bmc.core.model.BootVolume.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forBootVolume( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -46,17 +51,47 @@ public com.oracle.bmc.waiter.Waiter com.oracle.bmc.core.model.BootVolume.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forBootVolume( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forBootVolume( + GetBootVolumeRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.BootVolume.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forBootVolume( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for BootVolume. private com.oracle.bmc.waiter.Waiter forBootVolume( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetBootVolumeRequest request, - final com.oracle.bmc.core.model.BootVolume.LifecycleState targetState) { + final com.oracle.bmc.core.model.BootVolume.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -71,11 +106,12 @@ public GetBootVolumeResponse apply(GetBootVolumeRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetBootVolumeResponse response) { - return response.getBootVolume().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getBootVolume().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.BootVolume.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.BootVolume.LifecycleState.Terminated)), request); } @@ -83,13 +119,19 @@ public boolean apply(GetBootVolumeResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forVolume( - GetVolumeRequest request, com.oracle.bmc.core.model.Volume.LifecycleState targetState) { + GetVolumeRequest request, + com.oracle.bmc.core.model.Volume.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forVolume( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -106,17 +148,47 @@ public com.oracle.bmc.waiter.Waiter forVolu com.oracle.bmc.core.model.Volume.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forVolume( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forVolume( + GetVolumeRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.Volume.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forVolume( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Volume. private com.oracle.bmc.waiter.Waiter forVolume( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetVolumeRequest request, - final com.oracle.bmc.core.model.Volume.LifecycleState targetState) { + final com.oracle.bmc.core.model.Volume.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -130,10 +202,12 @@ public GetVolumeResponse apply(GetVolumeRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetVolumeResponse response) { - return response.getVolume().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getVolume().getLifecycleState()); } }, - targetState == com.oracle.bmc.core.model.Volume.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.Volume.LifecycleState.Terminated)), request); } @@ -141,15 +215,20 @@ public boolean apply(GetVolumeResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forVolumeBackup( GetVolumeBackupRequest request, - com.oracle.bmc.core.model.VolumeBackup.LifecycleState targetState) { + com.oracle.bmc.core.model.VolumeBackup.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forVolumeBackup( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -167,18 +246,49 @@ public boolean apply(GetVolumeResponse response) { com.oracle.bmc.core.model.VolumeBackup.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forVolumeBackup( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forVolumeBackup( + GetVolumeBackupRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.VolumeBackup.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forVolumeBackup( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for VolumeBackup. private com.oracle.bmc.waiter.Waiter forVolumeBackup( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetVolumeBackupRequest request, - final com.oracle.bmc.core.model.VolumeBackup.LifecycleState targetState) { + final com.oracle.bmc.core.model.VolumeBackup.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -193,13 +303,12 @@ public GetVolumeBackupResponse apply(GetVolumeBackupRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetVolumeBackupResponse response) { - return response.getVolumeBackup().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getVolumeBackup().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.VolumeBackup.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.VolumeBackup.LifecycleState.Terminated)), request); } } diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/Compute.java b/bmc-core/src/main/java/com/oracle/bmc/core/Compute.java index 13bd565b313..e9305dbc34b 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/Compute.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/Compute.java @@ -294,8 +294,8 @@ GetInstanceConsoleConnectionResponse getInstanceConsoleConnection( GetVolumeAttachmentResponse getVolumeAttachment(GetVolumeAttachmentRequest request); /** - * Gets the generated credentials for the instance. Only works for Windows instances. The returned credentials - * are only valid for the initial login. + * Gets the generated credentials for the instance. Only works for instances that require password to log in (E.g. Windows). + * For certain OS'es, users will be forced to change the initial credentials. * * @param request The request object containing the details to send * @return A response object containing details about the completed operation @@ -403,7 +403,7 @@ ListBootVolumeAttachmentsResponse listBootVolumeAttachments( /** * Lists the console connections for the specified compartment or instance. *

- * For more information about console access, see [Accessing the Instance Console](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/serialconsole.htm). + * For more information about console access, see [Accessing the Console](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/serialconsole.htm). * * @param request The request object containing the details to send * @return A response object containing details about the completed operation diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsync.java b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsync.java index a77d3981faa..6294505aa2e 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsync.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsync.java @@ -445,8 +445,8 @@ java.util.concurrent.Future getVolumeAttachment( handler); /** - * Gets the generated credentials for the instance. Only works for Windows instances. The returned credentials - * are only valid for the initial login. + * Gets the generated credentials for the instance. Only works for instances that require password to log in (E.g. Windows). + * For certain OS'es, users will be forced to change the initial credentials. * * * @param request The request object containing the details to send @@ -598,7 +598,7 @@ java.util.concurrent.Future listImages( /** * Lists the console connections for the specified compartment or instance. *

- * For more information about console access, see [Accessing the Instance Console](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/serialconsole.htm). + * For more information about console access, see [Accessing the Console](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/serialconsole.htm). * * * @param request The request object containing the details to send diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsyncClient.java b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsyncClient.java index 5cac37f02ac..369d4a0a408 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsyncClient.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeAsyncClient.java @@ -178,13 +178,16 @@ public ComputeAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeClient.java b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeClient.java index e91b47b82ca..c4ea04bb241 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeClient.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeClient.java @@ -183,13 +183,16 @@ public ComputeClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); // up to 50 (core) threads, time out after 60s idle, all daemon diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeWaiters.java b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeWaiters.java index afe25ef3ffa..58fb8362662 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/ComputeWaiters.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/ComputeWaiters.java @@ -22,16 +22,21 @@ public class ComputeWaiters { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter< GetBootVolumeAttachmentRequest, GetBootVolumeAttachmentResponse> forBootVolumeAttachment( GetBootVolumeAttachmentRequest request, - com.oracle.bmc.core.model.BootVolumeAttachment.LifecycleState targetState) { + com.oracle.bmc.core.model.BootVolumeAttachment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forBootVolumeAttachment( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -50,20 +55,52 @@ public class ComputeWaiters { com.oracle.bmc.core.model.BootVolumeAttachment.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forBootVolumeAttachment( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter< + GetBootVolumeAttachmentRequest, GetBootVolumeAttachmentResponse> + forBootVolumeAttachment( + GetBootVolumeAttachmentRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.BootVolumeAttachment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forBootVolumeAttachment( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for BootVolumeAttachment. private com.oracle.bmc.waiter.Waiter< GetBootVolumeAttachmentRequest, GetBootVolumeAttachmentResponse> forBootVolumeAttachment( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetBootVolumeAttachmentRequest request, - final com.oracle.bmc.core.model.BootVolumeAttachment.LifecycleState - targetState) { + final com.oracle.bmc.core.model.BootVolumeAttachment.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -79,8 +116,8 @@ public GetBootVolumeAttachmentResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetBootVolumeAttachmentResponse response) { - return response.getBootVolumeAttachment().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getBootVolumeAttachment().getLifecycleState()); } }, false), @@ -91,15 +128,20 @@ public boolean apply(GetBootVolumeAttachmentResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forConsoleHistory( GetConsoleHistoryRequest request, - com.oracle.bmc.core.model.ConsoleHistory.LifecycleState targetState) { + com.oracle.bmc.core.model.ConsoleHistory.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forConsoleHistory( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -117,18 +159,49 @@ public boolean apply(GetBootVolumeAttachmentResponse response) { com.oracle.bmc.core.model.ConsoleHistory.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forConsoleHistory( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forConsoleHistory( + GetConsoleHistoryRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.ConsoleHistory.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forConsoleHistory( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for ConsoleHistory. private com.oracle.bmc.waiter.Waiter forConsoleHistory( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetConsoleHistoryRequest request, - final com.oracle.bmc.core.model.ConsoleHistory.LifecycleState targetState) { + final com.oracle.bmc.core.model.ConsoleHistory.LifecycleState... targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -144,8 +217,8 @@ public GetConsoleHistoryResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetConsoleHistoryResponse response) { - return response.getConsoleHistory().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getConsoleHistory().getLifecycleState()); } }, false), @@ -156,12 +229,19 @@ public boolean apply(GetConsoleHistoryResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forImage( - GetImageRequest request, com.oracle.bmc.core.model.Image.LifecycleState targetState) { - return forImage(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + GetImageRequest request, + com.oracle.bmc.core.model.Image.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + + return forImage( + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -178,17 +258,47 @@ public com.oracle.bmc.waiter.Waiter forImage( com.oracle.bmc.core.model.Image.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forImage( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forImage( + GetImageRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.Image.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forImage( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Image. private com.oracle.bmc.waiter.Waiter forImage( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetImageRequest request, - final com.oracle.bmc.core.model.Image.LifecycleState targetState) { + final com.oracle.bmc.core.model.Image.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -202,10 +312,12 @@ public GetImageResponse apply(GetImageRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetImageResponse response) { - return response.getImage().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getImage().getLifecycleState()); } }, - targetState == com.oracle.bmc.core.model.Image.LifecycleState.Deleted), + targetStatesSet.contains( + com.oracle.bmc.core.model.Image.LifecycleState.Deleted)), request); } @@ -213,14 +325,19 @@ public boolean apply(GetImageResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forInstance( GetInstanceRequest request, - com.oracle.bmc.core.model.Instance.LifecycleState targetState) { + com.oracle.bmc.core.model.Instance.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forInstance( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -237,17 +354,47 @@ public com.oracle.bmc.waiter.Waiter for com.oracle.bmc.core.model.Instance.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forInstance( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forInstance( + GetInstanceRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.Instance.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forInstance( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Instance. private com.oracle.bmc.waiter.Waiter forInstance( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetInstanceRequest request, - final com.oracle.bmc.core.model.Instance.LifecycleState targetState) { + final com.oracle.bmc.core.model.Instance.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -262,11 +409,12 @@ public GetInstanceResponse apply(GetInstanceRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetInstanceResponse response) { - return response.getInstance().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getInstance().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.Instance.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.Instance.LifecycleState.Terminated)), request); } @@ -274,17 +422,22 @@ public boolean apply(GetInstanceResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter< GetInstanceConsoleConnectionRequest, GetInstanceConsoleConnectionResponse> forInstanceConsoleConnection( GetInstanceConsoleConnectionRequest request, - com.oracle.bmc.core.model.InstanceConsoleConnection.LifecycleState - targetState) { + com.oracle.bmc.core.model.InstanceConsoleConnection.LifecycleState... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forInstanceConsoleConnection( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -303,20 +456,53 @@ public boolean apply(GetInstanceResponse response) { com.oracle.bmc.core.model.InstanceConsoleConnection.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forInstanceConsoleConnection( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter< + GetInstanceConsoleConnectionRequest, GetInstanceConsoleConnectionResponse> + forInstanceConsoleConnection( + GetInstanceConsoleConnectionRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.InstanceConsoleConnection.LifecycleState... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forInstanceConsoleConnection( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for InstanceConsoleConnection. private com.oracle.bmc.waiter.Waiter< GetInstanceConsoleConnectionRequest, GetInstanceConsoleConnectionResponse> forInstanceConsoleConnection( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetInstanceConsoleConnectionRequest request, - final com.oracle.bmc.core.model.InstanceConsoleConnection.LifecycleState - targetState) { + final com.oracle.bmc.core.model.InstanceConsoleConnection.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -334,13 +520,14 @@ public GetInstanceConsoleConnectionResponse apply( GetInstanceConsoleConnectionResponse>() { @Override public boolean apply(GetInstanceConsoleConnectionResponse response) { - return response.getInstanceConsoleConnection().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getInstanceConsoleConnection() + .getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.InstanceConsoleConnection - .LifecycleState.Deleted), + targetStatesSet.contains( + com.oracle.bmc.core.model.InstanceConsoleConnection.LifecycleState + .Deleted)), request); } @@ -348,15 +535,20 @@ public boolean apply(GetInstanceConsoleConnectionResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forVnicAttachment( GetVnicAttachmentRequest request, - com.oracle.bmc.core.model.VnicAttachment.LifecycleState targetState) { + com.oracle.bmc.core.model.VnicAttachment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forVnicAttachment( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -374,18 +566,49 @@ public boolean apply(GetInstanceConsoleConnectionResponse response) { com.oracle.bmc.core.model.VnicAttachment.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forVnicAttachment( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forVnicAttachment( + GetVnicAttachmentRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.VnicAttachment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forVnicAttachment( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for VnicAttachment. private com.oracle.bmc.waiter.Waiter forVnicAttachment( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetVnicAttachmentRequest request, - final com.oracle.bmc.core.model.VnicAttachment.LifecycleState targetState) { + final com.oracle.bmc.core.model.VnicAttachment.LifecycleState... targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -401,8 +624,8 @@ public GetVnicAttachmentResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetVnicAttachmentResponse response) { - return response.getVnicAttachment().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getVnicAttachment().getLifecycleState()); } }, false), @@ -413,15 +636,20 @@ public boolean apply(GetVnicAttachmentResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forVolumeAttachment( GetVolumeAttachmentRequest request, - com.oracle.bmc.core.model.VolumeAttachment.LifecycleState targetState) { + com.oracle.bmc.core.model.VolumeAttachment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forVolumeAttachment( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -439,18 +667,50 @@ public boolean apply(GetVnicAttachmentResponse response) { com.oracle.bmc.core.model.VolumeAttachment.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forVolumeAttachment( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forVolumeAttachment( + GetVolumeAttachmentRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.VolumeAttachment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forVolumeAttachment( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for VolumeAttachment. private com.oracle.bmc.waiter.Waiter forVolumeAttachment( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetVolumeAttachmentRequest request, - final com.oracle.bmc.core.model.VolumeAttachment.LifecycleState targetState) { + final com.oracle.bmc.core.model.VolumeAttachment.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -466,8 +726,8 @@ public GetVolumeAttachmentResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetVolumeAttachmentResponse response) { - return response.getVolumeAttachment().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getVolumeAttachment().getLifecycleState()); } }, false), diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetwork.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetwork.java index b2b7e708fd7..82c4bb19d2d 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetwork.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetwork.java @@ -1359,7 +1359,7 @@ UpdateLocalPeeringGatewayResponse updateLocalPeeringGateway( * * Move a reserved public IP to a different private IP. * * Unassign a reserved public IP from a private IP (which returns it to your pool * of reserved public IPs). - * * Change the display name for a public IP (either ephemeral or reserved). + * * Change the display name for a public IP. *

* Assigning, moving, and unassigning a reserved public IP are asynchronous * operations. Poll the public IP's `lifecycleState` to determine if the operation diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsync.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsync.java index 3e885cf5cb2..6abd13a8ec1 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsync.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsync.java @@ -2086,7 +2086,7 @@ java.util.concurrent.Future updatePrivateIp( * * Move a reserved public IP to a different private IP. * * Unassign a reserved public IP from a private IP (which returns it to your pool * of reserved public IPs). - * * Change the display name for a public IP (either ephemeral or reserved). + * * Change the display name for a public IP. *

* Assigning, moving, and unassigning a reserved public IP are asynchronous * operations. Poll the public IP's `lifecycleState` to determine if the operation diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsyncClient.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsyncClient.java index df9b512a1af..0f9f912bae7 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsyncClient.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkAsyncClient.java @@ -178,13 +178,16 @@ public VirtualNetworkAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkClient.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkClient.java index 65f03c8bca4..3f763c9da84 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkClient.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkClient.java @@ -183,13 +183,16 @@ public VirtualNetworkClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); // up to 50 (core) threads, time out after 60s idle, all daemon diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkWaiters.java b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkWaiters.java index b20c30e67db..78bfff126a3 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkWaiters.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/VirtualNetworkWaiters.java @@ -22,15 +22,20 @@ public class VirtualNetworkWaiters { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forCrossConnect( GetCrossConnectRequest request, - com.oracle.bmc.core.model.CrossConnect.LifecycleState targetState) { + com.oracle.bmc.core.model.CrossConnect.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forCrossConnect( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -48,18 +53,49 @@ public class VirtualNetworkWaiters { com.oracle.bmc.core.model.CrossConnect.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forCrossConnect( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forCrossConnect( + GetCrossConnectRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.CrossConnect.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forCrossConnect( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for CrossConnect. private com.oracle.bmc.waiter.Waiter forCrossConnect( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetCrossConnectRequest request, - final com.oracle.bmc.core.model.CrossConnect.LifecycleState targetState) { + final com.oracle.bmc.core.model.CrossConnect.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -74,13 +110,12 @@ public GetCrossConnectResponse apply(GetCrossConnectRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetCrossConnectResponse response) { - return response.getCrossConnect().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getCrossConnect().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.CrossConnect.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.CrossConnect.LifecycleState.Terminated)), request); } @@ -88,15 +123,20 @@ public boolean apply(GetCrossConnectResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forCrossConnectGroup( GetCrossConnectGroupRequest request, - com.oracle.bmc.core.model.CrossConnectGroup.LifecycleState targetState) { + com.oracle.bmc.core.model.CrossConnectGroup.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forCrossConnectGroup( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -114,18 +154,50 @@ public boolean apply(GetCrossConnectResponse response) { com.oracle.bmc.core.model.CrossConnectGroup.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forCrossConnectGroup( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forCrossConnectGroup( + GetCrossConnectGroupRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.CrossConnectGroup.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forCrossConnectGroup( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for CrossConnectGroup. private com.oracle.bmc.waiter.Waiter forCrossConnectGroup( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetCrossConnectGroupRequest request, - final com.oracle.bmc.core.model.CrossConnectGroup.LifecycleState targetState) { + final com.oracle.bmc.core.model.CrossConnectGroup.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -141,13 +213,13 @@ public GetCrossConnectGroupResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetCrossConnectGroupResponse response) { - return response.getCrossConnectGroup().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getCrossConnectGroup().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.CrossConnectGroup.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.CrossConnectGroup.LifecycleState + .Terminated)), request); } @@ -155,15 +227,20 @@ public boolean apply(GetCrossConnectGroupResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDhcpOptions( GetDhcpOptionsRequest request, - com.oracle.bmc.core.model.DhcpOptions.LifecycleState targetState) { + com.oracle.bmc.core.model.DhcpOptions.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forDhcpOptions( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -181,18 +258,49 @@ public boolean apply(GetCrossConnectGroupResponse response) { com.oracle.bmc.core.model.DhcpOptions.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forDhcpOptions( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forDhcpOptions( + GetDhcpOptionsRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.DhcpOptions.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forDhcpOptions( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for DhcpOptions. private com.oracle.bmc.waiter.Waiter forDhcpOptions( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDhcpOptionsRequest request, - final com.oracle.bmc.core.model.DhcpOptions.LifecycleState targetState) { + final com.oracle.bmc.core.model.DhcpOptions.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -207,11 +315,12 @@ public GetDhcpOptionsResponse apply(GetDhcpOptionsRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetDhcpOptionsResponse response) { - return response.getDhcpOptions().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getDhcpOptions().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.DhcpOptions.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.DhcpOptions.LifecycleState.Terminated)), request); } @@ -219,12 +328,17 @@ public boolean apply(GetDhcpOptionsResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDrg( - GetDrgRequest request, com.oracle.bmc.core.model.Drg.LifecycleState targetState) { - return forDrg(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + GetDrgRequest request, com.oracle.bmc.core.model.Drg.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + + return forDrg(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -241,17 +355,47 @@ public com.oracle.bmc.waiter.Waiter forDrg( com.oracle.bmc.core.model.Drg.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forDrg( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forDrg( + GetDrgRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.Drg.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forDrg( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Drg. private com.oracle.bmc.waiter.Waiter forDrg( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDrgRequest request, - final com.oracle.bmc.core.model.Drg.LifecycleState targetState) { + final com.oracle.bmc.core.model.Drg.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -265,10 +409,12 @@ public GetDrgResponse apply(GetDrgRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetDrgResponse response) { - return response.getDrg().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getDrg().getLifecycleState()); } }, - targetState == com.oracle.bmc.core.model.Drg.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.Drg.LifecycleState.Terminated)), request); } @@ -276,15 +422,20 @@ public boolean apply(GetDrgResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDrgAttachment( GetDrgAttachmentRequest request, - com.oracle.bmc.core.model.DrgAttachment.LifecycleState targetState) { + com.oracle.bmc.core.model.DrgAttachment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forDrgAttachment( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -302,18 +453,49 @@ public boolean apply(GetDrgResponse response) { com.oracle.bmc.core.model.DrgAttachment.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forDrgAttachment( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forDrgAttachment( + GetDrgAttachmentRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.DrgAttachment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forDrgAttachment( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for DrgAttachment. private com.oracle.bmc.waiter.Waiter forDrgAttachment( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDrgAttachmentRequest request, - final com.oracle.bmc.core.model.DrgAttachment.LifecycleState targetState) { + final com.oracle.bmc.core.model.DrgAttachment.LifecycleState... targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -328,12 +510,12 @@ public GetDrgAttachmentResponse apply(GetDrgAttachmentRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetDrgAttachmentResponse response) { - return response.getDrgAttachment().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getDrgAttachment().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.DrgAttachment.LifecycleState.Detached), + targetStatesSet.contains( + com.oracle.bmc.core.model.DrgAttachment.LifecycleState.Detached)), request); } @@ -341,15 +523,20 @@ public boolean apply(GetDrgAttachmentResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forIPSecConnection( GetIPSecConnectionRequest request, - com.oracle.bmc.core.model.IPSecConnection.LifecycleState targetState) { + com.oracle.bmc.core.model.IPSecConnection.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forIPSecConnection( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -367,18 +554,50 @@ public boolean apply(GetDrgAttachmentResponse response) { com.oracle.bmc.core.model.IPSecConnection.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forIPSecConnection( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forIPSecConnection( + GetIPSecConnectionRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.IPSecConnection.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forIPSecConnection( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for IPSecConnection. private com.oracle.bmc.waiter.Waiter forIPSecConnection( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetIPSecConnectionRequest request, - final com.oracle.bmc.core.model.IPSecConnection.LifecycleState targetState) { + final com.oracle.bmc.core.model.IPSecConnection.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -394,13 +613,13 @@ public GetIPSecConnectionResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetIPSecConnectionResponse response) { - return response.getIPSecConnection().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getIPSecConnection().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.IPSecConnection.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.IPSecConnection.LifecycleState + .Terminated)), request); } @@ -408,15 +627,20 @@ public boolean apply(GetIPSecConnectionResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forInternetGateway( GetInternetGatewayRequest request, - com.oracle.bmc.core.model.InternetGateway.LifecycleState targetState) { + com.oracle.bmc.core.model.InternetGateway.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forInternetGateway( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -434,18 +658,50 @@ public boolean apply(GetIPSecConnectionResponse response) { com.oracle.bmc.core.model.InternetGateway.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forInternetGateway( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forInternetGateway( + GetInternetGatewayRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.InternetGateway.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forInternetGateway( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for InternetGateway. private com.oracle.bmc.waiter.Waiter forInternetGateway( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetInternetGatewayRequest request, - final com.oracle.bmc.core.model.InternetGateway.LifecycleState targetState) { + final com.oracle.bmc.core.model.InternetGateway.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -461,13 +717,13 @@ public GetInternetGatewayResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetInternetGatewayResponse response) { - return response.getInternetGateway().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getInternetGateway().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.InternetGateway.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.InternetGateway.LifecycleState + .Terminated)), request); } @@ -475,16 +731,21 @@ public boolean apply(GetInternetGatewayResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter< GetLocalPeeringGatewayRequest, GetLocalPeeringGatewayResponse> forLocalPeeringGateway( GetLocalPeeringGatewayRequest request, - com.oracle.bmc.core.model.LocalPeeringGateway.LifecycleState targetState) { + com.oracle.bmc.core.model.LocalPeeringGateway.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forLocalPeeringGateway( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -503,20 +764,52 @@ public boolean apply(GetInternetGatewayResponse response) { com.oracle.bmc.core.model.LocalPeeringGateway.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forLocalPeeringGateway( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter< + GetLocalPeeringGatewayRequest, GetLocalPeeringGatewayResponse> + forLocalPeeringGateway( + GetLocalPeeringGatewayRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.LocalPeeringGateway.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forLocalPeeringGateway( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for LocalPeeringGateway. private com.oracle.bmc.waiter.Waiter< GetLocalPeeringGatewayRequest, GetLocalPeeringGatewayResponse> forLocalPeeringGateway( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetLocalPeeringGatewayRequest request, - final com.oracle.bmc.core.model.LocalPeeringGateway.LifecycleState - targetState) { + final com.oracle.bmc.core.model.LocalPeeringGateway.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -532,13 +825,13 @@ public GetLocalPeeringGatewayResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetLocalPeeringGatewayResponse response) { - return response.getLocalPeeringGateway().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getLocalPeeringGateway().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.LocalPeeringGateway.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.LocalPeeringGateway.LifecycleState + .Terminated)), request); } @@ -546,16 +839,21 @@ public boolean apply(GetLocalPeeringGatewayResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter< GetLocalPeeringGatewayRequest, GetLocalPeeringGatewayResponse> forLocalPeeringGateway( GetLocalPeeringGatewayRequest request, - com.oracle.bmc.core.model.LocalPeeringGateway.PeeringStatus targetState) { + com.oracle.bmc.core.model.LocalPeeringGateway.PeeringStatus... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forLocalPeeringGateway( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -574,19 +872,52 @@ public boolean apply(GetLocalPeeringGatewayResponse response) { com.oracle.bmc.core.model.LocalPeeringGateway.PeeringStatus targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forLocalPeeringGateway( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter< + GetLocalPeeringGatewayRequest, GetLocalPeeringGatewayResponse> + forLocalPeeringGateway( + GetLocalPeeringGatewayRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.LocalPeeringGateway.PeeringStatus... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forLocalPeeringGateway( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for LocalPeeringGateway. private com.oracle.bmc.waiter.Waiter< GetLocalPeeringGatewayRequest, GetLocalPeeringGatewayResponse> forLocalPeeringGateway( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetLocalPeeringGatewayRequest request, - final com.oracle.bmc.core.model.LocalPeeringGateway.PeeringStatus targetState) { + final com.oracle.bmc.core.model.LocalPeeringGateway.PeeringStatus... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -602,13 +933,13 @@ public GetLocalPeeringGatewayResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetLocalPeeringGatewayResponse response) { - return response.getLocalPeeringGateway().getPeeringStatus() - == targetState; + return targetStatesSet.contains( + response.getLocalPeeringGateway().getPeeringStatus()); } }, - targetState - == com.oracle.bmc.core.model.LocalPeeringGateway.PeeringStatus - .Revoked), + targetStatesSet.contains( + com.oracle.bmc.core.model.LocalPeeringGateway.PeeringStatus + .Revoked)), request); } @@ -616,14 +947,19 @@ public boolean apply(GetLocalPeeringGatewayResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forPublicIp( GetPublicIpRequest request, - com.oracle.bmc.core.model.PublicIp.LifecycleState targetState) { + com.oracle.bmc.core.model.PublicIp.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forPublicIp( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -640,17 +976,47 @@ public com.oracle.bmc.waiter.Waiter for com.oracle.bmc.core.model.PublicIp.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forPublicIp( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forPublicIp( + GetPublicIpRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.PublicIp.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forPublicIp( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for PublicIp. private com.oracle.bmc.waiter.Waiter forPublicIp( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetPublicIpRequest request, - final com.oracle.bmc.core.model.PublicIp.LifecycleState targetState) { + final com.oracle.bmc.core.model.PublicIp.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -665,11 +1031,12 @@ public GetPublicIpResponse apply(GetPublicIpRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetPublicIpResponse response) { - return response.getPublicIp().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getPublicIp().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.PublicIp.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.PublicIp.LifecycleState.Terminated)), request); } @@ -677,16 +1044,22 @@ public boolean apply(GetPublicIpResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter< GetRemotePeeringConnectionRequest, GetRemotePeeringConnectionResponse> forRemotePeeringConnection( GetRemotePeeringConnectionRequest request, - com.oracle.bmc.core.model.RemotePeeringConnection.PeeringStatus targetState) { + com.oracle.bmc.core.model.RemotePeeringConnection.PeeringStatus... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forRemotePeeringConnection( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -705,20 +1078,53 @@ public boolean apply(GetPublicIpResponse response) { com.oracle.bmc.core.model.RemotePeeringConnection.PeeringStatus targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forRemotePeeringConnection( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter< + GetRemotePeeringConnectionRequest, GetRemotePeeringConnectionResponse> + forRemotePeeringConnection( + GetRemotePeeringConnectionRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.RemotePeeringConnection.PeeringStatus... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forRemotePeeringConnection( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for RemotePeeringConnection. private com.oracle.bmc.waiter.Waiter< GetRemotePeeringConnectionRequest, GetRemotePeeringConnectionResponse> forRemotePeeringConnection( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetRemotePeeringConnectionRequest request, - final com.oracle.bmc.core.model.RemotePeeringConnection.PeeringStatus - targetState) { + final com.oracle.bmc.core.model.RemotePeeringConnection.PeeringStatus... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -735,13 +1141,13 @@ public GetRemotePeeringConnectionResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetRemotePeeringConnectionResponse response) { - return response.getRemotePeeringConnection().getPeeringStatus() - == targetState; + return targetStatesSet.contains( + response.getRemotePeeringConnection().getPeeringStatus()); } }, - targetState - == com.oracle.bmc.core.model.RemotePeeringConnection.PeeringStatus - .Revoked), + targetStatesSet.contains( + com.oracle.bmc.core.model.RemotePeeringConnection.PeeringStatus + .Revoked)), request); } @@ -749,16 +1155,22 @@ public boolean apply(GetRemotePeeringConnectionResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter< GetRemotePeeringConnectionRequest, GetRemotePeeringConnectionResponse> forRemotePeeringConnection( GetRemotePeeringConnectionRequest request, - com.oracle.bmc.core.model.RemotePeeringConnection.LifecycleState targetState) { + com.oracle.bmc.core.model.RemotePeeringConnection.LifecycleState... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forRemotePeeringConnection( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -777,20 +1189,53 @@ public boolean apply(GetRemotePeeringConnectionResponse response) { com.oracle.bmc.core.model.RemotePeeringConnection.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forRemotePeeringConnection( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter< + GetRemotePeeringConnectionRequest, GetRemotePeeringConnectionResponse> + forRemotePeeringConnection( + GetRemotePeeringConnectionRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.RemotePeeringConnection.LifecycleState... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forRemotePeeringConnection( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for RemotePeeringConnection. private com.oracle.bmc.waiter.Waiter< GetRemotePeeringConnectionRequest, GetRemotePeeringConnectionResponse> forRemotePeeringConnection( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetRemotePeeringConnectionRequest request, - final com.oracle.bmc.core.model.RemotePeeringConnection.LifecycleState - targetState) { + final com.oracle.bmc.core.model.RemotePeeringConnection.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -807,13 +1252,13 @@ public GetRemotePeeringConnectionResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetRemotePeeringConnectionResponse response) { - return response.getRemotePeeringConnection().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getRemotePeeringConnection().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.RemotePeeringConnection.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.RemotePeeringConnection.LifecycleState + .Terminated)), request); } @@ -821,14 +1266,19 @@ public boolean apply(GetRemotePeeringConnectionResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forRouteTable( GetRouteTableRequest request, - com.oracle.bmc.core.model.RouteTable.LifecycleState targetState) { + com.oracle.bmc.core.model.RouteTable.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forRouteTable( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -845,17 +1295,47 @@ public com.oracle.bmc.waiter.Waiter com.oracle.bmc.core.model.RouteTable.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forRouteTable( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forRouteTable( + GetRouteTableRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.RouteTable.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forRouteTable( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for RouteTable. private com.oracle.bmc.waiter.Waiter forRouteTable( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetRouteTableRequest request, - final com.oracle.bmc.core.model.RouteTable.LifecycleState targetState) { + final com.oracle.bmc.core.model.RouteTable.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -870,11 +1350,12 @@ public GetRouteTableResponse apply(GetRouteTableRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetRouteTableResponse response) { - return response.getRouteTable().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getRouteTable().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.RouteTable.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.RouteTable.LifecycleState.Terminated)), request); } @@ -882,15 +1363,20 @@ public boolean apply(GetRouteTableResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forSecurityList( GetSecurityListRequest request, - com.oracle.bmc.core.model.SecurityList.LifecycleState targetState) { + com.oracle.bmc.core.model.SecurityList.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forSecurityList( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -908,18 +1394,49 @@ public boolean apply(GetRouteTableResponse response) { com.oracle.bmc.core.model.SecurityList.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forSecurityList( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forSecurityList( + GetSecurityListRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.SecurityList.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forSecurityList( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for SecurityList. private com.oracle.bmc.waiter.Waiter forSecurityList( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetSecurityListRequest request, - final com.oracle.bmc.core.model.SecurityList.LifecycleState targetState) { + final com.oracle.bmc.core.model.SecurityList.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -934,13 +1451,12 @@ public GetSecurityListResponse apply(GetSecurityListRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetSecurityListResponse response) { - return response.getSecurityList().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getSecurityList().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.SecurityList.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.SecurityList.LifecycleState.Terminated)), request); } @@ -948,13 +1464,19 @@ public boolean apply(GetSecurityListResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forSubnet( - GetSubnetRequest request, com.oracle.bmc.core.model.Subnet.LifecycleState targetState) { + GetSubnetRequest request, + com.oracle.bmc.core.model.Subnet.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forSubnet( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -971,17 +1493,47 @@ public com.oracle.bmc.waiter.Waiter forSubn com.oracle.bmc.core.model.Subnet.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forSubnet( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forSubnet( + GetSubnetRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.Subnet.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forSubnet( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Subnet. private com.oracle.bmc.waiter.Waiter forSubnet( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetSubnetRequest request, - final com.oracle.bmc.core.model.Subnet.LifecycleState targetState) { + final com.oracle.bmc.core.model.Subnet.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -995,10 +1547,12 @@ public GetSubnetResponse apply(GetSubnetRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetSubnetResponse response) { - return response.getSubnet().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getSubnet().getLifecycleState()); } }, - targetState == com.oracle.bmc.core.model.Subnet.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.Subnet.LifecycleState.Terminated)), request); } @@ -1006,12 +1560,17 @@ public boolean apply(GetSubnetResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forVcn( - GetVcnRequest request, com.oracle.bmc.core.model.Vcn.LifecycleState targetState) { - return forVcn(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + GetVcnRequest request, com.oracle.bmc.core.model.Vcn.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + + return forVcn(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -1028,17 +1587,47 @@ public com.oracle.bmc.waiter.Waiter forVcn( com.oracle.bmc.core.model.Vcn.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forVcn( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forVcn( + GetVcnRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.Vcn.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forVcn( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Vcn. private com.oracle.bmc.waiter.Waiter forVcn( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetVcnRequest request, - final com.oracle.bmc.core.model.Vcn.LifecycleState targetState) { + final com.oracle.bmc.core.model.Vcn.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -1052,10 +1641,12 @@ public GetVcnResponse apply(GetVcnRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetVcnResponse response) { - return response.getVcn().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getVcn().getLifecycleState()); } }, - targetState == com.oracle.bmc.core.model.Vcn.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.Vcn.LifecycleState.Terminated)), request); } @@ -1063,15 +1654,20 @@ public boolean apply(GetVcnResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forVirtualCircuit( GetVirtualCircuitRequest request, - com.oracle.bmc.core.model.VirtualCircuit.LifecycleState targetState) { + com.oracle.bmc.core.model.VirtualCircuit.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forVirtualCircuit( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -1089,18 +1685,49 @@ public boolean apply(GetVcnResponse response) { com.oracle.bmc.core.model.VirtualCircuit.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forVirtualCircuit( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forVirtualCircuit( + GetVirtualCircuitRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.VirtualCircuit.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forVirtualCircuit( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for VirtualCircuit. private com.oracle.bmc.waiter.Waiter forVirtualCircuit( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetVirtualCircuitRequest request, - final com.oracle.bmc.core.model.VirtualCircuit.LifecycleState targetState) { + final com.oracle.bmc.core.model.VirtualCircuit.LifecycleState... targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -1116,13 +1743,13 @@ public GetVirtualCircuitResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetVirtualCircuitResponse response) { - return response.getVirtualCircuit().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getVirtualCircuit().getLifecycleState()); } }, - targetState - == com.oracle.bmc.core.model.VirtualCircuit.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.VirtualCircuit.LifecycleState + .Terminated)), request); } @@ -1130,12 +1757,17 @@ public boolean apply(GetVirtualCircuitResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forVnic( - GetVnicRequest request, com.oracle.bmc.core.model.Vnic.LifecycleState targetState) { - return forVnic(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + GetVnicRequest request, com.oracle.bmc.core.model.Vnic.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + + return forVnic(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -1152,17 +1784,47 @@ public com.oracle.bmc.waiter.Waiter forVnic( com.oracle.bmc.core.model.Vnic.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forVnic( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forVnic( + GetVnicRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.core.model.Vnic.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forVnic( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Vnic. private com.oracle.bmc.waiter.Waiter forVnic( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetVnicRequest request, - final com.oracle.bmc.core.model.Vnic.LifecycleState targetState) { + final com.oracle.bmc.core.model.Vnic.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -1176,10 +1838,12 @@ public GetVnicResponse apply(GetVnicRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetVnicResponse response) { - return response.getVnic().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getVnic().getLifecycleState()); } }, - targetState == com.oracle.bmc.core.model.Vnic.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.core.model.Vnic.LifecycleState.Terminated)), request); } } diff --git a/bmc-core/src/main/java/com/oracle/bmc/core/model/BootVolume.java b/bmc-core/src/main/java/com/oracle/bmc/core/model/BootVolume.java index 9167f4fb97b..0b303aca075 100644 --- a/bmc-core/src/main/java/com/oracle/bmc/core/model/BootVolume.java +++ b/bmc-core/src/main/java/com/oracle/bmc/core/model/BootVolume.java @@ -4,7 +4,7 @@ package com.oracle.bmc.core.model; /** - * A detachable boot volume device that contains the image used to boot an Compute instance. For more information, see + * A detachable boot volume device that contains the image used to boot a Compute instance. For more information, see * [Overview of Boot Volumes](https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/bootvolumes.htm). *

* To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, diff --git a/bmc-database/pom.xml b/bmc-database/pom.xml index e55f2fa88b7..63230194313 100644 --- a/bmc-database/pom.xml +++ b/bmc-database/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 diff --git a/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseAsyncClient.java b/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseAsyncClient.java index 9736f9f9823..5d5c845a091 100644 --- a/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseAsyncClient.java +++ b/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseAsyncClient.java @@ -178,13 +178,16 @@ public DatabaseAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseClient.java b/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseClient.java index 968362933db..1dc178007fb 100644 --- a/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseClient.java +++ b/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseClient.java @@ -183,13 +183,16 @@ public DatabaseClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); // up to 50 (core) threads, time out after 60s idle, all daemon diff --git a/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseWaiters.java b/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseWaiters.java index cde126ea10d..01a805f4bf1 100644 --- a/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseWaiters.java +++ b/bmc-database/src/main/java/com/oracle/bmc/database/DatabaseWaiters.java @@ -22,14 +22,19 @@ public class DatabaseWaiters { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forBackup( GetBackupRequest request, - com.oracle.bmc.database.model.Backup.LifecycleState targetState) { + com.oracle.bmc.database.model.Backup.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forBackup( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -46,17 +51,47 @@ public com.oracle.bmc.waiter.Waiter forBack com.oracle.bmc.database.model.Backup.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forBackup( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forBackup( + GetBackupRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.database.model.Backup.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forBackup( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Backup. private com.oracle.bmc.waiter.Waiter forBackup( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetBackupRequest request, - final com.oracle.bmc.database.model.Backup.LifecycleState targetState) { + final com.oracle.bmc.database.model.Backup.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -70,10 +105,12 @@ public GetBackupResponse apply(GetBackupRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetBackupResponse response) { - return response.getBackup().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getBackup().getLifecycleState()); } }, - targetState == com.oracle.bmc.database.model.Backup.LifecycleState.Deleted), + targetStatesSet.contains( + com.oracle.bmc.database.model.Backup.LifecycleState.Deleted)), request); } @@ -81,16 +118,22 @@ public boolean apply(GetBackupResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter< GetDataGuardAssociationRequest, GetDataGuardAssociationResponse> forDataGuardAssociation( GetDataGuardAssociationRequest request, - com.oracle.bmc.database.model.DataGuardAssociation.LifecycleState targetState) { + com.oracle.bmc.database.model.DataGuardAssociation.LifecycleState... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forDataGuardAssociation( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -109,20 +152,53 @@ public boolean apply(GetBackupResponse response) { com.oracle.bmc.database.model.DataGuardAssociation.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forDataGuardAssociation( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter< + GetDataGuardAssociationRequest, GetDataGuardAssociationResponse> + forDataGuardAssociation( + GetDataGuardAssociationRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.database.model.DataGuardAssociation.LifecycleState... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forDataGuardAssociation( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for DataGuardAssociation. private com.oracle.bmc.waiter.Waiter< GetDataGuardAssociationRequest, GetDataGuardAssociationResponse> forDataGuardAssociation( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDataGuardAssociationRequest request, - final com.oracle.bmc.database.model.DataGuardAssociation.LifecycleState - targetState) { + final com.oracle.bmc.database.model.DataGuardAssociation.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -138,13 +214,13 @@ public GetDataGuardAssociationResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetDataGuardAssociationResponse response) { - return response.getDataGuardAssociation().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getDataGuardAssociation().getLifecycleState()); } }, - targetState - == com.oracle.bmc.database.model.DataGuardAssociation.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.database.model.DataGuardAssociation.LifecycleState + .Terminated)), request); } @@ -152,14 +228,19 @@ public boolean apply(GetDataGuardAssociationResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDatabase( GetDatabaseRequest request, - com.oracle.bmc.database.model.Database.LifecycleState targetState) { + com.oracle.bmc.database.model.Database.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forDatabase( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -176,17 +257,47 @@ public com.oracle.bmc.waiter.Waiter for com.oracle.bmc.database.model.Database.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forDatabase( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forDatabase( + GetDatabaseRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.database.model.Database.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forDatabase( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Database. private com.oracle.bmc.waiter.Waiter forDatabase( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDatabaseRequest request, - final com.oracle.bmc.database.model.Database.LifecycleState targetState) { + final com.oracle.bmc.database.model.Database.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -201,12 +312,12 @@ public GetDatabaseResponse apply(GetDatabaseRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetDatabaseResponse response) { - return response.getDatabase().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getDatabase().getLifecycleState()); } }, - targetState - == com.oracle.bmc.database.model.Database.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.database.model.Database.LifecycleState.Terminated)), request); } @@ -214,14 +325,19 @@ public boolean apply(GetDatabaseResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDbHome( GetDbHomeRequest request, - com.oracle.bmc.database.model.DbHome.LifecycleState targetState) { + com.oracle.bmc.database.model.DbHome.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forDbHome( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -238,17 +354,47 @@ public com.oracle.bmc.waiter.Waiter forDbHo com.oracle.bmc.database.model.DbHome.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forDbHome( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forDbHome( + GetDbHomeRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.database.model.DbHome.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forDbHome( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for DbHome. private com.oracle.bmc.waiter.Waiter forDbHome( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDbHomeRequest request, - final com.oracle.bmc.database.model.DbHome.LifecycleState targetState) { + final com.oracle.bmc.database.model.DbHome.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -262,11 +408,12 @@ public GetDbHomeResponse apply(GetDbHomeRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetDbHomeResponse response) { - return response.getDbHome().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getDbHome().getLifecycleState()); } }, - targetState - == com.oracle.bmc.database.model.DbHome.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.database.model.DbHome.LifecycleState.Terminated)), request); } @@ -274,14 +421,19 @@ public boolean apply(GetDbHomeResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDbNode( GetDbNodeRequest request, - com.oracle.bmc.database.model.DbNode.LifecycleState targetState) { + com.oracle.bmc.database.model.DbNode.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forDbNode( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -298,17 +450,47 @@ public com.oracle.bmc.waiter.Waiter forDbNo com.oracle.bmc.database.model.DbNode.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forDbNode( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forDbNode( + GetDbNodeRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.database.model.DbNode.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forDbNode( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for DbNode. private com.oracle.bmc.waiter.Waiter forDbNode( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDbNodeRequest request, - final com.oracle.bmc.database.model.DbNode.LifecycleState targetState) { + final com.oracle.bmc.database.model.DbNode.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -322,11 +504,12 @@ public GetDbNodeResponse apply(GetDbNodeRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetDbNodeResponse response) { - return response.getDbNode().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getDbNode().getLifecycleState()); } }, - targetState - == com.oracle.bmc.database.model.DbNode.LifecycleState.Terminated), + targetStatesSet.contains( + com.oracle.bmc.database.model.DbNode.LifecycleState.Terminated)), request); } @@ -334,14 +517,19 @@ public boolean apply(GetDbNodeResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDbSystem( GetDbSystemRequest request, - com.oracle.bmc.database.model.DbSystem.LifecycleState targetState) { + com.oracle.bmc.database.model.DbSystem.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forDbSystem( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -358,17 +546,47 @@ public com.oracle.bmc.waiter.Waiter for com.oracle.bmc.database.model.DbSystem.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forDbSystem( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forDbSystem( + GetDbSystemRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.database.model.DbSystem.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forDbSystem( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for DbSystem. private com.oracle.bmc.waiter.Waiter forDbSystem( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDbSystemRequest request, - final com.oracle.bmc.database.model.DbSystem.LifecycleState targetState) { + final com.oracle.bmc.database.model.DbSystem.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -383,12 +601,12 @@ public GetDbSystemResponse apply(GetDbSystemRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetDbSystemResponse response) { - return response.getDbSystem().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getDbSystem().getLifecycleState()); } }, - targetState - == com.oracle.bmc.database.model.DbSystem.LifecycleState - .Terminated), + targetStatesSet.contains( + com.oracle.bmc.database.model.DbSystem.LifecycleState.Terminated)), request); } } diff --git a/bmc-dns/pom.xml b/bmc-dns/pom.xml index 029a400a88d..1ce3194732b 100644 --- a/bmc-dns/pom.xml +++ b/bmc-dns/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 diff --git a/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsAsyncClient.java b/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsAsyncClient.java index c5750da7767..9151a4b70ea 100644 --- a/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsAsyncClient.java +++ b/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsAsyncClient.java @@ -178,13 +178,16 @@ public DnsAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsClient.java b/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsClient.java index b8ec85ed6ed..4c7a1fef838 100644 --- a/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsClient.java +++ b/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsClient.java @@ -183,13 +183,16 @@ public DnsClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); // up to 50 (core) threads, time out after 60s idle, all daemon diff --git a/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsWaiters.java b/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsWaiters.java index 603c978c833..c41677974e1 100644 --- a/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsWaiters.java +++ b/bmc-dns/src/main/java/com/oracle/bmc/dns/DnsWaiters.java @@ -22,12 +22,17 @@ public class DnsWaiters { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forZone( - GetZoneRequest request, com.oracle.bmc.dns.model.Zone.LifecycleState targetState) { - return forZone(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + GetZoneRequest request, com.oracle.bmc.dns.model.Zone.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + + return forZone(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -44,17 +49,47 @@ public com.oracle.bmc.waiter.Waiter forZone( com.oracle.bmc.dns.model.Zone.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forZone( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forZone( + GetZoneRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.dns.model.Zone.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forZone( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Zone. private com.oracle.bmc.waiter.Waiter forZone( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetZoneRequest request, - final com.oracle.bmc.dns.model.Zone.LifecycleState targetState) { + final com.oracle.bmc.dns.model.Zone.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -68,10 +103,12 @@ public GetZoneResponse apply(GetZoneRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetZoneResponse response) { - return response.getZone().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getZone().getLifecycleState()); } }, - targetState == com.oracle.bmc.dns.model.Zone.LifecycleState.Deleted), + targetStatesSet.contains( + com.oracle.bmc.dns.model.Zone.LifecycleState.Deleted)), request); } } diff --git a/bmc-email/pom.xml b/bmc-email/pom.xml index ef459c9119b..29386febcfe 100644 --- a/bmc-email/pom.xml +++ b/bmc-email/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 diff --git a/bmc-email/src/main/java/com/oracle/bmc/email/EmailAsyncClient.java b/bmc-email/src/main/java/com/oracle/bmc/email/EmailAsyncClient.java index b9a6d3125a5..f14a0adb0b8 100644 --- a/bmc-email/src/main/java/com/oracle/bmc/email/EmailAsyncClient.java +++ b/bmc-email/src/main/java/com/oracle/bmc/email/EmailAsyncClient.java @@ -178,13 +178,16 @@ public EmailAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-email/src/main/java/com/oracle/bmc/email/EmailClient.java b/bmc-email/src/main/java/com/oracle/bmc/email/EmailClient.java index d612ff64eef..a6c34c42f26 100644 --- a/bmc-email/src/main/java/com/oracle/bmc/email/EmailClient.java +++ b/bmc-email/src/main/java/com/oracle/bmc/email/EmailClient.java @@ -183,13 +183,16 @@ public EmailClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); // up to 50 (core) threads, time out after 60s idle, all daemon diff --git a/bmc-email/src/main/java/com/oracle/bmc/email/EmailWaiters.java b/bmc-email/src/main/java/com/oracle/bmc/email/EmailWaiters.java index f8af41318eb..59a52e25e4a 100644 --- a/bmc-email/src/main/java/com/oracle/bmc/email/EmailWaiters.java +++ b/bmc-email/src/main/java/com/oracle/bmc/email/EmailWaiters.java @@ -22,14 +22,19 @@ public class EmailWaiters { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forSender( GetSenderRequest request, - com.oracle.bmc.email.model.Sender.LifecycleState targetState) { + com.oracle.bmc.email.model.Sender.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forSender( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -46,17 +51,47 @@ public com.oracle.bmc.waiter.Waiter forSend com.oracle.bmc.email.model.Sender.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forSender( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forSender( + GetSenderRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.email.model.Sender.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forSender( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Sender. private com.oracle.bmc.waiter.Waiter forSender( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetSenderRequest request, - final com.oracle.bmc.email.model.Sender.LifecycleState targetState) { + final com.oracle.bmc.email.model.Sender.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -70,10 +105,12 @@ public GetSenderResponse apply(GetSenderRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetSenderResponse response) { - return response.getSender().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getSender().getLifecycleState()); } }, - targetState == com.oracle.bmc.email.model.Sender.LifecycleState.Deleted), + targetStatesSet.contains( + com.oracle.bmc.email.model.Sender.LifecycleState.Deleted)), request); } } diff --git a/bmc-examples/pom.xml b/bmc-examples/pom.xml index 9db0ecec0de..3c6aded7077 100644 --- a/bmc-examples/pom.xml +++ b/bmc-examples/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-bom - 1.2.35 + 1.2.37 pom import diff --git a/bmc-examples/src/main/java/InstancePrincipalsAuthenticationDetailsProviderExample.java b/bmc-examples/src/main/java/InstancePrincipalsAuthenticationDetailsProviderExample.java index 2808d40d262..326fe6bea06 100644 --- a/bmc-examples/src/main/java/InstancePrincipalsAuthenticationDetailsProviderExample.java +++ b/bmc-examples/src/main/java/InstancePrincipalsAuthenticationDetailsProviderExample.java @@ -2,16 +2,16 @@ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. */ import com.google.common.base.Function; - import com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider; import com.oracle.bmc.identity.IdentityAsyncClient; import com.oracle.bmc.identity.IdentityClient; import com.oracle.bmc.identity.model.AvailabilityDomain; import com.oracle.bmc.identity.requests.ListAvailabilityDomainsRequest; import com.oracle.bmc.identity.responses.ListAvailabilityDomainsResponse; -import com.oracle.bmc.model.BmcException; import com.oracle.bmc.responses.AsyncHandler; +import java.net.ConnectException; +import java.net.SocketTimeoutException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; @@ -19,8 +19,18 @@ public class InstancePrincipalsAuthenticationDetailsProviderExample { public static void main(String[] args) throws Exception { - final InstancePrincipalsAuthenticationDetailsProvider provider = - InstancePrincipalsAuthenticationDetailsProvider.builder().build(); + final InstancePrincipalsAuthenticationDetailsProvider provider; + try { + provider = InstancePrincipalsAuthenticationDetailsProvider.builder().build(); + } catch (Exception e) { + if (e.getCause() instanceof SocketTimeoutException + || e.getCause() instanceof ConnectException) { + System.out.println( + "This sample only works when running on an OCI instance. Are you sure you’re running on an OCI instance? For more info see: https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/callingservicesfrominstances.htm"); + return; + } + throw e; + } final IdentityClient identityClient = new IdentityClient(provider); final IdentityAsyncClient identityAsyncClient = new IdentityAsyncClient(provider); diff --git a/bmc-filestorage/pom.xml b/bmc-filestorage/pom.xml index 95cd191e483..83acfc415a5 100644 --- a/bmc-filestorage/pom.xml +++ b/bmc-filestorage/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 diff --git a/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageAsyncClient.java b/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageAsyncClient.java index 7539a41af3b..2a641664c31 100644 --- a/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageAsyncClient.java +++ b/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageAsyncClient.java @@ -178,13 +178,16 @@ public FileStorageAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageClient.java b/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageClient.java index da63dc518cf..965ac60a3e4 100644 --- a/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageClient.java +++ b/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageClient.java @@ -183,13 +183,16 @@ public FileStorageClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); // up to 50 (core) threads, time out after 60s idle, all daemon diff --git a/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageWaiters.java b/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageWaiters.java index 9a87022046e..afdf9ea9ca9 100644 --- a/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageWaiters.java +++ b/bmc-filestorage/src/main/java/com/oracle/bmc/filestorage/FileStorageWaiters.java @@ -22,14 +22,19 @@ public class FileStorageWaiters { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forExport( GetExportRequest request, - com.oracle.bmc.filestorage.model.Export.LifecycleState targetState) { + com.oracle.bmc.filestorage.model.Export.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forExport( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -46,17 +51,47 @@ public com.oracle.bmc.waiter.Waiter forExpo com.oracle.bmc.filestorage.model.Export.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forExport( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forExport( + GetExportRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.filestorage.model.Export.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forExport( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Export. private com.oracle.bmc.waiter.Waiter forExport( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetExportRequest request, - final com.oracle.bmc.filestorage.model.Export.LifecycleState targetState) { + final com.oracle.bmc.filestorage.model.Export.LifecycleState... targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -70,11 +105,12 @@ public GetExportResponse apply(GetExportRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetExportResponse response) { - return response.getExport().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getExport().getLifecycleState()); } }, - targetState - == com.oracle.bmc.filestorage.model.Export.LifecycleState.Deleted), + targetStatesSet.contains( + com.oracle.bmc.filestorage.model.Export.LifecycleState.Deleted)), request); } @@ -82,14 +118,19 @@ public boolean apply(GetExportResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forExportSet( GetExportSetRequest request, - com.oracle.bmc.filestorage.model.ExportSet.LifecycleState targetState) { + com.oracle.bmc.filestorage.model.ExportSet.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forExportSet( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -106,17 +147,47 @@ public com.oracle.bmc.waiter.Waiter f com.oracle.bmc.filestorage.model.ExportSet.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forExportSet( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forExportSet( + GetExportSetRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.filestorage.model.ExportSet.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forExportSet( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for ExportSet. private com.oracle.bmc.waiter.Waiter forExportSet( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetExportSetRequest request, - final com.oracle.bmc.filestorage.model.ExportSet.LifecycleState targetState) { + final com.oracle.bmc.filestorage.model.ExportSet.LifecycleState... targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -131,12 +202,12 @@ public GetExportSetResponse apply(GetExportSetRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetExportSetResponse response) { - return response.getExportSet().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getExportSet().getLifecycleState()); } }, - targetState - == com.oracle.bmc.filestorage.model.ExportSet.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.filestorage.model.ExportSet.LifecycleState.Deleted)), request); } @@ -144,14 +215,19 @@ public boolean apply(GetExportSetResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forFileSystem( GetFileSystemRequest request, - com.oracle.bmc.filestorage.model.FileSystem.LifecycleState targetState) { + com.oracle.bmc.filestorage.model.FileSystem.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forFileSystem( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -168,17 +244,47 @@ public com.oracle.bmc.waiter.Waiter com.oracle.bmc.filestorage.model.FileSystem.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forFileSystem( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forFileSystem( + GetFileSystemRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.filestorage.model.FileSystem.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forFileSystem( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for FileSystem. private com.oracle.bmc.waiter.Waiter forFileSystem( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetFileSystemRequest request, - final com.oracle.bmc.filestorage.model.FileSystem.LifecycleState targetState) { + final com.oracle.bmc.filestorage.model.FileSystem.LifecycleState... targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -193,12 +299,13 @@ public GetFileSystemResponse apply(GetFileSystemRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetFileSystemResponse response) { - return response.getFileSystem().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getFileSystem().getLifecycleState()); } }, - targetState - == com.oracle.bmc.filestorage.model.FileSystem.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.filestorage.model.FileSystem.LifecycleState + .Deleted)), request); } @@ -206,15 +313,20 @@ public boolean apply(GetFileSystemResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forMountTarget( GetMountTargetRequest request, - com.oracle.bmc.filestorage.model.MountTarget.LifecycleState targetState) { + com.oracle.bmc.filestorage.model.MountTarget.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forMountTarget( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -232,18 +344,50 @@ public boolean apply(GetFileSystemResponse response) { com.oracle.bmc.filestorage.model.MountTarget.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forMountTarget( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forMountTarget( + GetMountTargetRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.filestorage.model.MountTarget.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forMountTarget( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for MountTarget. private com.oracle.bmc.waiter.Waiter forMountTarget( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetMountTargetRequest request, - final com.oracle.bmc.filestorage.model.MountTarget.LifecycleState targetState) { + final com.oracle.bmc.filestorage.model.MountTarget.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -258,12 +402,13 @@ public GetMountTargetResponse apply(GetMountTargetRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetMountTargetResponse response) { - return response.getMountTarget().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getMountTarget().getLifecycleState()); } }, - targetState - == com.oracle.bmc.filestorage.model.MountTarget.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.filestorage.model.MountTarget.LifecycleState + .Deleted)), request); } @@ -271,14 +416,19 @@ public boolean apply(GetMountTargetResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forSnapshot( GetSnapshotRequest request, - com.oracle.bmc.filestorage.model.Snapshot.LifecycleState targetState) { + com.oracle.bmc.filestorage.model.Snapshot.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forSnapshot( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -295,17 +445,47 @@ public com.oracle.bmc.waiter.Waiter for com.oracle.bmc.filestorage.model.Snapshot.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forSnapshot( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forSnapshot( + GetSnapshotRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.filestorage.model.Snapshot.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forSnapshot( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Snapshot. private com.oracle.bmc.waiter.Waiter forSnapshot( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetSnapshotRequest request, - final com.oracle.bmc.filestorage.model.Snapshot.LifecycleState targetState) { + final com.oracle.bmc.filestorage.model.Snapshot.LifecycleState... targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -320,12 +500,12 @@ public GetSnapshotResponse apply(GetSnapshotRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetSnapshotResponse response) { - return response.getSnapshot().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getSnapshot().getLifecycleState()); } }, - targetState - == com.oracle.bmc.filestorage.model.Snapshot.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.filestorage.model.Snapshot.LifecycleState.Deleted)), request); } } diff --git a/bmc-full/pom.xml b/bmc-full/pom.xml index 5be775aa254..dba5e5a9a8f 100644 --- a/bmc-full/pom.xml +++ b/bmc-full/pom.xml @@ -4,154 +4,19 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml oci-java-sdk-full Oracle Cloud Infrastructure SDK - Full SDK This project contains the complete SDK distribution used for Oracle Cloud Infrastructure https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/javasdk.htm - - - - ziponly - - - - maven-assembly-plugin - - true - true - - src/main/assembly/assembly.xml - - - - - package - - single - - - - - - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 2.3 - - - package - - shade - - - false - false - true - - ${java.io.tmpdir}/dependency-reduced-pom.xml - - - - com.oracle.oci.sdk:* - - - - - *:* - - **/pom.xml - **/pom.properties - - - - - - - - - - - maven-javadoc-plugin - - true - Oracle Cloud Infrastructure Java SDK - ${project.version} - Oracle Cloud Infrastructure Java SDK - ${project.version} - OCI Java SDK - - ../bmc-audit/target/generated-sources-for-docs/delombok; - ../bmc-common/target/generated-sources-for-docs/delombok; - ../bmc-core/target/generated-sources-for-docs/delombok; - ../bmc-database/target/generated-sources-for-docs/delombok; - ../bmc-dns/target/generated-sources-for-docs/delombok; - ../bmc-email/target/generated-sources-for-docs/delombok; - ../bmc-filestorage/target/generated-sources-for-docs/delombok; - ../bmc-identity/target/generated-sources-for-docs/delombok; - ../bmc-loadbalancer/target/generated-sources-for-docs/delombok; - ../bmc-objectstorage/bmc-objectstorage-extensions/target/generated-sources-for-docs/delombok; - ../bmc-objectstorage/bmc-objectstorage-generated/target/generated-sources-for-docs/delombok; - - - - Oracle Cloud Infrastructure Audit Service - com.oracle.bmc.audit* - - - Oracle Cloud Infrastructure Core Services (Compute/Virtual Network/Block Storage) - com.oracle.bmc.core* - - - Oracle Cloud Infrastructure Database Service - com.oracle.bmc.database* - - - Oracle Cloud Infrastructure DNS Service - com.oracle.bmc.dns* - - - Oracle Cloud Infrastructure Email Service - com.oracle.bmc.email* - - - Oracle Cloud Infrastructure File Storage - com.oracle.bmc.filestorage* - - - Oracle Cloud Infrastructure Identity Service - com.oracle.bmc.identity* - - - Oracle Cloud Infrastructure Load Balancer Service - com.oracle.bmc.loadbalancer* - - - Oracle Cloud Infrastructure Object Storage Service - com.oracle.bmc.objectstorage* - - - Oracle Cloud Infrastructure Common Runtime - com.oracle.bmc* - - - src/main/java/overview.html - - - - com.oracle.oci.sdk oci-java-sdk-bom - 1.2.35 + 1.2.37 pom import diff --git a/bmc-identity/pom.xml b/bmc-identity/pom.xml index 5e3e8a7878c..a9087815288 100644 --- a/bmc-identity/pom.xml +++ b/bmc-identity/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityAsyncClient.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityAsyncClient.java index 37caad3d3ba..4ffdabcd560 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityAsyncClient.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityAsyncClient.java @@ -178,13 +178,16 @@ public IdentityAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityClient.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityClient.java index dbaa5bb8a2f..ac0f82f10a2 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityClient.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityClient.java @@ -183,13 +183,16 @@ public IdentityClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); // up to 50 (core) threads, time out after 60s idle, all daemon diff --git a/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityWaiters.java b/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityWaiters.java index 4df89649dae..11625760c64 100644 --- a/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityWaiters.java +++ b/bmc-identity/src/main/java/com/oracle/bmc/identity/IdentityWaiters.java @@ -22,15 +22,20 @@ public class IdentityWaiters { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forCompartment( GetCompartmentRequest request, - com.oracle.bmc.identity.model.Compartment.LifecycleState targetState) { + com.oracle.bmc.identity.model.Compartment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forCompartment( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -48,18 +53,50 @@ public class IdentityWaiters { com.oracle.bmc.identity.model.Compartment.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forCompartment( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forCompartment( + GetCompartmentRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.identity.model.Compartment.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forCompartment( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Compartment. private com.oracle.bmc.waiter.Waiter forCompartment( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetCompartmentRequest request, - final com.oracle.bmc.identity.model.Compartment.LifecycleState targetState) { + final com.oracle.bmc.identity.model.Compartment.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -74,12 +111,12 @@ public GetCompartmentResponse apply(GetCompartmentRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetCompartmentResponse response) { - return response.getCompartment().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getCompartment().getLifecycleState()); } }, - targetState - == com.oracle.bmc.identity.model.Compartment.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.identity.model.Compartment.LifecycleState.Deleted)), request); } @@ -87,15 +124,20 @@ public boolean apply(GetCompartmentResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDynamicGroup( GetDynamicGroupRequest request, - com.oracle.bmc.identity.model.DynamicGroup.LifecycleState targetState) { + com.oracle.bmc.identity.model.DynamicGroup.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forDynamicGroup( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -113,18 +155,50 @@ public boolean apply(GetCompartmentResponse response) { com.oracle.bmc.identity.model.DynamicGroup.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forDynamicGroup( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forDynamicGroup( + GetDynamicGroupRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.identity.model.DynamicGroup.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forDynamicGroup( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for DynamicGroup. private com.oracle.bmc.waiter.Waiter forDynamicGroup( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDynamicGroupRequest request, - final com.oracle.bmc.identity.model.DynamicGroup.LifecycleState targetState) { + final com.oracle.bmc.identity.model.DynamicGroup.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -139,13 +213,12 @@ public GetDynamicGroupResponse apply(GetDynamicGroupRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetDynamicGroupResponse response) { - return response.getDynamicGroup().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getDynamicGroup().getLifecycleState()); } }, - targetState - == com.oracle.bmc.identity.model.DynamicGroup.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.identity.model.DynamicGroup.LifecycleState.Deleted)), request); } @@ -153,13 +226,19 @@ public boolean apply(GetDynamicGroupResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forGroup( GetGroupRequest request, - com.oracle.bmc.identity.model.Group.LifecycleState targetState) { - return forGroup(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.identity.model.Group.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + + return forGroup( + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -176,17 +255,47 @@ public com.oracle.bmc.waiter.Waiter forGroup( com.oracle.bmc.identity.model.Group.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forGroup( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forGroup( + GetGroupRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.identity.model.Group.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forGroup( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Group. private com.oracle.bmc.waiter.Waiter forGroup( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetGroupRequest request, - final com.oracle.bmc.identity.model.Group.LifecycleState targetState) { + final com.oracle.bmc.identity.model.Group.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -200,10 +309,12 @@ public GetGroupResponse apply(GetGroupRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetGroupResponse response) { - return response.getGroup().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getGroup().getLifecycleState()); } }, - targetState == com.oracle.bmc.identity.model.Group.LifecycleState.Deleted), + targetStatesSet.contains( + com.oracle.bmc.identity.model.Group.LifecycleState.Deleted)), request); } @@ -211,15 +322,20 @@ public boolean apply(GetGroupResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forIdentityProvider( GetIdentityProviderRequest request, - com.oracle.bmc.identity.model.IdentityProvider.LifecycleState targetState) { + com.oracle.bmc.identity.model.IdentityProvider.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forIdentityProvider( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -237,19 +353,50 @@ public boolean apply(GetGroupResponse response) { com.oracle.bmc.identity.model.IdentityProvider.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forIdentityProvider( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forIdentityProvider( + GetIdentityProviderRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.identity.model.IdentityProvider.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forIdentityProvider( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for IdentityProvider. private com.oracle.bmc.waiter.Waiter forIdentityProvider( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetIdentityProviderRequest request, - final com.oracle.bmc.identity.model.IdentityProvider.LifecycleState - targetState) { + final com.oracle.bmc.identity.model.IdentityProvider.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -265,13 +412,13 @@ public GetIdentityProviderResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetIdentityProviderResponse response) { - return response.getIdentityProvider().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getIdentityProvider().getLifecycleState()); } }, - targetState - == com.oracle.bmc.identity.model.IdentityProvider.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.identity.model.IdentityProvider.LifecycleState + .Deleted)), request); } @@ -279,15 +426,20 @@ public boolean apply(GetIdentityProviderResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forIdpGroupMapping( GetIdpGroupMappingRequest request, - com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState targetState) { + com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forIdpGroupMapping( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -305,19 +457,50 @@ public boolean apply(GetIdentityProviderResponse response) { com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forIdpGroupMapping( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forIdpGroupMapping( + GetIdpGroupMappingRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forIdpGroupMapping( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for IdpGroupMapping. private com.oracle.bmc.waiter.Waiter forIdpGroupMapping( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetIdpGroupMappingRequest request, - final com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState - targetState) { + final com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -333,13 +516,13 @@ public GetIdpGroupMappingResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetIdpGroupMappingResponse response) { - return response.getIdpGroupMapping().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getIdpGroupMapping().getLifecycleState()); } }, - targetState - == com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState + .Deleted)), request); } @@ -347,14 +530,19 @@ public boolean apply(GetIdpGroupMappingResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forPolicy( GetPolicyRequest request, - com.oracle.bmc.identity.model.Policy.LifecycleState targetState) { + com.oracle.bmc.identity.model.Policy.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forPolicy( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -371,17 +559,47 @@ public com.oracle.bmc.waiter.Waiter forPoli com.oracle.bmc.identity.model.Policy.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forPolicy( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forPolicy( + GetPolicyRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.identity.model.Policy.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forPolicy( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for Policy. private com.oracle.bmc.waiter.Waiter forPolicy( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetPolicyRequest request, - final com.oracle.bmc.identity.model.Policy.LifecycleState targetState) { + final com.oracle.bmc.identity.model.Policy.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -395,10 +613,12 @@ public GetPolicyResponse apply(GetPolicyRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetPolicyResponse response) { - return response.getPolicy().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getPolicy().getLifecycleState()); } }, - targetState == com.oracle.bmc.identity.model.Policy.LifecycleState.Deleted), + targetStatesSet.contains( + com.oracle.bmc.identity.model.Policy.LifecycleState.Deleted)), request); } @@ -406,12 +626,18 @@ public boolean apply(GetPolicyResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forUser( - GetUserRequest request, com.oracle.bmc.identity.model.User.LifecycleState targetState) { - return forUser(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + GetUserRequest request, + com.oracle.bmc.identity.model.User.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + + return forUser(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -428,17 +654,47 @@ public com.oracle.bmc.waiter.Waiter forUser( com.oracle.bmc.identity.model.User.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forUser( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forUser( + GetUserRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.identity.model.User.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forUser( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for User. private com.oracle.bmc.waiter.Waiter forUser( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetUserRequest request, - final com.oracle.bmc.identity.model.User.LifecycleState targetState) { + final com.oracle.bmc.identity.model.User.LifecycleState... targetStates) { + final java.util.Set targetStatesSet = + new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -452,10 +708,12 @@ public GetUserResponse apply(GetUserRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetUserResponse response) { - return response.getUser().getLifecycleState() == targetState; + return targetStatesSet.contains( + response.getUser().getLifecycleState()); } }, - targetState == com.oracle.bmc.identity.model.User.LifecycleState.Deleted), + targetStatesSet.contains( + com.oracle.bmc.identity.model.User.LifecycleState.Deleted)), request); } @@ -463,16 +721,22 @@ public boolean apply(GetUserResponse response) { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter< GetUserGroupMembershipRequest, GetUserGroupMembershipResponse> forUserGroupMembership( GetUserGroupMembershipRequest request, - com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState targetState) { + com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forUserGroupMembership( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -491,20 +755,53 @@ public boolean apply(GetUserResponse response) { com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forUserGroupMembership( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter< + GetUserGroupMembershipRequest, GetUserGroupMembershipResponse> + forUserGroupMembership( + GetUserGroupMembershipRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState... + targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forUserGroupMembership( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for UserGroupMembership. private com.oracle.bmc.waiter.Waiter< GetUserGroupMembershipRequest, GetUserGroupMembershipResponse> forUserGroupMembership( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetUserGroupMembershipRequest request, - final com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState - targetState) { + final com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -520,13 +817,13 @@ public GetUserGroupMembershipResponse apply( new com.google.common.base.Predicate() { @Override public boolean apply(GetUserGroupMembershipResponse response) { - return response.getUserGroupMembership().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getUserGroupMembership().getLifecycleState()); } }, - targetState - == com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState + .Deleted)), request); } } diff --git a/bmc-loadbalancer/pom.xml b/bmc-loadbalancer/pom.xml index 58f8b065387..4e240f9e035 100644 --- a/bmc-loadbalancer/pom.xml +++ b/bmc-loadbalancer/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancer.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancer.java index 81528f5eaa8..bde9dfe6652 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancer.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancer.java @@ -53,13 +53,23 @@ public interface LoadBalancer extends AutoCloseable { CreateBackendSetResponse createBackendSet(CreateBackendSetRequest request); /** - * Creates an asynchronous request to add an SSL certificate. + * Creates an asynchronous request to add an SSL certificate bundle. * @param request The request object containing the details to send * @return A response object containing details about the completed operation * @throws BmcException when an error occurs. */ CreateCertificateResponse createCertificate(CreateCertificateRequest request); + /** + * Adds a hostname resource to the specified load balancer. For more information, see + * [Managing Request Routing](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm). + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateHostnameResponse createHostname(CreateHostnameRequest request); + /** * Adds a listener to a load balancer. * @param request The request object containing the details to send @@ -133,13 +143,22 @@ public interface LoadBalancer extends AutoCloseable { DeleteBackendSetResponse deleteBackendSet(DeleteBackendSetRequest request); /** - * Deletes an SSL certificate from a load balancer. + * Deletes an SSL certificate bundle from a load balancer. * @param request The request object containing the details to send * @return A response object containing details about the completed operation * @throws BmcException when an error occurs. */ DeleteCertificateResponse deleteCertificate(DeleteCertificateRequest request); + /** + * Deletes a hostname resource from the specified load balancer. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteHostnameResponse deleteHostname(DeleteHostnameRequest request); + /** * Deletes a listener from a load balancer. * @param request The request object containing the details to send @@ -208,6 +227,14 @@ public interface LoadBalancer extends AutoCloseable { */ GetHealthCheckerResponse getHealthChecker(GetHealthCheckerRequest request); + /** + * Gets the specified hostname resource's configuration information. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetHostnameResponse getHostname(GetHostnameRequest request); + /** * Gets the specified load balancer's configuration information. * @param request The request object containing the details to send @@ -257,13 +284,21 @@ public interface LoadBalancer extends AutoCloseable { ListBackendsResponse listBackends(ListBackendsRequest request); /** - * Lists all SSL certificates associated with a given load balancer. + * Lists all SSL certificates bundles associated with a given load balancer. * @param request The request object containing the details to send * @return A response object containing details about the completed operation * @throws BmcException when an error occurs. */ ListCertificatesResponse listCertificates(ListCertificatesRequest request); + /** + * Lists all hostname resources associated with the specified load balancer. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListHostnamesResponse listHostnames(ListHostnamesRequest request); + /** * Lists the summary health statuses for all load balancers in the specified compartment. * @param request The request object containing the details to send @@ -344,6 +379,16 @@ public interface LoadBalancer extends AutoCloseable { */ UpdateHealthCheckerResponse updateHealthChecker(UpdateHealthCheckerRequest request); + /** + * Overwrites an existing hostname resource on the specified load balancer. Use this operation to change a + * virtual hostname. + * + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + UpdateHostnameResponse updateHostname(UpdateHostnameRequest request); + /** * Updates a listener for a given load balancer. * @param request The request object containing the details to send diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsync.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsync.java index fd8dcdebf9e..38f706784b9 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsync.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsync.java @@ -67,7 +67,7 @@ java.util.concurrent.Future createBackendSet( handler); /** - * Creates an asynchronous request to add an SSL certificate. + * Creates an asynchronous request to add an SSL certificate bundle. * * @param request The request object containing the details to send * @param handler The request handler to invoke upon completion, may be null. @@ -82,6 +82,23 @@ java.util.concurrent.Future createCertificate( CreateCertificateRequest, CreateCertificateResponse> handler); + /** + * Adds a hostname resource to the specified load balancer. For more information, see + * [Managing Request Routing](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm). + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future createHostname( + CreateHostnameRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + /** * Adds a listener to a load balancer. * @@ -192,7 +209,7 @@ java.util.concurrent.Future deleteBackendSet( handler); /** - * Deletes an SSL certificate from a load balancer. + * Deletes an SSL certificate bundle from a load balancer. * * @param request The request object containing the details to send * @param handler The request handler to invoke upon completion, may be null. @@ -207,6 +224,22 @@ java.util.concurrent.Future deleteCertificate( DeleteCertificateRequest, DeleteCertificateResponse> handler); + /** + * Deletes a hostname resource from the specified load balancer. + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future deleteHostname( + DeleteHostnameRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + /** * Deletes a listener from a load balancer. * @@ -333,6 +366,20 @@ java.util.concurrent.Future getHealthChecker( com.oracle.bmc.responses.AsyncHandler handler); + /** + * Gets the specified hostname resource's configuration information. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future getHostname( + GetHostnameRequest request, + com.oracle.bmc.responses.AsyncHandler handler); + /** * Gets the specified load balancer's configuration information. * @@ -425,7 +472,7 @@ java.util.concurrent.Future listBackends( handler); /** - * Lists all SSL certificates associated with a given load balancer. + * Lists all SSL certificates bundles associated with a given load balancer. * * @param request The request object containing the details to send * @param handler The request handler to invoke upon completion, may be null. @@ -439,6 +486,21 @@ java.util.concurrent.Future listCertificates( com.oracle.bmc.responses.AsyncHandler handler); + /** + * Lists all hostname resources associated with the specified load balancer. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future listHostnames( + ListHostnamesRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + /** * Lists the summary health statuses for all load balancers in the specified compartment. * @@ -592,6 +654,23 @@ java.util.concurrent.Future updateHealthChecker( UpdateHealthCheckerRequest, UpdateHealthCheckerResponse> handler); + /** + * Overwrites an existing hostname resource on the specified load balancer. Use this operation to change a + * virtual hostname. + * + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future updateHostname( + UpdateHostnameRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + /** * Updates a listener for a given load balancer. * diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsyncClient.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsyncClient.java index d154045dda9..2f37ce490a2 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsyncClient.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerAsyncClient.java @@ -178,13 +178,16 @@ public LoadBalancerAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); @@ -536,6 +539,91 @@ public java.util.concurrent.Future get() { } } + @Override + public java.util.concurrent.Future createHostname( + final CreateHostnameRequest request, + final com.oracle.bmc.responses.AsyncHandler< + CreateHostnameRequest, CreateHostnameResponse> + handler) { + LOG.trace("Called async createHostname"); + final CreateHostnameRequest interceptedRequest = + CreateHostnameConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + CreateHostnameConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = CreateHostnameConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + CreateHostnameRequest, CreateHostnameResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.post( + ib, + interceptedRequest.getCreateHostnameDetails(), + interceptedRequest, + onSuccess, + onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.post( + ib, + interceptedRequest.getCreateHostnameDetails(), + interceptedRequest, + onSuccess, + onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, CreateHostnameResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.post( + ib, + interceptedRequest.getCreateHostnameDetails(), + interceptedRequest, + onSuccess, + onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + @Override public java.util.concurrent.Future createListener( final CreateListenerRequest request, @@ -1000,6 +1088,76 @@ public java.util.concurrent.Future get() { } } + @Override + public java.util.concurrent.Future deleteHostname( + final DeleteHostnameRequest request, + final com.oracle.bmc.responses.AsyncHandler< + DeleteHostnameRequest, DeleteHostnameResponse> + handler) { + LOG.trace("Called async deleteHostname"); + final DeleteHostnameRequest interceptedRequest = + DeleteHostnameConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + DeleteHostnameConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = DeleteHostnameConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + DeleteHostnameRequest, DeleteHostnameResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.delete(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.delete(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, DeleteHostnameResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.delete(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + @Override public java.util.concurrent.Future deleteListener( final DeleteListenerRequest request, @@ -1559,6 +1717,75 @@ public java.util.concurrent.Future get() { } } + @Override + public java.util.concurrent.Future getHostname( + final GetHostnameRequest request, + final com.oracle.bmc.responses.AsyncHandler + handler) { + LOG.trace("Called async getHostname"); + final GetHostnameRequest interceptedRequest = + GetHostnameConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetHostnameConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = GetHostnameConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + GetHostnameRequest, GetHostnameResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, GetHostnameResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + @Override public java.util.concurrent.Future getLoadBalancer( final GetLoadBalancerRequest request, @@ -2050,6 +2277,75 @@ public java.util.concurrent.Future get() { } } + @Override + public java.util.concurrent.Future listHostnames( + final ListHostnamesRequest request, + final com.oracle.bmc.responses.AsyncHandler + handler) { + LOG.trace("Called async listHostnames"); + final ListHostnamesRequest interceptedRequest = + ListHostnamesConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListHostnamesConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = ListHostnamesConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + ListHostnamesRequest, ListHostnamesResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, ListHostnamesResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + @Override public java.util.concurrent.Future listLoadBalancerHealths( final ListLoadBalancerHealthsRequest request, @@ -2794,6 +3090,91 @@ public java.util.concurrent.Future get() { } } + @Override + public java.util.concurrent.Future updateHostname( + final UpdateHostnameRequest request, + final com.oracle.bmc.responses.AsyncHandler< + UpdateHostnameRequest, UpdateHostnameResponse> + handler) { + LOG.trace("Called async updateHostname"); + final UpdateHostnameRequest interceptedRequest = + UpdateHostnameConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + UpdateHostnameConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = UpdateHostnameConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + UpdateHostnameRequest, UpdateHostnameResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.put( + ib, + interceptedRequest.getUpdateHostnameDetails(), + interceptedRequest, + onSuccess, + onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.put( + ib, + interceptedRequest.getUpdateHostnameDetails(), + interceptedRequest, + onSuccess, + onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, UpdateHostnameResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.put( + ib, + interceptedRequest.getUpdateHostnameDetails(), + interceptedRequest, + onSuccess, + onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + @Override public java.util.concurrent.Future updateListener( final UpdateListenerRequest request, diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerClient.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerClient.java index 82333577db9..a47e8815167 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerClient.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerClient.java @@ -183,13 +183,16 @@ public LoadBalancerClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); // up to 50 (core) threads, time out after 60s idle, all daemon @@ -383,6 +386,32 @@ && canRetryRequestIfInstancePrincipalsUsed(e)) { } } + @Override + public CreateHostnameResponse createHostname(CreateHostnameRequest request) { + LOG.trace("Called createHostname"); + request = CreateHostnameConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + CreateHostnameConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = CreateHostnameConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = + client.post(ib, request.getCreateHostnameDetails(), request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + @Override public CreateListenerResponse createListener(CreateListenerRequest request) { LOG.trace("Called createListener"); @@ -536,6 +565,31 @@ && canRetryRequestIfInstancePrincipalsUsed(e)) { } } + @Override + public DeleteHostnameResponse deleteHostname(DeleteHostnameRequest request) { + LOG.trace("Called deleteHostname"); + request = DeleteHostnameConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + DeleteHostnameConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = DeleteHostnameConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.delete(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + @Override public DeleteListenerResponse deleteListener(DeleteListenerRequest request) { LOG.trace("Called deleteListener"); @@ -736,6 +790,31 @@ && canRetryRequestIfInstancePrincipalsUsed(e)) { } } + @Override + public GetHostnameResponse getHostname(GetHostnameRequest request) { + LOG.trace("Called getHostname"); + request = GetHostnameConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetHostnameConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = GetHostnameConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + @Override public GetLoadBalancerResponse getLoadBalancer(GetLoadBalancerRequest request) { LOG.trace("Called getLoadBalancer"); @@ -912,6 +991,31 @@ && canRetryRequestIfInstancePrincipalsUsed(e)) { } } + @Override + public ListHostnamesResponse listHostnames(ListHostnamesRequest request) { + LOG.trace("Called listHostnames"); + request = ListHostnamesConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListHostnamesConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = ListHostnamesConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + @Override public ListLoadBalancerHealthsResponse listLoadBalancerHealths( ListLoadBalancerHealthsRequest request) { @@ -1166,6 +1270,32 @@ && canRetryRequestIfInstancePrincipalsUsed(e)) { } } + @Override + public UpdateHostnameResponse updateHostname(UpdateHostnameRequest request) { + LOG.trace("Called updateHostname"); + request = UpdateHostnameConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + UpdateHostnameConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = UpdateHostnameConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = + client.put(ib, request.getUpdateHostnameDetails(), request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + @Override public UpdateListenerResponse updateListener(UpdateListenerRequest request) { LOG.trace("Called updateListener"); diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerWaiters.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerWaiters.java index 5887487e1f2..a3bb55c9298 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerWaiters.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/LoadBalancerWaiters.java @@ -22,15 +22,20 @@ public class LoadBalancerWaiters { * Creates a new {@link Waiter} using default configuration. * * @param request the request to send - * @param targetState the desired state to wait for + * @param targetStates the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forLoadBalancer( GetLoadBalancerRequest request, - com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState targetState) { + com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + return forLoadBalancer( - com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetState); + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** @@ -48,19 +53,50 @@ public class LoadBalancerWaiters { com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + return forLoadBalancer( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forLoadBalancer( + GetLoadBalancerRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one target state must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null target states are not permitted"); + + return forLoadBalancer( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + // Helper method to create a new Waiter for LoadBalancer. private com.oracle.bmc.waiter.Waiter forLoadBalancer( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetLoadBalancerRequest request, - final com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState - targetState) { + final com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState... + targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( @@ -75,13 +111,13 @@ public GetLoadBalancerResponse apply(GetLoadBalancerRequest request) { new com.google.common.base.Predicate() { @Override public boolean apply(GetLoadBalancerResponse response) { - return response.getLoadBalancer().getLifecycleState() - == targetState; + return targetStatesSet.contains( + response.getLoadBalancer().getLifecycleState()); } }, - targetState - == com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState - .Deleted), + targetStatesSet.contains( + com.oracle.bmc.loadbalancer.model.LoadBalancer.LifecycleState + .Deleted)), request); } diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateHostnameConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateHostnameConverter.java new file mode 100644 index 00000000000..d31576e5bba --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/CreateHostnameConverter.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.extern.slf4j.Slf4j +public class CreateHostnameConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static CreateHostnameRequest interceptRequest(CreateHostnameRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, CreateHostnameRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notNull(request.getCreateHostnameDetails(), "createHostnameDetails is required"); + Validate.notBlank(request.getLoadBalancerId(), "loadBalancerId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getLoadBalancerId())) + .path("hostnames"); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, CreateHostnameResponse>() { + @Override + public CreateHostnameResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for CreateHostnameResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + CreateHostnameResponse.Builder builder = + CreateHostnameResponse.builder(); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcWorkRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + CreateHostnameResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteHostnameConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteHostnameConverter.java new file mode 100644 index 00000000000..8f573c745c7 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/DeleteHostnameConverter.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.extern.slf4j.Slf4j +public class DeleteHostnameConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static DeleteHostnameRequest interceptRequest(DeleteHostnameRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, DeleteHostnameRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getLoadBalancerId(), "loadBalancerId must not be blank"); + Validate.notBlank(request.getName(), "name must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getLoadBalancerId())) + .path("hostnames") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getName())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, DeleteHostnameResponse>() { + @Override + public DeleteHostnameResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for DeleteHostnameResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + DeleteHostnameResponse.Builder builder = + DeleteHostnameResponse.builder(); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcWorkRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + DeleteHostnameResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetHostnameConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetHostnameConverter.java new file mode 100644 index 00000000000..0d808ea4635 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/GetHostnameConverter.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.extern.slf4j.Slf4j +public class GetHostnameConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static GetHostnameRequest interceptRequest(GetHostnameRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, GetHostnameRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getLoadBalancerId(), "loadBalancerId must not be blank"); + Validate.notBlank(request.getName(), "name must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getLoadBalancerId())) + .path("hostnames") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getName())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, GetHostnameResponse>() { + @Override + public GetHostnameResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for GetHostnameResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = + RESPONSE_CONVERSION_FACTORY.create(Hostname.class); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + GetHostnameResponse.Builder builder = GetHostnameResponse.builder(); + + builder.hostname(response.getItem()); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetHostnameResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListHostnamesConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListHostnamesConverter.java new file mode 100644 index 00000000000..38fba659e53 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/ListHostnamesConverter.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.extern.slf4j.Slf4j +public class ListHostnamesConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static ListHostnamesRequest interceptRequest(ListHostnamesRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, ListHostnamesRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getLoadBalancerId(), "loadBalancerId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getLoadBalancerId())) + .path("hostnames"); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, ListHostnamesResponse>() { + @Override + public ListHostnamesResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for ListHostnamesResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + java.util.List>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new javax.ws.rs.core.GenericType< + java.util.List>() {}); + + com.oracle.bmc.http.internal.WithHeaders> + response = responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + ListHostnamesResponse.Builder builder = + ListHostnamesResponse.builder(); + + builder.items(response.getItem()); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListHostnamesResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateHostnameConverter.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateHostnameConverter.java new file mode 100644 index 00000000000..143cda71634 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/internal/http/UpdateHostnameConverter.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.internal.http; + +import com.oracle.bmc.loadbalancer.model.*; +import com.oracle.bmc.loadbalancer.requests.*; +import com.oracle.bmc.loadbalancer.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.extern.slf4j.Slf4j +public class UpdateHostnameConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static UpdateHostnameRequest interceptRequest(UpdateHostnameRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, UpdateHostnameRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notNull(request.getUpdateHostnameDetails(), "updateHostnameDetails is required"); + Validate.notBlank(request.getLoadBalancerId(), "loadBalancerId must not be blank"); + Validate.notBlank(request.getName(), "name must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20170115") + .path("loadBalancers") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getLoadBalancerId())) + .path("hostnames") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getName())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, UpdateHostnameResponse>() { + @Override + public UpdateHostnameResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for UpdateHostnameResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + UpdateHostnameResponse.Builder builder = + UpdateHostnameResponse.builder(); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcWorkRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + UpdateHostnameResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Backend.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Backend.java index e875f62cd28..c557ccb7c13 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Backend.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Backend.java @@ -123,7 +123,7 @@ public static Builder builder() { * Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress * traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("backup") @@ -133,7 +133,7 @@ public static Builder builder() { * Whether the load balancer should drain this server. Servers marked \"drain\" receive no new * incoming traffic. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("drain") @@ -142,7 +142,7 @@ public static Builder builder() { /** * The IP address of the backend server. *

- * Example: `10.10.10.4` + * Example: `10.0.0.3` * **/ @com.fasterxml.jackson.annotation.JsonProperty("ipAddress") @@ -151,7 +151,7 @@ public static Builder builder() { /** * A read-only field showing the IP address and port that uniquely identify this backend server in the backend set. *

- * Example: `10.10.10.4:8080` + * Example: `10.0.0.3:8080` * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") @@ -161,7 +161,7 @@ public static Builder builder() { * Whether the load balancer should treat this server as offline. Offline servers receive no incoming * traffic. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("offline") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendDetails.java index 4bc2b4e936d..1cda9b88d8a 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendDetails.java @@ -111,7 +111,7 @@ public static Builder builder() { * Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress * traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("backup") @@ -121,7 +121,7 @@ public static Builder builder() { * Whether the load balancer should drain this server. Servers marked \"drain\" receive no new * incoming traffic. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("drain") @@ -130,7 +130,7 @@ public static Builder builder() { /** * The IP address of the backend server. *

- * Example: `10.10.10.4` + * Example: `10.0.0.3` * **/ @com.fasterxml.jackson.annotation.JsonProperty("ipAddress") @@ -140,7 +140,7 @@ public static Builder builder() { * Whether the load balancer should treat this server as offline. Offline servers receive no incoming * traffic. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("offline") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSet.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSet.java index a28f3e22f44..4a6f19b0b5d 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSet.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSet.java @@ -129,7 +129,7 @@ public static Builder builder() { * Valid backend set names include only alphanumeric characters, dashes, and underscores. Backend set names cannot * contain spaces. Avoid entering confidential information. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSetHealth.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSetHealth.java index 1a797de9321..a1e7d5f0ede 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSetHealth.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/BackendSetHealth.java @@ -110,7 +110,7 @@ public static Builder builder() { * A list of backend servers that are currently in the `CRITICAL` health state. The list identifies each backend server by * IP address and port. *

- * Example: `1.1.1.1:80` + * Example: `10.0.0.4:8080` * **/ @com.fasterxml.jackson.annotation.JsonProperty("criticalStateBackendNames") @@ -194,7 +194,7 @@ public static Status create(String key) { /** * The total number of backend servers in this backend set. *

- * Example: `5` + * Example: `7` * **/ @com.fasterxml.jackson.annotation.JsonProperty("totalBackendCount") @@ -204,7 +204,7 @@ public static Status create(String key) { * A list of backend servers that are currently in the `UNKNOWN` health state. The list identifies each backend server by * IP address and port. *

- * Example: `1.1.1.5:80` + * Example: `10.0.0.5:8080` * **/ @com.fasterxml.jackson.annotation.JsonProperty("unknownStateBackendNames") @@ -214,7 +214,7 @@ public static Status create(String key) { * A list of backend servers that are currently in the `WARNING` health state. The list identifies each backend server by * IP address and port. *

- * Example: `1.1.1.7:42` + * Example: `10.0.0.3:8080` * **/ @com.fasterxml.jackson.annotation.JsonProperty("warningStateBackendNames") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Certificate.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Certificate.java index 04bd9a7f1dc..103ad1f3ebc 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Certificate.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Certificate.java @@ -4,7 +4,7 @@ package com.oracle.bmc.loadbalancer.model; /** - * The configuration details of a listener certificate bundle. + * The configuration details of a certificate bundle. * For more information on SSL certficate configuration, see * [Managing SSL Certificates](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingcertificates.htm). * @@ -102,7 +102,7 @@ public static Builder builder() { * Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. * Certificate bundle names cannot contain spaces. Avoid entering confidential information. *

- * Example: `My_certificate_bundle` + * Example: `example_certificate_bundle` * **/ @com.fasterxml.jackson.annotation.JsonProperty("certificateName") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CertificateDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CertificateDetails.java index 51ee6e3e8a8..068a70550a0 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CertificateDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CertificateDetails.java @@ -4,7 +4,7 @@ package com.oracle.bmc.loadbalancer.model; /** - * The configuration details for a listener certificate bundle. + * The configuration details for a certificate bundle. * For more information on SSL certficate configuration, see * [Managing SSL Certificates](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingcertificates.htm). * @@ -129,7 +129,7 @@ public static Builder builder() { * Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. * Certificate bundle names cannot contain spaces. Avoid entering confidential information. *

- * Example: `My_certificate_bundle` + * Example: `example_certificate_bundle` * **/ @com.fasterxml.jackson.annotation.JsonProperty("certificateName") @@ -137,8 +137,6 @@ public static Builder builder() { /** * A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. - *

- * Example: `Mysecretunlockingcode42!1!` * **/ @com.fasterxml.jackson.annotation.JsonProperty("passphrase") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ConnectionConfiguration.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ConnectionConfiguration.java index ce7acb45c06..298463aad05 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ConnectionConfiguration.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ConnectionConfiguration.java @@ -63,34 +63,7 @@ public static Builder builder() { * between the client and backend servers. A send operation does not reset the timer for receive operations. A * receive operation does not reset the timer for send operations. *

- * The default values are: - *

- * 300 seconds for TCP - *

- * 60 seconds for HTTP and WebSocket protocols. - *

- * Note: The protocol is set at the listener. - *

- * Modify this parameter if the client or backend server stops transmitting data for more than the default time. - * Some examples include: - *

- * The client sends a database query to the backend server and the database takes over 300 seconds to execute. - * Therefore, the backend server does not transmit any data within 300 seconds. - *

- * The client uploads data using the HTTP protocol. During the upload, the backend does not transmit any data - * to the client for more than 60 seconds. - *

- * The client downloads data using the HTTP protocol. After the initial request, it stops transmitting data to - * the backend server for more than 60 seconds. - *

- * The client starts transmitting data after establishing a WebSocket connection, but the backend server does - * not transmit data for more than 60 seconds. - *

- * The backend server starts transmitting data after establishing a WebSocket connection, but the client does - * not transmit data for more than 60 seconds. - *

- * The maximum value is 7200 seconds. Contact My Oracle Support to file a service request if you want to increase - * this limit for your tenancy. For more information, see [Service Limits](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/servicelimits.htm). + * For more information, see [Connection Configuration](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/connectionreuse.htm#ConnectionConfiguration). *

* Example: `1200` * diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendDetails.java index e77ccb54c99..f4ff9eb16e9 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendDetails.java @@ -116,7 +116,7 @@ public static Builder builder() { * Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress * traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("backup") @@ -126,7 +126,7 @@ public static Builder builder() { * Whether the load balancer should drain this server. Servers marked \"drain\" receive no new * incoming traffic. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("drain") @@ -135,7 +135,7 @@ public static Builder builder() { /** * The IP address of the backend server. *

- * Example: `10.10.10.4` + * Example: `10.0.0.3` * **/ @com.fasterxml.jackson.annotation.JsonProperty("ipAddress") @@ -145,7 +145,7 @@ public static Builder builder() { * Whether the load balancer should treat this server as offline. Offline servers receive no incoming * traffic. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("offline") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendSetDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendSetDetails.java index b515069fae5..2fbc1d8a9b6 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendSetDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateBackendSetDetails.java @@ -131,7 +131,7 @@ public static Builder builder() { * Valid backend set names include only alphanumeric characters, dashes, and underscores. Backend set names cannot * contain spaces. Avoid entering confidential information. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateCertificateDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateCertificateDetails.java index 348323a4cef..b089bd58a69 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateCertificateDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateCertificateDetails.java @@ -129,7 +129,7 @@ public static Builder builder() { * Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. * Certificate bundle names cannot contain spaces. Avoid entering confidential information. *

- * Example: `My_certificate_bundle` + * Example: `example_certificate_bundle` * **/ @com.fasterxml.jackson.annotation.JsonProperty("certificateName") @@ -137,8 +137,6 @@ public static Builder builder() { /** * A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase. - *

- * Example: `Mysecretunlockingcode42!1!` * **/ @com.fasterxml.jackson.annotation.JsonProperty("passphrase") @@ -167,10 +165,10 @@ public static Builder builder() { * Example: *

* -----BEGIN CERTIFICATE----- - * MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG - * A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE - * MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl - * YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw + * MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbM..QswCQYDVQQGEwJKU + * A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxE..TAPBgNVBAoTCEZyY + * MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWB..gNVBAMTD0ZyYW5rN + * YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmc..mFuazRkZC5jb20wH * ... * -----END CERTIFICATE----- * diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateHostnameDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateHostnameDetails.java new file mode 100644 index 00000000000..fc83925e737 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateHostnameDetails.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +/** + * The details of the hostname resource to add to a load balancer. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = CreateHostnameDetails.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class CreateHostnameDetails { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("hostname") + private String hostname; + + public Builder hostname(String hostname) { + this.hostname = hostname; + this.__explicitlySet__.add("hostname"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public CreateHostnameDetails build() { + CreateHostnameDetails __instance__ = new CreateHostnameDetails(hostname, name); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(CreateHostnameDetails o) { + Builder copiedBuilder = hostname(o.getHostname()).name(o.getName()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * A virtual hostname. For more information about virtual hostname string construction, see + * [Managing Request Routing](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm#routing). + *

+ * Example: `app.example.com` + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("hostname") + String hostname; + + /** + * A friendly name for the hostname resource. It must be unique and it cannot be changed. Avoid entering confidential + * information. + *

+ * Example: `example_hostname_001` + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateListenerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateListenerDetails.java index 3bbfc9c6a45..ef7372b5b03 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateListenerDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateListenerDetails.java @@ -6,7 +6,7 @@ /** * The configuration details for adding a listener to a backend set. * For more information on listener configuration, see - * [Managing Load Balancer Listeners](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managinglisteners.htm). + * [Managing Load Balancer Listeners](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managinglisteners.htm). * *
* Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly @@ -44,6 +44,15 @@ public Builder defaultBackendSetName(String defaultBackendSetName) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("hostnameNames") + private java.util.List hostnameNames; + + public Builder hostnameNames(java.util.List hostnameNames) { + this.hostnameNames = hostnameNames; + this.__explicitlySet__.add("hostnameNames"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("name") private String name; @@ -97,6 +106,7 @@ public CreateListenerDetails build() { new CreateListenerDetails( connectionConfiguration, defaultBackendSetName, + hostnameNames, name, pathRouteSetName, port, @@ -111,6 +121,7 @@ public Builder copy(CreateListenerDetails o) { Builder copiedBuilder = connectionConfiguration(o.getConnectionConfiguration()) .defaultBackendSetName(o.getDefaultBackendSetName()) + .hostnameNames(o.getHostnameNames()) .name(o.getName()) .pathRouteSetName(o.getPathRouteSetName()) .port(o.getPort()) @@ -135,17 +146,23 @@ public static Builder builder() { /** * The name of the associated backend set. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("defaultBackendSetName") String defaultBackendSetName; + /** + * An array of hostname resource names. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("hostnameNames") + java.util.List hostnameNames; + /** * A friendly name for the listener. It must be unique and it cannot be changed. * Avoid entering confidential information. *

- * Example: `My listener` + * Example: `example_listener` * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") @@ -155,7 +172,7 @@ public static Builder builder() { * The name of the set of path-based routing rules, {@link PathRouteSet}, * applied to this listener's traffic. *

- * Example: `path-route-set-001` + * Example: `example_path_route_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("pathRouteSetName") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateLoadBalancerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateLoadBalancerDetails.java index 01539065fb1..7a3c3042002 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateLoadBalancerDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreateLoadBalancerDetails.java @@ -59,6 +59,15 @@ public Builder displayName(String displayName) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("hostnames") + private java.util.Map hostnames; + + public Builder hostnames(java.util.Map hostnames) { + this.hostnames = hostnames; + this.__explicitlySet__.add("hostnames"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("isPrivate") private Boolean isPrivate; @@ -114,6 +123,7 @@ public CreateLoadBalancerDetails build() { certificates, compartmentId, displayName, + hostnames, isPrivate, listeners, pathRouteSets, @@ -130,6 +140,7 @@ public Builder copy(CreateLoadBalancerDetails o) { .certificates(o.getCertificates()) .compartmentId(o.getCompartmentId()) .displayName(o.getDisplayName()) + .hostnames(o.getHostnames()) .isPrivate(o.getIsPrivate()) .listeners(o.getListeners()) .pathRouteSets(o.getPathRouteSets()) @@ -164,12 +175,15 @@ public static Builder builder() { * A user-friendly name. It does not have to be unique, and it is changeable. * Avoid entering confidential information. *

- * Example: `My load balancer` + * Example: `example_load_balancer` * **/ @com.fasterxml.jackson.annotation.JsonProperty("displayName") String displayName; + @com.fasterxml.jackson.annotation.JsonProperty("hostnames") + java.util.Map hostnames; + /** * Whether the load balancer has a VCN-local (private) IP address. *

@@ -185,7 +199,7 @@ public static Builder builder() { * hosts the secondary (standby) load balancer. A public load balancer is accessible from the internet, depending on your * VCN's [security list rules](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm). *

- * Example: `false` + * Example: `true` * **/ @com.fasterxml.jackson.annotation.JsonProperty("isPrivate") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreatePathRouteSetDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreatePathRouteSetDetails.java index 968214bce99..80b8858f049 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreatePathRouteSetDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/CreatePathRouteSetDetails.java @@ -71,7 +71,7 @@ public static Builder builder() { * The name for this set of path route rules. It must be unique and it cannot be changed. Avoid entering * confidential information. *

- * Example: `path-route-set-001` + * Example: `example_path_route_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckResult.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckResult.java index 53f805090e2..dc64c0db25a 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckResult.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckResult.java @@ -154,14 +154,14 @@ public static HealthCheckStatus create(String key) { * The IP address of the health check status report provider. This identifier helps you differentiate same-subnet * (private) load balancers that report health check status. *

- * Example: `10.2.0.1` + * Example: `10.0.0.7` * **/ @com.fasterxml.jackson.annotation.JsonProperty("sourceIpAddress") String sourceIpAddress; /** - * The OCID of the subnet hosting the load balancer that reported this health check status. + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the subnet hosting the load balancer that reported this health check status. * **/ @com.fasterxml.jackson.annotation.JsonProperty("subnetId") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthChecker.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthChecker.java index abaadfb1961..0d0959ff002 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthChecker.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthChecker.java @@ -140,7 +140,7 @@ public static Builder builder() { /** * The interval between health checks, in milliseconds. The default is 10000 (10 seconds). *

- * Example: `30000` + * Example: `10000` * **/ @com.fasterxml.jackson.annotation.JsonProperty("intervalInMillis") @@ -168,7 +168,7 @@ public static Builder builder() { /** * A regular expression for parsing the response body from the backend server. *

- * Example: `^(500|40[1348])$` + * Example: `^((?!false).|\\s)*$` * **/ @com.fasterxml.jackson.annotation.JsonProperty("responseBodyRegex") @@ -197,7 +197,7 @@ public static Builder builder() { * The maximum time, in milliseconds, to wait for a reply to a health check. A health check is successful only if a reply * returns within this timeout period. Defaults to 3000 (3 seconds). *

- * Example: `6000` + * Example: `3000` * **/ @com.fasterxml.jackson.annotation.JsonProperty("timeoutInMillis") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckerDetails.java index 804307bc2f1..1862cca6b3c 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckerDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HealthCheckerDetails.java @@ -140,7 +140,7 @@ public static Builder builder() { /** * The interval between health checks, in milliseconds. *

- * Example: `30000` + * Example: `10000` * **/ @com.fasterxml.jackson.annotation.JsonProperty("intervalInMillis") @@ -168,7 +168,7 @@ public static Builder builder() { /** * A regular expression for parsing the response body from the backend server. *

- * Example: `^(500|40[1348])$` + * Example: `^((?!false).|\\s)*$` * **/ @com.fasterxml.jackson.annotation.JsonProperty("responseBodyRegex") @@ -196,7 +196,7 @@ public static Builder builder() { * The maximum time, in milliseconds, to wait for a reply to a health check. A health check is successful only if a reply * returns within this timeout period. *

- * Example: `6000` + * Example: `3000` * **/ @com.fasterxml.jackson.annotation.JsonProperty("timeoutInMillis") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Hostname.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Hostname.java new file mode 100644 index 00000000000..3babd65ea2a --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Hostname.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +/** + * A hostname resource associated with a load balancer for use by one or more listeners. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = Hostname.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class Hostname { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("hostname") + private String hostname; + + public Builder hostname(String hostname) { + this.hostname = hostname; + this.__explicitlySet__.add("hostname"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public Hostname build() { + Hostname __instance__ = new Hostname(hostname, name); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(Hostname o) { + Builder copiedBuilder = hostname(o.getHostname()).name(o.getName()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * A virtual hostname. For more information about virtual hostname string construction, see + * [Managing Request Routing](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm#routing). + *

+ * Example: `app.example.com` + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("hostname") + String hostname; + + /** + * A friendly name for the hostname resource. It must be unique and it cannot be changed. Avoid entering confidential + * information. + *

+ * Example: `example_hostname_001` + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HostnameDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HostnameDetails.java new file mode 100644 index 00000000000..c7dda79eaa3 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/HostnameDetails.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +/** + * The details of a hostname resource associated with a load balancer. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = HostnameDetails.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class HostnameDetails { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("hostname") + private String hostname; + + public Builder hostname(String hostname) { + this.hostname = hostname; + this.__explicitlySet__.add("hostname"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public HostnameDetails build() { + HostnameDetails __instance__ = new HostnameDetails(hostname, name); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(HostnameDetails o) { + Builder copiedBuilder = hostname(o.getHostname()).name(o.getName()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * A virtual hostname. For more information about virtual hostname string construction, see + * [Managing Request Routing](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm#routing). + *

+ * Example: `app.example.com` + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("hostname") + String hostname; + + /** + * The name of the hostname resource. + *

+ * Example: `example_hostname_001` + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/IpAddress.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/IpAddress.java index 3021ca4627b..9365d3d0a9a 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/IpAddress.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/IpAddress.java @@ -67,7 +67,7 @@ public static Builder builder() { /** * An IP address. *

- * Example: `128.148.10.20` + * Example: `192.168.0.3` * **/ @com.fasterxml.jackson.annotation.JsonProperty("ipAddress") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Listener.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Listener.java index 0ec4d1136aa..aa70418b2c0 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Listener.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/Listener.java @@ -6,7 +6,7 @@ /** * The listener's configuration. * For more information on backend set configuration, see - * [Managing Load Balancer Listeners](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/tasks/managinglisteners.htm). + * [Managing Load Balancer Listeners](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managinglisteners.htm). * *
* Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly @@ -42,6 +42,15 @@ public Builder defaultBackendSetName(String defaultBackendSetName) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("hostnameNames") + private java.util.List hostnameNames; + + public Builder hostnameNames(java.util.List hostnameNames) { + this.hostnameNames = hostnameNames; + this.__explicitlySet__.add("hostnameNames"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("name") private String name; @@ -95,6 +104,7 @@ public Listener build() { new Listener( connectionConfiguration, defaultBackendSetName, + hostnameNames, name, pathRouteSetName, port, @@ -109,6 +119,7 @@ public Builder copy(Listener o) { Builder copiedBuilder = connectionConfiguration(o.getConnectionConfiguration()) .defaultBackendSetName(o.getDefaultBackendSetName()) + .hostnameNames(o.getHostnameNames()) .name(o.getName()) .pathRouteSetName(o.getPathRouteSetName()) .port(o.getPort()) @@ -133,16 +144,22 @@ public static Builder builder() { /** * The name of the associated backend set. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("defaultBackendSetName") String defaultBackendSetName; + /** + * An array of hostname resource names. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("hostnameNames") + java.util.List hostnameNames; + /** * A friendly name for the listener. It must be unique and it cannot be changed. *

- * Example: `My listener` + * Example: `example_listener` * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") @@ -152,7 +169,7 @@ public static Builder builder() { * The name of the set of path-based routing rules, {@link PathRouteSet}, * applied to this listener's traffic. *

- * Example: `path-route-set-001` + * Example: `example_path_route_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("pathRouteSetName") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ListenerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ListenerDetails.java index 403b973b9af..a0bf256a701 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ListenerDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/ListenerDetails.java @@ -39,6 +39,15 @@ public Builder defaultBackendSetName(String defaultBackendSetName) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("hostnameNames") + private java.util.List hostnameNames; + + public Builder hostnameNames(java.util.List hostnameNames) { + this.hostnameNames = hostnameNames; + this.__explicitlySet__.add("hostnameNames"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("pathRouteSetName") private String pathRouteSetName; @@ -83,6 +92,7 @@ public ListenerDetails build() { new ListenerDetails( connectionConfiguration, defaultBackendSetName, + hostnameNames, pathRouteSetName, port, protocol, @@ -96,6 +106,7 @@ public Builder copy(ListenerDetails o) { Builder copiedBuilder = connectionConfiguration(o.getConnectionConfiguration()) .defaultBackendSetName(o.getDefaultBackendSetName()) + .hostnameNames(o.getHostnameNames()) .pathRouteSetName(o.getPathRouteSetName()) .port(o.getPort()) .protocol(o.getProtocol()) @@ -119,17 +130,23 @@ public static Builder builder() { /** * The name of the associated backend set. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("defaultBackendSetName") String defaultBackendSetName; + /** + * An array of hostname resource names. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("hostnameNames") + java.util.List hostnameNames; + /** * The name of the set of path-based routing rules, {@link PathRouteSet}, * applied to this listener's traffic. *

- * Example: `path-route-set-001` + * Example: `example_path_route_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("pathRouteSetName") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancer.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancer.java index 4ee4425de9b..8328a16bcb7 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancer.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancer.java @@ -67,6 +67,15 @@ public Builder displayName(String displayName) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("hostnames") + private java.util.Map hostnames; + + public Builder hostnames(java.util.Map hostnames) { + this.hostnames = hostnames; + this.__explicitlySet__.add("hostnames"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("id") private String id; @@ -158,6 +167,7 @@ public LoadBalancer build() { certificates, compartmentId, displayName, + hostnames, id, ipAddresses, isPrivate, @@ -178,6 +188,7 @@ public Builder copy(LoadBalancer o) { .certificates(o.getCertificates()) .compartmentId(o.getCompartmentId()) .displayName(o.getDisplayName()) + .hostnames(o.getHostnames()) .id(o.getId()) .ipAddresses(o.getIpAddresses()) .isPrivate(o.getIsPrivate()) @@ -215,12 +226,15 @@ public static Builder builder() { /** * A user-friendly name. It does not have to be unique, and it is changeable. *

- * Example: `My load balancer` + * Example: `example_load_balancer` * **/ @com.fasterxml.jackson.annotation.JsonProperty("displayName") String displayName; + @com.fasterxml.jackson.annotation.JsonProperty("hostnames") + java.util.Map hostnames; + /** * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer. **/ @@ -248,6 +262,8 @@ public static Builder builder() { * requires two subnets, each in a different Availability Domain. One subnet hosts the primary load balancer and the other * hosts the secondary (standby) load balancer. A public load balancer is accessible from the internet, depending on your * VCN's [security list rules](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/securitylists.htm). + *

+ * Example: `true` * **/ @com.fasterxml.jackson.annotation.JsonProperty("isPrivate") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerHealth.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerHealth.java index d83ad44d6b9..e3856c19e37 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerHealth.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerHealth.java @@ -115,7 +115,7 @@ public static Builder builder() { * A list of backend sets that are currently in the `CRITICAL` health state. The list identifies each backend set by the * friendly name you assigned when you created it. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("criticalStateBackendSetNames") @@ -225,7 +225,7 @@ public static Status create(String key) { * A list of backend sets that are currently in the `UNKNOWN` health state. The list identifies each backend set by the * friendly name you assigned when you created it. *

- * Example: `Backend_set2` + * Example: `example_backend_set2` * **/ @com.fasterxml.jackson.annotation.JsonProperty("unknownStateBackendSetNames") @@ -235,7 +235,7 @@ public static Status create(String key) { * A list of backend sets that are currently in the `WARNING` health state. The list identifies each backend set by the * friendly name you assigned when you created it. *

- * Example: `Backend_set3` + * Example: `example_backend_set3` * **/ @com.fasterxml.jackson.annotation.JsonProperty("warningStateBackendSetNames") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerPolicy.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerPolicy.java index 2e1a0889dd1..fddc7ee3319 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerPolicy.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerPolicy.java @@ -61,7 +61,10 @@ public static Builder builder() { } /** - * The name of the load balancing policy. + * The name of a load balancing policy. + *

+ * Example: 'LEAST_CONNECTIONS' + * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") String name; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerProtocol.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerProtocol.java index f2004de0780..b06e88664ba 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerProtocol.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerProtocol.java @@ -4,7 +4,7 @@ package com.oracle.bmc.loadbalancer.model; /** - * The protocol that defines the type of traffic accepted by a listener. + * A protocol that defines the type of traffic accepted by a listener. *
* Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all @@ -58,7 +58,10 @@ public static Builder builder() { } /** - * The name of the protocol. + * The name of a protocol. + *

+ * Example: 'HTTP' + * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") String name; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerShape.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerShape.java index 3d3a4c02bdc..6974fb7d64f 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerShape.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/LoadBalancerShape.java @@ -64,6 +64,9 @@ public static Builder builder() { /** * The name of the shape. + *

+ * Example: `100Mbps` + * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") String name; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/PathRoute.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/PathRoute.java index 94ea0d0ba4c..f613f429cc6 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/PathRoute.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/PathRoute.java @@ -82,7 +82,7 @@ public static Builder builder() { /** * The name of the target backend set for requests where the incoming URI matches the specified path. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("backendSetName") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/PathRouteSet.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/PathRouteSet.java index e907dde24fe..0c747537b14 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/PathRouteSet.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/PathRouteSet.java @@ -69,7 +69,7 @@ public static Builder builder() { /** * The unique name for this set of path route rules. Avoid entering confidential information. *

- * Example: `path-route-set-001` + * Example: `example_path_route_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("name") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfiguration.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfiguration.java index 9503b5e0e68..ceb1dd96733 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfiguration.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfiguration.java @@ -85,7 +85,7 @@ public static Builder builder() { * Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. * Certificate bundle names cannot contain spaces. Avoid entering confidential information. *

- * Example: `My_certificate_bundle` + * Example: `example_certificate_bundle` * **/ @com.fasterxml.jackson.annotation.JsonProperty("certificateName") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfigurationDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfigurationDetails.java index cbdae02b1b5..e02725a7294 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfigurationDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SSLConfigurationDetails.java @@ -85,7 +85,7 @@ public static Builder builder() { * Valid certificate bundle names include only alphanumeric characters, dashes, and underscores. * Certificate bundle names cannot contain spaces. Avoid entering confidential information. *

- * Example: `My_certificate_bundle` + * Example: `example_certificate_bundle` * **/ @com.fasterxml.jackson.annotation.JsonProperty("certificateName") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SessionPersistenceConfigurationDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SessionPersistenceConfigurationDetails.java index f996856338f..e06ec474e8a 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SessionPersistenceConfigurationDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/SessionPersistenceConfigurationDetails.java @@ -81,7 +81,7 @@ public static Builder builder() { * The name of the cookie used to detect a session initiated by the backend server. Use '*' to specify * that any cookie set by the backend causes the session to persist. *

- * Example: `myCookieName` + * Example: `example_cookie` * **/ @com.fasterxml.jackson.annotation.JsonProperty("cookieName") @@ -91,7 +91,7 @@ public static Builder builder() { * Whether the load balancer is prevented from directing traffic from a persistent session client to * a different backend server if the original server is unavailable. Defaults to false. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("disableFallback") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendDetails.java index d094f71c016..400d139a309 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateBackendDetails.java @@ -93,7 +93,7 @@ public static Builder builder() { * Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress * traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("backup") @@ -103,7 +103,7 @@ public static Builder builder() { * Whether the load balancer should drain this server. Servers marked \"drain\" receive no new * incoming traffic. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("drain") @@ -113,7 +113,7 @@ public static Builder builder() { * Whether the load balancer should treat this server as offline. Offline servers receive no incoming * traffic. *

- * Example: `true` + * Example: `false` * **/ @com.fasterxml.jackson.annotation.JsonProperty("offline") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHealthCheckerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHealthCheckerDetails.java index d9f1af6f170..0111576a8c4 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHealthCheckerDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHealthCheckerDetails.java @@ -140,7 +140,7 @@ public static Builder builder() { /** * The interval between health checks, in milliseconds. *

- * Example: `30000` + * Example: `10000` * **/ @com.fasterxml.jackson.annotation.JsonProperty("intervalInMillis") @@ -167,7 +167,7 @@ public static Builder builder() { /** * A regular expression for parsing the response body from the backend server. *

- * Example: `^(500|40[1348])$` + * Example: `^((?!false).|\\s)*$` * **/ @com.fasterxml.jackson.annotation.JsonProperty("responseBodyRegex") @@ -195,7 +195,7 @@ public static Builder builder() { * The maximum time, in milliseconds, to wait for a reply to a health check. A health check is successful only if a reply * returns within this timeout period. *

- * Example: `6000` + * Example: `3000` * **/ @com.fasterxml.jackson.annotation.JsonProperty("timeoutInMillis") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHostnameDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHostnameDetails.java new file mode 100644 index 00000000000..cae622dfdb5 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateHostnameDetails.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.model; + +/** + * The configuration details for updating a virtual hostname. + * For more information on virtual hostnames, see + * [Managing Request Routing](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm). + * + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = UpdateHostnameDetails.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class UpdateHostnameDetails { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("hostname") + private String hostname; + + public Builder hostname(String hostname) { + this.hostname = hostname; + this.__explicitlySet__.add("hostname"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public UpdateHostnameDetails build() { + UpdateHostnameDetails __instance__ = new UpdateHostnameDetails(hostname); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(UpdateHostnameDetails o) { + Builder copiedBuilder = hostname(o.getHostname()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The virtual hostname to update. For more information about virtual hostname string construction, see + * [Managing Request Routing](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm#routing). + *

+ * Example: `app.example.com` + * + **/ + @com.fasterxml.jackson.annotation.JsonProperty("hostname") + String hostname; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateListenerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateListenerDetails.java index a25958c925d..1b2a2ab71d8 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateListenerDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateListenerDetails.java @@ -41,6 +41,15 @@ public Builder defaultBackendSetName(String defaultBackendSetName) { return this; } + @com.fasterxml.jackson.annotation.JsonProperty("hostnameNames") + private java.util.List hostnameNames; + + public Builder hostnameNames(java.util.List hostnameNames) { + this.hostnameNames = hostnameNames; + this.__explicitlySet__.add("hostnameNames"); + return this; + } + @com.fasterxml.jackson.annotation.JsonProperty("pathRouteSetName") private String pathRouteSetName; @@ -85,6 +94,7 @@ public UpdateListenerDetails build() { new UpdateListenerDetails( connectionConfiguration, defaultBackendSetName, + hostnameNames, pathRouteSetName, port, protocol, @@ -98,6 +108,7 @@ public Builder copy(UpdateListenerDetails o) { Builder copiedBuilder = connectionConfiguration(o.getConnectionConfiguration()) .defaultBackendSetName(o.getDefaultBackendSetName()) + .hostnameNames(o.getHostnameNames()) .pathRouteSetName(o.getPathRouteSetName()) .port(o.getPort()) .protocol(o.getProtocol()) @@ -121,17 +132,23 @@ public static Builder builder() { /** * The name of the associated backend set. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("defaultBackendSetName") String defaultBackendSetName; + /** + * An array of hostname resource names. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("hostnameNames") + java.util.List hostnameNames; + /** * The name of the set of path-based routing rules, {@link PathRouteSet}, * applied to this listener's traffic. *

- * Example: `path-route-set-001` + * Example: `example_path_route_set` * **/ @com.fasterxml.jackson.annotation.JsonProperty("pathRouteSetName") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateLoadBalancerDetails.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateLoadBalancerDetails.java index 3e52eca3b71..38635c3a8bc 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateLoadBalancerDetails.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/UpdateLoadBalancerDetails.java @@ -61,7 +61,7 @@ public static Builder builder() { * The user-friendly display name for the load balancer. It does not have to be unique, and it is changeable. * Avoid entering confidential information. *

- * Example: `My load balancer` + * Example: `example_load_balancer` * **/ @com.fasterxml.jackson.annotation.JsonProperty("displayName") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequest.java index 1b80e3d6fbe..d08ef3d92d4 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/model/WorkRequest.java @@ -245,6 +245,8 @@ public static LifecycleState create(String key) { /** * The type of action the work request represents. + *

+ * Example: `CreateListener` * **/ @com.fasterxml.jackson.annotation.JsonProperty("type") diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendRequest.java index 2865834556d..b838a5f89e9 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateBackendRequest.java @@ -23,7 +23,7 @@ public class CreateBackendRequest extends com.oracle.bmc.requests.BmcRequest { /** * The name of the backend set to add the backend server to. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateCertificateRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateCertificateRequest.java index d59445b4908..43d28d49d03 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateCertificateRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateCertificateRequest.java @@ -11,12 +11,12 @@ public class CreateCertificateRequest extends com.oracle.bmc.requests.BmcRequest { /** - * The details of the certificate to add. + * The details of the certificate bundle to add. */ private CreateCertificateDetails createCertificateDetails; /** - * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add the certificate. + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer on which to add the certificate bundle. */ private String loadBalancerId; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateHostnameRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateHostnameRequest.java new file mode 100644 index 00000000000..3282db40f11 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/CreateHostnameRequest.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class CreateHostnameRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The details of the hostname resource to add to the specified load balancer. + */ + private CreateHostnameDetails createHostnameDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer to add the hostname to. + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A token that uniquely identifies a request so it can be retried in case of a timeout or + * server error without risk of executing that same action again. Retry tokens expire after 24 + * hours, but can be invalidated before then due to conflicting operations (e.g., if a resource + * has been deleted and purged from the system, then a retry of the original creation request + * may be rejected). + * + */ + private String opcRetryToken; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateHostnameRequest o) { + createHostnameDetails(o.getCreateHostnameDetails()); + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + opcRetryToken(o.getOpcRetryToken()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of CreateHostnameRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of CreateHostnameRequest + */ + public CreateHostnameRequest build() { + CreateHostnameRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendRequest.java index 4517f81a884..b852ba03b3d 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendRequest.java @@ -18,7 +18,7 @@ public class DeleteBackendRequest extends com.oracle.bmc.requests.BmcRequest { /** * The name of the backend set associated with the backend server. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; @@ -26,7 +26,7 @@ public class DeleteBackendRequest extends com.oracle.bmc.requests.BmcRequest { /** * The IP address and port of the backend server to remove. *

- * Example: `1.1.1.7:42` + * Example: `10.0.0.3:8080` * */ private String backendName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendSetRequest.java index 6e82c015c90..46d368399ce 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendSetRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteBackendSetRequest.java @@ -18,7 +18,7 @@ public class DeleteBackendSetRequest extends com.oracle.bmc.requests.BmcRequest /** * The name of the backend set to delete. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteCertificateRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteCertificateRequest.java index 266ece65317..2a9df98cd88 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteCertificateRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteCertificateRequest.java @@ -11,14 +11,16 @@ public class DeleteCertificateRequest extends com.oracle.bmc.requests.BmcRequest { /** - * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificate to be deleted. + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificate bundle + * to be deleted. + * */ private String loadBalancerId; /** - * The name of the certificate to delete. + * The name of the certificate bundle to delete. *

- * Example: `My_certificate_bundle` + * Example: `example_certificate_bundle` * */ private String certificateName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteHostnameRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteHostnameRequest.java new file mode 100644 index 00000000000..725e0d1ac79 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteHostnameRequest.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class DeleteHostnameRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the hostname to delete. + */ + private String loadBalancerId; + + /** + * The name of the hostname resource to delete. + *

+ * Example: `example_hostname_001` + * + */ + private String name; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteHostnameRequest o) { + loadBalancerId(o.getLoadBalancerId()); + name(o.getName()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of DeleteHostnameRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of DeleteHostnameRequest + */ + public DeleteHostnameRequest build() { + DeleteHostnameRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteListenerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteListenerRequest.java index c113d93aef1..9baaea84069 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteListenerRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeleteListenerRequest.java @@ -18,7 +18,7 @@ public class DeleteListenerRequest extends com.oracle.bmc.requests.BmcRequest { /** * The name of the listener to delete. *

- * Example: `My listener` + * Example: `example_listener` * */ private String listenerName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeletePathRouteSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeletePathRouteSetRequest.java index 4c97a40900b..fcb9d8cc328 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeletePathRouteSetRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/DeletePathRouteSetRequest.java @@ -18,7 +18,7 @@ public class DeletePathRouteSetRequest extends com.oracle.bmc.requests.BmcReques /** * The name of the path route set to delete. *

- * Example: `path-route-set-001` + * Example: `example_path_route_set` * */ private String pathRouteSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendHealthRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendHealthRequest.java index b478cb27cd6..f3e4f43f9c7 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendHealthRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendHealthRequest.java @@ -18,7 +18,7 @@ public class GetBackendHealthRequest extends com.oracle.bmc.requests.BmcRequest /** * The name of the backend set associated with the backend server to retrieve the health status for. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; @@ -26,7 +26,7 @@ public class GetBackendHealthRequest extends com.oracle.bmc.requests.BmcRequest /** * The IP address and port of the backend server to retrieve the health status for. *

- * Example: `1.1.1.7:42` + * Example: `10.0.0.3:8080` * */ private String backendName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendRequest.java index fb581a6f146..84aded843f5 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendRequest.java @@ -18,7 +18,7 @@ public class GetBackendRequest extends com.oracle.bmc.requests.BmcRequest { /** * The name of the backend set that includes the backend server. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; @@ -26,7 +26,7 @@ public class GetBackendRequest extends com.oracle.bmc.requests.BmcRequest { /** * The IP address and port of the backend server to retrieve. *

- * Example: `1.1.1.7:42` + * Example: `10.0.0.3:8080` * */ private String backendName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetHealthRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetHealthRequest.java index a3d16c9588a..c5808cc38b1 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetHealthRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetHealthRequest.java @@ -18,7 +18,7 @@ public class GetBackendSetHealthRequest extends com.oracle.bmc.requests.BmcReque /** * The name of the backend set to retrieve the health status for. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetRequest.java index b2f29bfcdc0..d7003dd1286 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetBackendSetRequest.java @@ -18,7 +18,7 @@ public class GetBackendSetRequest extends com.oracle.bmc.requests.BmcRequest { /** * The name of the backend set to retrieve. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHealthCheckerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHealthCheckerRequest.java index f7215fdbb57..4d8ef68abff 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHealthCheckerRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHealthCheckerRequest.java @@ -18,7 +18,7 @@ public class GetHealthCheckerRequest extends com.oracle.bmc.requests.BmcRequest /** * The name of the backend set associated with the health check policy to be retrieved. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHostnameRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHostnameRequest.java new file mode 100644 index 00000000000..b347c8a0d38 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetHostnameRequest.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class GetHostnameRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the specified load balancer. + */ + private String loadBalancerId; + + /** + * The name of the hostname resource to retrieve. + *

+ * Example: `example_hostname_001` + * + */ + private String name; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetHostnameRequest o) { + loadBalancerId(o.getLoadBalancerId()); + name(o.getName()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of GetHostnameRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of GetHostnameRequest + */ + public GetHostnameRequest build() { + GetHostnameRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetPathRouteSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetPathRouteSetRequest.java index b735dc902fa..ad639638648 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetPathRouteSetRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/GetPathRouteSetRequest.java @@ -18,7 +18,7 @@ public class GetPathRouteSetRequest extends com.oracle.bmc.requests.BmcRequest { /** * The name of the path route set to retrieve. *

- * Example: `path-route-set-001` + * Example: `example_path_route_set` * */ private String pathRouteSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendsRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendsRequest.java index dc6fa8abbe4..43d5ad15f9c 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendsRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListBackendsRequest.java @@ -18,7 +18,7 @@ public class ListBackendsRequest extends com.oracle.bmc.requests.BmcRequest { /** * The name of the backend set associated with the backend servers. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListCertificatesRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListCertificatesRequest.java index 7692101fa91..d05af8af2b3 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListCertificatesRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListCertificatesRequest.java @@ -11,7 +11,9 @@ public class ListCertificatesRequest extends com.oracle.bmc.requests.BmcRequest { /** - * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificates to be listed. + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the certificate bundles + * to be listed. + * */ private String loadBalancerId; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListHostnamesRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListHostnamesRequest.java new file mode 100644 index 00000000000..fde1eeb3470 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListHostnamesRequest.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class ListHostnamesRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the hostnames + * to retrieve. + * + */ + private String loadBalancerId; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListHostnamesRequest o) { + loadBalancerId(o.getLoadBalancerId()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of ListHostnamesRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of ListHostnamesRequest + */ + public ListHostnamesRequest build() { + ListHostnamesRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListLoadBalancersRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListLoadBalancersRequest.java index ab94a276b48..d16dc8cf126 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListLoadBalancersRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/ListLoadBalancersRequest.java @@ -136,12 +136,16 @@ public static SortOrder create(String key) { /** * A filter to return only resources that match the given display name exactly. + *

+ * Example: `example_load_balancer` * */ private String displayName; /** * A filter to return only resources that match the given lifecycle state. + *

+ * Example: `SUCCEEDED` * */ private LoadBalancer.LifecycleState lifecycleState; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendRequest.java index 02cfc8c32b8..b3102cfe29b 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendRequest.java @@ -23,7 +23,7 @@ public class UpdateBackendRequest extends com.oracle.bmc.requests.BmcRequest { /** * The name of the backend set associated with the backend server. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; @@ -31,7 +31,7 @@ public class UpdateBackendRequest extends com.oracle.bmc.requests.BmcRequest { /** * The IP address and port of the backend server to update. *

- * Example: `1.1.1.7:42` + * Example: `10.0.0.3:8080` * */ private String backendName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendSetRequest.java index 2fe79869870..b0ab561f1cf 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendSetRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateBackendSetRequest.java @@ -23,7 +23,7 @@ public class UpdateBackendSetRequest extends com.oracle.bmc.requests.BmcRequest /** * The name of the backend set to update. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHealthCheckerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHealthCheckerRequest.java index 5ac7279ce18..d2020564e81 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHealthCheckerRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHealthCheckerRequest.java @@ -23,7 +23,7 @@ public class UpdateHealthCheckerRequest extends com.oracle.bmc.requests.BmcReque /** * The name of the backend set associated with the health check policy to be retrieved. *

- * Example: `My_backend_set` + * Example: `example_backend_set` * */ private String backendSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHostnameRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHostnameRequest.java new file mode 100644 index 00000000000..9c72429b9db --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateHostnameRequest.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.requests; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class UpdateHostnameRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The configuration details to update a virtual hostname. + */ + private UpdateHostnameDetails updateHostnameDetails; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer associated with the virtual hostname + * to update. + * + */ + private String loadBalancerId; + + /** + * The name of the hostname resource to update. + *

+ * Example: `example_hostname_001` + * + */ + private String name; + + /** + * The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateHostnameRequest o) { + updateHostnameDetails(o.getUpdateHostnameDetails()); + loadBalancerId(o.getLoadBalancerId()); + name(o.getName()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of UpdateHostnameRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of UpdateHostnameRequest + */ + public UpdateHostnameRequest build() { + UpdateHostnameRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateListenerRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateListenerRequest.java index 755adf0e877..43f45196c54 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateListenerRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdateListenerRequest.java @@ -23,7 +23,7 @@ public class UpdateListenerRequest extends com.oracle.bmc.requests.BmcRequest { /** * The name of the listener to update. *

- * Example: `My listener` + * Example: `example_listener` * */ private String listenerName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdatePathRouteSetRequest.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdatePathRouteSetRequest.java index 40a89e63561..20a368d835f 100644 --- a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdatePathRouteSetRequest.java +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/requests/UpdatePathRouteSetRequest.java @@ -23,7 +23,7 @@ public class UpdatePathRouteSetRequest extends com.oracle.bmc.requests.BmcReques /** * The name of the path route set to update. *

- * Example: `path-route-set-001` + * Example: `example_path_route_set` * */ private String pathRouteSetName; diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateHostnameResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateHostnameResponse.java new file mode 100644 index 00000000000..b0c60a2509f --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/CreateHostnameResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class CreateHostnameResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateHostnameResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteHostnameResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteHostnameResponse.java new file mode 100644 index 00000000000..dcd177c1d07 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/DeleteHostnameResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class DeleteHostnameResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteHostnameResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetHostnameResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetHostnameResponse.java new file mode 100644 index 00000000000..be413e569c8 --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/GetHostnameResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class GetHostnameResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned Hostname instance. + */ + private Hostname hostname; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetHostnameResponse o) { + opcRequestId(o.getOpcRequestId()); + hostname(o.getHostname()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListHostnamesResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListHostnamesResponse.java new file mode 100644 index 00000000000..dd2491840ce --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/ListHostnamesResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class ListHostnamesResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of Hostname instances. + */ + private java.util.List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListHostnamesResponse o) { + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateHostnameResponse.java b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateHostnameResponse.java new file mode 100644 index 00000000000..d359fbf9b7e --- /dev/null +++ b/bmc-loadbalancer/src/main/java/com/oracle/bmc/loadbalancer/responses/UpdateHostnameResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.loadbalancer.responses; + +import com.oracle.bmc.loadbalancer.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20170115") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class UpdateHostnameResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about + * a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request. + */ + private String opcWorkRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateHostnameResponse o) { + opcRequestId(o.getOpcRequestId()); + opcWorkRequestId(o.getOpcWorkRequestId()); + + return this; + } + } +} diff --git a/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml b/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml index 67819d4359d..ac73da554c5 100644 --- a/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml +++ b/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../../pom.xml @@ -18,12 +18,12 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 com.oracle.oci.sdk oci-java-sdk-objectstorage-generated - 1.2.35 + 1.2.37 diff --git a/bmc-objectstorage/bmc-objectstorage-generated/pom.xml b/bmc-objectstorage/bmc-objectstorage-generated/pom.xml index 3f894ef3824..6c2fa7dcb16 100644 --- a/bmc-objectstorage/bmc-objectstorage-generated/pom.xml +++ b/bmc-objectstorage/bmc-objectstorage-generated/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 diff --git a/bmc-objectstorage/bmc-objectstorage-generated/src/main/java/com/oracle/bmc/objectstorage/ObjectStorageAsyncClient.java b/bmc-objectstorage/bmc-objectstorage-generated/src/main/java/com/oracle/bmc/objectstorage/ObjectStorageAsyncClient.java index 8a462230675..889aba4aedd 100644 --- a/bmc-objectstorage/bmc-objectstorage-generated/src/main/java/com/oracle/bmc/objectstorage/ObjectStorageAsyncClient.java +++ b/bmc-objectstorage/bmc-objectstorage-generated/src/main/java/com/oracle/bmc/objectstorage/ObjectStorageAsyncClient.java @@ -180,13 +180,16 @@ public ObjectStorageAsyncClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-objectstorage/bmc-objectstorage-generated/src/main/java/com/oracle/bmc/objectstorage/ObjectStorageClient.java b/bmc-objectstorage/bmc-objectstorage-generated/src/main/java/com/oracle/bmc/objectstorage/ObjectStorageClient.java index 2568e706bce..8b2cff11484 100644 --- a/bmc-objectstorage/bmc-objectstorage-generated/src/main/java/com/oracle/bmc/objectstorage/ObjectStorageClient.java +++ b/bmc-objectstorage/bmc-objectstorage-generated/src/main/java/com/oracle/bmc/objectstorage/ObjectStorageClient.java @@ -184,13 +184,16 @@ public ObjectStorageClient( com.oracle.bmc.http.signing.SigningStrategy, com.oracle.bmc.http.signing.RequestSigner> requestSigners = new java.util.HashMap<>(); - for (com.oracle.bmc.http.signing.SigningStrategy s : - com.oracle.bmc.http.signing.SigningStrategy.values()) { - requestSigners.put( - s, - signingStrategyRequestSignerFactories - .get(s) - .createRequestSigner(SERVICE, authenticationDetailsProvider)); + 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); diff --git a/bmc-objectstorage/pom.xml b/bmc-objectstorage/pom.xml index 35f87693ac6..34069eedfe9 100644 --- a/bmc-objectstorage/pom.xml +++ b/bmc-objectstorage/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 ../pom.xml @@ -19,17 +19,17 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.35 + 1.2.37 com.oracle.oci.sdk oci-java-sdk-objectstorage-generated - 1.2.35 + 1.2.37 com.oracle.oci.sdk oci-java-sdk-objectstorage-extensions - 1.2.35 + 1.2.37 diff --git a/bmc-shaded/bmc-shaded-full/README.md b/bmc-shaded/bmc-shaded-full/README.md new file mode 100644 index 00000000000..bf41474d822 --- /dev/null +++ b/bmc-shaded/bmc-shaded-full/README.md @@ -0,0 +1,33 @@ +# Oracle Cloud Infrastructure Java SDK - Shaded Full Jar + +## About + +This directory contains a Maven `pom.xml` file that allows you to use the shaded full jar (which contains most of the OCI Java SDK's dependencies) in Maven, while automatically pulling in the dependencies that are not already contained in the shaded full jar. + +## Usage + +The pom.xml file in this directory, `bmc-shaded/bmc-shaded-full/pom.xml` depends on two other ancestor files, `pom.xml` and `bmc-shaded/pom.xml`. + +Those will have to be installed in your Maven repository first: + + cd java-sdk + mvn install:install-file -Dfile=pom.xml -Dpackaging=pom -DpomFile=pom.xml + mvn install:install-file -Dfile=bmc-shaded/pom.xml -Dpackaging=pom -DpomFile=bmc-shaded/pom.xml + +Download the latest release of the OCI Java SDK from Github: https://github.com/oracle/oci-java-sdk/releases + +Extract the `shaded/lib/oci-java-sdk-full-shaded-*.jar` file from the downloaded zip file. + +Now you can install that zip file in your Maven repository: + + mvn install:install-file -Dfile=/path/to/oci-java-sdk-full-shaded-.jar -Dpackaging=jar -DpomFile=bmc-shaded/bmc-shaded-full/pom.xml + +You can now depend on the `com.oracle.oci.sdk:oci-java-sdk-shaded-full` artifact by including the following dependency in your own Maven `pom.xml` files: + + + + com.oracle.oci.sdk + oci-java-sdk-shaded-full + -- insert version here -- + + diff --git a/bmc-shaded/bmc-shaded-full/pom.xml b/bmc-shaded/bmc-shaded-full/pom.xml new file mode 100644 index 00000000000..237459eec8d --- /dev/null +++ b/bmc-shaded/bmc-shaded-full/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + com.oracle.oci.sdk + oci-java-sdk-shaded + 1.2.37 + ../pom.xml + + oci-java-sdk-shaded-full + Oracle Cloud Infrastructure SDK - Shaded Distribution + This project contains the SDK distribution used for Oracle Cloud Infrastructure, and all the dependencies that can be shaded. It also has Maven dependencies that cannot be shaded. Therefore, use this module to depend on the shaded distribution via Maven -- it will shade everything that can be shaded, and automatically pull in the other dependencies. + https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/javasdk.htm + + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + + + com.google.code.findbugs + jsr305 + ${jsr305.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + + + javax.validation + validation-api + ${validation-api.version} + + + com.google.guava + guava + ${guava.version} + + + javax.ws.rs + javax.ws.rs-api + ${javax.ws.rs-api.version} + + + + diff --git a/bmc-shaded/pom.xml b/bmc-shaded/pom.xml new file mode 100644 index 00000000000..b68b1105612 --- /dev/null +++ b/bmc-shaded/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + + + com.oracle.oci.sdk + oci-java-sdk + 1.2.37 + ../pom.xml + + + oci-java-sdk-shaded + pom + Oracle Cloud Infrastructure SDK - Shaded Parent + This project contains modules for shading the Oracle Cloud Infrastructure SDK + https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/javasdk.htm + + + bmc-shaded-full + + + diff --git a/pom.xml b/pom.xml index 00872969d03..2f0da069b73 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.oracle.oci.sdk oci-java-sdk - 1.2.35 + 1.2.37 pom Oracle Cloud Infrastructure SDK This project contains the SDK used for Oracle Cloud Infrastructure @@ -313,6 +313,11 @@ org.apache.maven.plugins maven-surefire-plugin 2.19.1 + + + bmc-integtests/**/*IntegrationAutoTest.java + + org.apache.maven.surefire @@ -492,5 +497,6 @@ bmc-objectstorage/bmc-objectstorage-extensions bmc-objectstorage bmc-full + bmc-shaded