diff options
author | Smokowski, Kevin (ks6305) <kevin.smokowski@att.com> | 2019-11-01 14:38:49 +0000 |
---|---|---|
committer | Kevin Smokowski <kevin.smokowski@att.com> | 2019-11-01 17:14:39 +0000 |
commit | 0f166dd572d7124ea9c46c97b6a1caf6c231d9a6 (patch) | |
tree | 22d5d52d95e426d2a0d6b7e46c7032dcaf17a39a /sli/provider | |
parent | 49a41adb9f709485ed259a6a4603f3adad1324e2 (diff) |
SliProviderBaseUpdates
SvcLogicServiceImplBase constructor should have SvcLogicResolver as a parameter,Added HashMapResolver to map svclogic instances without osgi,Added InMemorySvcLogicStore useful for simple demos or junit test
Issue-ID: CCSDK-1891
Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Change-Id: I3c3cdd33177ef10133db2672ddd4b308becefc90
Diffstat (limited to 'sli/provider')
-rwxr-xr-x | sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java | 31 |
1 files changed, 2 insertions, 29 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 49d0a382..92c2aa49 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 @@ -26,20 +26,16 @@ package org.onap.ccsdk.sli.core.sli.provider; import java.util.Properties; import org.onap.ccsdk.sli.core.dblib.DbLibService; import org.onap.ccsdk.sli.core.sli.ConfigurationException; -import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicDblibStore; import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.onap.ccsdk.sli.core.sli.SvcLogicGraph; import org.onap.ccsdk.sli.core.sli.SvcLogicStore; import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory; import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicPropertiesProvider; import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicResolver; import org.onap.ccsdk.sli.core.sli.provider.base.SvcLogicServiceImplBase; -import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.slf4j.MDC; public class SvcLogicServiceImpl extends SvcLogicServiceImplBase implements SvcLogicService { @@ -47,42 +43,19 @@ public class SvcLogicServiceImpl extends SvcLogicServiceImplBase implements SvcL public SvcLogicServiceImpl(SvcLogicPropertiesProvider resourceProvider, SvcLogicResolver resolver) throws SvcLogicException { - super(null); - this.resolver = resolver; + super(null, resolver); properties = resourceProvider.getProperties(); this.store = getStore(); } public SvcLogicServiceImpl(SvcLogicPropertiesProvider resourceProvider, DbLibService dbSvc, SvcLogicResolver resolver) throws SvcLogicException { - super(null); - this.resolver = resolver; + super(null, resolver); properties = resourceProvider.getProperties(); this.store = new SvcLogicDblibStore(dbSvc); } @Override - public Properties execute(String module, String rpc, String version, String mode, Properties props) - throws SvcLogicException { - SvcLogicGraph graph = store.fetch(module, rpc, version, mode); - - if (graph == null) { - Properties retProps = new Properties(); - retProps.setProperty("error-code", "401"); - retProps.setProperty("error-message", - "No service logic found for [" + module + "," + rpc + "," + version + "," + mode + "]"); - return (retProps); - } - - SvcLogicContext ctx = new SvcLogicContext(props); - ctx.setAttribute(CURRENT_GRAPH, graph.toString()); - // To support legacy code we should not stop populating X-ECOMP-RequestID - ctx.setAttribute("X-ECOMP-RequestID", MDC.get(ONAPLogConstants.MDCs.REQUEST_ID)); - execute(graph, ctx); - return (ctx.toProperties()); - } - - @Override @Deprecated // DomDataBroker is not being used, this should be removed eventually public Properties execute(String module, String rpc, String version, String mode, Properties props, |