public class Jobs
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getLogURL(java.lang.String jobName)
Returns an URL under which OpenWGA publishes the log of a running job
OpenWGA publishes the log of running jobs under URLs that can be retrieved by this method.
|
java.util.List<java.lang.String> |
getNames()
Returns the names of currently registered jobs
|
boolean |
isRunning(java.lang.String jobName)
Tests if the given job is currently running
This method will also return false if a job of the given name is not defined.
|
void |
run(java.lang.String jobName)
Runs a job
This will run a job just like it would have been run from the OpenWGA admin client manually.
|
void |
run(java.lang.String jobName,
java.util.Map<java.lang.String,java.lang.Object> customOptions)
Runs a job
This will run a job just like it would have been run from the OpenWGA admin client manually.
|
java.lang.String |
runScriptModule(java.lang.String design)
Runs the code of a TMLScript module as a job
Running a TMLScript module as a job is equivalent to creating a job, adding a single task of type "TMLScript" to it, and specifying a TMLScript module to run.
|
java.lang.String |
runScriptModule(java.lang.String design,
java.util.Map<java.lang.String,java.lang.Object> options)
Runs the code of a TMLScript module as a job
Running a TMLScript module as a job is equivalent to creating a job, adding a single task of type "TMLScript" to it, and specifying a TMLScript module to run.
|
java.lang.String |
runTask(java.lang.Class<? extends TaskImplementation> taskClass,
java.util.Map<java.lang.String,java.lang.Object> options)
Runs a custom Java task implementation as transient job
The job created and run by this method will be transient, which means that it will be gone again after it has finished running.
|
void |
schedule(java.lang.String jobName,
java.lang.String scheduleStr)
Adds a schedule to an existing job
|
void |
schedule(java.lang.String jobName,
java.lang.String cronSchedule,
java.util.Date startingDate,
java.util.Date endingDate)
Adds a schedule to an existing job
This should only be used on jobs that are registered via some Designs configuration.
|
void |
unschedule(java.lang.String jobName)
Removes all schedules from an existing job
|
void |
waitWhileRunning(java.lang.String jobName,
int timeout)
Pauses execution until the job is no longer running or the timeout is reached
Use this method if you want to continue execution of the current thread not until a certain Job has finished execution.
|
public void run(java.lang.String jobName) throws de.innovationgate.webgate.api.WGException
jobName
- Name of the jobWGAServerException
JobFailedException
de.innovationgate.webgate.api.WGException
public void run(java.lang.String jobName, java.util.Map<java.lang.String,java.lang.Object> customOptions) throws de.innovationgate.webgate.api.WGException
jobName
- Name of the jobcustomOptions
- Optional additional options that will be available to the tasks of the job via JobContext.getOption(String)
WGAServerException
JobFailedException
de.innovationgate.webgate.api.WGException
public java.lang.String runScriptModule(java.lang.String design) throws de.innovationgate.webgate.api.WGException
design
- Design reference of the TMLScript module that is to be run as jobWGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.String runScriptModule(java.lang.String design, java.util.Map<java.lang.String,java.lang.Object> options) throws de.innovationgate.webgate.api.WGException
design
- Design reference of the TMLScript module that is to be run as joboptions
- Optional additional options that will be available to the tasks of the job via JobContext.getOption(String)
WGAServerException
de.innovationgate.webgate.api.WGException
public java.lang.String runTask(java.lang.Class<? extends TaskImplementation> taskClass, java.util.Map<java.lang.String,java.lang.Object> options) throws de.innovationgate.webgate.api.WGException
taskClass
- Class of the task implementationoptions
- Options given to the jobWGAServerException
de.innovationgate.webgate.api.WGException
public boolean isRunning(java.lang.String jobName) throws de.innovationgate.webgate.api.WGException
jobName
- Name of the jobde.innovationgate.webgate.api.WGException
public void waitWhileRunning(java.lang.String jobName, int timeout) throws de.innovationgate.webgate.api.WGException
jobName
- Name of the jobtimeout
- Timeout in secondsde.innovationgate.webgate.api.WGException
public java.lang.String getLogURL(java.lang.String jobName) throws de.innovationgate.webgate.api.WGException
jobName
- Name of the jobWGAServerException
de.innovationgate.webgate.api.WGException
public java.util.List<java.lang.String> getNames() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public void schedule(java.lang.String jobName, java.lang.String cronSchedule, java.util.Date startingDate, java.util.Date endingDate) throws de.innovationgate.webgate.api.WGException
jobName
- The name of the jobcronSchedule
- The CRON schedule string, having the known format from CRON schedules when configuring in admin clientstartingDate
- The date from which the job starts running or null for no starting dateendingDate
- The date on which the job ends running or null for no ending datede.innovationgate.webgate.api.WGException
public void schedule(java.lang.String jobName, java.lang.String scheduleStr) throws de.innovationgate.webgate.api.WGException
jobName
- The name of the jobscheduleStr
- The CRON schedule string, having the known format from CRON schedules when configuring in admin clientde.innovationgate.webgate.api.WGException
public void unschedule(java.lang.String jobName) throws de.innovationgate.webgate.api.WGException
jobName
- The name of the jobde.innovationgate.webgate.api.WGException