From 116667df3977935f02206b3ce16e8d117ffa7545 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 29 Aug 2019 10:49:50 -0400 Subject: Revert "Proposal to remove OSGi dependencies from the CCSDK project" This reverts commit b1dd81ede363508f83c86ed497b8c0815045f8e5. This commit contains a significant amount of new code with no jUnit testing, which drives our code coverage for this repo below mandatory 55% line coverage. Thus, this is not acceptable. Change-Id: I8a3196df31d0c86747bdb3facd963983276a66e2 Signed-off-by: Timoney, Dan (dt5972) --- resource-assignment/lighty/pom.xml | 58 -------- .../adaptors/resource/lighty/ResourceModule.java | 152 --------------------- resource-assignment/pom.xml | 1 - 3 files changed, 211 deletions(-) delete mode 100755 resource-assignment/lighty/pom.xml delete mode 100644 resource-assignment/lighty/src/main/java/org/onap/ccsdk/sli/adaptors/resource/lighty/ResourceModule.java (limited to 'resource-assignment') diff --git a/resource-assignment/lighty/pom.xml b/resource-assignment/lighty/pom.xml deleted file mode 100755 index feea3e10f..000000000 --- a/resource-assignment/lighty/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - - - org.onap.ccsdk.parent - binding-parent - 1.4.1-SNAPSHOT - - - - org.onap.ccsdk.sli.adaptors - resource-assignment-lighty - 0.6.1-SNAPSHOT - jar - - ccsdk-sli-adaptors :: resource-assignment :: ${project.artifactId} - http://maven.apache.org - - - UTF-8 - - - - - - org.onap.ccsdk.sli.core - ccsdk-lighty-dependency-versions - ${project.version} - pom - import - - - - - - - io.lighty.core - lighty-controller - - - org.onap.ccsdk.sli.adaptors - resource-assignment-provider - ${project.version} - - - org.onap.ccsdk.sli.core - dblib-provider - ${project.version} - - - org.onap.ccsdk.sli.core - sli-provider - ${project.version} - provided - - - diff --git a/resource-assignment/lighty/src/main/java/org/onap/ccsdk/sli/adaptors/resource/lighty/ResourceModule.java b/resource-assignment/lighty/src/main/java/org/onap/ccsdk/sli/adaptors/resource/lighty/ResourceModule.java deleted file mode 100644 index b90905995..000000000 --- a/resource-assignment/lighty/src/main/java/org/onap/ccsdk/sli/adaptors/resource/lighty/ResourceModule.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * ============LICENSE_START========================================== - * Copyright (c) 2019 PANTHEON.tech s.r.o. - * =================================================================== - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS - * OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - * - */ -package org.onap.ccsdk.sli.adaptors.resource.lighty; - -import io.lighty.core.controller.api.AbstractLightyModule; -import java.util.Collections; -import org.onap.ccsdk.sli.adaptors.lock.comp.LockHelperImpl; -import org.onap.ccsdk.sli.adaptors.lock.dao.ResourceLockDaoImpl; -import org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator; -import org.onap.ccsdk.sli.adaptors.ra.ResourceLockNode; -import org.onap.ccsdk.sli.adaptors.ra.alloc.DbAllocationRule; -import org.onap.ccsdk.sli.adaptors.ra.comp.EndPointAllocatorImpl; -import org.onap.ccsdk.sli.adaptors.ra.rule.dao.RangeRuleDaoImpl; -import org.onap.ccsdk.sli.adaptors.ra.rule.dao.ResourceRuleDaoImpl; -import org.onap.ccsdk.sli.adaptors.rm.comp.ResourceManagerImpl; -import org.onap.ccsdk.sli.adaptors.rm.dao.jdbc.AllocationItemJdbcDaoImpl; -import org.onap.ccsdk.sli.adaptors.rm.dao.jdbc.ResourceDaoImpl; -import org.onap.ccsdk.sli.adaptors.rm.dao.jdbc.ResourceJdbcDaoImpl; -import org.onap.ccsdk.sli.adaptors.rm.dao.jdbc.ResourceLoadJdbcDaoImpl; -import org.onap.ccsdk.sli.adaptors.util.db.CachedDataSourceWrap; -import org.onap.ccsdk.sli.adaptors.util.db.DataSourceWrap; -import org.onap.ccsdk.sli.adaptors.util.speed.SpeedUtil; -import org.onap.ccsdk.sli.core.dblib.DbLibService; -import org.springframework.jdbc.core.JdbcTemplate; - -/** - * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that manages and provides services from - * the resource-assignment-provider artifact. - */ -public class ResourceModule extends AbstractLightyModule { - - private final DbLibService dbLibService; - - private DataSourceWrap dataSourceWrap; - private CachedDataSourceWrap cachedDataSourceWrap; - private JdbcTemplate rmJdbcTemplate; - private JdbcTemplate lockJdbcTemplate; - private ResourceLockDaoImpl resourceLockDao; - private LockHelperImpl lockHelper; - private ResourceJdbcDaoImpl resourceJdbcDao; - private AllocationItemJdbcDaoImpl allocationItemJdbcDao; - private ResourceLoadJdbcDaoImpl resourceLoadJdbcDao; - private ResourceDaoImpl resourceDao; - private ResourceManagerImpl resourceManager; - private ResourceRuleDaoImpl resourceRuleDao; - private RangeRuleDaoImpl rangeRuleDao; - private ResourceAllocator resourceAllocator; - private ResourceLockNode resourceLockNode; - private SpeedUtil speedUtil; - private EndPointAllocatorImpl endPointAllocator; - private DbAllocationRule dbAllocationRule; - - public ResourceModule(final DbLibService dbLibService) { - this.dbLibService = dbLibService; - } - - @Override - protected boolean initProcedure() { - this.dataSourceWrap = new DataSourceWrap(); - this.dataSourceWrap.setDataSource(dbLibService); - - this.cachedDataSourceWrap = new CachedDataSourceWrap(); - this.cachedDataSourceWrap.setDataSource(dataSourceWrap); - - this.rmJdbcTemplate = new JdbcTemplate(); - this.rmJdbcTemplate.setDataSource(dataSourceWrap); - - this.lockJdbcTemplate = new JdbcTemplate(); - this.lockJdbcTemplate.setDataSource(cachedDataSourceWrap); - - this.resourceLockDao = new ResourceLockDaoImpl(); - this.resourceLockDao.setJdbcTemplate(lockJdbcTemplate); - - this.lockHelper = new LockHelperImpl(); - this.lockHelper.setResourceLockDao(resourceLockDao); - this.lockHelper.setRetryCount(10); - this.lockHelper.setLockWait(5); - - this.resourceJdbcDao = new ResourceJdbcDaoImpl(); - this.resourceJdbcDao.setJdbcTemplate(rmJdbcTemplate); - - this.allocationItemJdbcDao = new AllocationItemJdbcDaoImpl(); - this.allocationItemJdbcDao.setJdbcTemplate(rmJdbcTemplate); - - this.resourceLoadJdbcDao = new ResourceLoadJdbcDaoImpl(); - this.resourceLoadJdbcDao.setJdbcTemplate(rmJdbcTemplate); - - this.resourceDao = new ResourceDaoImpl(); - this.resourceDao.setResourceJdbcDao(resourceJdbcDao); - this.resourceDao.setAllocationItemJdbcDao(allocationItemJdbcDao); - this.resourceDao.setResourceLoadJdbcDao(resourceLoadJdbcDao); - - this.resourceManager = new ResourceManagerImpl(); - this.resourceManager.setLockHelper(lockHelper); - this.resourceManager.setResourceDao(resourceDao); - this.resourceManager.setLockTimeout(600); - - this.resourceRuleDao = new ResourceRuleDaoImpl(); - this.resourceRuleDao.setJdbcTemplate(rmJdbcTemplate); - - this.rangeRuleDao = new RangeRuleDaoImpl(); - this.rangeRuleDao.setJdbcTemplate(rmJdbcTemplate); - - this.resourceLockNode = new ResourceLockNode(); - this.resourceLockNode.setLockHelper(lockHelper); - - this.speedUtil = new SpeedUtil(); - - this.dbAllocationRule = new DbAllocationRule(); - this.dbAllocationRule.setResourceRuleDao(resourceRuleDao); - this.dbAllocationRule.setRangeRuleDao(rangeRuleDao); - - this.endPointAllocator = new EndPointAllocatorImpl(); - this.endPointAllocator.setResourceManager(resourceManager); - this.endPointAllocator.setAllocationRuleMap( - Collections.singletonMap("DEFAULT", Collections.singletonList(dbAllocationRule))); - - this.resourceAllocator = new ResourceAllocator(); - this.resourceAllocator.setResourceManager(resourceManager); - this.resourceAllocator.setEndPointAllocator(endPointAllocator); - this.resourceAllocator.setSpeedUtil(speedUtil); - return true; - } - - @Override - protected boolean stopProcedure() { - return true; - } - - public ResourceAllocator getResourceAllocator() { - return resourceAllocator; - } - - public ResourceLockNode getResourceLockNode() { - return resourceLockNode; - } - -} diff --git a/resource-assignment/pom.xml b/resource-assignment/pom.xml index 196331a32..8b53a45c3 100755 --- a/resource-assignment/pom.xml +++ b/resource-assignment/pom.xml @@ -21,7 +21,6 @@ provider features installer - lighty -- cgit 1.2.3-korg