public class RetryStorageOperation extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
RetryStorageOperation.Operation
An operation to be retried
|
static interface |
RetryStorageOperation.RepeatOperation<Ex extends Throwable>
An action that may fail because of expired credentials.
|
Constructor and Description |
---|
RetryStorageOperation() |
Modifier and Type | Method and Description |
---|---|
static <Ex extends Throwable> |
performRequestWithReinitCredentials(RetryStorageOperation.RepeatOperation<Ex> a,
int retries)
Keeps performing actions until credentials expire.
|
static void |
performRequestWithRetry(com.google.jenkins.plugins.util.Executor executor,
RetryStorageOperation.Operation a,
int attempts)
Perform the given operation retrying on error.
|
public static void performRequestWithRetry(com.google.jenkins.plugins.util.Executor executor, RetryStorageOperation.Operation a, int attempts) throws IOException, InterruptedException, com.google.jenkins.plugins.util.ExecutorException
executor
- The executor to use for the operationa
- The operation to execute.attempts
- How many attempts to make. Must be at least 1.IOException
InterruptedException
com.google.jenkins.plugins.util.ExecutorException
public static <Ex extends Throwable> void performRequestWithReinitCredentials(RetryStorageOperation.RepeatOperation<Ex> a, int retries) throws IOException, InterruptedException, com.google.jenkins.plugins.util.ExecutorException, Ex extends Throwable
Ex
- An action-specific exception that might be throwns.a
- Operation to executeretries
- How many times to attempt to refresh credentials if there is
no progress. (Every time an action successfully completes, the retry budget
is reset)IOException
InterruptedException
com.google.jenkins.plugins.util.ExecutorException
Ex extends Throwable
Copyright © 2016–2017. All rights reserved.