org.gcube.portlets.admin.irbootstrapperportlet.gwt.server
Class BootstrappingConfiguration

java.lang.Object
  extended by org.gcube.portlets.admin.irbootstrapperportlet.gwt.server.BootstrappingConfiguration

public class BootstrappingConfiguration
extends Object

Author:
Spyros Boutsis, NKUA

Constructor Summary
BootstrappingConfiguration()
          Class constructor
 
Method Summary
 void addJobInstance(String jobTypeName, JobType jobInstance)
          Adds a job instance to the list of instances for the given job type
 void addSubmittedJobInstance(JobType jobInstance)
          Adds a submitted (started) job instance to the list of submitted jobs
 void clearAllJobInstances()
          Clears the map of job instances for all the job types
 void clearJobTypeInstances(String jobTypeName)
          Clears the list of job instances for the given job type
 Map<String,List<JobType>> getAllJobInstances()
          Returns all the instances of all job types in the active scope
 Map<String,List<JobType>> getAllJobsPerJobType()
          Returns a map containing all jobs defined for each job type
 Map<String,JobType> getallJobTypes()
          Returns a map containing all the available JobType objects paired with their names.
 Map<String,DataType<? extends Resource>> getDataTypes()
          Returns the list of available data types
 List<JobType> getJobInstancesForJobType(String jobTypeName)
          Returns all the instances of a given job type in the active scope
 List<JobType> getJobs()
          Returns the list of available jobs
 JobType getJobTypeByName(String jobTypeName)
          Returns the JobType object corresponding to a given job type name
 ResourceCache getResourceCache()
          Returns the ResourceCache object used by this BootstrappingConfiguration object
 JobType getSubmittedJobInstanceByUID(String jobUID)
          Returns a submitted job instance in the active scope, given its UID
 List<JobType> getSubmittedJobInstances()
          Returns the list of submitted job instances in the active scope
 Map<String,ExecutionEntity> getTaskTypes()
          Returns the list of available task types
 void initialize(org.gcube.common.core.scope.GCUBEScope scope)
          Reads the configuration for the given scope and initializes the internal structures
 void jobInChainCompleted(String jobChainUID, JobType completedJob)
           
 void jobInChainFailed(String jobChainUID, JobType failedJob)
           
 ExecutionEntity newTaskObject(String taskTypeName)
          Creates and returns a new instance of the object representing the task with the given name.
 ExecutionEntity parseJobExecutionEntity(Element xml)
          Parses a XML fragment describing an execution entity inside a job and returns an appropriate object describing it.
 void removeSubmittedJobInstance(String jobUID)
          Removes a submitted (stopped) job instance from the list of submitted jobs
 String submitJobForExecution(String jobUID, EntityExecutionData eed, Map<String,String> userInputs)
          Submits a new instance of the job with the given UID for execution
 String submitJobsForExecution(ArrayList<String> jobsUIDs, EntityExecutionData eed, Map<String,String> userInputs)
          Submits a list of jobs Submits a new instance of the job with the given UID for execution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BootstrappingConfiguration

public BootstrappingConfiguration()
Class constructor

Method Detail

initialize

public void initialize(org.gcube.common.core.scope.GCUBEScope scope)
                throws Exception
Reads the configuration for the given scope and initializes the internal structures

Parameters:
scope -
Throws:
Exception

getResourceCache

public ResourceCache getResourceCache()
Returns the ResourceCache object used by this BootstrappingConfiguration object

Returns:
the ResourceCache object

parseJobExecutionEntity

public ExecutionEntity parseJobExecutionEntity(Element xml)
                                        throws Exception
Parses a XML fragment describing an execution entity inside a job and returns an appropriate object describing it.

Parameters:
xml - the XML fragment to parse
Returns:
an ExecutionEntity object
Throws:
Exception

newTaskObject

public ExecutionEntity newTaskObject(String taskTypeName)
Creates and returns a new instance of the object representing the task with the given name.

Parameters:
taskTypeName -

getDataTypes

public Map<String,DataType<? extends Resource>> getDataTypes()
Returns the list of available data types

Returns:

getTaskTypes

public Map<String,ExecutionEntity> getTaskTypes()
Returns the list of available task types

Returns:

getJobs

public List<JobType> getJobs()
Returns the list of available jobs

Returns:

getAllJobsPerJobType

public Map<String,List<JobType>> getAllJobsPerJobType()
Returns a map containing all jobs defined for each job type

Returns:

addJobInstance

public void addJobInstance(String jobTypeName,
                           JobType jobInstance)
Adds a job instance to the list of instances for the given job type

Parameters:
jobTypeName - the job type name
jobInstance - the job instance to add

clearAllJobInstances

public void clearAllJobInstances()
Clears the map of job instances for all the job types


clearJobTypeInstances

public void clearJobTypeInstances(String jobTypeName)
Clears the list of job instances for the given job type

Parameters:
jobTypeName - the job type name

getAllJobInstances

public Map<String,List<JobType>> getAllJobInstances()
Returns all the instances of all job types in the active scope

Returns:
the map of job instances, containing (jobTypeName, List) pairs

getJobInstancesForJobType

public List<JobType> getJobInstancesForJobType(String jobTypeName)
Returns all the instances of a given job type in the active scope

Returns:
the list of job instances

addSubmittedJobInstance

public void addSubmittedJobInstance(JobType jobInstance)
Adds a submitted (started) job instance to the list of submitted jobs

Parameters:
jobInstance - the submitted job

removeSubmittedJobInstance

public void removeSubmittedJobInstance(String jobUID)
Removes a submitted (stopped) job instance from the list of submitted jobs

Parameters:
jobUID - the UID of the job instance to remove

getSubmittedJobInstances

public List<JobType> getSubmittedJobInstances()
Returns the list of submitted job instances in the active scope

Returns:
the list of submitted jobs

getSubmittedJobInstanceByUID

public JobType getSubmittedJobInstanceByUID(String jobUID)
Returns a submitted job instance in the active scope, given its UID

Returns:
the list of job instances

submitJobForExecution

public String submitJobForExecution(String jobUID,
                                    EntityExecutionData eed,
                                    Map<String,String> userInputs)
                             throws Exception
Submits a new instance of the job with the given UID for execution

Parameters:
jobUID - the UID of the job to submit
eed - the EntityExecutionData object to be used during the job's execution
Throws:
Exception

submitJobsForExecution

public String submitJobsForExecution(ArrayList<String> jobsUIDs,
                                     EntityExecutionData eed,
                                     Map<String,String> userInputs)
                              throws Exception
Submits a list of jobs Submits a new instance of the job with the given UID for execution

Parameters:
jobUID - the UID of the job to submit
eed - the EntityExecutionData object to be used during the job's execution
Throws:
Exception

jobInChainCompleted

public void jobInChainCompleted(String jobChainUID,
                                JobType completedJob)

jobInChainFailed

public void jobInChainFailed(String jobChainUID,
                             JobType failedJob)

getJobTypeByName

public JobType getJobTypeByName(String jobTypeName)
Returns the JobType object corresponding to a given job type name

Parameters:
jobTypeName -
Returns:

getallJobTypes

public Map<String,JobType> getallJobTypes()
Returns a map containing all the available JobType objects paired with their names.

Returns:


Copyright © 2013. All Rights Reserved.