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 --- .../appc-license-manager-api/pom.xml | 8 ------ .../java/org/openecomp/appc/licmgr/Constants.java | 1 - .../org/openecomp/appc/licmgr/LicenseManager.java | 1 + .../appc-license-manager-core/pom.xml | 14 ++++++++--- .../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 - 9 files changed, 36 insertions(+), 59 deletions(-) (limited to 'appc-dispatcher/appc-license-manager') diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-api/pom.xml b/appc-dispatcher/appc-license-manager/appc-license-manager-api/pom.xml index d4da50767..635e1fc12 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-api/pom.xml +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-api/pom.xml @@ -16,11 +16,6 @@ - - org.openecomp.appc - appc-common - ${project.version} - org.openecomp.sdnc.core dblib-provider @@ -36,9 +31,6 @@ ${project.artifactId} ${project.version} org.openecomp.appc.licmgr,org.openecomp.appc.licmgr.exception,org.openecomp.appc.licmgr.objects - !dblib-provider,appc-common,eelf-core,logback-core,logback-classic;scope=compile|runtime;inline=false - true - !groovy.lang,!javax.*,!org.apache.log,!org.apache.log4j.*,!org.codehaus.jackson.*,!org.codehaus.jackson.map.*,!org.codehaus.commons.compiler,!org.codehaus.groovy.*,!org.codehaus.janino,!org.jasypt.*,!com.ibm.icu.*,!com.sun.faces.*,* diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/Constants.java b/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/Constants.java index 81ce0e713..5f758e7ae 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/Constants.java +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/Constants.java @@ -68,7 +68,6 @@ public class Constants { public static final String VNF_HOST_IP_ADDRESS_FIELD_NAME = "vnf-host-ip-address"; public static final String UPGRADE_VERSION = "upgrade-version"; public static final String DG_ERROR_FIELD_NAME = "org.openecomp.appc.dg.error"; - public static final String DG_OUTPUT_STATUS_MESSAGE = "output.status.message"; public static final String RESOURCEKEY = "resourceKey"; public static final String REQ_ID_FIELD_NAME = "org.openecomp.appc.reqid"; public static final String API_VERSION_FIELD_NAME = "org.openecomp.appc.apiversion"; diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/LicenseManager.java b/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/LicenseManager.java index 40c7d8bb6..547b8c4f9 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/LicenseManager.java +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-api/src/main/java/org/openecomp/appc/licmgr/LicenseManager.java @@ -27,6 +27,7 @@ import org.openecomp.appc.licmgr.exception.DataAccessException; import org.openecomp.appc.licmgr.objects.LicenseModel; +@SuppressWarnings("JavaDoc") public interface LicenseManager { /** diff --git a/appc-dispatcher/appc-license-manager/appc-license-manager-core/pom.xml b/appc-dispatcher/appc-license-manager/appc-license-manager-core/pom.xml index 66b314798..99ab538ca 100644 --- a/appc-dispatcher/appc-license-manager/appc-license-manager-core/pom.xml +++ b/appc-dispatcher/appc-license-manager/appc-license-manager-core/pom.xml @@ -58,10 +58,18 @@ ${project.artifactId} ${project.version} - !dblib-provider,appc-common,eelf-core,logback-core,logback-classic,javax.mail;scope=compile|runtime;inline=false - true org.openecomp.appc.licmgr.LicenseManager - org.openecomp.appc.licmgr,org.openecomp.appc.licmgr.exception,org.openecomp.appc.licmgr.objects,javax.mail.internet,!javax.mail,!groovy.lang,!javax.jms,!org.apache.log,!org.apache.log4j.*,!org.codehaus.jackson.*,!org.codehaus.jackson.map.*,!org.codehaus.commons.compiler,!org.codehaus.groovy.*,!org.codehaus.janino,!org.jasypt.*,!com.ibm.icu.*,!com.sun.faces.*,* + + + artifactId=!dblib-provider|slf4j-api|jcl-over-slf4j;scope=compile|runtime;inline=false + + + + org.openecomp.appc.licmgr,org.openecomp.appc.licmgr.exception,org.openecomp.appc.licmgr.objects, + *;resolution:=optional + + + true 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