Class Recipe


  • public class Recipe
    extends Object
    This class define a recipe.
    Since:
    3.0
    Author:
    Laurent Jourdren
    • 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 name
        description - description of the recipe
        conf - configuration
        logger - 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 storage
        storage - storage to add
      • addDataProvider

        public void addDataProvider​(String providerName,
                                    String storageName,
                                    boolean inProgress,
                                    Configuration conf)
                             throws Aozan3Exception
        Add a data provider.
        Parameters:
        providerName - provider name
        storageName - storage used by the provider
        inProgress - true if in progress data must be used
        conf - 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
      • 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