use of org.xdi.model.SmtpConfiguration in project oxTrust by GluuFederation.
the class ApplicationFactory method getSmtpConfiguration.
@Produces
@ApplicationScoped
public SmtpConfiguration getSmtpConfiguration() {
GluuAppliance appliance = applianceService.getAppliance();
SmtpConfiguration smtpConfiguration = appliance.getSmtpConfiguration();
if (smtpConfiguration == null) {
return null;
}
String password = smtpConfiguration.getPassword();
if (StringHelper.isNotEmpty(password)) {
try {
smtpConfiguration.setPasswordDecrypted(encryptionService.decrypt(password));
} catch (EncryptionException ex) {
log.error("Failed to decript SMTP user password", ex);
}
}
return smtpConfiguration;
}
use of org.xdi.model.SmtpConfiguration in project oxAuth by GluuFederation.
the class ApplicationFactory method getSmtpConfiguration.
@Produces
@ApplicationScoped
public SmtpConfiguration getSmtpConfiguration() {
GluuAppliance appliance = applianceService.getAppliance();
SmtpConfiguration smtpConfiguration = appliance.getSmtpConfiguration();
if (smtpConfiguration == null) {
return null;
}
String password = smtpConfiguration.getPassword();
if (StringHelper.isNotEmpty(password)) {
try {
smtpConfiguration.setPasswordDecrypted(encryptionService.decrypt(password));
} catch (EncryptionException ex) {
log.error("Failed to decript SMTP user password", ex);
}
}
return smtpConfiguration;
}
use of org.xdi.model.SmtpConfiguration in project oxTrust by GluuFederation.
the class UpdateOrganizationAction method updateSmptConfiguration.
private void updateSmptConfiguration(GluuAppliance appliance) {
SmtpConfiguration smtpConfiguration = new SmtpConfiguration();
smtpConfiguration.setHost(appliance.getSmtpHost());
smtpConfiguration.setPort(StringHelper.toInteger(appliance.getSmtpPort(), 25));
smtpConfiguration.setRequiresSsl(StringHelper.toBoolean(appliance.getSmtpRequiresSsl(), false));
smtpConfiguration.setFromName(appliance.getSmtpFromName());
smtpConfiguration.setFromEmailAddress(appliance.getSmtpFromEmailAddress());
smtpConfiguration.setRequiresAuthentication(StringHelper.toBoolean(appliance.getSmtpRequiresAuthentication(), false));
smtpConfiguration.setUserName(appliance.getSmtpUserName());
smtpConfiguration.setPassword(appliance.getSmtpPassword());
appliance.setSmtpConfiguration(smtpConfiguration);
}
Aggregations