Package yandex.cloud.sdk.utils
Class OperationUtils
- java.lang.Object
-
- yandex.cloud.sdk.utils.OperationUtils
-
public class OperationUtils extends Object
Helper functions to work with operations.
-
-
Constructor Summary
Constructors Constructor Description OperationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static yandex.cloud.api.operation.OperationOuterClass.Operationwait(yandex.cloud.api.operation.OperationServiceGrpc.OperationServiceBlockingStub operationService, yandex.cloud.api.operation.OperationOuterClass.Operation operation, Duration timeout)Waits for an operation completion for the given timeout.static yandex.cloud.api.operation.OperationOuterClass.Operationwait(yandex.cloud.api.operation.OperationServiceGrpc.OperationServiceBlockingStub operationService, yandex.cloud.api.operation.OperationOuterClass.Operation operation, Duration timeout, Duration pollInterval)Waits for an operation completion for the given timeout checking operation state with the given interval.
-
-
-
Method Detail
-
wait
public static yandex.cloud.api.operation.OperationOuterClass.Operation wait(yandex.cloud.api.operation.OperationServiceGrpc.OperationServiceBlockingStub operationService, yandex.cloud.api.operation.OperationOuterClass.Operation operation, Duration timeout) throws InterruptedException, OperationTimeoutExceptionWaits for an operation completion for the given timeout.- Parameters:
operationService- gRPC stub to communicate with a serveroperation- an operation that should be completedtimeout- operation completion timeout- Returns:
- the same operation but in completed state
- Throws:
InterruptedException- if any thread has interrupted the current thread.OperationTimeoutException- if operation was not completed within the given timeout
-
wait
public static yandex.cloud.api.operation.OperationOuterClass.Operation wait(yandex.cloud.api.operation.OperationServiceGrpc.OperationServiceBlockingStub operationService, yandex.cloud.api.operation.OperationOuterClass.Operation operation, Duration timeout, Duration pollInterval) throws InterruptedException, OperationTimeoutExceptionWaits for an operation completion for the given timeout checking operation state with the given interval.- Parameters:
operationService- gRPC stub to communicate with a serveroperation- an operation that should be completedtimeout- operation completion timeoutpollInterval- the length of time to wait between operation state checks- Returns:
- the same operation but in completed state
- Throws:
InterruptedException- if any thread has interrupted the current thread.OperationTimeoutException- if operation was not completed within the given timeout
-
-