Package pyGlobus :: Module gramClient :: Class GramClient
[show private | hide private]
[frames | no frames]

Class GramClient


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.
Method Summary
  __init__(self)
Constructs an instance.
  __del__(self)
Destroys an instance.
  cancel_job(self, jobContact)
Cancels a job.
  check_status(self, jobContact)
Checks the status of a current job.
  debug(self)
Enables debugging output.
  ping(self, jobContact)
Pings a gatekeeper.
  refresh_credentials(self, jobContact, cred)
Refresh credentials assosciated with a job.
  register_callback(self, jobContact, stateMask, callbackContact)
Registers a callback.
  register_callback_registration(self, jobContact, jobStateMask, callbackContact, attr, func, userArg)
Non-blocking callback registration.
  register_refresh_credentials(self, jobContact, cred, attr, func, userArg)
Non-blocking for of credential refresh.
  register_submit_request(self, resourceManager, description, jobStateMask, callbackContact, attr, func, userArg)
Non-blocking submit a job request to a resource manger.
  remove_callback(self, callbackContact)
Stops the callback.
  set_callback(self, callback, arg)
Sets a callback.
  submit_request(self, resourceManager, description, jobStateMask, callbackContact)
Submits a job request to a resource manger.
  unregister_callback(self, jobContact, callbackContact)
Unregisters a callback.
  version(self)
Returns an int version number for the gram client package.

Method Details

__init__(self)
(Constructor)

Constructs an instance.

This will activate the globus_gram_client_mddule.
Raises:
GramClientException - A GramClientException is thrown if unable to activate the module.

__del__(self)
(Destructor)

Destroys an instance.

It will deactivate the globus_gram_client module when the object is destroyed.
Raises:
GramClientException - 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. :-)

cancel_job(self, jobContact)

Cancels a job.
Parameters:
jobContact - A string containing the contact information for the job to be canceled.
Raises:
GramClientException - A GramClientException if unable to cancel the job.

check_status(self, jobContact)

Checks the status of a current job.
Parameters:
jobContact - A string containing the contact information for the job you would like the status of.
Returns:
An int containing the current job status. This int will be one of the module constants defined above.
Raises:
GramClientException - A GramClientException if unable to get the job status.

debug(self)

Enables debugging output.

ping(self, jobContact)

Pings a gatekeeper.
Parameters:
jobContact - A string containing the contact information

refresh_credentials(self, jobContact, cred)

Refresh credentials assosciated with a job.
Parameters:
jobContact - A string containing the job contact information.
cred - An instance of pyGlobus.security.GSSCred containing the credential ot use to contact the job manager. If GSS_C_NO_CREDENTIAL is used the process's default credential will be used.
Raises:
GramClientException - A GramClientException if an error occurs while refreshing creds.

register_callback(self, jobContact, stateMask, callbackContact)

Registers a callback.

Sets the function to receive job state changes for the given job.
Parameters:
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.
Returns:
An int containing the current job status. This is one of the values defined in the module constants.
Raises:
GramClientException - A GramClientException if unable to register the callback.

register_callback_registration(self, jobContact, jobStateMask, callbackContact, attr, func, userArg)

Non-blocking callback registration.

Sets the function to receive job state changes for the given job.
Parameters:
jobContact - A string containing the job contact information.
jobStateMask - 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 of job state changes.
attr - An instance of GramClientAttr containing the client attributes to be used.
func -

Callback function to be called when callback registration is completed.

The callback function has the following signature: func(userArg, job_contact, job_state, failure_code)

userArg is the argument passed to register_callback_registration job_contact is a string containing the job contact string job_state is an int containing one of the possible job states failure_code is one of the possible failure codes.
userArg - A user defined argument to be passed to the callback functions.
Raises:
GramClientException - A GramClientException if unable to register the callback.

register_refresh_credentials(self, jobContact, cred, attr, func, userArg)

Non-blocking for of credential refresh.
Parameters:
jobContact -

A string containing the job contact information.

@param cred:An instance of pyGlobus.security.GSSCred containing the credential ot use to contact the job manager. If GSS_C_NO_CREDENTIAL is used the process's default credential will be used.
attr - An instance of GramClientAttr containing the client attributes to be used.
func -

Callback function to be called when credential refresh is completed.

The callback function has the following signature: func(userArg, job_contact, job_state, failure_code)

userArg is the argument passed to register_refresh_credentials job_contact is a string containing the job contact string job_state is an int containing one of the possible job states failure_code is one of the possible failure codes.
userArg - A user defined argument to be passed to the callback functions.
Raises:
GramClientException - A GramClientException if unable to refresh the credential.

register_submit_request(self, resourceManager, description, jobStateMask, callbackContact, attr, func, userArg)

Non-blocking submit a job request to a resource manger.
Parameters:
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.
attr - An instance of GramClientAttr.
func -

Callback function to be called when job submission is completed.

The callback function has the following signature: func(userArg, job_contact, job_state, failure_code)

userArg is the argument passed to register_submit_request job_contact is a string containing the job contact string job_state is an int containing one of the possible job states failure_code is one of the possible failure codes.
userArg - A user defined argument to be passed to the callback functions.
Raises:
GramClientException - A GramClientException if unable to submit the job request.

remove_callback(self, callbackContact)

Stops the callback.

Stops the callback from listening for job state changes and cleans up any resources.
Parameters:
callbackContact - The string identifier for the callbck to be removed.
Raises:
GramClientException - A GramClientException if unable to remove the callback.

set_callback(self, callback, arg)

Sets a callback.

Sets the function to be notified of job state changes.
Parameters:
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.
Returns:
A string containing the callback contact is returned. This can be passed to submit_request.
Raises:
GramClientException - A GramClientException if an error occurs while setting the callback.

submit_request(self, resourceManager, description, jobStateMask, callbackContact)

Submits a job request to a resource manger.
Parameters:
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.
Returns:
A string containing the job contact used for communicting with the remote job.
Raises:
GramClientException - A GramClientException if unable to submit the job request.

unregister_callback(self, jobContact, callbackContact)

Unregisters a callback.

Stop notifing the callback of job state changes for the given job.
Raises:
GramClientException -

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.

version(self)

Returns an int version number for the gram client package.

Generated by Epydoc 2.0 on Mon Oct 13 13:47:20 2003 http://epydoc.sf.net