From 1076ae8b7e4cbdf69d62660f645b778d2d987acf Mon Sep 17 00:00:00 2001 From: Mamtha Date: Wed, 15 Apr 2020 01:02:38 +0530 Subject: code smell. Corrected suggested formating Issue-ID: APPC-1858 Change-Id: I9e384a71e756e2fd168be7d30ad726dfe08b261d Signed-off-by: Mamtha --- .../netconf/odlconnector/NetconfClientRestconfImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/odlconnector/NetconfClientRestconfImpl.java b/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/odlconnector/NetconfClientRestconfImpl.java index beb14e359..0255836a8 100644 --- a/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/odlconnector/NetconfClientRestconfImpl.java +++ b/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/odlconnector/NetconfClientRestconfImpl.java @@ -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 !"); -- cgit 1.2.3-korg