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

com.oracle.bmc.identity.IdentityWaiters Maven / Gradle / Ivy

Go to download

This project contains the SDK used for Oracle Cloud Infrastructure Identity Service

There is a newer version: 3.55.1
Show newest version
/**
 * Copyright (c) 2016, 2024, Oracle and/or its affiliates.  All rights reserved.
 * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
 */
package com.oracle.bmc.identity;

import com.oracle.bmc.identity.requests.*;
import com.oracle.bmc.identity.responses.*;

/**
 * Collection of helper methods to produce {@link com.oracle.bmc.waiter.Waiter}s for different
 * resources of Identity.
 *
 * 

The default configuration used is defined by {@link * com.oracle.bmc.waiter.Waiters.Waiters#DEFAULT_POLLING_WAITER}. */ @jakarta.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20160918") public class IdentityWaiters { private final java.util.concurrent.ExecutorService executorService; private final Identity client; public IdentityWaiters(java.util.concurrent.ExecutorService executorService, Identity client) { this.executorService = executorService; this.client = client; } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forCompartment( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forCompartment( GetCompartmentRequest request, com.oracle.bmc.identity.model.Compartment.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forCompartment( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.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) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.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... 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( () -> request, new java.util.function.Function< GetCompartmentRequest, GetCompartmentResponse>() { @Override public GetCompartmentResponse apply(GetCompartmentRequest request) { return client.getCompartment(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetCompartmentResponse response) { return targetStatesSet.contains( response.getCompartment().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.Compartment.LifecycleState.Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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 forDomain( GetDomainRequest request, com.oracle.bmc.identity.model.Domain.LifecycleState... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forDomain( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDomain( GetDomainRequest request, com.oracle.bmc.identity.model.Domain.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forDomain( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDomain( GetDomainRequest request, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy, com.oracle.bmc.identity.model.Domain.LifecycleState... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null target states are not permitted"); return forDomain( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetStates); } // Helper method to create a new Waiter for Domain. private com.oracle.bmc.waiter.Waiter forDomain( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetDomainRequest request, final com.oracle.bmc.identity.model.Domain.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( () -> request, new java.util.function.Function() { @Override public GetDomainResponse apply(GetDomainRequest request) { return client.getDomain(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetDomainResponse response) { return targetStatesSet.contains( response.getDomain().getLifecycleState()); } }, false), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forDynamicGroup( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forDynamicGroup( GetDynamicGroupRequest request, com.oracle.bmc.identity.model.DynamicGroup.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forDynamicGroup( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.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) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.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... 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( () -> request, new java.util.function.Function< GetDynamicGroupRequest, GetDynamicGroupResponse>() { @Override public GetDynamicGroupResponse apply(GetDynamicGroupRequest request) { return client.getDynamicGroup(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetDynamicGroupResponse response) { return targetStatesSet.contains( response.getDynamicGroup().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.DynamicGroup.LifecycleState.Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forGroup( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forGroup( GetGroupRequest request, com.oracle.bmc.identity.model.Group.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forGroup( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.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) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.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... 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( () -> request, new java.util.function.Function() { @Override public GetGroupResponse apply(GetGroupRequest request) { return client.getGroup(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetGroupResponse response) { return targetStatesSet.contains( response.getGroup().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.Group.LifecycleState.Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using default configuration. * * @param request the request to send * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forIamWorkRequest(GetIamWorkRequestRequest request) { return forIamWorkRequest(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@linkcom.oracle.bmc.waiter. DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forIamWorkRequest( GetIamWorkRequestRequest request, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { return forIamWorkRequest( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request); } // Helper method to create a new Waiter for IamWorkRequest. private com.oracle.bmc.waiter.Waiter forIamWorkRequest( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetIamWorkRequestRequest request) { return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( () -> request, new java.util.function.Function< GetIamWorkRequestRequest, GetIamWorkRequestResponse>() { @Override public GetIamWorkRequestResponse apply( GetIamWorkRequestRequest request) { return client.getIamWorkRequest(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetIamWorkRequestResponse response) { // work requests are complete once the time finished is available return response.getIamWorkRequest().getTimeFinished() != null; } }, false), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forIdentityProvider( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forIdentityProvider( GetIdentityProviderRequest request, com.oracle.bmc.identity.model.IdentityProvider.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forIdentityProvider( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.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) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.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... 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( () -> request, new java.util.function.Function< GetIdentityProviderRequest, GetIdentityProviderResponse>() { @Override public GetIdentityProviderResponse apply( GetIdentityProviderRequest request) { return client.getIdentityProvider(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetIdentityProviderResponse response) { return targetStatesSet.contains( response.getIdentityProvider().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.IdentityProvider.LifecycleState .Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forIdpGroupMapping( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forIdpGroupMapping( GetIdpGroupMappingRequest request, com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forIdpGroupMapping( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.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) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.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... 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( () -> request, new java.util.function.Function< GetIdpGroupMappingRequest, GetIdpGroupMappingResponse>() { @Override public GetIdpGroupMappingResponse apply( GetIdpGroupMappingRequest request) { return client.getIdpGroupMapping(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetIdpGroupMappingResponse response) { return targetStatesSet.contains( response.getIdpGroupMapping().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.IdpGroupMapping.LifecycleState .Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forPolicy( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forPolicy( GetPolicyRequest request, com.oracle.bmc.identity.model.Policy.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forPolicy( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.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) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.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... 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( () -> request, new java.util.function.Function() { @Override public GetPolicyResponse apply(GetPolicyRequest request) { return client.getPolicy(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetPolicyResponse response) { return targetStatesSet.contains( response.getPolicy().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.Policy.LifecycleState.Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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 forTag( GetTagRequest request, com.oracle.bmc.identity.model.Tag.LifecycleState... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forTag(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forTag( GetTagRequest request, com.oracle.bmc.identity.model.Tag.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forTag( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forTag( GetTagRequest request, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy, com.oracle.bmc.identity.model.Tag.LifecycleState... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null target states are not permitted"); return forTag( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetStates); } // Helper method to create a new Waiter for Tag. private com.oracle.bmc.waiter.Waiter forTag( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetTagRequest request, final com.oracle.bmc.identity.model.Tag.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( () -> request, new java.util.function.Function() { @Override public GetTagResponse apply(GetTagRequest request) { return client.getTag(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetTagResponse response) { return targetStatesSet.contains( response.getTag().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.Tag.LifecycleState.Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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 forTagDefault( GetTagDefaultRequest request, com.oracle.bmc.identity.model.TagDefault.LifecycleState... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forTagDefault( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forTagDefault( GetTagDefaultRequest request, com.oracle.bmc.identity.model.TagDefault.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forTagDefault( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forTagDefault( GetTagDefaultRequest request, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy, com.oracle.bmc.identity.model.TagDefault.LifecycleState... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null target states are not permitted"); return forTagDefault( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetStates); } // Helper method to create a new Waiter for TagDefault. private com.oracle.bmc.waiter.Waiter forTagDefault( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetTagDefaultRequest request, final com.oracle.bmc.identity.model.TagDefault.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( () -> request, new java.util.function.Function< GetTagDefaultRequest, GetTagDefaultResponse>() { @Override public GetTagDefaultResponse apply(GetTagDefaultRequest request) { return client.getTagDefault(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetTagDefaultResponse response) { return targetStatesSet.contains( response.getTagDefault().getLifecycleState()); } }, false), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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 forTagNamespace( GetTagNamespaceRequest request, com.oracle.bmc.identity.model.TagNamespace.LifecycleState... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forTagNamespace( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forTagNamespace( GetTagNamespaceRequest request, com.oracle.bmc.identity.model.TagNamespace.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forTagNamespace( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forTagNamespace( GetTagNamespaceRequest request, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy, com.oracle.bmc.identity.model.TagNamespace.LifecycleState... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null target states are not permitted"); return forTagNamespace( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetStates); } // Helper method to create a new Waiter for TagNamespace. private com.oracle.bmc.waiter.Waiter forTagNamespace( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetTagNamespaceRequest request, final com.oracle.bmc.identity.model.TagNamespace.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( () -> request, new java.util.function.Function< GetTagNamespaceRequest, GetTagNamespaceResponse>() { @Override public GetTagNamespaceResponse apply(GetTagNamespaceRequest request) { return client.getTagNamespace(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetTagNamespaceResponse response) { return targetStatesSet.contains( response.getTagNamespace().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.TagNamespace.LifecycleState.Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using default configuration. * * @param request the request to send * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forTaggingWorkRequest(GetTaggingWorkRequestRequest request) { return forTaggingWorkRequest(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@linkcom.oracle.bmc.waiter. DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forTaggingWorkRequest( GetTaggingWorkRequestRequest request, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { return forTaggingWorkRequest( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request); } // Helper method to create a new Waiter for TaggingWorkRequest. private com.oracle.bmc.waiter.Waiter< GetTaggingWorkRequestRequest, GetTaggingWorkRequestResponse> forTaggingWorkRequest( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetTaggingWorkRequestRequest request) { return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( () -> request, new java.util.function.Function< GetTaggingWorkRequestRequest, GetTaggingWorkRequestResponse>() { @Override public GetTaggingWorkRequestResponse apply( GetTaggingWorkRequestRequest request) { return client.getTaggingWorkRequest(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetTaggingWorkRequestResponse response) { // work requests are complete once the time finished is available return response.getTaggingWorkRequest().getTimeFinished() != null; } }, false), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forUser(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forUser( GetUserRequest request, com.oracle.bmc.identity.model.User.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forUser( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.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) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.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... 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( () -> request, new java.util.function.Function() { @Override public GetUserResponse apply(GetUserRequest request) { return client.getUser(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetUserResponse response) { return targetStatesSet.contains( response.getUser().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.User.LifecycleState.Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the default configuration. * * @param request the request to send * @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... targetStates) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one targetState must be provided"); com.oracle.bmc.util.internal.Validate.noNullElements( targetStates, "Null targetState values are not permitted"); return forUserGroupMembership( com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param targetState the desired state to wait for * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter< GetUserGroupMembershipRequest, GetUserGroupMembershipResponse> forUserGroupMembership( GetUserGroupMembershipRequest request, com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState targetState, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { com.oracle.bmc.util.internal.Validate.notNull( targetState, "The targetState cannot be null"); return forUserGroupMembership( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request, targetState); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@link com.oracle.bmc.waiter.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 com.oracle.bmc.waiter.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) { com.oracle.bmc.util.internal.Validate.notEmpty( targetStates, "At least one target state must be provided"); com.oracle.bmc.util.internal.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... 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( () -> request, new java.util.function.Function< GetUserGroupMembershipRequest, GetUserGroupMembershipResponse>() { @Override public GetUserGroupMembershipResponse apply( GetUserGroupMembershipRequest request) { return client.getUserGroupMembership(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetUserGroupMembershipResponse response) { return targetStatesSet.contains( response.getUserGroupMembership().getLifecycleState()); } }, targetStatesSet.contains( com.oracle.bmc.identity.model.UserGroupMembership.LifecycleState .Deleted)), request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using default configuration. * * @param request the request to send * @return a new {@code Waiter} instance */ public com.oracle.bmc.waiter.Waiter forWorkRequest(GetWorkRequestRequest request) { return forWorkRequest(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request); } /** * Creates a new {@link com.oracle.bmc.waiter.Waiter} using the provided configuration. * * @param request the request to send * @param terminationStrategy the {@link com.oracle.bmc.waiter.TerminationStrategy} to use * @param delayStrategy the {@linkcom.oracle.bmc.waiter. DelayStrategy} to use * @return a new {@code com.oracle.bmc.waiter.Waiter} instance */ public com.oracle.bmc.waiter.Waiter forWorkRequest( GetWorkRequestRequest request, com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, com.oracle.bmc.waiter.DelayStrategy delayStrategy) { return forWorkRequest( com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), request); } // Helper method to create a new Waiter for WorkRequest. private com.oracle.bmc.waiter.Waiter forWorkRequest( com.oracle.bmc.waiter.BmcGenericWaiter waiter, final GetWorkRequestRequest request) { return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( executorService, waiter.toCallable( () -> request, new java.util.function.Function< GetWorkRequestRequest, GetWorkRequestResponse>() { @Override public GetWorkRequestResponse apply(GetWorkRequestRequest request) { return client.getWorkRequest(request); } }, new java.util.function.Predicate() { @Override public boolean test(GetWorkRequestResponse response) { // work requests are complete once the time finished is available return response.getWorkRequest().getTimeFinished() != null; } }, false), request); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy