archipelagentactionscheduler :: actionscheduler :: TNActionScheduler :: Class TNActionScheduler
[hide private]
[frames] | no frames]

Class TNActionScheduler

source code

archipelcore.archipelPlugin.TNArchipelPlugin --+
                                               |
                                              TNActionScheduler

This plugin allows to create scheduled actions.

Instance Methods [hide private]
 
__init__(self, configuration, entity, entry_point_group)
Initialize the plugin.
source code
 
register_handlers(self)
This method will be called by the plugin user when it will be necessary to register module for listening to stanza.
source code
 
unregister_handlers(self)
Unregister the handlers.
source code
 
delete_job(self, uid)
Remove a job from the database.
source code
 
save_jobs(self, uid, action, year, month, day, hour, minute, second, comment, params=None)
Save a job in the database.
source code
 
restore_jobs(self)
Restore the jobs from the database.
source code
 
vm_terminate(self, origin, user_info, arguments)
Close the database connection.
source code
 
get_jod_with_uid(self, uid)
Get a job with given uid.
source code
 
do_job_for_vm(self, action, uid, str_date, comment, param)
Perform the job.
source code
 
do_job_for_hypervisor(self, action, uid, str_date, comment, param)
Perform the job.
source code
 
process_iq(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_VM_SCHEDULER IQ is received.
source code
xmpp.Protocol.Iq
iq_schedule(self, iq)
Schedule a task.
source code
xmpp.Protocol.Iq
iq_jobs(self, iq)
Get jobs.
source code
xmpp.Protocol.Iq
iq_unschedule(self, iq)
Unschedule a job.
source code
xmpp.Protocol.Iq
iq_actions(self, iq)
Get available actions.
source code
Static Methods [hide private]
dict
plugin_info()
Return informations about the plugin.
source code
Method Details [hide private]

__init__(self, configuration, entity, entry_point_group)
(Constructor)

source code 

Initialize the plugin.

Parameters:
  • configuration (Configuration object) - the configuration
  • entity (TNArchipelEntity) - the entity that owns the plugin
  • entry_point_group (string) - the group name of plugin entry_point
Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.__init__

register_handlers(self)

source code 

This method will be called by the plugin user when it will be necessary to register module for listening to stanza.

Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.register_handlers

unregister_handlers(self)

source code 

Unregister the handlers.

Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.unregister_handlers

plugin_info()
Static Method

source code 

Return informations about the plugin.

Returns: dict
dictionary contaning plugin informations
Overrides: archipelcore.archipelPlugin.TNArchipelPlugin.plugin_info

delete_job(self, uid)

source code 

Remove a job from the database.

Parameters:
  • uid (string) - the uid of the job to remove

save_jobs(self, uid, action, year, month, day, hour, minute, second, comment, params=None)

source code 

Save a job in the database.

Parameters:
  • uid (string) - the uid of the job
  • action (string) - the action
  • year (string) - year of execution
  • month (string) - month of execution
  • day (string) - day of execution
  • hour (string) - hour of execution
  • minute (string) - minute of execution
  • second (string) - second of execution
  • comment (string) - comment about the job
  • params (string) - random parameter of the job

vm_terminate(self, origin, user_info, arguments)

source code 

Close the database connection.

Parameters:
  • origin (TNArchipelEntity) - the origin of the hook
  • user_info (object) - random user information
  • arguments (object) - runtime argument

get_jod_with_uid(self, uid)

source code 

Get a job with given uid.

Parameters:
  • uid (string) - the uid of the job

do_job_for_vm(self, action, uid, str_date, comment, param)

source code 

Perform the job.

Parameters:
  • action (string) - the action to execute
  • uid (string) - the uid of the job
  • str_date (string) - the date of the job
  • comment (string) - comment about the job
  • param (string) - a random parameter to give to job

do_job_for_hypervisor(self, action, uid, str_date, comment, param)

source code 

Perform the job.

Parameters:
  • action (string) - the action to execute
  • uid (string) - the uid of the job
  • str_date (string) - the date of the job
  • comment (string) - comment about the job
  • param (string) - a random parameter to give to job

process_iq(self, conn, iq)

source code 

This method is invoked when a ARCHIPEL_NS_VM_SCHEDULER IQ is received. It understands IQ of type:

  • jobs
  • schedule
  • unschedule
Parameters:
  • conn (xmpp.Dispatcher) - ths instance of the current connection that send the stanza
  • iq (xmpp.Protocol.Iq) - the received IQ

iq_schedule(self, iq)

source code 

Schedule a task.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_jobs(self, iq)

source code 

Get jobs.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_unschedule(self, iq)

source code 

Unschedule a job.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action

iq_actions(self, iq)

source code 

Get available actions.

Parameters:
  • iq (xmpp.Protocol.Iq) - the received IQ
Returns: xmpp.Protocol.Iq
a ready to send IQ containing the result of the action