* Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications (C) 2019 Ericsson
* =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
if (configUrl != null) {
try {
- client = new RestClientInvoker(new URL(configUrl));
+ client = getRestClientInvoker(new URL(configUrl));
client.setAuthentication(user, password);
} catch (MalformedURLException e) {
logger.error("Error initializing RestConf client: " + e.getMessage(), e);
URL configUrl = new URL(properties.getProperty(Constants.CONFIG_URL_PROPERTY, Constants.CONFIG_URL_DEFAULT));
String user = properties.getProperty(Constants.CONFIG_USER_PROPERTY);
String password = properties.getProperty(Constants.CONFIG_PASS_PROPERTY);
- RestClientInvoker remoteClient = new RestClientInvoker(new URL(configUrl.getProtocol(), leader, configUrl.getPort(), ""));
+ RestClientInvoker remoteClient = getRestClientInvoker(new URL(configUrl.getProtocol(), leader, configUrl.getPort(), ""));
remoteClient.setAuthentication(user, password);
remoteClientMap.put(leader, remoteClient);
return remoteClient;
throw new MDSALStoreException(e);
}
}
+
+ protected RestClientInvoker getRestClientInvoker(URL configUrl) throws MalformedURLException {
+ return new RestClientInvoker(configUrl);
+ }
}