@@ -52,7 +52,6 @@ public class Operation implements Serializable {
5252 private final ComputeOptions options ;
5353 private final String id ;
5454 private final OperationId operationId ;
55- private final Long creationTimestamp ;
5655 private final String clientOperationId ;
5756 private final String operationType ;
5857 private final String targetLink ;
@@ -296,7 +295,6 @@ static final class Builder {
296295
297296 private Compute compute ;
298297 private String id ;
299- private Long creationTimestamp ;
300298 private OperationId operationId ;
301299 private String clientOperationId ;
302300 private String operationType ;
@@ -324,9 +322,6 @@ static final class Builder {
324322 if (operationPb .getId () != null ) {
325323 id = operationPb .getId ().toString ();
326324 }
327- if (operationPb .getCreationTimestamp () != null ) {
328- creationTimestamp = TIMESTAMP_FORMATTER .parseMillis (operationPb .getCreationTimestamp ());
329- }
330325 if (RegionOperationId .matchesUrl (operationPb .getSelfLink ())) {
331326 operationId = RegionOperationId .fromUrl (operationPb .getSelfLink ());
332327 } else if (ZoneOperationId .matchesUrl (operationPb .getSelfLink ())) {
@@ -372,11 +367,6 @@ Builder id(String id) {
372367 return this ;
373368 }
374369
375- Builder creationTimestamp (Long creationTimestamp ) {
376- this .creationTimestamp = creationTimestamp ;
377- return this ;
378- }
379-
380370 Builder operationId (OperationId operationId ) {
381371 this .operationId = checkNotNull (operationId );
382372 return this ;
@@ -471,7 +461,6 @@ private Operation(Builder builder) {
471461 this .compute = checkNotNull (builder .compute );
472462 this .options = compute .options ();
473463 this .id = builder .id ;
474- this .creationTimestamp = builder .creationTimestamp ;
475464 this .operationId = checkNotNull (builder .operationId );
476465 this .clientOperationId = builder .clientOperationId ;
477466 this .operationType = builder .operationType ;
@@ -505,13 +494,6 @@ public String id() {
505494 return id ;
506495 }
507496
508- /**
509- * Returns the creation timestamp in milliseconds since epoch.
510- */
511- public Long creationTimestamp () {
512- return creationTimestamp ;
513- }
514-
515497 /**
516498 * Returns the operation's identity. This method returns an {@link GlobalOperationId} for global
517499 * operations, a {@link RegionOperationId} for region operations and a {@link ZoneOperationId} for
@@ -658,23 +640,21 @@ public boolean exists() throws ComputeException {
658640
659641 /**
660642 * Checks if this operation has completed its execution, either failing or succeeding. If the
661- * operation does not exist this method returns {@code false }. To correctly wait for operation's
662- * completion, check that the operation exists first using {@link #exists()} :
643+ * operation does not exist this method returns {@code true }. You can wait for operation
644+ * completion with :
663645 * <pre> {@code
664- * if (operation.exists()) {
665- * while(!operation.isDone()) {
666- * Thread.sleep(1000L);
667- * }
646+ * while(!operation.isDone()) {
647+ * Thread.sleep(1000L);
668648 * }}</pre>
669649 *
670- * @return {@code true} if this operation is in {@link Operation.Status#DONE} state, {@code false}
671- * if the state is not {@link Operation.Status#DONE} or the operation does not exist
650+ * @return {@code true} if this operation is in {@link Operation.Status#DONE} state or if it does
651+ * not exist, {@code false} if the state is not {@link Operation.Status#DONE}
672652 * @throws ComputeException upon failure
673653 */
674654 public boolean isDone () throws ComputeException {
675655 Operation operation =
676656 compute .get (operationId , Compute .OperationOption .fields (Compute .OperationField .STATUS ));
677- return operation != null && operation .status () == Status .DONE ;
657+ return operation == null || operation .status () == Status .DONE ;
678658 }
679659
680660 /**
@@ -705,7 +685,6 @@ public String toString() {
705685 return MoreObjects .toStringHelper (this )
706686 .add ("id" , id )
707687 .add ("operationsId" , operationId )
708- .add ("creationTimestamp" , creationTimestamp )
709688 .add ("clientOperationId" , clientOperationId )
710689 .add ("operationType" , operationType )
711690 .add ("targetLink" , targetLink )
@@ -743,9 +722,6 @@ com.google.api.services.compute.model.Operation toPb() {
743722 if (id != null ) {
744723 operationPb .setId (new BigInteger (id ));
745724 }
746- if (creationTimestamp != null ) {
747- operationPb .setCreationTimestamp (TIMESTAMP_FORMATTER .print (creationTimestamp ));
748- }
749725 operationPb .setName (operationId .operation ());
750726 operationPb .setClientOperationId (clientOperationId );
751727 switch (operationId .type ()) {
0 commit comments