diff options
author | Mamtha <mamtha.sabesan@in.ibm.com> | 2020-04-15 01:02:38 +0530 |
---|---|---|
committer | Mamtha <mamtha.sabesan@in.ibm.com> | 2020-04-15 01:02:47 +0530 |
commit | 1076ae8b7e4cbdf69d62660f645b778d2d987acf (patch) | |
tree | c364f9a17d20ac433d0a676a9e43ff950e7b4f84 | |
parent | 2706a51d340e612730210adb5a521b6e01fde46d (diff) |
code smell. Corrected suggested formating
Issue-ID: APPC-1858
Change-Id: I9e384a71e756e2fd168be7d30ad726dfe08b261d
Signed-off-by: Mamtha <mamtha.sabesan@in.ibm.com>
-rw-r--r-- | appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/odlconnector/NetconfClientRestconfImpl.java | 11 |
1 files 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 !"); |