web.clientjob.model.Job

Package web :: Package clientjob :: Module model :: Class Job |
[hide private]
[frames] | no frames]

# Class Job

source code

    declarative_base() --+
                         |
                        Job

A instance of this class is created when a plugin sends a job to a client. The client will reply to the job with a new state and with a message. When this reponse comes to the server the plugin's callback_function is called. The Job instance is updated and it's passed as argument. The response won't be always finished. For example if a job takes a long time, it could send a response with state 'in progress' and the percentage in the message.

* 'id' is the primary key. * 'plugins' is the plugin that made the call. * 'callback_function' is called when a response comes. * 'request' is the command sent to the client. * 'state' three posibilities: open, 'in progress' and close * 'message' is the last 'string' sent by the client * 'creation_date' is the date when the job was sent * 'last_modified_date' is the date of the last response of the client

Instance Methods | [hide private]
__init__(self) Creates a new open job | source code
update_response(self, message, state) This function is called when a new response comes. | source code

Class Variables | [hide private]
| __tablename__ = `'job'`
| id = `Column(Integer, primary_key= True)`
| origin = `Column(Unicode(128))`
| callback_function = `Column(Unicode(128))`
| request = `Column(Unicode(1024))`
| state = `Column(Unicode(128))`
| message = `Column(Unicode())`
| creation_date = `Column(DateTime())`
| last_modified_date = `Column(DateTime())`
| computer_id = `Column(Integer, ForeignKey('computer.id'))`
| computer = `relation(Computer, backref= backref('jobs', order_b`...``

Method Details | [hide private]

### update_response(self, message, state) | source code
This function is called when a new response comes. The message, the state and the modified date are updated

Class Variable Details | [hide private]

  ### computer Value:
      relation(Computer, backref= backref('jobs', order_by= id))