magoffin.matt.ma2.biz
Interface WorkBiz.WorkInfo

All Superinterfaces:
java.lang.Comparable<WorkBiz.WorkInfo>, java.util.concurrent.Future<WorkBiz.WorkInfo>
Enclosing interface:
WorkBiz

public static interface WorkBiz.WorkInfo
extends java.lang.Comparable<WorkBiz.WorkInfo>, java.util.concurrent.Future<WorkBiz.WorkInfo>

Work information created by submitting WorkRequest instances.

This interface extends Future so calling code can choose to wait for the work to complete by calling Future.get() if you desire. The WorkInfo returned by Future.get() will be the same instance as returned by WorkBiz.submitWork(WorkRequest), this is just a convenience.

In addition this interface extends Comparable so that work can be prioritized according to the natural ording of the implementing class. The getPriority() should be treated as such that higher values are given a higher priority over lower values. For jobs with equal priority, a FIFO ordering should be used.


Method Summary
 float getAmountCompleted()
          Get the amount of work that has been completed, from 0 to 1.
 long getCompleteTime()
           
 java.lang.String getDisplayName()
          Get a display-friendly name for this task.
 java.lang.Throwable getException()
           
 java.lang.String getMessage()
          Get a message to pass to the result work info.
 java.util.List<java.lang.Long> getObjectIds()
          Get a List of object IDs related to this work.
 java.lang.Integer getPriority()
          Get the priority assigned to the work.
 long getStartTime()
           
 long getSubmitTime()
           
 long getTicket()
           
 WorkBiz.WorkRequest getWorkRequest()
          Get the original WorkBiz.WorkRequest associated with this info.
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface java.util.concurrent.Future
cancel, get, get, isCancelled, isDone
 

Method Detail

getWorkRequest

WorkBiz.WorkRequest getWorkRequest()
Get the original WorkBiz.WorkRequest associated with this info.

Returns:
the work request

getDisplayName

java.lang.String getDisplayName()
Get a display-friendly name for this task.

Returns:
display name

getMessage

java.lang.String getMessage()
Get a message to pass to the result work info.

Returns:
message

getPriority

java.lang.Integer getPriority()
Get the priority assigned to the work.

Returns:
Returns the priority.

getAmountCompleted

float getAmountCompleted()
Get the amount of work that has been completed, from 0 to 1.

Returns:
the amount of work completed, as a fraction from 0 to 1

getException

java.lang.Throwable getException()
Returns:
Returns the exception.

getCompleteTime

long getCompleteTime()
Returns:
Returns the completeTime.

getStartTime

long getStartTime()
Returns:
Returns the startTime.

getSubmitTime

long getSubmitTime()
Returns:
Returns the submitTime.

getTicket

long getTicket()
Returns:
Returns the ticket.

getObjectIds

java.util.List<java.lang.Long> getObjectIds()
Get a List of object IDs related to this work.

Returns:
List of object IDs, or null if none available