com.ibm.ia.global.jobs.management
Interface JobManagerMXBean
-
public interface JobManagerMXBean
The job manager MXBean.The JobManagerMXBean provides client side administrative job related functions.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
MXBEAN_OBJECT_NAME
The object name by which a JMX client can find the JobManagerMXBean
-
Method Summary
Methods Modifier and Type Method and Description void
abortJob(java.lang.String jobRunId, java.lang.String jobName, java.lang.String solutionName)
Aborts a running job if one exists for the given job run id, job name, and solution name.void
abortJobByName(java.lang.String jobName, java.lang.String solutionName)
Aborts a running job if one exists for the given job name.JobRunId[]
getActiveJobs()
Returns an array of job run identifiers for active jobs.JobRunId[]
getActiveJobs(java.lang.String solutionName)
Returns an array of job run identifiers for active jobs that correspond to the given solution name.JobRunId[]
getActiveJobs(java.lang.String jobName, java.lang.String solutionName)
Returns an array of job identifiers for active jobs that correspond to the given job name and solution name, or null.int
getActiveJobsCount()
Returns the number of active jobs.java.util.Map<java.lang.String,java.lang.Boolean>
getIsGlobalRuntimeRunningByContainer()
Returns whether or not the global runtime is running by container.JobRunId[]
getJobRunIds()
Returns an array of job run identifiers for all job runs that have been submitted regardless of their status (QUEUED, RUNNING, COMPLETED, FAILED, etc).JobRunInfo
getJobRunInfo(java.lang.String jobName, java.lang.String solutionName)
Gets the latestJobRunInfo
that corresponds to the given job name.JobRunInfo
getJobRunInfo(java.lang.String jobRunId, java.lang.String jobName, java.lang.String solutionName)
Returns aJobRunInfo
for the given job run id, job name, and solution name.JobRunInfo[]
getJobRunInfos()
Returns an array ofJobRunInfo
objects for all job runs that have been submitted regardless of their status (QUEUED, RUNNING, COMPLETED, FAILED, etc).JobRunInfo[]
getJobRunInfos(JobRunId[] jobRunIds)
Returns an array ofJobRunInfo
objects that correspond to the given array ofJobRunId
objects.java.lang.String
getJobSchedule(java.lang.String jobName, java.lang.String solutionName)
retrieves the schedule of a job for the given job name, solution name.JobRunInfo[]
getQueuedJobs(java.lang.String solutionName)
Returns an array ofJobRunInfo
objects for all jobs that are currently in the job queue.boolean
isGlobalRuntimeRunning()
Returns whether or not the global runtime is running on all containers.boolean
removeJobSchedule(java.lang.String jobName, java.lang.String solutionName)
Removes the schedule of a job for the given job name, solution name.void
startGlobalRuntime()
Starts the global runtime on all containers.void
stopGlobalRuntime()
Stops the global runtime on all containers.JobRunId
submitJob(java.lang.String jobName, java.lang.String solutionName, java.lang.String description, java.util.List<JobParameter> params)
Submits a job that corresponds to the given global variable name in order to update its value.boolean
updateJobSchedule(java.lang.String jobName, java.lang.String solutionName, java.lang.String intervalString, java.lang.String crontabString)
Updates the schedule of a job for the given job name, solution name with the schedule identified with the crontabString.
-
-
-
Field Detail
-
MXBEAN_OBJECT_NAME
static final java.lang.String MXBEAN_OBJECT_NAME
The object name by which a JMX client can find the JobManagerMXBean- See Also:
- Constant Field Values
-
-
Method Detail
-
getActiveJobsCount
int getActiveJobsCount()
Returns the number of active jobs.- Returns:
- The number of active jobs.
-
getActiveJobs
JobRunId[] getActiveJobs()
Returns an array of job run identifiers for active jobs.- Returns:
- An array of job run identifiers.
-
getActiveJobs
JobRunId[] getActiveJobs(java.lang.String solutionName)
Returns an array of job run identifiers for active jobs that correspond to the given solution name.- Parameters:
solutionName
- The name of the solution.- Returns:
- an array of job identifiers for the given soution's active jobs.
-
getActiveJobs
JobRunId[] getActiveJobs(java.lang.String jobName, java.lang.String solutionName)
Returns an array of job identifiers for active jobs that correspond to the given job name and solution name, or null.- Parameters:
jobName
- The job name.solutionName
- The solutionName name.- Returns:
- An array of job run identifiers or
null
.
-
getJobRunIds
JobRunId[] getJobRunIds()
Returns an array of job run identifiers for all job runs that have been submitted regardless of their status (QUEUED, RUNNING, COMPLETED, FAILED, etc).The number of returned job run identifiers will vary based on the volume of jobs and time to live setting of the job history map.
- Returns:
- An array of job run identifiers.
-
getJobRunInfos
JobRunInfo[] getJobRunInfos(JobRunId[] jobRunIds)
Returns an array ofJobRunInfo
objects that correspond to the given array ofJobRunId
objects.- Parameters:
jobRunIds
- The array of job run identifiers.- Returns:
- An array of
JobRunInfo
objects.
-
getJobRunInfos
JobRunInfo[] getJobRunInfos()
Returns an array ofJobRunInfo
objects for all job runs that have been submitted regardless of their status (QUEUED, RUNNING, COMPLETED, FAILED, etc).The number of returned job run identifiers will vary based on the volume of jobs and time to live setting of the job history map.
- Returns:
- An array of
JobRunInfo
objects.
-
submitJob
JobRunId submitJob(java.lang.String jobName, java.lang.String solutionName, java.lang.String description, java.util.List<JobParameter> params) throws java.lang.Exception
Submits a job that corresponds to the given global variable name in order to update its value.If a job with the same name is already in the job queue, the submitted job is skipped, otherwise it is put into the job queue. Note that even if a job with the same name is already running, the sbmitted job is still put into the queue.
- Throws:
java.lang.Exception
- if the job fails to be submitted for any reason.- Parameters:
jobName
- The job name. The name is the technical name of the global aggregate variable defined in the tooling.solutionName
- The solutionName name.description
- An optional description which will appear in theJobRunInfo
when looking at job history.params
- An optional list of job parameters.- Returns:
- The job run identifier of the submitted job.
-
updateJobSchedule
boolean updateJobSchedule(java.lang.String jobName, java.lang.String solutionName, java.lang.String intervalString, java.lang.String crontabString)
Updates the schedule of a job for the given job name, solution name with the schedule identified with the crontabString.- Parameters:
jobName
- The job name.solutionName
- The solutionName name.intervalString
- a description of the recurrent job schedulecrontabString
- a description of the restricted job schedule- Returns:
- true if the schedule was successfully updated, false otherwise
-
getJobSchedule
java.lang.String getJobSchedule(java.lang.String jobName, java.lang.String solutionName)
retrieves the schedule of a job for the given job name, solution name.- Parameters:
jobName
- The job name.solutionName
- The solutionName name.- Returns:
- a String describing the current schedule in the form intervalString:crontabString
-
removeJobSchedule
boolean removeJobSchedule(java.lang.String jobName, java.lang.String solutionName)
Removes the schedule of a job for the given job name, solution name.- Parameters:
jobName
- The job name.solutionName
- The solutionName name.- Returns:
- true if the schedule was successfully removed, false otherwise
-
abortJobByName
void abortJobByName(java.lang.String jobName, java.lang.String solutionName) throws java.lang.Exception
Aborts a running job if one exists for the given job name. If no job with the given name is running an exception is thrown.- Throws:
java.lang.Exception
- if no job with the given name is found.- Parameters:
jobName
- The job name.solutionName
- The solutionName name.
-
abortJob
void abortJob(java.lang.String jobRunId, java.lang.String jobName, java.lang.String solutionName) throws java.lang.Exception
Aborts a running job if one exists for the given job run id, job name, and solution name. If no job with the given name is running an exception is thrown.- Throws:
java.lang.Exception
- if no job with the given name is found.- Parameters:
jobRunId
- The job run identifier.jobName
- The job name.solutionName
- The solutionName name.
-
getJobRunInfo
JobRunInfo getJobRunInfo(java.lang.String jobRunId, java.lang.String jobName, java.lang.String solutionName)
Returns aJobRunInfo
for the given job run id, job name, and solution name.- Parameters:
id
- The job run identifier.jobName
- The job name.solutionName
- The solutionName name.- Returns:
- The
JobRunInfo
for the given job run id, job name, and solution name.
-
getJobRunInfo
JobRunInfo getJobRunInfo(java.lang.String jobName, java.lang.String solutionName)
Gets the latestJobRunInfo
that corresponds to the given job name.- Parameters:
jobName
- The job name.solutionName
- The solutionName name.- Returns:
- the
JobResultInfo
ornull
.
-
getQueuedJobs
JobRunInfo[] getQueuedJobs(java.lang.String solutionName)
Returns an array ofJobRunInfo
objects for all jobs that are currently in the job queue. The job queue contains a list of jobs waiting to be run.- Returns:
- An array of
JobRunInfo
objects.
-
stopGlobalRuntime
void stopGlobalRuntime() throws java.lang.Exception
Stops the global runtime on all containers.- Throws:
java.lang.Exception
-
startGlobalRuntime
void startGlobalRuntime() throws java.lang.Exception
Starts the global runtime on all containers.- Throws:
java.lang.Exception
-
isGlobalRuntimeRunning
boolean isGlobalRuntimeRunning() throws java.lang.Exception
Returns whether or not the global runtime is running on all containers.- Throws:
java.lang.Exception
- Returns:
- true if the global runtime is started, false if not.
-
getIsGlobalRuntimeRunningByContainer
java.util.Map<java.lang.String,java.lang.Boolean> getIsGlobalRuntimeRunningByContainer() throws java.lang.Exception
Returns whether or not the global runtime is running by container.- Throws:
java.lang.Exception
- Returns:
-
-