jlite
Class GridSessionImpl

java.lang.Object
  extended by jlite.GridSessionImpl
All Implemented Interfaces:
GridSession

public class GridSessionImpl
extends java.lang.Object
implements GridSession

Default implementation of the GridSession interface.

Author:
Oleg Sukhoroslov
See Also:
GridSession

Method Summary
 void cancelJob(java.lang.String jobId)
          Requests cancellation of a job.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
 void cancelJob(java.lang.String wmProxyURL, java.lang.String jobId)
          Requests cancellation of a job.
 org.globus.gsi.GlobusCredential createProxy(java.lang.String[] vomsArgs, int lifetime, int proxyType, boolean limited)
          Creates a VOMS user proxy certificate (advanced version).
 org.globus.gsi.GlobusCredential createProxy(java.lang.String vo, int lifetime)
          Creates a VOMS user proxy certificate.
If you want to request specific ACs or create a limited proxy, check the advanced version.
 void delegateProxy(java.lang.String delegationId)
          Delegates a proxy certificate linked to the session to WMProxy service.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
 void delegateProxy(java.lang.String wmProxyURL, java.lang.String delegationId)
          Delegates a proxy certificate linked to the session to the specified WMProxy service.
 void destroyProxy()
          Destroys a proxy certificate linked to the session.
 void getJobOutput(java.lang.String jobId, java.lang.String outputDir, boolean purge)
          Retrieves the output of a job via GridFTP.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
Throws GridAPIException if the job is not in DONE state.
 void getJobOutput(java.lang.String wmProxyURL, java.lang.String jobId, java.lang.String outputDir, boolean purge)
          Retrieves the output of a job via GridFTP.
Throws GridAPIException if the job is not in DONE state.
 java.lang.String getJobState(java.lang.String jobId)
          Retrieves current job state of a job.
Possible job states are: SUBMITTED, WAITING, READY, SCHEDULED, RUNNING, DONE, ABORTED, CANCELED, CLEARED (refer to gLite documentation).
 org.glite.wsdl.types.lb.JobStatus getJobStatus(java.lang.String jobId)
          Retrieves the status of a job.
 org.globus.gsi.GlobusCredential getProxy()
          Returns a proxy certificate linked to the session.
 java.util.List<java.lang.String> listJobOutput(java.lang.String jobId)
          Returns URIs of the job output files on the server.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
Throws GridAPIException if the job is not in DONE state.
 java.util.List<java.lang.String> listJobOutput(java.lang.String wmProxyURL, java.lang.String jobId)
          Returns URIs of the job output files on the server.
Throws GridAPIException if the job is not in DONE state.
 java.util.List<MatchedCE> listMatchedCE(java.lang.String jdl)
          Matches available grid resources (computing elements, CE) to requirements specified in the job description.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
Returns a list of matched CEs sorted in decreasing rank order.
 java.util.List<MatchedCE> listMatchedCE(java.lang.String wmProxyURL, java.lang.String jdl)
          Matches available grid resources (computing elements) to requirements specified in the job description.
Returns a list of matched CEs sorted in decreasing rank order.
 java.lang.String submitJob(java.lang.String jdl)
          Submits a job via WMProxy service.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
 java.lang.String submitJob(java.lang.String jdl, java.lang.String inputDir)
          Submits a job via WMProxy service.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
 java.lang.String submitJob(java.lang.String wmProxyURL, java.lang.String jdl, java.lang.String inputDir)
          Submits a job via WMProxy service.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cancelJob

public void cancelJob(java.lang.String jobId)
               throws GridAPIException
Description copied from interface: GridSession
Requests cancellation of a job.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.

Specified by:
cancelJob in interface GridSession
Parameters:
jobId - job identifier
Throws:
GridAPIException

cancelJob

public void cancelJob(java.lang.String wmProxyURL,
                      java.lang.String jobId)
               throws GridAPIException
Description copied from interface: GridSession
Requests cancellation of a job.

