From 2a66c7c042d4d5919f8b200d026f211ba241774f Mon Sep 17 00:00:00 2001 From: kusuma kumari M Date: Wed, 3 Jan 2018 21:55:50 -0500 Subject: code changes for platform hardening appc adapters Issue-ID: APPC-305 Change-Id: Ice60ca77ffccc409d50ef11318e841c3b1f82ce1 Signed-off-by: kusuma kumari M --- .../netconf/AppcNetconfAdapterActivator.java | 21 ++++++--------------- .../internal/NetconfDataAccessServiceImpl.java | 2 +- 2 files changed, 7 insertions(+), 16 deletions(-) (limited to 'appc-adapters/appc-netconf-adapter') diff --git a/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/AppcNetconfAdapterActivator.java b/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/AppcNetconfAdapterActivator.java index bae220d13..70438d7da 100644 --- a/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/AppcNetconfAdapterActivator.java +++ b/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/AppcNetconfAdapterActivator.java @@ -43,13 +43,6 @@ public class AppcNetconfAdapterActivator implements BundleActivator { private ServiceRegistration reporterRegistration = null; private ServiceRegistration factoryRegistration = null; private ServiceRegistration dbRegistration = null; - - /** - * The reference to the actual implementation object that implements the services - */ - private NetconfClientFactory clientFactory; - private NetconfDataAccessService DAService; - /** * The logger to be used */ @@ -73,24 +66,22 @@ public class AppcNetconfAdapterActivator implements BundleActivator { @Override public void start(BundleContext context) throws Exception { if (registration == null) { - clientFactory = new NetconfClientFactory(); + /* + * The reference to the actual implementation object that implements the services + */ + NetconfClientFactory clientFactory = new NetconfClientFactory(); factoryRegistration = context.registerService(NetconfClientFactory.class, clientFactory, null); - - DAService = new NetconfDataAccessServiceImpl(); + NetconfDataAccessService DAService = new NetconfDataAccessServiceImpl(); //set dblib service DbLibService dblibSvc = null; ServiceReference sref = context.getServiceReference(DbLibService.class.getName()); - try{ dblibSvc = (DbLibService)context.getService(sref); - }catch(Exception e){ - logger.error(e.getMessage()); - } DAService.setDbLibService(dblibSvc); /////////////////////////////////// factoryRegistration = context.registerService(NetconfDataAccessService.class, DAService, null); } - logger.info(Msg.COMPONENT_INITIALIZED, "NETCONF adapter"); + //logger.info(Msg.COMPONENT_INITIALIZED, "NETCONF adapter"); } /** diff --git a/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/internal/NetconfDataAccessServiceImpl.java b/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/internal/NetconfDataAccessServiceImpl.java index f3cca8597..6ed181d1d 100644 --- a/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/internal/NetconfDataAccessServiceImpl.java +++ b/appc-adapters/appc-netconf-adapter/appc-netconf-adapter-bundle/src/main/java/org/onap/appc/adapter/netconf/internal/NetconfDataAccessServiceImpl.java @@ -39,7 +39,7 @@ import java.util.ArrayList; public class NetconfDataAccessServiceImpl implements NetconfDataAccessService { - private static EELFLogger logger = EELFManager.getInstance().getLogger(NetconfDataAccessServiceImpl.class); + private final EELFLogger logger = EELFManager.getInstance().getLogger(NetconfDataAccessServiceImpl.class); public void setSchema(String schema) { this.schema = schema; -- cgit 1.2.3-korg