Package eoxserver :: Package resources :: Package processes :: Module tracker :: Class TaskStatus
[hide private]
[frames] | no frames]

Class TaskStatus

source code

TaskStatus provides an interface to current asynchronous task. An instance of this class is exepected to be passed as an input parameter to the ATP handler function when executed by the ATPD. * 'task_id' in an unique task identifier (string). * dbLock' can be None or any class instance providing two members: 'dbLock.acquire()' and 'dbLock.release()'. The status changing member function internally lock the access to the DB using the user provided 'dbLock'. In case the 'dbLock' is not provided the locking is not performed (see also 'DummyLock' class).
Instance Methods [hide private]
 
__init__(self, task_id, dbLock=None)
TaskStatus constructor ...
source code
 
getInfo(self)
Get short info about the task.
source code
 
getIdentifier(self)
Get tuple of task Type and Instance identifiers.
source code
 
getStatus(self)
Get task status as tuple of the integer code and the string label.
source code
 
setSuccess(self, message='')
Set task status to FINISHED (i.e., success).
source code
 
setFailure(self, message='')
Set task status to FAILED.
source code
 
setPaused(self, message='')
Set task status to PAUSED.
source code
 
setRunning(self, message='')
Set task status to RUNNING.
source code
 
storeResponse(self, response, mimeType='text/xml')
Store the task response.
source code
Class Variables [hide private]
  ACCEPTED = 1
  FAILED = 6
  FINISHED = 5
  PAUSED = 4
  RUNNING = 3
  SCHEDULED = 2
  UNDEFINED = 0
Method Details [hide private]

__init__(self, task_id, dbLock=None)
(Constructor)

source code 
TaskStatus constructor

getInfo(self)

source code 
Get short info about the task. Returns tuple of Type identifier, Instance identifier, status, and status string.

storeResponse(self, response, mimeType='text/xml')

source code 
Store the task response. The response is expected to be python string (Text). However binary data (such as pickled data) may be used as well.