@Override public Operation getOperation(String name) throws SpannerException { GetOperationRequest request = GetOperationRequest.newBuilder().setName(name).build(); GrpcCallContext context = newCallContext(null, name); return get( databaseAdminStub.getOperationsStub().getOperationCallable().futureCall(request, context)); }
/** * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to * cancel the operation, but success is not guaranteed. If the server doesn't support this method, * it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or other methods to check * whether the cancellation succeeded or whether the operation completed despite cancellation. On * successful cancellation, the operation is not deleted; instead, it becomes an operation with an * [Operation.error][google.longrunning.Operation.error] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. * * <p>Sample code: * * <pre><code> * try (OperationsClient operationsClient = OperationsClient.create()) { * String name = ""; * CancelOperationRequest request = CancelOperationRequest.newBuilder() * .setName(name) * .build(); * ApiFuture<Void> future = operationsClient.cancelOperationCallable().futureCall(request); * // Do something * future.get(); * } * </code></pre> */ public final UnaryCallable<CancelOperationRequest, Empty> cancelOperationCallable() { return stub.cancelOperationCallable(); }
/** * Deletes a long-running operation. This method indicates that the client is no longer interested * in the operation result. It does not cancel the operation. If the server doesn't support this * method, it returns `google.rpc.Code.UNIMPLEMENTED`. * * <p>Sample code: * * <pre><code> * try (OperationsClient operationsClient = OperationsClient.create()) { * String name = ""; * DeleteOperationRequest request = DeleteOperationRequest.newBuilder() * .setName(name) * .build(); * ApiFuture<Void> future = operationsClient.deleteOperationCallable().futureCall(request); * // Do something * future.get(); * } * </code></pre> */ public final UnaryCallable<DeleteOperationRequest, Empty> deleteOperationCallable() { return stub.deleteOperationCallable(); }
@Override public boolean isTerminated() { return stub.isTerminated(); }
@Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); }
@Override public void shutdown() { stub.shutdown(); }
@Override public boolean isShutdown() { return stub.isShutdown(); }
@Override public final void close() { stub.close(); }
/** * Lists operations that match the specified filter in the request. If the server doesn't support * this method, it returns `UNIMPLEMENTED`. * * <p>NOTE: the `name` binding below allows API services to override the binding to use different * resource name schemes, such as `users/*/operations`. * * <p>Sample code: * * <pre><code> * try (OperationsClient operationsClient = OperationsClient.create()) { * String name = ""; * String filter = ""; * ListOperationsRequest request = ListOperationsRequest.newBuilder() * .setName(name) * .setFilter(filter) * .build(); * ApiFuture<ListOperationsPagedResponse> future = operationsClient.listOperationsPagedCallable().futureCall(request); * // Do something * for (Operation element : future.get().iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> */ public final UnaryCallable<ListOperationsRequest, ListOperationsPagedResponse> listOperationsPagedCallable() { return stub.listOperationsPagedCallable(); }
return stub.listOperationsCallable();
/** * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to * cancel the operation, but success is not guaranteed. If the server doesn't support this method, * it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or other methods to check * whether the cancellation succeeded or whether the operation completed despite cancellation. On * successful cancellation, the operation is not deleted; instead, it becomes an operation with an * [Operation.error][google.longrunning.Operation.error] value with a * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`. * * <p>Sample code: * * <pre><code> * try (OperationsClient operationsClient = OperationsClient.create()) { * String name = ""; * CancelOperationRequest request = CancelOperationRequest.newBuilder() * .setName(name) * .build(); * ApiFuture<Void> future = operationsClient.cancelOperationCallable().futureCall(request); * // Do something * future.get(); * } * </code></pre> */ public final UnaryCallable<CancelOperationRequest, Empty> cancelOperationCallable() { return stub.cancelOperationCallable(); }
/** * Deletes a long-running operation. This method indicates that the client is no longer interested * in the operation result. It does not cancel the operation. If the server doesn't support this * method, it returns `google.rpc.Code.UNIMPLEMENTED`. * * <p>Sample code: * * <pre><code> * try (OperationsClient operationsClient = OperationsClient.create()) { * String name = ""; * DeleteOperationRequest request = DeleteOperationRequest.newBuilder() * .setName(name) * .build(); * ApiFuture<Void> future = operationsClient.deleteOperationCallable().futureCall(request); * // Do something * future.get(); * } * </code></pre> */ public final UnaryCallable<DeleteOperationRequest, Empty> deleteOperationCallable() { return stub.deleteOperationCallable(); }
@Override public boolean isTerminated() { return stub.isTerminated(); }
@Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); }
@Override public void shutdown() { stub.shutdown(); }
@Override public boolean isShutdown() { return stub.isShutdown(); }
@Override public final void close() { stub.close(); }
/** * Lists operations that match the specified filter in the request. If the server doesn't support * this method, it returns `UNIMPLEMENTED`. * * <p>NOTE: the `name` binding below allows API services to override the binding to use different * resource name schemes, such as `users/*/operations`. * * <p>Sample code: * * <pre><code> * try (OperationsClient operationsClient = OperationsClient.create()) { * String name = ""; * String filter = ""; * ListOperationsRequest request = ListOperationsRequest.newBuilder() * .setName(name) * .setFilter(filter) * .build(); * ApiFuture<ListOperationsPagedResponse> future = operationsClient.listOperationsPagedCallable().futureCall(request); * // Do something * for (Operation element : future.get().iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> */ public final UnaryCallable<ListOperationsRequest, ListOperationsPagedResponse> listOperationsPagedCallable() { return stub.listOperationsPagedCallable(); }
return stub.listOperationsCallable();
/** * Gets the latest state of a long-running operation. Clients can use this method to poll the * operation result at intervals as recommended by the API service. * * <p>Sample code: * * <pre><code> * try (OperationsClient operationsClient = OperationsClient.create()) { * String name = ""; * GetOperationRequest request = GetOperationRequest.newBuilder() * .setName(name) * .build(); * ApiFuture<Operation> future = operationsClient.getOperationCallable().futureCall(request); * // Do something * Operation response = future.get(); * } * </code></pre> */ public final UnaryCallable<GetOperationRequest, Operation> getOperationCallable() { return stub.getOperationCallable(); }