org.jclouds.cloudstack.domain
Class AsyncJob<T>

java.lang.Object
  extended by org.jclouds.cloudstack.domain.AsyncJob<T>

public class AsyncJob<T>
extends Object

Author:
Adrian Cole

Nested Class Summary
static class AsyncJob.Builder<T>
           
static class AsyncJob.ResultCode
          Valid job result codes
static class AsyncJob.Status
          Valid async job statuses
 
Constructor Summary
AsyncJob(long accountId, String cmd, Date created, long id, long instanceId, String instanceType, int progress, T result, AsyncJob.ResultCode resultCode, String resultType, AsyncJob.Status status, int userId, AsyncJobError error)
           
 
Method Summary
static
<T> AsyncJob.Builder<T>
builder()
           
 boolean equals(Object obj)
           
 long getAccountId()
           
 String getCmd()
           
 Date getCreated()
           
 AsyncJobError getError()
           
 long getId()
           
 long getInstanceId()
           
 String getInstanceType()
           
 int getProgress()
           
 T getResult()
           
 AsyncJob.ResultCode getResultCode()
           
 String getResultType()
           
 AsyncJob.Status getStatus()
           
 int getUserId()
           
 boolean hasFailed()
           
 int hashCode()
           
 boolean hasSucceed()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AsyncJob

public AsyncJob(long accountId,
                String cmd,
                Date created,
                long id,
                long instanceId,
                String instanceType,
                int progress,
                T result,
                AsyncJob.ResultCode resultCode,
                String resultType,
                AsyncJob.Status status,
                int userId,
                AsyncJobError error)
Method Detail

builder

public static <T> AsyncJob.Builder<T> builder()

getAccountId

public long getAccountId()
Returns:
the account that executed the async command

getCmd

public String getCmd()
Returns:
the async command executed

getCreated

public Date getCreated()
Returns:
the created date of the job

getId

public long getId()
Returns:
async job ID

getInstanceId

public long getInstanceId()
Returns:
the unique ID of the instance/entity object related to the job

getInstanceType

public String getInstanceType()
Returns:
the instance/entity object related to the job

getProgress

public int getProgress()
Returns:
the progress information of the PENDING job

getResult

public T getResult()
Returns:
the result reason

getResultCode

public AsyncJob.ResultCode getResultCode()
Returns:
the result code for the job

getResultType

public String getResultType()
Returns:
the result type

getStatus

public AsyncJob.Status getStatus()
Returns:
the current job status-should be 0 for PENDING

getUserId

public int getUserId()
Returns:
the user that executed the async command

getError

public AsyncJobError getError()
Returns:
the error related to this command, or null if no error or error not yet encountered.

hasFailed

public boolean hasFailed()

hasSucceed

public boolean hasSucceed()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012 jclouds. All Rights Reserved.