g-Eclipse
Release 1.0.0

eu.geclipse.servicejob.model
Class AbstractServiceJob

java.lang.Object
  extended by PlatformObject
      extended by eu.geclipse.core.model.impl.AbstractGridElement
          extended by eu.geclipse.servicejob.model.AbstractServiceJob
All Implemented Interfaces:
IGridElement, IManageable, IServiceJob
Direct Known Subclasses:
AbstractSubmittableServiceJob, GridAccessServiceJob

public abstract class AbstractServiceJob
extends AbstractGridElement
implements IServiceJob

An abstract, base implementation of IServiceJob interface.


Constructor Summary
AbstractServiceJob()
           
 
Method Summary
 void addServiceJobResult(java.util.List<IServiceJobResult> newResults)
          This method should be called each time when service job was run and new results are available.
 int getColumnWidth(java.lang.String singleServiceJobName)
          This method sets column width for single service job with a name specified as parameter.
 IFileStore getFileStore()
          Get the file store that this element is associated with.
 java.util.Date getLastUpdate()
          Method to access date of last service job submission.
 java.util.Date getLastUpdate(java.lang.String serviceJobResourceName)
          The same as IServiceJob.getLastUpdate(), but should be used in case there can be difference in number of service job's runs for each resource.
 IGridElementManager getManager()
          Get the manager that is responsible for the element.
 java.lang.String getName()
          Get the name of this element.
 IGridContainer getParent()
          Get the parent element of this element.
 IPath getPath()
          Get the path of this element relative to the grid root element.
 java.util.Map<java.lang.String,java.lang.String> getProperties()
          Method returns all the data which needs to be viewed in properties view.
 IResource getResource()
          Get the corresponding resource of this element.
 java.util.List<IServiceJobResult> getResults()
          Method to access list of single service job's results
 IFolder getServiceJobFolder()
          This methods returns handle to folder specific to single instance of service job.
 java.util.List<java.lang.String> getServiceJobResourcesNames()
          Method to access names of the resources on which service job is operating.
 java.util.List<java.util.List<IServiceJobResult>> getServiceJobResultsForResourceForDate(java.lang.String resourceName)
          This method gives access to ordered collection of sub service jobs' results.
 IServiceJobResult getSingleServiceJobResult(java.lang.String serviceJobName, java.lang.String resourceName, java.util.Date date)
          Method to access text interpretation of single service job for given single service job's name performed on target resource at given date.
 java.lang.Object getStatus()
           
 IGridJobService getSubmissionService()
          Gives access to information to which submission service service's jobs should be submitted.
 java.lang.String getSummary()
          Method returning result of the service job - as a summary of single service jobs.
 void internalInit(IFile initInputData)
          This method is used to initialize instance just after it was created with some data.
 boolean needsSubmissionWizard()
          This method is to obtain information whether service job implementation needs to display job submission wizard to the user when it is being run.
 void setResource(IFile resource)
          Sets resource for this object.
 void setSubmissionService(IGridJobService submissionService)
          Method to set the submission service for use when job-based service jobs are submitted.
 
Methods inherited from class eu.geclipse.core.model.impl.AbstractGridElement
dispose, getAdapter, getProject, isHidden, isVirtual
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.geclipse.core.model.IServiceJob
getInputStreamForResult, getServiceJobDescription, getSingleServiceJobNames, init, run
 

Constructor Detail

AbstractServiceJob

public AbstractServiceJob()
Method Detail

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
Specified by:
getName in interface IServiceJob
Returns:
The name of this element.

getResults

public java.util.List<IServiceJobResult> getResults()
Description copied from interface: IServiceJob
Method to access list of single service job's results

Specified by:
getResults in interface IServiceJob
Returns:
List of single service job's results

getServiceJobResourcesNames

public java.util.List<java.lang.String> getServiceJobResourcesNames()
Description copied from interface: IServiceJob
Method to access names of the resources on which service job is operating.

Specified by:
getServiceJobResourcesNames in interface IServiceJob
Returns:
List of resources' names.

getSingleServiceJobResult

public IServiceJobResult getSingleServiceJobResult(java.lang.String serviceJobName,
                                                   java.lang.String resourceName,
                                                   java.util.Date date)
Description copied from interface: IServiceJob
Method to access text interpretation of single service job for given single service job's name performed on target resource at given date.

Specified by:
getSingleServiceJobResult in interface IServiceJob
Parameters:
serviceJobName - name of single service job
resourceName - name of resource service job is performing on
date - date of the submission
Returns:
String that is representation of single service job result

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.

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.

internalInit

