Class Recipe
- java.lang.Object
-
- fr.ens.biologie.genomique.aozan.aozan3.recipe.Recipe
-
public class Recipe extends Object
This class define a recipe.- Since:
- 3.0
- Author:
- Laurent Jourdren
-
-
Constructor Summary
Constructors Constructor Description Recipe(String recipeName, String description, Configuration conf, fr.ens.biologie.genomique.kenetre.log.GenericLogger logger)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDataProvider(RunDataProvider dataProvider)
Set an existing data providervoid
addDataProvider(String providerName, String storageName, boolean inProgress, Configuration conf)
Add a data provider.void
addStep(Step step)
Add a step.void
addSteps(Collection<Step> steps)
Add steps.void
addStorage(String name, DataStorage storage)
Add a storage.Set<RunId>
availableRuns()
Get available runs.Set<RunId>
availableRuns(Collection<RunId> excludedRunIds)
Get available runs.void
execute()
Use the recipe to process run provided by the run data providerboolean
execute(String runId)
Execute the recipe for a run.Set<RunId>
execute(List<String> runIds)
Execute a list of run Ids.List<String>
getAvalaibleRuns()
Get the list of available runs.Configuration
getConfiguration()
Get the configuration.String
getDescription()
Get the recipe namefr.ens.biologie.genomique.kenetre.log.GenericLogger
getLogger()
Get the logger.String
getName()
Get the recipe nameDataStorageRegistry
getStorages()
Get storagesvoid
init()
Initialize the steps of the recipe
-
-
-
Constructor Detail
-
Recipe
public Recipe(String recipeName, String description, Configuration conf, fr.ens.biologie.genomique.kenetre.log.GenericLogger logger) throws Aozan3Exception
Public constructor.- Parameters:
recipeName
- recipe namedescription
- description of the recipeconf
- configurationlogger
- logger- Throws:
Aozan3Exception
- if an error occurs while initializing the email sending
-
-
Method Detail
-
getName
public String getName()
Get the recipe name- Returns:
- the name of the recipe
-
getDescription
public String getDescription()
Get the recipe name- Returns:
- the name of the recipe
-
getLogger
public fr.ens.biologie.genomique.kenetre.log.GenericLogger getLogger()
Get the logger.- Returns:
- the logger
-
getConfiguration
public Configuration getConfiguration()
Get the configuration.- Returns:
- a copy of the configuration of the recipe
-
getStorages
public DataStorageRegistry getStorages()
Get storages- Returns:
- the storage registry
-
addStorage
public void addStorage(String name, DataStorage storage)
Add a storage.- Parameters:
name
- name of the storagestorage
- storage to add
-
addDataProvider
public void addDataProvider(String providerName, String storageName, boolean inProgress, Configuration conf) throws Aozan3Exception
Add a data provider.- Parameters:
providerName
- provider namestorageName
- storage used by the providerinProgress
- true if in progress data must be usedconf
- provider configuration- Throws:
Aozan3Exception
- if an error occurs while setting the provider
-
addDataProvider
public void addDataProvider(RunDataProvider dataProvider)
Set an existing data provider- Parameters:
dataProvider
- provider to set
-
addSteps
public void addSteps(Collection<Step> steps)
Add steps.- Parameters:
steps
- a collection of step to add
-
addStep
public void addStep(Step step)
Add a step.- Parameters:
step
- the step to add
-
init
public void init() throws Aozan3Exception
Initialize the steps of the recipe- Throws:
Aozan3Exception
- if an error occurs while initializing the steps
-
execute
public void execute() throws Aozan3Exception
Use the recipe to process run provided by the run data provider- Throws:
Aozan3Exception
- if an error occurs while executing the recipe
-
execute
public boolean execute(String runId) throws Aozan3Exception
Execute the recipe for a run.- Parameters:
runId
- the run identifier- Throws:
Aozan3Exception
- if an error occurs while executing the recipe
-
execute
public Set<RunId> execute(List<String> runIds) throws Aozan3Exception
Execute a list of run Ids.- Parameters:
runIds
- a list of run ids- Throws:
Aozan3Exception
- if an error occurs while executing the recipe
-
availableRuns
public Set<RunId> availableRuns() throws Aozan3Exception
Get available runs.- Returns:
- a set with available runs.
- Throws:
Aozan3Exception
- if an error occurs while getting the available runs
-
availableRuns
public Set<RunId> availableRuns(Collection<RunId> excludedRunIds) throws Aozan3Exception
Get available runs.- Parameters:
excludedRunIds
- run ids to exclude from the result- Returns:
- a set with available runs.
- Throws:
Aozan3Exception
- if an error occurs while getting the available runs
-
getAvalaibleRuns
public List<String> getAvalaibleRuns() throws Aozan3Exception
Get the list of available runs.- Returns:
- a list with available runs
- Throws:
Aozan3Exception
- if an error occurs while getting the available runs
-
-