public class Job extends java.lang.Object implements JobInfo, ActionLifecycleContext
Constructor and Description |
---|
Job(Action action,
long timeoutInterval,
long createTime)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
complete() |
void |
complete(java.lang.String statusMsg) |
void |
fail(java.lang.String statusMsg) |
java.lang.Long |
getCompletionTime() |
java.lang.String |
getId() |
java.lang.Long |
getStartTime() |
JobStatus |
getStatus()
Returns the current status of the job.
|
java.util.List<java.lang.String> |
getStatusMessages()
Returns status messages associated with the job.
|
boolean |
hasExceededTimeout(long now) |
boolean |
isAssociatedWithPlugin(PluginContext ctx) |
boolean |
isComplete() |
boolean |
isInProgress() |
boolean |
isOlderThanAnHour(long currentTime) |
Future |
message(java.lang.String name,
java.lang.Object prop)
Sends a message to the job which its associated Action can process.
|
Future |
start()
Starts the job.
|
Future |
stop()
Stops this job.
|
void |
timeout()
Flag the job as timed out.
|
void |
update(java.lang.String statusMsg) |
public Job(Action action, long timeoutInterval, long createTime)
action
- the action associated with this jobtimeoutInterval
- the maximum interval the job is allowed to run before being considered timed outcreateTime
- the time the job was createdpublic java.lang.String getId()
public java.lang.Long getStartTime()
public boolean hasExceededTimeout(long now)
public java.lang.Long getCompletionTime()
public boolean isAssociatedWithPlugin(PluginContext ctx)
public boolean isComplete()
public boolean isInProgress()
public boolean isOlderThanAnHour(long currentTime)
public Future message(java.lang.String name, java.lang.Object prop)
name
- the message nameprop
- a property object associated with the messagepublic Future start()
public Future stop()
public void timeout()
public JobStatus getStatus()
JobInfo
public java.util.List<java.lang.String> getStatusMessages()
JobInfo
getStatusMessages
in interface JobInfo
public void complete()
complete
in interface ActionLifecycleContext
public void complete(java.lang.String statusMsg)
complete
in interface ActionLifecycleContext
public void fail(java.lang.String statusMsg)
fail
in interface ActionLifecycleContext
public void update(java.lang.String statusMsg)
update
in interface ActionLifecycleContext
Copyright © 2015 Whizzo Software LLC. All rights reserved.