diff options
Diffstat (limited to 'blueprints-processor/adaptors/data-adaptor-provider/src/main')
9 files changed, 11 insertions, 213 deletions
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDao.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDao.java deleted file mode 100644 index 4a77f7f05..000000000 --- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.data.adaptor.dao;
-
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-
-public interface ConfigPropertyMapDao {
-
- /**
- * Query ConcurrentHashMap having CONFIG_PROPERTY_MAP table data for given key.
- *
- * @param key key mapped to a value
- * @return the result string, containing mapped string value
- * @throws org.onap.ccsdk.sli.core.sli.SvcLogicException if fails
- */
- public String getConfigPropertyByKey(String key) throws SvcLogicException;
-
-}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoImpl.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoImpl.java deleted file mode 100644 index 90f92ca27..000000000 --- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigPropertyMapDaoImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.data.adaptor.dao;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import org.apache.commons.lang3.StringUtils;
-import org.onap.ccsdk.features.data.adaptor.DataAdaptorConstants;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import org.springframework.jdbc.CannotGetJdbcConnectionException;
-import org.springframework.jdbc.core.JdbcTemplate;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.google.common.base.Preconditions;
-
-public class ConfigPropertyMapDaoImpl implements ConfigPropertyMapDao {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(ConfigPropertyMapDaoImpl.class);
-
- private JdbcTemplate jdbcTemplate;
- private Map<String, String> configPropertyMap = new ConcurrentHashMap<>();
-
- public ConfigPropertyMapDaoImpl(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- initializeMap();
-
- String envType = configPropertyMap.get(DataAdaptorConstants.PROPERTY_ENV_TYPE);
- if (!(DataAdaptorConstants.PROPERTY_ENV_PROD.equalsIgnoreCase(envType)
- || DataAdaptorConstants.PROPERTY_ENV_SOLO.equalsIgnoreCase(envType))) {
- ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
- Runnable task = this::initializeMap;
- executor.scheduleWithFixedDelay(task, 60, 15, TimeUnit.MINUTES);
- }
- }
-
- private void initializeMap() {
- try {
- String getPropQuery = "SELECT * FROM CONFIG_PROPERTY_MAP";
- jdbcTemplate.queryForList(getPropQuery).forEach(rows -> {
- String key = StringUtils.trimToEmpty((String) rows.get("reference_key"));
- String value = StringUtils.trimToEmpty((String) rows.get("reference_value"));
- configPropertyMap.put(key, value);
- });
- logger.trace("loaded configPropertyMap : ({})", configPropertyMap);
- } catch (Exception e) {
- logger.error(e.getMessage(), e);
- }
- }
-
- @Override
- public String getConfigPropertyByKey(String key) throws SvcLogicException {
- Preconditions.checkArgument(StringUtils.isNotBlank(key), "missing property key");
- return configPropertyMap.get(key);
- }
-
-}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigResourceDao.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigResourceDao.java index 5e50d6f5f..bc33d51a3 100644 --- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigResourceDao.java +++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/ConfigResourceDao.java @@ -18,7 +18,6 @@ package org.onap.ccsdk.features.data.adaptor.dao;
import java.util.List;
-
import org.onap.ccsdk.features.data.adaptor.domain.ConfigResource;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/TransactionLogDao.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/TransactionLogDao.java index c9c5f8a73..c0381a989 100644 --- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/TransactionLogDao.java +++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/dao/TransactionLogDao.java @@ -18,7 +18,6 @@ package org.onap.ccsdk.features.data.adaptor.dao;
import java.util.List;
-
import org.onap.ccsdk.features.data.adaptor.domain.TransactionLog;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/domain/ConfigPropertyMapData.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/domain/ConfigPropertyMapData.java deleted file mode 100644 index d9503b3be..000000000 --- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/domain/ConfigPropertyMapData.java +++ /dev/null @@ -1,49 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.data.adaptor.domain;
-
-import java.io.Serializable;
-
-public class ConfigPropertyMapData implements Serializable {
- private static final long serialVersionUID = 1L;
-
- private String referenceKey;
- private String referenceValue;
-
- public String getReferenceKey() {
- return referenceKey;
- }
-
- public void setReferenceKey(String referenceKey) {
- this.referenceKey = referenceKey;
- }
-
- public String getReferenceValue() {
- return referenceValue;
- }
-
- public void setReferenceValue(String referenceValue) {
- this.referenceValue = referenceValue;
- }
-
- @Override
- public String toString() {
- return "ConfigPropertyMapData [referenceKey=" + referenceKey + ", referenceValue=" + referenceValue + "]";
- }
-
-}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceService.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceService.java index 2f01749a3..cbd9e9279 100644 --- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceService.java +++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceService.java @@ -19,7 +19,6 @@ package org.onap.ccsdk.features.data.adaptor.service; import java.util.List;
import java.util.Map;
-
import org.onap.ccsdk.features.data.adaptor.domain.ConfigResource;
import org.onap.ccsdk.features.data.adaptor.domain.TransactionLog;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
@@ -128,15 +127,6 @@ public interface ConfigResourceService { public ConfigResource saveConfigResource(ConfigResource configResource) throws SvcLogicException;
/**
- * Query ConcurrentHashMap having CONFIG_PROPERTY_MAP table data for given key.
- *
- * @param key key mapped to a value
- * @return the result string, containing mapped string value
- * @throws org.onap.ccsdk.sli.core.sli.SvcLogicException if fails
- */
- public String getConfigPropertyByKey(String key) throws SvcLogicException;
-
- /**
* Query CONFIG_TRANSACTION_LOG table for given request_id, mapping each row to a Java object via a
* TransactionLog RowMapper.
*
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceImpl.java b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceImpl.java index bf1990377..ab24f16c7 100644 --- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceImpl.java +++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/java/org/onap/ccsdk/features/data/adaptor/service/ConfigResourceServiceImpl.java @@ -19,8 +19,6 @@ package org.onap.ccsdk.features.data.adaptor.service; import java.util.List;
import java.util.Map;
-
-import org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDao;
import org.onap.ccsdk.features.data.adaptor.dao.ConfigResourceDao;
import org.onap.ccsdk.features.data.adaptor.dao.NamedQueryExecutorDao;
import org.onap.ccsdk.features.data.adaptor.dao.QueryExecutorDao;
@@ -40,19 +38,16 @@ public class ConfigResourceServiceImpl implements ConfigResourceService { private ConfigResourceDao configResourceDao;
private QueryExecutorDao queryExecutorDao;
private NamedQueryExecutorDao namedQueryExecutorDao;
- private ConfigPropertyMapDao configPropertyMapDao;
@SuppressWarnings("squid:S00107")
public ConfigResourceServiceImpl(TransactionLogDao transactionLogDao, ConfigResourceDao configResourceDao,
- QueryExecutorDao queryExecutorDao, NamedQueryExecutorDao namedQueryExecutorDao,
- ConfigPropertyMapDao configPropertyMapDao) {
+ QueryExecutorDao queryExecutorDao, NamedQueryExecutorDao namedQueryExecutorDao) {
logger.info("{} Constuctor Initated...", CLASS_NAME);
this.transactionLogDao = transactionLogDao;
this.configResourceDao = configResourceDao;
this.queryExecutorDao = queryExecutorDao;
this.namedQueryExecutorDao = namedQueryExecutorDao;
- this.configPropertyMapDao = configPropertyMapDao;
}
@Override
@@ -106,9 +101,4 @@ public class ConfigResourceServiceImpl implements ConfigResourceService { return configResourceDao.save(configResource);
}
- @Override
- public String getConfigPropertyByKey(String key) throws SvcLogicException {
- return configPropertyMapDao.getConfigPropertyByKey(key);
- }
-
}
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml index e38bcd3ce..76459d51d 100644 --- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml +++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml @@ -1,20 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright © 2017-2018 AT&T Intellectual Property.
- Modifications Copyright © 2018 IBM.
-
- 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.
--->
+<!-- Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright
+ © 2018 IBM. 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. -->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
@@ -62,23 +54,17 @@ <argument ref="namedParameterJdbcTemplate" />
</bean>
- <bean id="configPropertyMapDao"
- class="org.onap.ccsdk.features.data.adaptor.dao.ConfigPropertyMapDaoImpl">
- <argument ref="jdbcTemplate" />
- </bean>
-
<!-- Expose the Common Component Bean -->
<bean id="configResourceService"
- class="org.onap.ccsdk.features.data.adaptor.service.ConfigResourceServiceImpl">
+ class="org.onap.ccsdk.features.data.adaptor.service.ConfigResourceServiceImpl">
<argument ref="transactionLogDao" />
<argument ref="configResourceDao" />
<argument ref="queryExecutorDao" />
<argument ref="namedQueryExecutorDao" />
- <argument ref="configPropertyMapDao" />
</bean>
<service ref="configResourceService"
- interface="org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService" />
+ interface="org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService" />
</blueprint>
diff --git a/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/sql/001_init_ddl.sql b/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/sql/001_init_ddl.sql index 593f347de..efcd415e3 100644 --- a/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/sql/001_init_ddl.sql +++ b/blueprints-processor/adaptors/data-adaptor-provider/src/main/resources/sql/001_init_ddl.sql @@ -6,7 +6,6 @@ DROP TABLE sdnctl.CONFIG_RESOURCE_ASSIGNMENT_DATA; DROP TABLE sdnctl.CONFIG_RESOURCE;
DROP TABLE sdnctl.CONFIG_RESOURCE_RELATION;
DROP TABLE sdnctl.CONFIG_TRANSACTION_LOG
-DROP TABLE sdnctl.CONFIG_PROPERTY_MAP
-- -----------------------------------------------------
@@ -95,12 +94,3 @@ CREATE TABLE IF NOT EXISTS sdnctl.CONFIG_RESOURCE_ASSIGNMENT_DATA ( ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
--- -----------------------------------------------------
--- table sdnctl.CONFIG_PROPERTY_MAP
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS sdnctl.CONFIG_PROPERTY_MAP (
- reference_key VARCHAR(100) NOT NULL,
- reference_value VARCHAR(250) NOT NULL,
- CONSTRAINT PK_CONFIG_PROPERTY_MAP PRIMARY KEY (reference_key)
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|