g-Eclipse
Release 1.0.0

eu.geclipse.core.jobs
Class ParametricJobService

java.lang.Object
  extended by eu.geclipse.core.jobs.ParametricJobService
All Implemented Interfaces:
IGridElement, IGridJobService, IGridResource, IGridService

public class ParametricJobService
extends java.lang.Object
implements IGridJobService

Job service, which handles parametric jobs. Can: submit parametric JSDL, update param job status, delete job


Constructor Summary
ParametricJobService(IGridJobService jobService)
          Constructor used only for job submission, when job is not known yet
ParametricJobService(eu.geclipse.core.jobs.internal.ParametricJobID jobID)
          Constructor used for submitted job, when parametric jobs is created and all actions are delegated to job children
 
Method Summary
 boolean canSubmit(IGridJobDescription desc)
          Tests if a given job description can be handled (i.e., submitted) by this job service.
 IGridJob createParamJobStructure(JSDLJobDescription jsdl, IGridContainer parent, java.lang.String jobName)
           
 void deleteJob(IGridJobID dummyJobId, IVirtualOrganization vo, IProgressMonitor monitor)
          Deletes the given job from the server and releases resources on it.
 void dispose()
          Clean up all resources that this element uses internally.
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 IFileStore getFileStore()
          Get the file store that this element is associated with.
 java.lang.String getHostName()
          Get the host name of the machine (physical or virtual) that represent this resource.
 java.util.Map<java.lang.String,java.net.URI> getInputFiles(IGridJobID jobId, IGridJobDescription jobDescription, IVirtualOrganization vo)
          Get pairs (filename, URI) of input files for job.
 IGridJobStatus getJobStatus(IGridJobID id, IVirtualOrganization vo, boolean fullStatus, IProgressMonitor progressMonitor)
          Queries the service about the job's status.
 java.lang.String getName()
          Get the name of this element.
 java.util.Map<java.lang.String,java.net.URI> getOutputFiles(IGridJobID jobId, IGridJobDescription jobDescription, IVirtualOrganization vo)
          Get pairs (filename, URI) of output files for job.
 IGridContainer getParent()
          Get the parent element of this element.
 IPath getPath()
          Get the path of this element relative to the grid root element.
 IGridProject getProject()
          Get the IGridProject this element belongs to.
 IResource getResource()
          Get the corresponding resource of this element.
 java.net.URI getURI()
          Get the URI that corresponds to this grid resource.
 boolean isHidden()
          Determines if this element is hidden.
 boolean isLocal()
          Determines if this element is local.
 boolean isVirtual()
          Determines if this element is virtual.
 IGridJobID submitJob(IGridJobDescription description, IProgressMonitor monitor)
          Submits the given job description to the grid.
 IGridJobID submitJob(IGridJobDescription description, IVirtualOrganization vo, IProgressMonitor monitor)
          Submits the given job description to the grid.
 IGridJobID submitJob(IGridJobDescription description, SubMonitor monitor, IGridContainer parent, java.lang.String jobName)
          Specialized method to submit parametric job
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParametricJobService

public ParametricJobService(IGridJobService jobService)
Constructor used only for job submission, when job is not known yet

Parameters:
jobService -

ParametricJobService

public ParametricJobService(eu.geclipse.core.jobs.internal.ParametricJobID jobID)
Constructor used for submitted job, when parametric jobs is created and all actions are delegated to job children

Parameters:
jobID -
Method Detail

canSubmit

public boolean canSubmit(IGridJobDescription desc)
Description copied from interface: IGridJobService
Tests if a given job description can be handled (i.e., submitted) by this job service.

Specified by:
canSubmit in interface IGridJobService
Parameters:
desc - the job description to be tested.
Returns:
true if the given job description can be submitted to the grid using this service, false otherwise.

deleteJob

public void deleteJob(IGridJobID dummyJobId,
                      IVirtualOrganization vo,
                      IProgressMonitor monitor)
               throws ProblemException
