return connection;
}
private void decryptCredentials(Connection connection) {
ConnectionCredentialsEncrypter credentialsEncrypter = new ConnectionCredentialsEncrypter();
// force decryption until we upgrade to morphia 1.0
if (connection.getCredentials() != null) {
credentialsEncrypter.decrypt(connection.getCredentials());
}
if (CollectionUtils.isNotEmpty(connection.getOutboundConfigurations())) {
for (OutboundConfiguration outboundConfiguration : connection.getOutboundConfigurations()) {
if (outboundConfiguration.getCredentials() != null) {
credentialsEncrypter.decrypt(outboundConfiguration.getCredentials());
}
}
}
}