It is mainly a proxy class for the gramClient module. It provides a higher
level interface designed to simplify usage. Exceptions are used to indicate
all error conditions.
Methods
|
|
|
|
__del__
|
__del__ ( self )
Destroys an instance.
It will deactivate the globus_gram_client module when
the object is destroyed.
Raises:
A GramClientException is thrown if unable to destroy the module. This
exception can't be caught, and should never happend. It's there mainly
for debugging if it does happen. :-)
|
|
__init__
|
__init__ ( self )
Constructs an instance.
This will activate the globus_gram_client_mddule.
Raises:
A GramClientException is thrown if unable to activate the module.
|
|
cancel_job
|
cancel_job ( self, jobContact )
Cancels a job.
Arguments:
Raises:
A GramClientException if unable to cancel the job.
|
|
check_status
|
check_status ( self, jobContact )
Checks the status of a current job.
Arguments:
Raises:
A GramClientException if unable to get the job status.
Returns:
An int containing the current job status. This int will be one
of the module constants defined above.
|
|
ping
|
ping ( self, jobContact )
Pings a gatekeeper.
Arguments:
|
|
register_callback
|
register_callback (
self,
jobContact,
stateMask,
callbackContact,
)
Registers a callback.
Sets the functions to receive job state changes for the given job.
Arguments:
jobContact The job who's changes should be reported to the given
callback.
stateMask Which job state change messages you wish to be notified of.
The notification happens through the callback. This is an int that
can formed by bitwise or'ing the module constants defined above.
callbackContact The callback that should be notified.
Raises:
A GramClientException if unable to register the callback.
Returns:
An int containing the current job status. This is one of the
values defined in the module constants.
|
|
remove_callback
|
remove_callback ( self, callbackContact )
Stops the callback.
Stops the callback from listening for job state changes and cleans up
any resources.
Arguments:
Raises:
A GramClientException if unable to remove the callback.
|
|
set_callback
|
set_callback (
self,
callback,
arg,
)
Sets a callback.
Sets the function to be notified of job state changes.
Arguments:
callback The function that should be called when the job state changes.
The function has the following prototype:
function(arg, contact, state, error)
where contact is the job contact, state is one of the module constants
defined above, and error is an integer error code. It can be passed to
the error_string function to return an error string.
arg The argument to be passed to the callback when it is called.
Raises:
A GramClientException if an error occurs while setting the callback.
Returns:
A string containing the callback contact is returned. This can
be passed to submit_request.
|
|
submit_request
|
submit_request (
self,
resourceManager,
description,
jobStateMask,
callbackContact,
)
Submits a job request to a resource manger.
Arguments:
resourceManager The resource manager to submit the job to.
description An RSL string that contains the job description.
jobStateMask Which job state change message you wish to be notified of.
The notification happens through the callback. This is an int that can
be formed by bitwise or'ing the module constants defined above.
callbackContact A string containing the contact for the callback that
should be notified of job state changes.
Raises:
A GramClientException if unable to submit the job request.
Returns:
A string containing the job contact used for communicting with the
remote job.
|
|
unregister_callback
|
unregister_callback (
self,
jobContact,
callbackContact,
)
Unregisters a callback.
Stop notifing the callback of job state changes for the given job.
Arguments:
Raises:
A GramClientException is thrown if unable to unregister the
callback.
Returns:
An int containing the current job status. This is one of the
values defined in the module constants.
|