Package Jobber :: Module manager :: Class JobManager
[hide private]
[frames] | no frames]

Class JobManager

source code

Products.ZenModel.ZenModelRM.ZenModelRM --+
                                          |
                                         JobManager

Instance Methods [hide private]
str
_getId(self, klass=None)
Get a unique id for jobs.
source code
JobStatus
addJob(self, klass, *args, **kwargs)
Create a new Job and JobStatus from the class specified.
source code
JobStatus, None
getJob(self, jobid)
Return a JobStatus object that matches the id specified.
source code
list
getUnfinishedJobs(self)
Return JobStatus objects that have not yet completed, including those that have not yet started.
source code
list
getRunningJobs(self)
Return JobStatus objects that have started but not finished.
source code
list
getPendingJobs(self)
Return JobStatus objects that have not yet started.
source code
list
getFinishedJobs(self)
Return JobStatus objects that have finished.
source code
 
deleteUntil(self, untiltime)
Delete all jobs older than untiltime.
source code
 
clearJobs(self)
Clear out all finished jobs.
source code
 
killRunning(self)
Cancel running jobs with FAILURE.
source code
Class Variables [hide private]
  portal_type = 'JobManager'
  meta_type = 'JobManager'
  _relations = "jobs", ToManyCont(ToOne, "Products.Jobber.status...
Method Details [hide private]

_getId(self, klass=None)

source code 

Get a unique id for jobs.

If klass is not None, its __name__ attribute will be used as the id prefix.
Returns: str
A unique id.

addJob(self, klass, *args, **kwargs)

source code 

Create a new Job and JobStatus from the class specified.

klass must implement IJob and should subclass Job.
Returns: JobStatus
The JobStatus object representing the job created.

getJob(self, jobid)

source code 
Return a JobStatus object that matches the id specified.
Parameters:
  • jobid (str) - id of the JobStatus. The "JobStatus_" prefix is not necessary.
Returns: JobStatus, None
A matching JobStatus object, or None if none is found

getUnfinishedJobs(self)

source code 
Return JobStatus objects that have not yet completed, including those that have not yet started.
Returns: list
A list of jobs.

getRunningJobs(self)

source code 
Return JobStatus objects that have started but not finished.
Returns: list
A list of jobs.

getPendingJobs(self)

source code 
Return JobStatus objects that have not yet started.
Returns: list
A list of jobs.

getFinishedJobs(self)

source code 
Return JobStatus objects that have finished.
Returns: list
A list of jobs.

Class Variable Details [hide private]

_relations

Value:
"jobs", ToManyCont(ToOne, "Products.Jobber.status.JobStatus", "jobmana\
ger"),