Search in sources :

Example 1 with GalaxyAccountEmail

use of ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyAccountEmail in project irida by phac-nml.

the class NonWindowsLocalGalaxyConfig method localGalaxy.

/**
 * Builds a new LocalGalaxy allowing for connecting with a running Galaxy
 * instance.
 *
 * @return A LocalGalaxy with information about the running Galaxy instance.
 * @throws Exception
 */
@Lazy
@Bean
public LocalGalaxy localGalaxy() throws Exception {
    LocalGalaxy localGalaxy = new LocalGalaxy();
    logger.debug("Setting URL for test Galaxy: " + galaxyURL);
    logger.debug("Setting invalid URL for test Galaxy: " + galaxyInvalidURL);
    logger.debug("Setting invalid URL2 for test Galaxy: " + galaxyInvalidURL2);
    localGalaxy.setGalaxyURL(galaxyURL);
    localGalaxy.setInvalidGalaxyURL(galaxyInvalidURL);
    localGalaxy.setTestGalaxyURL(galaxyInvalidURL2);
    localGalaxy.setAdminName(new GalaxyAccountEmail("admin@galaxy.org"));
    localGalaxy.setAdminPassword("admin");
    localGalaxy.setAdminAPIKey("admin");
    logger.debug("Creating Admin Blend4j Galaxy Instance using api key: " + localGalaxy.getAdminAPIKey());
    GalaxyInstance adminInstance = GalaxyInstanceFactory.get(localGalaxy.getGalaxyURL().toString(), localGalaxy.getAdminAPIKey());
    localGalaxy.setGalaxyInstanceAdmin(adminInstance);
    localGalaxy.setupWorkflows();
    return localGalaxy;
}
Also used : LocalGalaxy(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.integration.LocalGalaxy) GalaxyAccountEmail(ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyAccountEmail) GalaxyInstance(com.github.jmchilton.blend4j.galaxy.GalaxyInstance) Lazy(org.springframework.context.annotation.Lazy) Bean(org.springframework.context.annotation.Bean)

Example 2 with GalaxyAccountEmail

use of ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyAccountEmail in project irida by phac-nml.

the class ExecutionManagerConfig method getGalaxyEmail.

/**
 * Gets and validates a GalaxyAccountEmail from the given property.
 * @param emailProperty  The property to find the email address.
 * @return  A valid GalaxyAccountEmail.
 * @throws ExecutionManagerConfigurationException  If the properties value was invalid.
 */
private GalaxyAccountEmail getGalaxyEmail(String emailProperty) throws ExecutionManagerConfigurationException {
    String galaxyEmailString = environment.getProperty(emailProperty);
    GalaxyAccountEmail galaxyEmail = new GalaxyAccountEmail(galaxyEmailString);
    Set<ConstraintViolation<GalaxyAccountEmail>> violations = validator.validate(galaxyEmail);
    if (!violations.isEmpty()) {
        throw new ExecutionManagerConfigurationException("Invalid email address", emailProperty, new ConstraintViolationException(violations));
    }
    return galaxyEmail;
}
Also used : GalaxyAccountEmail(ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyAccountEmail) ExecutionManagerConfigurationException(ca.corefacility.bioinformatics.irida.exceptions.ExecutionManagerConfigurationException) ConstraintViolation(javax.validation.ConstraintViolation) ConstraintViolationException(javax.validation.ConstraintViolationException)

Example 3 with GalaxyAccountEmail

use of ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyAccountEmail 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

GalaxyAccountEmail (ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyAccountEmail)3 ExecutionManagerConfigurationException (ca.corefacility.bioinformatics.irida.exceptions.ExecutionManagerConfigurationException)1 ExecutionManagerGalaxy (ca.corefacility.bioinformatics.irida.model.workflow.manager.galaxy.ExecutionManagerGalaxy)1 DataStorage (ca.corefacility.bioinformatics.irida.pipeline.upload.DataStorage)1 LocalGalaxy (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.integration.LocalGalaxy)1 GalaxyInstance (com.github.jmchilton.blend4j.galaxy.GalaxyInstance)1 URL (java.net.URL)1 ConstraintViolation (javax.validation.ConstraintViolation)1 ConstraintViolationException (javax.validation.ConstraintViolationException)1 Bean (org.springframework.context.annotation.Bean)1 Lazy (org.springframework.context.annotation.Lazy)1