use of ca.corefacility.bioinformatics.irida.exceptions.ExecutionManagerConfigurationException 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;
}
Aggregations