Specified by:
cancelJob in interface GridSession
Parameters:
wmProxyURL - WMProxy service endpoint
jobId - job identifier
Throws:
GridAPIException

createProxy

public org.globus.gsi.GlobusCredential createProxy(java.lang.String vo,
                                                   int lifetime)
                                            throws GridAPIException
Description copied from interface: GridSession
Creates a VOMS user proxy certificate.
If you want to request specific ACs or create a limited proxy, check the advanced version.

Specified by:
createProxy in interface GridSession
Parameters:
vo - VO name
lifetime - proxy validity time in seconds
Returns:
created proxy certificate
Throws:
GridAPIException

createProxy

public org.globus.gsi.GlobusCredential createProxy(java.lang.String[] vomsArgs,
                                                   int lifetime,
                                                   int proxyType,
                                                   boolean limited)
                                            throws GridAPIException
Description copied from interface: GridSession
Creates a VOMS user proxy certificate (advanced version).

Specified by:
createProxy in interface GridSession
Parameters:
vomsArgs - a list of VOMS commands in the form [:] identical to "-voms" arguments of glite-voms-proxy-init command
lifetime - proxy validity time in seconds
proxyType - version of proxy certificate {2,3,4} (use 2 for default gLite behavior)
limited - creates a limited proxy (use false for default gLite behavior)
Returns:
created proxy certificate
Throws:
GridAPIException

delegateProxy

public void delegateProxy(java.lang.String delegationId)
                   throws GridAPIException
Description copied from interface: GridSession
Delegates a proxy certificate linked to the session to WMProxy service.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.

Specified by:
delegateProxy in interface GridSession
Parameters:
delegationId - delegation identifier
Throws:
GridAPIException

delegateProxy

public void delegateProxy(java.lang.String wmProxyURL,
                          java.lang.String delegationId)
                   throws GridAPIException
Description copied from interface: GridSession
Delegates a proxy certificate linked to the session to the specified WMProxy service.

Specified by:
delegateProxy in interface GridSession
Parameters:
wmProxyURL - WMProxy service endpoint
delegationId - delegation identifier
Throws:
GridAPIException

destroyProxy

public void destroyProxy()
                  throws GridAPIException
Description copied from interface: GridSession
Destroys a proxy certificate linked to the session.

Specified by:
destroyProxy in interface GridSession
Throws:
GridAPIException

getJobOutput

public void getJobOutput(java.lang.String jobId,
                         java.lang.String outputDir,
                         boolean purge)
                  throws GridAPIException
Description copied from interface: GridSession
Retrieves the output of a job via GridFTP.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
Throws GridAPIException if the job is not in DONE state.

Specified by:
getJobOutput in interface GridSession
Parameters:
jobId - job identifier
outputDir - directory to store retrieved files
purge - purge job output from the server after retrieval (use true for default gLite behavior)
Throws:
GridAPIException

getJobOutput

public void getJobOutput(java.lang.String wmProxyURL,
                         java.lang.String jobId,
                         java.lang.String outputDir,
                         boolean purge)
                  throws GridAPIException
Description copied from interface: GridSession
Retrieves the output of a job via GridFTP.
Throws GridAPIException if the job is not in DONE state.

Specified by:
getJobOutput in interface GridSession
Parameters:
wmProxyURL - WMProxy service endpoint
jobId - job identifier
outputDir - directory to store retrieved files
purge - purge job output from the server after retrieval (use true for default gLite behavior)
Throws:
GridAPIException

getJobState

public java.lang.String getJobState(java.lang.String jobId)
                             throws GridAPIException
Description copied from interface: GridSession
Retrieves current job state of a job.
Possible job states are: SUBMITTED, WAITING, READY, SCHEDULED, RUNNING, DONE, ABORTED, CANCELED, CLEARED (refer to gLite documentation).

Specified by:
getJobState in interface GridSession
Parameters:
jobId - job identifier
Returns:
job state
Throws:
GridAPIException

