private EELFLogger logger = EELFManager.getInstance().getLogger(NetconfClientRestconfImpl.class);
private NetconfConnectionDetails connectionDetails;
+ private String appFormat = "application/json";
public NetconfClientRestconfImpl(){
//constructor
logger.info("Configuring device " + deviceMountPointName + " with configuration " + configuration);
int httpCode = httpClient.putMethod(Constants.PROTOCOL,Constants.CONTROLLER_IP,Constants.CONTROLLER_PORT,
- getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), configuration, "application/json");
+ getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), configuration, appFormat);
if (httpCode != HttpStatus.SC_OK) {
logger.error("Configuration request failed. throwing Exception !");
logger.info("Connecting device " + deviceMountPointName);
int httpCode = httpClient.postMethod(Constants.PROTOCOL, Constants.CONTROLLER_IP, Constants.CONTROLLER_PORT,
- getConnectPath(), payload, "application/json");
+ getConnectPath(), payload, appFormat);
if(httpCode != HttpStatus.SC_NO_CONTENT){
logger.error("Connect request failed with code " + httpCode + ". throwing Exception !");
logger.info("Checking device " + deviceMountPointName + " connectivity");
String result = httpClient.getMethod(Constants.PROTOCOL, Constants.CONTROLLER_IP,
- Constants.CONTROLLER_PORT, getCheckConnectivityPath(deviceMountPointName), "application/json");
+ Constants.CONTROLLER_PORT, getCheckConnectivityPath(deviceMountPointName), appFormat);
return result != null;
}
logger.info("Disconnecting " + deviceMountPointName);
int httpCode = httpClient.deleteMethod(Constants.PROTOCOL, Constants.CONTROLLER_IP, Constants.CONTROLLER_PORT,
- getDisconnectPath(deviceMountPointName), "application/json");
+ getDisconnectPath(deviceMountPointName), appFormat);
if(httpCode != HttpStatus.SC_OK){
logger.error("Disconnection of device " + deviceMountPointName + " failed!");
logger.info("Getting configuration of device " + deviceMountPointName);
String result = httpClient.getMethod(Constants.PROTOCOL, Constants.CONTROLLER_IP, Constants.CONTROLLER_PORT,
- getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), "application/json");
+ getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), appFormat);
if (result == null) {
logger.error("Configuration request failed. throwing Exception !");