de.fzj.unicore.uas.client
Class JobClient

java.lang.Object
  extended by de.fzj.unicore.wsrflite.xmlbeans.client.BaseWSRFClient
      extended by de.fzj.unicore.uas.client.BaseUASClient
          extended by de.fzj.unicore.uas.client.JobClient

public class JobClient
extends BaseUASClient

a client to manage a Job resource and to access the job working directory (Uspace). It can be used to

Author:
schuller

Field Summary
 
Fields inherited from class de.fzj.unicore.wsrflite.xmlbeans.client.BaseWSRFClient
epr, proxyMaker, retryDecider, securityProperties, url
 
Constructor Summary
JobClient(org.w3.x2005.x08.addressing.EndpointReferenceType epr)
           
JobClient(org.w3.x2005.x08.addressing.EndpointReferenceType address, IUASSecurityProperties sec)
          connect to the Job service at EPR 'address'
JobClient(java.lang.String url, org.w3.x2005.x08.addressing.EndpointReferenceType address, IUASSecurityProperties sec)
          connect to the Job service at EPR 'address' using the given URL
 
Method Summary
 void abort()
          abort this job
 java.lang.Integer getExitCode()
          return the exit code of the job
 java.lang.String getJobLog()
           
 java.lang.Float getProgress()
          return the progress of the job
 org.unigrids.x2006.x04.services.jms.JobPropertiesDocument getResourcePropertiesDocument()
          returns the service's JobPropertiesDocument
 org.unigrids.services.atomic.types.StatusType.Enum getStatus()
          return the job status
 java.lang.String getStatusMessage()
          get the job status message
 java.util.Calendar getSubmissionTime()
          get the time of submission
 StorageClient getUspaceClient()
          get a client for the Uspace SMS
 void hold()
           
 void resume()
           
 void start()
          start this job
This will throw an exception if the job is not in the READY state
 java.lang.String waitUntilDone(int timeout)
          convenience method that waits until a job has finished and returns the final status (SUCCESSFUL or FAILED)
 java.lang.String waitUntilReady(int timeout)
          convenience method that waits until a job is READY and can be started.
 
Methods inherited from class de.fzj.unicore.uas.client.BaseUASClient
extractReceiver, getSecurityProperties, getServerVersion, setRetryDefaults
 
Methods inherited from class de.fzj.unicore.wsrflite.xmlbeans.client.BaseWSRFClient
checkConnection, checkConnection, destroy, getConnectionStatus, getCurrentTime, getEPR, getLT, getMultipleResourceProperties, getResourceProperty, getResourcePropertyDocument, GetResourcePropertyDocument, getRP, getTerminationTime, getUpdateInterval, getUrl, makeProxy, queryResourceProperties, setConnectionTimeout, setConnectionTimeout, setRetryHandler, setTerminationTime, setUpdateInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobClient

public JobClient(java.lang.String url,
                 org.w3.x2005.x08.addressing.EndpointReferenceType address,
                 IUASSecurityProperties sec)
          throws java.lang.Exception
connect to the Job service at EPR 'address' using the given URL

Parameters:
url - - the URL of the job
address - - the EPR of the job
sec - - the security settings to use
Throws:
java.lang.Exception

JobClient

public JobClient(org.w3.x2005.x08.addressing.EndpointReferenceType address,
                 IUASSecurityProperties sec)
          throws java.lang.Exception
connect to the Job service at EPR 'address'

Parameters:
address - - the EPR of the jon
sec - - the security settings to use
Throws:
java.lang.Exception

JobClient

public JobClient(org.w3.x2005.x08.addressing.EndpointReferenceType epr)
          throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getResourcePropertiesDocument

public org.unigrids.x2006.x04.services.jms.JobPropertiesDocument getResourcePropertiesDocument()
                                                                                        throws java.lang.Exception
returns the service's JobPropertiesDocument

Parameters:
endpointUrl -
epr -
Throws:
java.lang.Exception

getUspaceClient

public StorageClient getUspaceClient()
                              throws java.lang.Exception
get a client for the Uspace SMS

Returns:
StorageClient
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
start this job
This will throw an exception if the job is not in the READY state

Throws:
java.lang.Exception

abort

public void abort()
           throws java.lang.Exception
abort this job

Throws:
java.lang.Exception

hold

public void hold()
          throws java.lang.Exception
Throws:
java.lang.Exception

resume

public void resume()
            throws java.lang.Exception
Throws:
java.lang.Exception

waitUntilDone

public java.lang.String waitUntilDone(int timeout)
                               throws java.lang.Exception
convenience method that waits until a job has finished and returns the final status (SUCCESSFUL or FAILED)

Parameters:
timeout - in milliseconds (null for no timeout)
Returns:
Throws:
java.lang.Exception

waitUntilReady

public java.lang.String waitUntilReady(int timeout)
                                throws java.lang.Exception
convenience method that waits until a job is READY and can be started. If the job is already past the READY state, an exception is thrown.

Parameters:
timeout - in milliseconds (null for no timeout)
Returns:
Throws:
java.lang.Exception

getStatus

public org.unigrids.services.atomic.types.StatusType.Enum getStatus()
                                                             throws java.lang.Exception
return the job status

Throws:
java.lang.Exception

getStatusMessage

public java.lang.String getStatusMessage()
                                  throws java.lang.Exception
get the job status message

Returns:
Throws:
java.lang.Exception

getExitCode

public java.lang.Integer getExitCode()
return the exit code of the job

Returns:
the exit code or null if not (yet) available

getProgress

public java.lang.Float getProgress()
return the progress of the job

Returns:
a value between 0 and 1 or null if progress value not available

getSubmissionTime

public java.util.Calendar getSubmissionTime()
get the time of submission


getJobLog

public java.lang.String getJobLog()
                           throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2006-2010 Research Center Juelich. All Rights Reserved.