Tripal
|
Public Member Functions | |
getId () | |
setParameters (array $parameters=[]) | |
validateParameters () | |
performTask () | |
getProgress () | |
getStatus () | |
getLogger () | |
Provides an interface to manage a task on one or more biological schemas.
Drupal\tripal_biodb\Task\BioTaskInterface::getId | ( | ) |
Returns the task identifier.
This identifier is unique for a given task on a given set of schemas. It can be used to identify and retrieve an task to get its status while running from another independant process. It must only contain lower case alpha-numeric characters, underscores, dashes and dots. The task identifier should follow the following scheme: <task_name>-<dash_separated_schema_list> When a task works with more than one schema, the schema names should be ordered. The order could be alpha-numeric if it is not important or schema names could be ordered by argument order if this order is important. Schema name should be prefixed by the associated database name followed by a dot when it is not the default one.
For example, a schema cloning task that clones the "chado" schema to a new schema named "alpha_chado" would use the task identifier: "clone-chado-alpha_chado".
Another example would be a Chado data merging task that would merge the data of 2 Chado instances (chado1 and chado2)into a new schema (big_chado). The order of the 2 merged schema names is not relevant so they will be sorted alpha-numericaly. The target schema would come first as it will be unique while there could be more than 2 schemas to merge. So its task identifier would look like: "merge-big_chado-chado1-chado2"
Implemented in Drupal\tripal_biodb\Task\BioTaskBase.
Drupal\tripal_biodb\Task\BioTaskInterface::getLogger | ( | ) |
Returns the logger used by this task.
Implemented in Drupal\tripal_biodb\Task\BioTaskBase.
Drupal\tripal_biodb\Task\BioTaskInterface::getProgress | ( | ) |
Returns the percent of progress of current task.
This method can also be used to check if a task is currently running if it has a > 0 value. A negative value means an error occured while running.
Implemented in Drupal\tripal_chado\Task\ChadoUpgrader, Drupal\tripal_chado\Task\ChadoRenamer, Drupal\tripal_chado\Task\ChadoRemover, Drupal\tripal_chado\Task\ChadoPreparer, Drupal\tripal_chado\Task\ChadoIntegrator, Drupal\tripal_chado\Task\ChadoInstaller, and Drupal\tripal_chado\Task\ChadoCloner.
Drupal\tripal_biodb\Task\BioTaskInterface::getStatus | ( | ) |
Returns a string describing current status of the performed task.
This function returns the last known status, even if the task ended. In case of failure, this function may return the reason of the failure.
Implemented in Drupal\tripal_chado\Task\ChadoUpgrader, Drupal\tripal_chado\Task\ChadoRenamer, Drupal\tripal_chado\Task\ChadoRemover, Drupal\tripal_chado\Task\ChadoPreparer, Drupal\tripal_chado\Task\ChadoIntegrator, Drupal\tripal_chado\Task\ChadoInstaller, Drupal\tripal_chado\Task\ChadoCloner, and Drupal\tripal_biodb\Task\BioTaskBase.
Drupal\tripal_biodb\Task\BioTaskInterface::performTask | ( | ) |
Performs the required task.
Implemented in Drupal\tripal_chado\Task\ChadoUpgrader, Drupal\tripal_chado\Task\ChadoRenamer, Drupal\tripal_chado\Task\ChadoRemover, Drupal\tripal_chado\Task\ChadoPreparer, Drupal\tripal_chado\Task\ChadoIntegrator, Drupal\tripal_chado\Task\ChadoInstaller, Drupal\tripal_chado\Task\ChadoCloner, and Drupal\tripal_biodb\Task\BioTaskBase.
Drupal\tripal_biodb\Task\BioTaskInterface::setParameters | ( | array | $parameters = [] | ) |
Sets task parameters.
It sets (or sets again) task parameter before task execution. Only schema names are checked here, no other parameter validation are performed. Parameters are validate at runtime by ::performTask, just before the actual task is started.
$parameters | A associative array of parameters used to configure the task. The array should include the keys 'input_schemas' and 'output_schemas', both containing an array of ordered schema names (or an empty array). 'input_schemas' are biological schemas used for reading only which may be shared for reading with other concurrent tasks. 'output_schemas' are schemas that will be created or modified and must not be shared ( exclusive use) during the task. If a schema comes from a different database than the default one (ie. the one used by Drupal), the schema name must be prefixed by the database key name (and not the "target", as describbed in \Drupal\Core\Database\Database::getConnection()) followed by a dot. |
Implemented in Drupal\tripal_biodb\Task\BioTaskBase.
Drupal\tripal_biodb\Task\BioTaskInterface::validateParameters | ( | ) |
Validate task parameters.
This method should be called just before executing a task in the ::performTask method and should not need to be called from outside the class.
Implemented in Drupal\tripal_chado\Task\ChadoUpgrader, Drupal\tripal_chado\Task\ChadoRenamer, Drupal\tripal_chado\Task\ChadoRemover, Drupal\tripal_chado\Task\ChadoPreparer, Drupal\tripal_chado\Task\ChadoIntegrator, Drupal\tripal_chado\Task\ChadoInstaller, and Drupal\tripal_chado\Task\ChadoCloner.