SMILA 1.0 API documentation

org.eclipse.smila.jobmanager.persistence
Interface PermanentStorage

All Known Implementing Classes:
PermanentStorageObjectstore

public interface PermanentStorage

Interface for handling persistent jobmanager data.


Method Summary
 void addBucket(BucketDefinition bucket)
          Write bucket definition to storage.
 void addJob(JobDefinition job)
          Write job definition to storage.
 void addWorkflow(WorkflowDefinition workflow)
          Write workflow definition to storage.
 boolean containsJobRun(java.lang.String jobName, java.lang.String jobRunId)
           
 void deleteJobRunData(java.lang.String jobName, java.lang.String jobRunId)
          Deletes the stored data for the given job run.
 BucketDefinition getBucket(java.lang.String name)
          get bucket definition from storage.
 java.util.Collection<java.lang.String> getBuckets()
          Get bucket names defined in storage.
 JobDefinition getJob(java.lang.String name)
          get job definition from storage.
 AnyMap getJobRunData(java.lang.String jobName, java.lang.String jobRunId)
           
 java.util.Collection<java.lang.String> getJobRunIds(java.lang.String jobName)
           
 java.util.Collection<java.lang.String> getJobs()
          Get job names defined in storage.
 WorkflowDefinition getWorkflow(java.lang.String name)
          get workflow definition from storage.
 java.util.Collection<java.lang.String> getWorkflows()
          Get workflow names defined in storage.
 boolean hasJob(java.lang.String jobName)
           
 void removeBucket(java.lang.String name)
          Remove bucket definition from storage.
 void removeJob(java.lang.String name)
          Remove job definition from storage.
 void removeWorkflow(java.lang.String name)
          Remove workflow definition from storage.
 void storeJobRun(java.lang.String jobName, java.lang.String jobRunId, AnyMap jobRunData)
          Stores the job run data for the given job run.
 

Method Detail

addBucket

void addBucket(BucketDefinition bucket)
               throws PersistenceException
Write bucket definition to storage.

Parameters:
bucket - bucket definition
Throws:
PersistenceException - error writing.

getBucket

BucketDefinition getBucket(java.lang.String name)
                           throws PersistenceException
get bucket definition from storage.

Parameters:
name - bucket name
Returns:
bucket definition or null if bucket doesn't exist.
Throws:
PersistenceException - error reading bucket definition

removeBucket

void removeBucket(java.lang.String name)
                  throws PersistenceException
Remove bucket definition from storage. Removing a non-existing bucket will be ignored.

Parameters:
name - bucket name
Throws:
PersistenceException - error deleting.

getBuckets

java.util.Collection<java.lang.String> getBuckets()
                                                  throws PersistenceException
Get bucket names defined in storage.

Returns:
bucket names.
Throws:
PersistenceException - error reading.

addJob

void addJob(JobDefinition job)
            throws PersistenceException
Write job definition to storage.

Parameters:
job - job definition
Throws:
PersistenceException - error writing.

getJob

JobDefinition getJob(java.lang.String name)
                     throws PersistenceException
get job definition from storage.

Parameters:
name - job name
Returns:
job definition or null if job doesn't exist.
Throws:
PersistenceException - error reading job definition

hasJob

boolean hasJob(java.lang.String jobName)
               throws PersistenceException
Parameters:
jobName - job name
Returns:
true if a job with this name is defined
Throws:
PersistenceException - error checking existence.

getJobs

java.util.Collection<java.lang.String> getJobs()
                                               throws PersistenceException
Get job names defined in storage.

Returns:
job names.
Throws:
PersistenceException - error reading.

removeJob

void removeJob(java.lang.String name)
               throws PersistenceException
Remove job definition from storage. Removing a non-existing job will be ignored.

Parameters:
name - job name
Throws:
PersistenceException - error deleting.

addWorkflow

void addWorkflow(WorkflowDefinition workflow)
                 throws PersistenceException
Write workflow definition to storage.

Parameters:
workflow - workflow definition
Throws:
PersistenceException - error writing.

getWorkflow

WorkflowDefinition getWorkflow(java.lang.String name)
                               throws PersistenceException
get workflow definition from storage.

Parameters:
name - workflow name
Returns:
workflow definition or null if workflow doesn't exist.
Throws:
PersistenceException - error reading workflow definition

getWorkflows

java.util.Collection<java.lang.String> getWorkflows()
                                                    throws PersistenceException
Get workflow names defined in storage.

Returns:
workflow names.
Throws:
PersistenceException - error reading.

removeWorkflow

void removeWorkflow(java.lang.String name)
                    throws PersistenceException
Remove workflow definition from storage. Removing a non-existing workflow will be ignored.

Parameters:
name - workflow name
Throws:
PersistenceException - error deleting.

getJobRunIds

java.util.Collection<java.lang.String> getJobRunIds(java.lang.String jobName)
                                                    throws PersistenceException
Parameters:
jobName - the job for which to return the job run ids
Returns:
the ids of the stored job runs for the given job. If no entries are found an empty list is returned
Throws:
PersistenceException - error accessing store

storeJobRun

void storeJobRun(java.lang.String jobName,
                 java.lang.String jobRunId,
                 AnyMap jobRunData)
Stores the job run data for the given job run. If writing to the storage fails for whatever reason, the data is logged, but no exception is thrown.

Parameters:
jobName - the job
jobRunId - the job run for which to store the data
jobRunData - the job run data

containsJobRun

boolean containsJobRun(java.lang.String jobName,
                       java.lang.String jobRunId)
                       throws PersistenceException
Parameters:
jobName - the job
jobRunId - the job run for which to check if it's contained in the store
Returns:
'true' if an entry exists for the given job run, otherwise 'false'.
Throws:
PersistenceException - error accessing store

getJobRunData

AnyMap getJobRunData(java.lang.String jobName,
                     java.lang.String jobRunId)
                     throws PersistenceException
Parameters:
jobName - the job
jobRunId - the job run id
Returns:
the job run data for the given job run id. If the job run doesn't exist 'null' is returned
Throws:
PersistenceException - error accessing store

deleteJobRunData

void deleteJobRunData(java.lang.String jobName,
                      java.lang.String jobRunId)
                      throws PersistenceException
Deletes the stored data for the given job run.

Parameters:
jobName - the job
jobRunId - the id of the job run for which to delete the data
Throws:
PersistenceException - error accessing store

SMILA 1.0 API documentation