Table of Contents

Class: GramClient ./pyGlobus/gramClient.py

The main interface to the gram client module.

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__
__init__
cancel_job
check_status
ping
register_callback
remove_callback
set_callback
submit_request
unregister_callback
  __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. :-)

Exceptions   
ex
  __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.

Exceptions   
ex
  cancel_job 
cancel_job ( self,  jobContact )

Cancels a job.

Arguments:

  • jobContact A string containing the contact information for the job to be canceled.

Raises:

A GramClientException if unable to cancel the job.

Exceptions   
ex
  check_status 
check_status ( self,  jobContact )

Checks the status of a current job.

Arguments:

  • jobContact A string containing the contact information for the job you would like the status of.

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.

Exceptions   
ex
  ping 
ping ( self,  jobContact )

Pings a gatekeeper.

Arguments:

  • jobContact A string containing the contact information

Exceptions   
GramClientException( error )
  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.

Exceptions   
ex
  remove_callback 
remove_callback ( self,  callbackContact )

Stops the callback.

Stops the callback from listening for job state changes and cleans up any resources.

Arguments:

  • callbackContact The string identifier for the callbck to be removed.

Raises:

A GramClientException if unable to remove the callback.

Exceptions   
ex
  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.

Exceptions   
ex
  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.

Exceptions   
ex
  unregister_callback 
unregister_callback (
        self,
        jobContact,
        callbackContact,
        )

Unregisters a callback.

Stop notifing the callback of job state changes for the given job.

Arguments:

  • callbcackContact The callback that should no longer be notified.

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.

Exceptions   
ex

Table of Contents

This document was automatically generated on Tue Feb 4 16:47:03 2003 by HappyDoc version 2.1