Search in sources :

Example 1 with DataStorage

use of ca.corefacility.bioinformatics.irida.pipeline.upload.DataStorage in project irida by phac-nml.

the class ExecutionManagerConfig method getDataStorage.

/**
 * Gets and validates a property with the storage strategy for Galaxy.
 * @param dataStorageProperty  The property with the storage strategy for Galaxy.
 * @return  The corresponding storage strategy object, defaults to DEFAULT_DATA_STORAGE if invalid.
 */
private DataStorage getDataStorage(String dataStorageProperty) {
    String dataStorageString = environment.getProperty(dataStorageProperty, "");
    DataStorage dataStorage = VALID_STORAGE.get(dataStorageString.toLowerCase());
    if (dataStorage == null) {
        dataStorage = DEFAULT_DATA_STORAGE;
        logger.warn("Invalid configuration property \"" + dataStorageProperty + "\"=\"" + dataStorageString + "\" must be one of " + VALID_STORAGE.keySet() + ": using default (" + DEFAULT_DATA_STORAGE.toString().toLowerCase() + ")");
    }
    return dataStorage;
}
Also used : DataStorage(ca.corefacility.bioinformatics.irida.pipeline.upload.DataStorage)

Example 2 with DataStorage

use of ca.corefacility.bioinformatics.irida.pipeline.upload.DataStorage in project irida by phac-nml.

the class ExecutionManagerConfig method buildExecutionManager.

/**
 * Builds a new ExecutionManagerGalaxy given the following environment properties.
 * @param urlProperty The property defining the URL to Galaxy.
 * @param apiKeyProperty  The property defining the API key to Galaxy.
 * @param emailProperty  The property defining the account email in Galaxy.
 * @param dataStorageProperty  The property defning the data storage method.
 * @return  An ExecutionManagerGalaxy.
 * @throws ExecutionManagerConfigurationException If there was an issue building an ExecutionManagerGalaxy
 * 	from the given properties.
 */
private ExecutionManagerGalaxy buildExecutionManager(String urlProperty, String apiKeyProperty, String emailProperty, String dataStorageProperty) throws ExecutionManagerConfigurationException {
    URL galaxyURL = getGalaxyURL(urlProperty);
    GalaxyAccountEmail galaxyEmail = getGalaxyEmail(emailProperty);
    String apiKey = getAPIKey(apiKeyProperty);
    DataStorage dataStorage = getDataStorage(dataStorageProperty);
    return new ExecutionManagerGalaxy(galaxyURL, apiKey, galaxyEmail, dataStorage);
}
Also used : DataStorage(ca.corefacility.bioinformatics.irida.pipeline.upload.DataStorage) GalaxyAccountEmail(ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyAccountEmail) ExecutionManagerGalaxy(ca.corefacility.bioinformatics.irida.model.workflow.manager.galaxy.ExecutionManagerGalaxy) URL(java.net.URL)

Aggregations

DataStorage (ca.corefacility.bioinformatics.irida.pipeline.upload.DataStorage)2 GalaxyAccountEmail (ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyAccountEmail)1 ExecutionManagerGalaxy (ca.corefacility.bioinformatics.irida.model.workflow.manager.galaxy.ExecutionManagerGalaxy)1 URL (java.net.URL)1