Module xg :: Class JobManager
[show private | hide private]
[frames | no frames]

Class JobManager

Known Subclasses:
Controller, Grid

Manage a set of Xgrid jobs.
Method Summary
  __init__(self, gridID, connection, update)
Create a JobManager for a given Grid and Connection.
  deleteAll(self)
Deletes all active jobs.
  job(self, jobID, update)
Returns the Job object with job identifier id.
tuple jobIDs(self, update)
Returns a tuple of job identifiers for all active jobs.
list jobs(self, update)
Returns a list of initialized Job objects for all active jobs.
  perform(self, action, jobIDs)
Performs an action on a subset of active jobs.
  printJobs(self)
Prints information about all active Xgrid jobs.
  restartAll(self)
Restarts all active jobs.
  resumeAll(self)
Resumes all active jobs.
  stopAll(self)
Stops all active jobs.
  suspendAll(self)
Suspends all active jobs.

Method Details

__init__(self, gridID=u'0', connection=None, update=0)
(Constructor)

Create a JobManager for a given Grid and Connection.

This class is mainly designed to be a base class of the Conroller and Grid classes, both of which need to manage Xgrid jobs. The class provides basic capabilities to list active jobs and perform various actions on those jobs (stop, restart, resume, suspend, delete). Job submission is handled by the Controller, Grid and Job classes.

Usage

Parameters:
gridID - The grid identifier of the grid on which the JobManager will manage jobs. Internally, the grid identifier is a unicode string, but gridID can be given in any of the formats u'0', '0' or 0. If gridID=u'0', the JobManager will manage jobs on the default grid
           (type=unicode, str or int)
connection - Instance of Connection class. If empty a default Connection object is used.
           (type=Connection)
update - A boolean flag that determines whether or not the internal state is updated upon creation. This involves a call to the Xgrid controller.
           (type=boolean)

deleteAll(self)

Deletes all active jobs.

job(self, jobID=u'999999999', update=1)

Returns the Job object with job identifier id.
Parameters:
jobID - The job identifier. Can be given as unicode, str or int.
           (type=unicode, str, or int)
update - A boolean flag that determines whether or not the internal state is updated upon creation. This involves a call to the Xgrid controller.
           (type=boolean)
Returns:
Initialize Job object.

jobIDs(self, update=1)

Returns a tuple of job identifiers for all active jobs.
Parameters:
update - A boolean flag that determines whether or not the internal state is updated upon creation. This involves a call to the Xgrid controller.
           (type=boolean)
Returns:
Tuple of job identifiers.
           (type=tuple)

jobs(self, update=1)

Returns a list of initialized Job objects for all active jobs.
Parameters:
update - A boolean flag that determines whether or not the internal state is updated upon creation. This involves a call to the Xgrid controller.
           (type=boolean)
Returns:
a lists of active Job objects.
           (type=list)

perform(self, action, jobIDs)

Performs an action on a subset of active jobs.
Parameters:
action - The action to be performed as a string. Implemented actions are stop, resume, delete, restart, and suspend.
           (type=str)
jobIDs - Jobs to perform the action on.
           (type=Either the string 'all' or a python sequence of job identifiers.)

printJobs(self)

Prints information about all active Xgrid jobs.

restartAll(self)

Restarts all active jobs.

resumeAll(self)

Resumes all active jobs.

stopAll(self)

Stops all active jobs.

suspendAll(self)

Suspends all active jobs.

Generated by Epydoc 2.1 on Thu Dec 22 15:15:21 2005 http://epydoc.sf.net