From c7d0075d223eab9f89fd28853c4b138792059be9 Mon Sep 17 00:00:00 2001 From: Patrick Brady Date: Thu, 1 Jun 2017 10:45:37 -0700 Subject: Merge of new rebased code Change-Id: I9b8d1f69eb3e0af1935ed8304fea4bf54c1aac47 Signed-off-by: Patrick Brady --- .../licmgr/impl/LicenseDataAccessServiceImpl.java | 26 ++++++------------- .../appc/licmgr/impl/LicenseManagerImpl.java | 3 --- .../resources/OSGI-INF/blueprint/blueprint.xml | 12 +++++++-- .../org/openecomp/appc/default.properties | 29 ++++++---------------- .../openecomp/appc/licmgr/LicenseServiceMock.java | 1 - 5 files changed, 24 insertions(+), 47 deletions(-) (limited to 'appc-dispatcher/appc-license-manager/appc-license-manager-core/src') diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseDataAccessServiceImpl.java b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseDataAccessServiceImpl.java index 2aff1ffb9..2eaf79062 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseDataAccessServiceImpl.java +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseDataAccessServiceImpl.java @@ -21,17 +21,14 @@ package org.openecomp.appc.licmgr.impl; +import javax.sql.rowset.CachedRowSet; + import org.openecomp.appc.licmgr.Constants; import org.openecomp.appc.licmgr.LicenseDataAccessService; import org.openecomp.appc.licmgr.exception.DataAccessException; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import org.openecomp.sdnc.sli.resource.dblib.DbLibService; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; - -import javax.sql.rowset.CachedRowSet; import static org.openecomp.appc.licmgr.Constants.ASDC_ARTIFACTS_FIELDS; @@ -42,7 +39,7 @@ import java.util.Map; @SuppressWarnings("JavaDoc") -class LicenseDataAccessServiceImpl implements LicenseDataAccessService { +public class LicenseDataAccessServiceImpl implements LicenseDataAccessService { private static EELFLogger logger = EELFManager.getInstance().getLogger(LicenseDataAccessServiceImpl.class); @@ -52,17 +49,12 @@ class LicenseDataAccessServiceImpl implements LicenseDataAccessService { private String schema; - private DbLibService dbLibService; - - private void checkDbLibService() throws DataAccessException { - if (null != dbLibService) {return;} + public void setDbLibService(DbLibService dbLibService) { + this.dbLibService = dbLibService; + } - //get dblib service and send it to DAService - BundleContext bctx = FrameworkUtil.getBundle(LicenseManagerImpl.class).getBundleContext(); - ServiceReference sref = bctx.getServiceReference(DbLibService.class.getName()); - dbLibService = (DbLibService)bctx.getService(sref); + private DbLibService dbLibService; - } /** * empty constructor @@ -73,8 +65,6 @@ class LicenseDataAccessServiceImpl implements LicenseDataAccessService { public Map retrieveLicenseModelData(String vnfType, String vnfVersion, String... fields) throws DataAccessException { - checkDbLibService(); - Map result = new HashMap<>(); if (null == fields || 0 == fields.length) fields = new String[]{ASDC_ARTIFACTS_FIELDS.ARTIFACT_CONTENT.name()}; @@ -119,8 +109,6 @@ class LicenseDataAccessServiceImpl implements LicenseDataAccessService { @Override public void storeArtifactPayload(Map parameters) throws RuntimeException { - checkDbLibService(); - if(parameters == null || parameters.isEmpty()) { throw new RuntimeException("No parameters for insert are provided"); } diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseManagerImpl.java b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseManagerImpl.java index 815bb02ab..86d1eddd9 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseManagerImpl.java +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/java/org/openecomp/appc/licmgr/impl/LicenseManagerImpl.java @@ -25,7 +25,6 @@ import static org.openecomp.appc.licmgr.Constants.ASDC_ARTIFACTS_FIELDS.ARTIFACT import java.util.Map; -import org.openecomp.appc.licmgr.Constants; import org.openecomp.appc.licmgr.LicenseDataAccessService; import org.openecomp.appc.licmgr.LicenseManager; import org.openecomp.appc.licmgr.exception.DataAccessException; @@ -42,8 +41,6 @@ public class LicenseManagerImpl implements LicenseManager { } public LicenseManagerImpl() { - DAService = new LicenseDataAccessServiceImpl(); - DAService.setSchema(Constants.SDNCTL_SCHEMA); } @Override diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/resources/OSGI-INF/blueprint/blueprint.xml index c8efb8390..45ef4f179 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -27,7 +27,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> - - + + + + + + + + + + diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/resources/org/openecomp/appc/default.properties b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/resources/org/openecomp/appc/default.properties index 9d9e1d787..a3b064f90 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/resources/org/openecomp/appc/default.properties +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main/resources/org/openecomp/appc/default.properties @@ -23,27 +23,12 @@ # to supply configuration options org.openecomp.appc.bootstrap.file=appc.properties org.openecomp.appc.bootstrap.path=/opt/openecomp/appc/data/properties,${user.home},. - - #Property below provided by appc.properties -#dmaap.poolMembers=:3904 - -dmaap.topic.read=APPC-TEST2 -dmaap.topic.write=APPC-TEST2 -#dmaap.topic.read.filter={"class":"Assigned","field":"request"} -dmaap.topic.read.filter={"class": "And","filters": [{"class": "Assigned","field": "request"},{"class": "Unassigned","field": "response"}]} -dmaap.client.name=APPC-TEST-CLIENT-LIC-MGR-MAIN -dmaap.client.name.id=0 -#dmaap.client.key=random -#dmaap.client.secret=random +appc.LCM.provider.url=https://localhost:8443/restconf/operations/appc-provider-lcm +appc.LCM.poolMembers=:3904 +appc.LCM.service=dmaap +appc.LCM.topic.write=APPC-TEST2 +appc.LCM.client.name=APPC-TEST-CLIENT-LIC-MGR-TEST +appc.LCM.provider.user=test +appc.LCM.provider.pass=test -dmaap.threads.queuesize.min=1 -dmaap.threads.queuesize.max=1000 -dmaap.threads.poolsize.min=2 -dmaap.threads.poolsize.max=2 - -# -# This needs to be changed so that the action can be appended to the end of the URL path -# -#provider.urls.topology=https://admin:password@:8443/restconf/operations/appc-provider:topology-service -#provider.urls.topology=https://admin:password@:8443/restconf/operations/appc-provider: diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseServiceMock.java b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseServiceMock.java index e496da7b5..9760cef54 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseServiceMock.java +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/src/test/java/org/openecomp/appc/licmgr/LicenseServiceMock.java @@ -20,7 +20,6 @@ */ package org.openecomp.appc.licmgr; - import java.util.HashMap; import java.util.Map; -- cgit 1.2.3-korg