Description copied from interface: IGridJobService
Deletes the given job from the server and releases resources on it.

Specified by:
deleteJob in interface IGridJobService
Parameters:
dummyJobId - The id of job, which will be deleted
vo - Virtual Organization, to which job with passed id belongs to
monitor - Use to monitor progress. May be null.
Throws:
ProblemException - if deleting the job failed.

getJobStatus

public IGridJobStatus getJobStatus(IGridJobID id,
                                   IVirtualOrganization vo,
                                   boolean fullStatus,
                                   IProgressMonitor progressMonitor)
                            throws ProblemException
Description copied from interface: IGridJobService
Queries the service about the job's status.

Specified by:
getJobStatus in interface IGridJobService
Parameters:
id - The id of the job whose status has to be queried.
vo - Virtual Organization, to which job with passed id belongs to
fullStatus - true if all available status information should be downloaded, false if only basic information are needed (status type, status name and reason)
progressMonitor - Use to monitor progress. May be null.
Returns:
IGridJobStatus the current status of the job.
Throws:
ProblemException - if the status query failed.

createParamJobStructure

public IGridJob createParamJobStructure(JSDLJobDescription jsdl,
                                        IGridContainer parent,
                                        java.lang.String jobName)
                                 throws ProblemException
Parameters:
jsdl -
parent -
jobName -
Returns:
created job
Throws:
ProblemException

submitJob

public IGridJobID submitJob(IGridJobDescription description,
                            SubMonitor monitor,
                            IGridContainer parent,
                            java.lang.String jobName)
                     throws ProblemException
Specialized method to submit parametric job

Parameters:
description -
monitor -
parent -
jobName -
Returns:
submitted job
Throws:
ProblemException

getHostName

public java.lang.String getHostName()
Description copied from interface: IGridResource
Get the host name of the machine (physical or virtual) that represent this resource. This name should either be the DNS entry or IP address of this host.

Specified by:
getHostName in interface IGridResource
Returns:
Returns the hostname of the machine, may be null if the resource cannot provide its hostname.

getURI

public java.net.URI getURI()
Description copied from interface: IGridResource
Get the URI that corresponds to this grid resource.

Specified by:
getURI in interface IGridResource
Returns:
The resource's contact string. May be null if the resource may not be represented by a URI.

dispose

public void dispose()
Description copied from interface: IGridElement
Clean up all resources that this element uses internally.

Specified by:
dispose in interface IGridElement

getFileStore

public IFileStore getFileStore()
Description copied from interface: IGridElement
Get the file store that this element is associated with. May return null if there is no such associated file store. If this element is not virtual the filestore corresponds to the file store of the corresponding resource.

Specified by:
getFileStore in interface IGridElement
Returns:
The corresponding file store.

getName

public java.lang.String getName()
Description copied from interface: IGridElement
Get the name of this element. The names of all children of a container have to be unique within this container. If this element is not virtual the name is the name of the corresponding resource.

Specified by:
getName in interface IGridElement
Returns:
The name of this element.

getParent

public IGridContainer getParent()
Description copied from interface: IGridElement
Get the parent element of this element. The parent can only be an IGridContainer. This method may not return null since the only element that is allowed to return null is the IGridRoot which is a singleton and is internally defined within the model.

Specified by:
getParent in interface IGridElement
Returns:
The parent container of this element.

getPath

public IPath getPath()
Description copied from interface: IGridElement
Get the path of this element relative to the grid root element. If this element is not virtual this has to be the path of the corresponding @IResource.

Specified by:
getPath in interface IGridElement
Returns:
The path of this element relative to the grid root.

getProject

public IGridProject getProject()
Description copied from interface: IGridElement
Get the IGridProject this element belongs to. This method may return null if the element is not contained in a project like for example an element manager and its children.

Specified by:
getProject in interface IGridElement
Returns:
The IGridProject this element belongs to.