public final void internalInit(IFile initInputData)
Description copied from interface: IServiceJob
This method is used to initialize instance just after it was created with some data. This method existing separately from class' constructor, because its instances are created through extension points, which require - for simplicity - constructors without parameters.

Specified by:
internalInit in interface IServiceJob
Parameters:
initInputData - object with information to initialize new (and most likely empty) instance of class

getStatus

public java.lang.Object getStatus()
Specified by:
getStatus in interface IServiceJob

getLastUpdate

public java.util.Date getLastUpdate()
Description copied from interface: IServiceJob
Method to access date of last service job submission.

Specified by:
getLastUpdate in interface IServiceJob
Returns:
date of last service job submission.

getSummary

public java.lang.String getSummary()
Description copied from interface: IServiceJob
Method returning result of the service job - as a summary of single service jobs.

Specified by:
getSummary in interface IServiceJob
Returns:
Service job's result.

getServiceJobResultsForResourceForDate

public java.util.List<java.util.List<IServiceJobResult>> getServiceJobResultsForResourceForDate(java.lang.String resourceName)
Description copied from interface: IServiceJob
This method gives access to ordered collection of sub service jobs' results. All service jobs' results returned by this method are results for given resource. Those results are grouped by date - which means that collection itself is divided into another collections, each of which keeps service job's result for given resource and date. In other words this method returns collection of collections. Those internal collections keep service job's result for given resource and date.

Method used by providers for Operator's Job History.

Specified by:
getServiceJobResultsForResourceForDate in interface IServiceJob
Parameters:
resourceName - Name of resource (e.g. host name).
Returns:
List of list of service job's results.

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.

getManager

public IGridElementManager getManager()
Description copied from interface: IManageable
Get the manager that is responsible for the element.

Specified by:
getManager in interface IManageable
Returns:
This element's IGridElementManager.

addServiceJobResult

public void addServiceJobResult(java.util.List<IServiceJobResult> newResults)
Description copied from interface: IServiceJob
This method should be called each time when service job was run and new results are available. Calling this method results in serialisation of new results - they are written to service job's GTDL file - this is how exemplary implementation available in service job framework works.

Specified by:
addServiceJobResult in interface IServiceJob
Parameters:
newResults - list of new results that should be added to set of results maintained by this service job's class

getLastUpdate

public java.util.Date getLastUpdate(java.lang.String serviceJobResourceName)
Description copied from interface: IServiceJob
The same as IServiceJob.getLastUpdate(), but should be used in case there can be difference in number of service job's runs for each resource.

Specified by:
getLastUpdate in interface IServiceJob
Parameters:
serviceJobResourceName - Name of a resource where service job should run.
Returns:
date Date of last successful service job run for given resource.

getProperties

public java.util.Map<java.lang.String,java.lang.String> getProperties()
Description copied from interface: IServiceJob
Method returns all the data which needs to be viewed in properties view.

Specified by:
getProperties in interface IServiceJob
Returns:
Map with property name as a key and its value as a value

setResource

public void setResource(IFile resource)
Sets resource for this object.

Parameters:
resource -

getServiceJobFolder

public IFolder getServiceJobFolder()
This methods returns handle to folder specific to single instance of service job. This folder should be used to store all files used by a service job.

Returns:
Folder specific for this service job.

getColumnWidth

public int getColumnWidth(java.lang.String singleServiceJobName)
Description copied from interface: IServiceJob
This method sets column width for single service job with a name specified as parameter.

Specified by:
getColumnWidth in interface IServiceJob
Parameters:
singleServiceJobName - Name of the single service job.
Returns:
Width of the column.

getSubmissionService

public IGridJobService getSubmissionService()
Description copied from interface: IServiceJob
Gives access to information to which submission service service's jobs should be submitted. This information should be set by class that runs service job (see also IServiceJob.needsSubmissionWizard()).

Specified by:
getSubmissionService in interface IServiceJob
Returns:
reference to submission service to which this service job should submit its jobs or null in case this information wasn't set yet, or when service job implementation did not declare that this information is needed (see IServiceJob.needsSubmissionWizard()).

needsSubmissionWizard

public boolean needsSubmissionWizard()
Description copied from interface: IServiceJob
This method is to obtain information whether service job implementation needs to display job submission wizard to the user when it is being run. Job submission wizard gives access to information which job submission service to use (see IServiceJob.getSubmissionService() method).

Specified by:
needsSubmissionWizard in interface IServiceJob
Returns:
true if this service job needs information to which submission service submit its jobs, false otherwise

setSubmissionService

public void setSubmissionService(IGridJobService submissionService)
Description copied from interface: IServiceJob
Method to set the submission service for use when job-based service jobs are submitted.

Specified by:
setSubmissionService in interface IServiceJob

g-Eclipse
Release 1.0.0