diff options
author | Patrick Brady <pb071s@att.com> | 2017-06-01 10:45:37 -0700 |
---|---|---|
committer | Patrick Brady <pb071s@att.com> | 2017-06-02 13:05:15 -0700 |
commit | c7d0075d223eab9f89fd28853c4b138792059be9 (patch) | |
tree | 40aa3e41e598ea7a59bcf6899a2004c1abab11c2 /appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main | |
parent | 8aac2df744820304ee29354333661699e9695939 (diff) |
Merge of new rebased code
Change-Id: I9b8d1f69eb3e0af1935ed8304fea4bf54c1aac47
Signed-off-by: Patrick Brady <pb071s@att.com>
Diffstat (limited to 'appc-dispatcher/appc-license-manager/appc-license-manager-core/src/main')
4 files changed, 24 insertions, 46 deletions
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<String,String> retrieveLicenseModelData(String vnfType, String vnfVersion, String... fields) throws DataAccessException { - checkDbLibService(); - Map<String,String> 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<String, String> 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"> - <bean id="licenseServiceBean" class="org.openecomp.appc.licmgr.impl.LicenseManagerImpl" scope="singleton" activation="lazy"/> - <service id="licenseService" interface="org.openecomp.appc.licmgr.LicenseManager" ref="licenseServiceBean"/> + <reference id="dbLibServiceRef" availability="mandatory" activation="eager" interface="org.openecomp.sdnc.sli.resource.dblib.DbLibService" /> + + <bean id="licenseDataServiceBean" class="org.openecomp.appc.licmgr.impl.LicenseDataAccessServiceImpl" scope="singleton" activation="eager"> + <property name="dbLibService" ref="dbLibServiceRef" /> + <property name="schema" value="sdnctl" /> + </bean> + <bean id="licenseServiceBean" class="org.openecomp.appc.licmgr.impl.LicenseManagerImpl" scope="singleton" activation="lazy"> + <property name="DAService" ref="licenseDataServiceBean"/> + </bean> + <service id="licenseService" interface="org.openecomp.appc.licmgr.LicenseManager" ref="licenseServiceBean"/> </blueprint> 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=<DMAAP_IP>: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=<DMAAP_IP>: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@<IP_ADDRESS>:8443/restconf/operations/appc-provider:topology-service -#provider.urls.topology=https://admin:password@<IP_ADDRESS>:8443/restconf/operations/appc-provider: |