code smell. Corrected suggested formating
[appc.git] / appc-adapters / appc-netconf-adapter / appc-netconf-adapter-bundle / src / main / java / org / onap / appc / adapter / netconf / odlconnector / NetconfClientRestconfImpl.java
index beb14e3..0255836 100644 (file)
@@ -42,6 +42,7 @@ public class NetconfClientRestconfImpl implements NetconfClient, NetconfClientRe
     private EELFLogger logger = EELFManager.getInstance().getLogger(NetconfClientRestconfImpl.class);
 
     private NetconfConnectionDetails connectionDetails;
+       private String appFormat = "application/json";
 
     public NetconfClientRestconfImpl(){
         //constructor
@@ -56,7 +57,7 @@ public class NetconfClientRestconfImpl implements NetconfClient, NetconfClientRe
         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 !");
@@ -71,7 +72,7 @@ public class NetconfClientRestconfImpl implements NetconfClient, NetconfClientRe
         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 !");
@@ -84,7 +85,7 @@ public class NetconfClientRestconfImpl implements NetconfClient, NetconfClientRe
         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;
     }
@@ -94,7 +95,7 @@ public class NetconfClientRestconfImpl implements NetconfClient, NetconfClientRe
         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!");
@@ -107,7 +108,7 @@ public class NetconfClientRestconfImpl implements NetconfClient, NetconfClientRe
         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 !");