getJobStatus

public org.glite.wsdl.types.lb.JobStatus getJobStatus(java.lang.String jobId)
                                               throws GridAPIException
Description copied from interface: GridSession
Retrieves the status of a job.

Specified by:
getJobStatus in interface GridSession
Parameters:
jobId - job identifier
Returns:
job status structure (as returned from LB WS endpoint)
Throws:
GridAPIException

getProxy

public org.globus.gsi.GlobusCredential getProxy()
Description copied from interface: GridSession
Returns a proxy certificate linked to the session.

Specified by:
getProxy in interface GridSession
Returns:
proxy certiciate (null if proxy is not found)

listJobOutput

public java.util.List<java.lang.String> listJobOutput(java.lang.String jobId)
                                               throws GridAPIException
Description copied from interface: GridSession
Returns URIs of the job output files on the server.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
Throws GridAPIException if the job is not in DONE state.

Specified by:
listJobOutput in interface GridSession
Parameters:
jobId - job identifier
Returns:
list of file URIs
Throws:
GridAPIException

listJobOutput

public java.util.List<java.lang.String> listJobOutput(java.lang.String wmProxyURL,
                                                      java.lang.String jobId)
                                               throws GridAPIException
Description copied from interface: GridSession
Returns URIs of the job output files on the server.
Throws GridAPIException if the job is not in DONE state.

Specified by:
listJobOutput in interface GridSession
Parameters:
wmProxyURL - WMProxy service endpoint
jobId - job identifier
Returns:
list of file URIs
Throws:
GridAPIException

listMatchedCE

public java.util.List<MatchedCE> listMatchedCE(java.lang.String jdl)
                                        throws GridAPIException
Description copied from interface: GridSession
Matches available grid resources (computing elements, CE) to requirements specified in the job description.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.
Returns a list of matched CEs sorted in decreasing rank order. The MatchedCE structure contains a CE identifier and its rank.

Specified by:
listMatchedCE in interface GridSession
Parameters:
jdl - job description in JDL format
Returns:
list of matched CEs
Throws:
GridAPIException

listMatchedCE

public java.util.List<MatchedCE> listMatchedCE(java.lang.String wmProxyURL,
                                               java.lang.String jdl)
                                        throws GridAPIException
Description copied from interface: GridSession
Matches available grid resources (computing elements) to requirements specified in the job description.
Returns a list of matched CEs sorted in decreasing rank order. The MatchedCE structure contains a CE identifier and its rank.

Specified by:
listMatchedCE in interface GridSession
Parameters:
wmProxyURL - WMProxy service endpoint
jdl - job description in JDL format
Returns:
list of matched CEs
Throws:
GridAPIException

submitJob

public java.lang.String submitJob(java.lang.String jdl)
                           throws GridAPIException
Description copied from interface: GridSession
Submits a job via WMProxy service.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.

Specified by:
submitJob in interface GridSession
Parameters:
jdl - job description in JDL format
Returns:
job identifier
Throws:
GridAPIException

submitJob

public java.lang.String submitJob(java.lang.String jdl,
                                  java.lang.String inputDir)
                           throws GridAPIException
Description copied from interface: GridSession
Submits a job via WMProxy service.
The WMProxy service endpoint is determined by the default VO of the proxy certificate.

Specified by:
submitJob in interface GridSession
Parameters:
jdl - job description in JDL format
inputDir - all input files with relative paths will be searched in the specified directory
Returns:
job identifier
Throws:
GridAPIException

submitJob

public java.lang.String submitJob(java.lang.String wmProxyURL,
                                  java.lang.String jdl,
                                  java.lang.String inputDir)
                           throws GridAPIException
Description copied from interface: GridSession
Submits a job via WMProxy service.

Specified by:
submitJob in interface GridSession
Parameters:
wmProxyURL - WMProxy service endpoint
jdl - job description in JDL format
inputDir - search input files in the specified directory
Returns:
job identifier
Throws:
GridAPIException