From f5f13c4f6b6fe3b4d98e349dfd7db59339803436 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 19 Feb 2017 12:35:04 +0200 Subject: push addional code Change-Id: Ia427bb3460cda3a896f8faced2de69eaf3807b74 Signed-off-by: Michael Lando --- .../applicationconfig/ApplicationConfig.java | 35 +++++++ .../ApplicationConfigFactory.java | 31 ++++++ .../dao/ApplicationConfigDao.java | 33 ++++++ .../dao/ApplicationConfigDaoFactory.java | 32 ++++++ .../impl/ApplicationConfigDaoCassandraImpl.java | 115 +++++++++++++++++++++ .../dao/impl/ApplicationConfigDaoFactoryImpl.java | 33 ++++++ .../dao/type/ApplicationConfigEntity.java | 79 ++++++++++++++ .../impl/ApplicationConfigFactoryImpl.java | 34 ++++++ .../impl/ApplicationConfigImpl.java | 74 +++++++++++++ .../applicationconfig/type/ConfigurationData.java | 48 +++++++++ 10 files changed, 514 insertions(+) create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java create mode 100644 openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java (limited to 'openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig') diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java new file mode 100644 index 0000000000..a68c6b614a --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfig.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig; + +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; + +import java.util.Collection; + +public interface ApplicationConfig { + + ConfigurationData getConfigurationData(String namespace, String key); + + void insertValue(String namespace, String key, String value); + + Collection getListOfConfigurationByNamespace(String namespace); +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java new file mode 100644 index 0000000000..e022294dfd --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/ApplicationConfigFactory.java @@ -0,0 +1,31 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ApplicationConfigFactory extends AbstractComponentFactory { + + public static ApplicationConfigFactory getInstance() { + return AbstractFactory.getInstance(ApplicationConfigFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java new file mode 100644 index 0000000000..a4c582744a --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDao.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig.dao; + +import org.openecomp.core.dao.BaseDao; +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; + + +public interface ApplicationConfigDao extends BaseDao { + + long getValueTimestamp(String namespace, String key); + + ConfigurationData getConfigurationData(String namespace, String key); +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java new file mode 100644 index 0000000000..f60e4a9010 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/ApplicationConfigDaoFactory.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig.dao; + +import org.openecomp.core.factory.api.AbstractComponentFactory; +import org.openecomp.core.factory.api.AbstractFactory; + +public abstract class ApplicationConfigDaoFactory + extends AbstractComponentFactory { + + public static ApplicationConfigDaoFactory getInstance() { + return AbstractFactory.getInstance(ApplicationConfigDaoFactory.class); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java new file mode 100644 index 0000000000..7fb0e2f5ae --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoCassandraImpl.java @@ -0,0 +1,115 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig.dao.impl; + +import com.datastax.driver.core.ResultSet; +import com.datastax.driver.core.Row; +import com.datastax.driver.mapping.Mapper; +import com.datastax.driver.mapping.Result; +import com.datastax.driver.mapping.annotations.Accessor; +import com.datastax.driver.mapping.annotations.Query; +import org.openecomp.core.dao.impl.CassandraBaseDao; +import org.openecomp.core.nosqldb.api.NoSqlDb; +import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao; +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; + +import java.util.Collection; +import java.util.Objects; + +public class ApplicationConfigDaoCassandraImpl extends CassandraBaseDao + implements ApplicationConfigDao { + + private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface(); + private static final Mapper mapper = + noSqlDb.getMappingManager().mapper(ApplicationConfigEntity.class); + private static final ApplicationConfigAccessor accessor = + noSqlDb.getMappingManager().createAccessor(ApplicationConfigAccessor.class); + + @Override + protected Mapper getMapper() { + return mapper; + } + + @Override + protected Object[] getKeys(ApplicationConfigEntity entity) { + return new Object[]{entity.getNamespace(), entity.getKey(), entity.getValue()}; + } + + @Override + public Collection list(ApplicationConfigEntity entity) { + return accessor.list(entity.getNamespace()).all(); + } + + @Override + public void create(ApplicationConfigEntity entity) { + accessor.updateApplicationConfigData(entity.getNamespace(), entity.getKey(), entity.getValue()); + } + + @Override + public void update(ApplicationConfigEntity entity) { + accessor.updateApplicationConfigData(entity.getNamespace(), entity.getKey(), entity.getValue()); + } + + @Override + public ApplicationConfigEntity get(ApplicationConfigEntity entity) { + return accessor.get(entity.getNamespace(), entity.getKey()); + } + + @Override + public long getValueTimestamp(String namespace, String key) { + ResultSet resultSet = accessor.getValueAndTimestampOfConfigurationValue(namespace, key); + + return resultSet.one().getLong("writetime(value)"); + } + + @Override + public ConfigurationData getConfigurationData(String namespace, String key) { + //String value = accessor.getValue(namespace, key).one().getString("value"); + ResultSet resultSet = accessor.getValueAndTimestampOfConfigurationValue(namespace, key); + Row one = resultSet.one(); + + if (Objects.nonNull(one)) { + return new ConfigurationData(one.getString("value"), one.getLong("writetime(value)")); + } + + return null; + } + + + @Accessor + interface ApplicationConfigAccessor { + + @Query("select namespace, key, value from application_config where namespace=?") + Result list(String namespace); + + @Query("insert into application_config (namespace, key, value) values (?,?,?)") + ResultSet updateApplicationConfigData(String namespace, String key, String value); + + @Query("select namespace, key, value from application_config where namespace=? and key=?") + ApplicationConfigEntity get(String namespace, String key); + + @Query("select value, writetime(value) from application_config where namespace=? and key=?") + ResultSet getValueAndTimestampOfConfigurationValue(String namespace, String key); + + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java new file mode 100644 index 0000000000..cea49ea8d1 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/impl/ApplicationConfigDaoFactoryImpl.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig.dao.impl; + +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory; + +public class ApplicationConfigDaoFactoryImpl extends ApplicationConfigDaoFactory { + private static final ApplicationConfigDao INSTANCE = new ApplicationConfigDaoCassandraImpl(); + + @Override + public ApplicationConfigDao createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java new file mode 100644 index 0000000000..c73ce36744 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/dao/type/ApplicationConfigEntity.java @@ -0,0 +1,79 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig.dao.type; + + +import com.datastax.driver.mapping.annotations.ClusteringColumn; +import com.datastax.driver.mapping.annotations.PartitionKey; +import com.datastax.driver.mapping.annotations.Table; + +@Table(keyspace = "dox", name = "application_config") +public class ApplicationConfigEntity { + + @PartitionKey + private String namespace; + @ClusteringColumn + private String key; + private String value; + + /** + * Instantiates a new Application config entity. + * + * @param namespace the namespace + * @param key the key + * @param value the value + */ + public ApplicationConfigEntity(String namespace, String key, String value) { + this.namespace = namespace; + this.key = key; + this.value = value; + } + + + public ApplicationConfigEntity() { + } + + + public String getNamespace() { + return namespace; + } + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java new file mode 100644 index 0000000000..cca07fc227 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigFactoryImpl.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig.impl; + +import org.openecomp.core.utilities.applicationconfig.ApplicationConfig; +import org.openecomp.core.utilities.applicationconfig.ApplicationConfigFactory; + +public class ApplicationConfigFactoryImpl extends ApplicationConfigFactory { + + private static final ApplicationConfig INSTANCE = new ApplicationConfigImpl(); + + @Override + public ApplicationConfig createInterface() { + return INSTANCE; + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java new file mode 100644 index 0000000000..ff9c9aea87 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/impl/ApplicationConfigImpl.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig.impl; + +import org.openecomp.core.utilities.applicationconfig.ApplicationConfig; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDao; +import org.openecomp.core.utilities.applicationconfig.dao.ApplicationConfigDaoFactory; +import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfigEntity; +import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; +import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +import java.util.Collection; +import java.util.Objects; + +/** + * The type Application config. + */ +public class ApplicationConfigImpl implements ApplicationConfig { + private static final ApplicationConfigDao applicationConfigDao = + ApplicationConfigDaoFactory.getInstance().createInterface(); + + private static final String CONFIGURATION_SEARCH_ERROR = "CONFIGURATION_NOT_FOUND"; + private static final String CONFIGURATION_SEARCH_ERROR_MSG = + "Configuration for namespace %s and key %s was not found"; + + @Override + public ConfigurationData getConfigurationData(String namespace, String key) { + ConfigurationData configurationData = applicationConfigDao.getConfigurationData(namespace, key); + + if (Objects.isNull(configurationData)) { + throw new CoreException(new ErrorCode.ErrorCodeBuilder() + .withCategory(ErrorCategory.APPLICATION) + .withId(CONFIGURATION_SEARCH_ERROR) + .withMessage(String.format(CONFIGURATION_SEARCH_ERROR_MSG, namespace, key)) + .build()); + } + + return configurationData; + } + + @Override + public void insertValue(String namespace, String key, String value) { + ApplicationConfigEntity applicationConfigEntity = + new ApplicationConfigEntity(namespace, key, value); + applicationConfigDao.create(applicationConfigEntity); + } + + @Override + public Collection getListOfConfigurationByNamespace(String namespace) { + ApplicationConfigEntity applicationConfigEntity = + new ApplicationConfigEntity(namespace, null, null); + return applicationConfigDao.list(applicationConfigEntity); + } +} diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java new file mode 100644 index 0000000000..53d3797e53 --- /dev/null +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/main/java/org/openecomp/core/utilities/applicationconfig/type/ConfigurationData.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.openecomp.core.utilities.applicationconfig.type; + +public class ConfigurationData { + + private String value; + private long timeStamp; + + public ConfigurationData(String value, long timeStamp) { + this.value = value; + this.timeStamp = timeStamp; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public long getTimeStamp() { + return timeStamp; + } + + public void setTimeStamp(long timeStamp) { + this.timeStamp = timeStamp; + } +} -- cgit 1.2.3-korg