return connection;
}
private void validateExternalIntegrationConnections(Connection connection) throws InvalidCredentialsException, IOException {
ExternalIntegrationConnectionProvider connectionProvider;
try {
connectionProvider = connectionProviderFactory.externalIntegrationConnectionProviderFromId(connection.getProviderId());
} catch (Exception e) {
logger.info("Connection with providerId of " + connection.getProviderId() + " does not " +
"support validation via an external client.");
return;
}
ExternalIntegrationClient externalClient = connectionProvider.getClient(connection);
externalClient.validateConnection();
externalClient.cleanUp();
}