diff options
author | Dan Timoney <dtimoney@att.com> | 2018-11-28 22:33:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-11-28 22:33:30 +0000 |
commit | 081eb693b595ec59a0a0f2957ae072f2300461c9 (patch) | |
tree | 272384997eead2dc12aacd11eaf43417a242a3a1 | |
parent | bcd44237af5b45f1c37a91c85e8f27ea56446d42 (diff) | |
parent | eae054f3173db091814435e47032c9a9aeacc631 (diff) |
Merge "Fixed Sonar issue in SvcLogicServiceImpl"
-rwxr-xr-x | sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java index c5a848a17..fe1d484ec 100755 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java @@ -5,6 +5,8 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -37,12 +39,7 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicStore; import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory; import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceEvent; -import org.osgi.framework.ServiceListener; import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; @@ -80,6 +77,7 @@ public class SvcLogicServiceImpl implements SvcLogicService { protected BundleContext bctx = null; protected Properties properties; protected SvcLogicStore store; + private static final String CURRENT_GRAPH="currentGraph"; public SvcLogicServiceImpl(SvcLogicPropertiesProvider resourceProvider) throws SvcLogicException { properties = resourceProvider.getProperties(); @@ -148,7 +146,7 @@ public class SvcLogicServiceImpl implements SvcLogicService { // Set service name in MDC to reference current working directed graph MDC.put(MetricLogger.SERVICE_NAME, graph.getModule() + ":" + graph.getRpc() + "/v" + graph.getVersion()); - MDC.put("currentGraph", graph.toString()); + MDC.put(CURRENT_GRAPH, graph.toString()); SvcLogicNode curNode = graph.getRootNode(); LOG.info("About to execute graph {}", graph.toString()); @@ -162,7 +160,7 @@ public class SvcLogicServiceImpl implements SvcLogicService { LOG.debug("SvcLogicServiceImpl caught ExitNodeException"); } MDC.remove("nodeId"); - MDC.remove("currentGraph"); + MDC.remove(CURRENT_GRAPH); return (ctx); } @@ -217,7 +215,7 @@ public class SvcLogicServiceImpl implements SvcLogicService { } SvcLogicContext ctx = new SvcLogicContext(props); - ctx.setAttribute("currentGraph", graph.toString()); + ctx.setAttribute(CURRENT_GRAPH, graph.toString()); ctx.setAttribute("X-ECOMP-RequestID", MDC.get("X-ECOMP-RequestID")); ctx.setDomDataBroker(domDataBroker); |