Class 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.Operation wait​(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.Operation wait​(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.
    • Constructor Detail

      • OperationUtils

        public OperationUtils()
    • 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,
                                                                                    OperationTimeoutException
        Waits for an operation completion for the given timeout.
        Parameters:
        operationService - gRPC stub to communicate with a server
        operation - an operation that should be completed
        timeout - 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,
                                                                                    OperationTimeoutException
        Waits for an operation completion for the given timeout checking operation state with the given interval.
        Parameters:
        operationService - gRPC stub to communicate with a server
        operation - an operation that should be completed
        timeout - operation completion timeout
        pollInterval - 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