getResource

public IResource getResource()
Description copied from interface: IGridElement
Get the corresponding resource of this element. This may be null if - and only if - this element is virtual.

Specified by:
getResource in interface IGridElement
Returns:
The corresponding resource or null if this element is virtual.

isHidden

public boolean isHidden()
Description copied from interface: IGridElement
Determines if this element is hidden. Hidden elements are not shown in the Grid model views.

Specified by:
isHidden in interface IGridElement
Returns:
True if this is a hidden element, false otherwise.

isLocal

public boolean isLocal()
Description copied from interface: IGridElement
Determines if this element is local. A local element has to be any related item (not necessarily an IResource) that is local in the means that it is located on the local machine.

Specified by:
isLocal in interface IGridElement
Returns:
True if this element is local.

isVirtual

public boolean isVirtual()
Description copied from interface: IGridElement
Determines if this element is virtual. Virtual elements have no corresponding resources. If this method returns false the IGridElement.getResource() method returns null. If this method returns true the IGridElement.getResource() has to return a valid IResource that is related to this element.

Specified by:
isVirtual in interface IGridElement
Returns:
True if this element is virtual, i.e. has no corresponding resource.

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)

submitJob

public IGridJobID submitJob(IGridJobDescription description,
                            IProgressMonitor monitor)
                     throws ProblemException
Description copied from interface: IGridJobService
Submits the given job description to the grid.

Specified by:
submitJob in interface IGridJobService
Parameters:
description - the job description to be submitted.
monitor - Use to monitor progress. May be null.
Returns:
The id of the submitted job.
Throws:
ProblemException - if submitting the job failed.

submitJob

public IGridJobID submitJob(IGridJobDescription description,
                            IVirtualOrganization vo,
                            IProgressMonitor monitor)
                     throws ProblemException
Description copied from interface: IGridJobService
Submits the given job description to the grid.

Specified by:
submitJob in interface IGridJobService
Parameters:
description - the job description to be submitted.
vo - Virtual Organization, to which job is submitted
monitor - Use to monitor progress. May be null.
Returns:
The id of the submitted job.
Throws:
ProblemException - if submitting the job failed.

getInputFiles

public java.util.Map<java.lang.String,java.net.URI> getInputFiles(IGridJobID jobId,
                                                                  IGridJobDescription jobDescription,
                                                                  IVirtualOrganization vo)
                                                           throws ProblemException
Description copied from interface: IGridJobService
Get pairs (filename, URI) of input files for job.

Specified by:
getInputFiles in interface IGridJobService
Parameters:
jobId - id of job, for which input files will be returned
jobDescription - job description, which was used to submit job
vo - Virtual Organization, for which job belongs to
Returns:
URI Map containing input files used by job. Map contains pairs: filename (used to create link), and URI of input file.
It's possible to return null if input files cannot be returned
Throws:
ProblemException - thrown, when input files cannot be retrieved, because of any error

getOutputFiles

public java.util.Map<java.lang.String,java.net.URI> getOutputFiles(IGridJobID jobId,
                                                                   IGridJobDescription jobDescription,
                                                                   IVirtualOrganization vo)
                                                            throws ProblemException
Description copied from interface: IGridJobService
Get pairs (filename, URI) of output files for job.

Specified by:
getOutputFiles in interface IGridJobService
Parameters:
jobId - id of job, for which input files will be returned
jobDescription - job description, which was used to submit job.
May be null - in this case only output files, which can be get without reading job description will be returned.
E.g. for gLite jobs only files stayed in the sandbox will be returned. Files transfered to the Storage Element can be read only from Job Description.
vo - Virtual Organization, for which job belongs to
Returns:
URI Map containing output files created by job. Map contains pairs: filename (used to create link), and URI of output file.
It's possible to return null if input files cannot be returned now (because e.g. job status doesn't allow it now).
Throws:
ProblemException

g-Eclipse
Release 1.0.0