*
* @param serverName the name of the GerritServer
* @return the Provider with info from the GerritServer, or an empty provider if server not found
*/
private Provider createProviderFromGerritServer(String serverName) {
GerritServer server = PluginImpl.getInstance().getServer(serverName);
if (server != null) {
return new Provider(
server.getName(),
server.getConfig().getGerritHostName(),
String.valueOf(server.getConfig().getGerritSshPort()),
GerritDefaultValues.DEFAULT_GERRIT_SCHEME,
server.getConfig().getGerritFrontEndUrl(),
server.getGerritVersion()
);
} else {
logger.warn("Could not find GerritServer: {}", serverName);
return new Provider();
}