Status finalStatus = Status.getWorstStatus(connectorValidation.getStatus(),
frameworkValidation.getStatus());
// Return back validations in all cases
ValidationBean outputBean =
new ValidationBean(connectorValidation, frameworkValidation);
// If we're good enough let's perform the action
if(finalStatus.canProceed()) {
if(update) {
AuditLoggerManager.getInstance()
.logAuditEvent(ctx.getUserName(), ctx.getRequest().getRemoteAddr(),
"update", "connection", String.valueOf(connection.getPersistenceId()));
connection.setLastUpdateUser(username);
RepositoryManager.getInstance().getRepository().updateConnection(connection);
} else {
connection.setCreationUser(username);
connection.setLastUpdateUser(username);
RepositoryManager.getInstance().getRepository().createConnection(connection);
outputBean.setId(connection.getPersistenceId());
AuditLoggerManager.getInstance()
.logAuditEvent(ctx.getUserName(), ctx.getRequest().getRemoteAddr(),
"create", "connection", String.valueOf(connection.getPersistenceId()));
}