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;
}
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;
}
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);
}
Aggregations