org.jclouds.googlecomputeengine.domain
Class Operation

java.lang.Object
  extended by org.jclouds.googlecomputeengine.domain.Resource
      extended by org.jclouds.googlecomputeengine.domain.Operation

@Beta
public class Operation
extends Resource

Describes an operation being executed on some Resource

Author:
David Alves
See Also:

Nested Class Summary
static class Operation.Builder
           
static class Operation.Error
          A particular error for an operation including the details.
static class Operation.Status
           
 
Nested classes/interfaces inherited from class org.jclouds.googlecomputeengine.domain.Resource
Resource.Kind
 
Field Summary
 
Fields inherited from class org.jclouds.googlecomputeengine.domain.Resource
creationTimestamp, description, id, kind, name, selfLink
 
Constructor Summary
protected Operation(String id, Date creationTimestamp, URI selfLink, String name, String description, URI targetLink, String targetId, String clientOperationId, Operation.Status status, String statusMessage, String user, Integer progress, Date insertTime, Date startTime, Date endTime, Integer httpErrorStatusCode, String httpErrorMessage, String operationType, List<Operation.Error> errors, URI region, URI zone)
           
 
Method Summary
static Operation.Builder builder()
           
 com.google.common.base.Optional<String> getClientOperationId()
           
 com.google.common.base.Optional<Date> getEndTime()
           
 List<Operation.Error> getErrors()
           
 com.google.common.base.Optional<org.jclouds.http.HttpResponse> getHttpError()
           
 Date getInsertTime()
           
 String getOperationType()
           
 com.google.common.base.Optional<Integer> getProgress()
           
 com.google.common.base.Optional<URI> getRegion()
           
 com.google.common.base.Optional<Date> getStartTime()
           
 Operation.Status getStatus()
           
 com.google.common.base.Optional<String> getStatusMessage()
           
 com.google.common.base.Optional<String> getTargetId()
           
 URI getTargetLink()
           
 String getUser()
           
 com.google.common.base.Optional<URI> getZone()
           
protected  com.google.common.base.Objects.ToStringHelper string()
          
 Operation.Builder toBuilder()
           
 String toString()
          
 
Methods inherited from class org.jclouds.googlecomputeengine.domain.Resource
equals, getCreationTimestamp, getDescription, getId, getKind, getName, getSelfLink, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operation

protected Operation(String id,
                    Date creationTimestamp,
                    URI selfLink,
                    String name,
                    String description,
                    URI targetLink,
                    String targetId,
                    String clientOperationId,
                    Operation.Status status,
                    String statusMessage,
                    String user,
                    Integer progress,
                    Date insertTime,
                    Date startTime,
                    Date endTime,
                    Integer httpErrorStatusCode,
                    String httpErrorMessage,
                    String operationType,
                    @Nullable
                    List<Operation.Error> errors,
                    URI region,
                    URI zone)
Method Detail

getTargetLink

public URI getTargetLink()
Returns:
URL of the resource the operation is mutating.

getClientOperationId

public com.google.common.base.Optional<String> getClientOperationId()
Returns:
An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project.

getTargetId

public com.google.common.base.Optional<String> getTargetId()
Returns:
unique target id which identifies a particular incarnation of the target.

getRegion

public com.google.common.base.Optional<URI> getRegion()
Returns:
region this operation is in, if any.

getZone

public com.google.common.base.Optional<URI> getZone()
Returns:
zone this operation is in, if any.

getStatus

public Operation.Status getStatus()
Returns:
Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.

getStatusMessage

public com.google.common.base.Optional<String> getStatusMessage()
Returns:
An optional textual description of the current status of the operation.

getUser

public String getUser()
Returns:
User who requested the operation, for example "user@example.com".

getProgress

public com.google.common.base.Optional<Integer> getProgress()
Returns:
an optional progress indicator that ranges from 0 to 100. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).

getInsertTime

public Date getInsertTime()
Returns:
the time that this operation was requested.

getStartTime

public com.google.common.base.Optional<Date> getStartTime()
Returns:
the time that this operation was started by the server.

getEndTime

public com.google.common.base.Optional<Date> getEndTime()
Returns:
the time that this operation was completed.

getHttpError

public com.google.common.base.Optional<org.jclouds.http.HttpResponse> getHttpError()
Returns:
if operation fails, the HttpResponse with error status code returned and the message, e.g. NOT_FOUND.

getOperationType

public String getOperationType()
Returns:
type of the operation. Examples include insert, update, and delete.

getErrors

public List<Operation.Error> getErrors()
Returns:
if error occurred during processing of this operation, this field will be populated.

string

protected com.google.common.base.Objects.ToStringHelper string()

Overrides:
string in class Resource

toString

public String toString()

Overrides:
toString in class Resource

builder

public static Operation.Builder builder()

toBuilder

public Operation.Builder toBuilder()
Overrides:
toBuilder in class Resource


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.