SMILA (incubation) API documentation

org.eclipse.smila.jobmanager.persistence
Class DefinitionValidator

java.lang.Object
  extended by org.eclipse.smila.jobmanager.persistence.DefinitionValidator

public class DefinitionValidator
extends java.lang.Object

Helper class for validating asynchronous workflow elements.


Constructor Summary
DefinitionValidator(DefinitionAccessor definitionAccessor, JobManager jobManager, ObjectStoreService objectStoreService)
           
 
Method Summary
 void checkJobRemove(java.lang.String jobName)
          Checks if the job can be removed.
 void checkRemoveBucket(java.lang.String name)
          Check if the bucket can be safely removed without compromising data integrity.
 void checkRemoveWorkflow(java.lang.String name)
          Check if the workflow can be safely removed without compromising data integrity.
 void validateBucket(BucketDefinition bucketDefinition)
          check if bucket definition is valid.
 void validateBucketWorkflows(BucketDefinition bucketDefinition)
          Check if the bucket can be safely added without compromising data integrity.
 void validateJob(JobDefinition job)
          check the the workflow referenced by this job.
 void validateWorkflow(WorkflowDefinition workflow)
          check if workflow definition is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefinitionValidator

public DefinitionValidator(DefinitionAccessor definitionAccessor,
                           JobManager jobManager,
                           ObjectStoreService objectStoreService)
Parameters:
definitionAccessor - accessor for reading user-submitted or configured definitions.
jobManager - needed for accessing task generators needed for validation
objectStoreService - the reference to the object store service.
Method Detail

validateJob

public void validateJob(JobDefinition job)
                 throws InvalidConfigException,
                        PersistenceException
check the the workflow referenced by this job.

Parameters:
job - job definition
Throws:
InvalidConfigException - validation error.
PersistenceException - error reading definition(s).

validateWorkflow

public void validateWorkflow(WorkflowDefinition workflow)
                      throws InvalidConfigException,
                             PersistenceException
check if workflow definition is valid.

Parameters:
workflow - workflow definition
Throws:
InvalidConfigException - validation error.
PersistenceException - error accessing storage

validateBucket

public void validateBucket(BucketDefinition bucketDefinition)
                    throws InvalidConfigException,
                           PersistenceException
check if bucket definition is valid.

Parameters:
bucketDefinition - bucket definition
Throws:
InvalidConfigException - validation error.
PersistenceException - the bucket names cannot be retrieved.

validateBucketWorkflows

public void validateBucketWorkflows(BucketDefinition bucketDefinition)
                             throws PersistenceException,
                                    InvalidConfigException
Check if the bucket can be safely added without compromising data integrity. I.e. if there is an existing workflow definition that already references a bucket with the same name, it must still be valid after the update.

Parameters:
bucketDefinition - The bucket to check
Throws:
PersistenceException - error reading workflow definition(s)
InvalidConfigException - error adding definition due to dependency constraints

checkRemoveWorkflow

public void checkRemoveWorkflow(java.lang.String name)
                         throws InvalidConfigException,
                                PersistenceException
Check if the workflow can be safely removed without compromising data integrity. I.e. if there is an existing job definition that still references this workflow, it must not be removed.

Parameters:
name - The name of the workflow to check
Throws:
PersistenceException - error reading job definition(s)
InvalidConfigException - error deleting definition due to dependency constraints

checkRemoveBucket

public void checkRemoveBucket(java.lang.String name)
                       throws InvalidConfigException,
                              PersistenceException
Check if the bucket can be safely removed without compromising data integrity. I.e. if there is an existing workflow definition that still references this bucket, it must not be removed.

Parameters:
name - The name of the bucket to check
Throws:
PersistenceException - error reading workflow definition(s)
InvalidConfigException - error deleting definition due to dependency constraints

checkJobRemove

public void checkJobRemove(java.lang.String jobName)
                    throws JobManagerException
Checks if the job can be removed.

Parameters:
jobName - The name of the job to be removed.
Throws:
JobManagerException - Some error occurred while checking if job is currently running.

SMILA (incubation) API documentation