summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
diff options
context:
space:
mode:
authorsheetalm <sheetal.mudholkar@amdocs.com>2018-02-14 09:39:22 +0530
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-02-18 19:44:22 +0000
commit04c1754116920f5b43b20f449a39cbfa7a681102 (patch)
tree805a48420c86466c82eace500d5edc6531e1f554 /openecomp-be/lib/openecomp-sdc-vendor-software-product-lib
parent1f79fe6cf0abafc9db0a99f4c9fbd661a5d87b32 (diff)
Onboarding foundation changes for ItemManager
Resolved conflicting changes 1. Split ItemManager to ASDCItemManager and ItemManager 2. ItemManager provides basic capability of item without collaboration 3. AsdcItemManager provides all capabilities of item including collaboration which are required by onboarding 4. ItemManager can be used by other services like activity spec to create a basic item without collaboration features. Change-Id: I6c6dc34a2b1a1745c796099b70e359432e90f85e Issue-ID: SDC-1039 Signed-off-by: sheetalm <sheetal.mudholkar@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java37
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComputeDaoCassandraImpl.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/DeploymentFlavorDaoCassandraImpl.java162
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ImageDaoImpl.java31
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java17
6 files changed, 184 insertions, 125 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java
index 9cdd950a72..da852a62b4 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDaoCassandraImpl.java
@@ -1,21 +1,17 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
* 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
- *
+ *
+ * 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.sdc.vendorsoftwareproduct.dao.impl;
@@ -27,21 +23,20 @@ import com.datastax.driver.mapping.Result;
import com.datastax.driver.mapping.UDTMapper;
import com.datastax.driver.mapping.annotations.Accessor;
import com.datastax.driver.mapping.annotations.Query;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
import org.openecomp.core.dao.impl.CassandraBaseDao;
import org.openecomp.core.nosqldb.api.NoSqlDb;
import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.ActionVersioningManagerFactory;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
public class ComponentDaoCassandraImpl extends CassandraBaseDao<ComponentEntity>
implements ComponentDao {
@@ -66,7 +61,7 @@ public class ComponentDaoCassandraImpl extends CassandraBaseDao<ComponentEntity>
Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(),
mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
- VersioningManagerFactory.getInstance().createInterface()
+ ActionVersioningManagerFactory.getInstance().createInterface()
.register(versionableEntityType, metadata);
}
@@ -100,7 +95,8 @@ public class ComponentDaoCassandraImpl extends CassandraBaseDao<ComponentEntity>
@Override
public void updateQuestionnaireData(String vspId, Version version, String componentId,
String questionnaireData) {
- accessor.updateQuestionnaireData(questionnaireData, vspId, versionMapper.toUDT(version), componentId);
+ accessor.updateQuestionnaireData(questionnaireData, vspId, versionMapper.toUDT(version),
+ componentId);
}
@Override
@@ -109,7 +105,8 @@ public class ComponentDaoCassandraImpl extends CassandraBaseDao<ComponentEntity>
}
@Override
- public Collection<ComponentEntity> listCompositionAndQuestionnaire(String vspId, Version version){
+ public Collection<ComponentEntity> listCompositionAndQuestionnaire(String vspId,
+ Version version) {
return accessor.listCompositionAndQuestionnaire(vspId, versionMapper.toUDT(version)).all();
}
@@ -145,13 +142,13 @@ public class ComponentDaoCassandraImpl extends CassandraBaseDao<ComponentEntity>
"insert into vsp_component (vsp_id, version, component_id, composition_data)"
+ " values (?,?,?,?)")
ResultSet updateCompositionData(String vspId, UDTValue version, String id,
- String compositionData);
+ String compositionData);
@Query(
"update vsp_component set questionnaire_data=? where vsp_id=? and version=?"
+ " and component_id=?")
ResultSet updateQuestionnaireData(String questionnaireData, String vspId, UDTValue version,
- String id);
+ String id);
@Query("delete from vsp_component where vsp_id=? and version=?")
ResultSet deleteAll(String vspId, Version version);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java
index 2fcbc1aae8..11524ed05f 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.openecomp.sdc.vendorsoftwareproduct.dao.impl;
import com.datastax.driver.core.ResultSet;
@@ -7,23 +23,22 @@ import com.datastax.driver.mapping.Result;
import com.datastax.driver.mapping.UDTMapper;
import com.datastax.driver.mapping.annotations.Accessor;
import com.datastax.driver.mapping.annotations.Query;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
import org.openecomp.core.dao.impl.CassandraBaseDao;
import org.openecomp.core.nosqldb.api.NoSqlDb;
import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.ActionVersioningManagerFactory;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
-public class ComponentDependencyModelDaoCassandraImpl extends CassandraBaseDao
- <ComponentDependencyModelEntity> implements ComponentDependencyModelDao {
+public class ComponentDependencyModelDaoCassandraImpl extends
+ CassandraBaseDao<ComponentDependencyModelEntity> implements ComponentDependencyModelDao {
private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
private static final Mapper<ComponentDependencyModelEntity> mapper =
@@ -62,7 +77,7 @@ public class ComponentDependencyModelDaoCassandraImpl extends CassandraBaseDao
VendorSoftwareProductConstants.UniqueValues.PROCESS_NAME,
Arrays.asList("vsp_id", "version", "component_id", "name"))));
- VersioningManagerFactory.getInstance().createInterface()
+ ActionVersioningManagerFactory.getInstance().createInterface()
.register(versionableEntityType, metadata);
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComputeDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComputeDaoCassandraImpl.java
index ba878c661e..4e85ff61c3 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComputeDaoCassandraImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComputeDaoCassandraImpl.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.openecomp.sdc.vendorsoftwareproduct.dao.impl;
import com.datastax.driver.core.ResultSet;
@@ -7,21 +23,20 @@ import com.datastax.driver.mapping.Result;
import com.datastax.driver.mapping.UDTMapper;
import com.datastax.driver.mapping.annotations.Accessor;
import com.datastax.driver.mapping.annotations.Query;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
import org.openecomp.core.dao.impl.CassandraBaseDao;
import org.openecomp.core.nosqldb.api.NoSqlDb;
import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.ActionVersioningManagerFactory;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
public class ComputeDaoCassandraImpl extends CassandraBaseDao<ComputeEntity> implements
ComputeDao {
@@ -45,7 +60,7 @@ public class ComputeDaoCassandraImpl extends CassandraBaseDao<ComputeEntity> imp
VendorSoftwareProductConstants.UniqueValues.COMPUTE_NAME,
Arrays.asList("vsp_id", "version", "component_id", "name"))));
- VersioningManagerFactory.getInstance().createInterface()
+ ActionVersioningManagerFactory.getInstance().createInterface()
.register(versionableEntityType, metadata);
}
@@ -107,12 +122,12 @@ public class ComputeDaoCassandraImpl extends CassandraBaseDao<ComputeEntity> imp
@Query("update vsp_component_compute set composition_data=? where vsp_id=? and version=?"
+ " and component_id=? and compute_id=?")
ResultSet updateCompositionData(String compositionData, String vspId, UDTValue version,
- String componentId, String computeId);
+ String componentId, String computeId);
@Query("update vsp_component_compute set questionnaire_data=? where vsp_id=? and version=?"
+ " and component_id=? and compute_id=?")
ResultSet updateQuestionnaireData(String questionnaireData, String vspId, UDTValue version,
- String componentId, String computeId);
+ String componentId, String computeId);
@Query("delete from vsp_component_compute where vsp_id=? and version=?")
ResultSet deleteAll(String vspId, Version version);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/DeploymentFlavorDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/DeploymentFlavorDaoCassandraImpl.java
index 5831b582fc..2a19082005 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/DeploymentFlavorDaoCassandraImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/DeploymentFlavorDaoCassandraImpl.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.openecomp.sdc.vendorsoftwareproduct.dao.impl;
import com.datastax.driver.core.ResultSet;
@@ -7,87 +23,89 @@ import com.datastax.driver.mapping.Result;
import com.datastax.driver.mapping.UDTMapper;
import com.datastax.driver.mapping.annotations.Accessor;
import com.datastax.driver.mapping.annotations.Query;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
import org.openecomp.core.dao.impl.CassandraBaseDao;
import org.openecomp.core.nosqldb.api.NoSqlDb;
import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.ActionVersioningManagerFactory;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
-public class DeploymentFlavorDaoCassandraImpl extends CassandraBaseDao<DeploymentFlavorEntity> implements DeploymentFlavorDao {
- private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
- private static final Mapper<DeploymentFlavorEntity> mapper = noSqlDb.getMappingManager().mapper(DeploymentFlavorEntity.class);
- private static final DeploymentFlavorAccessor accessor =
- noSqlDb.getMappingManager().createAccessor(DeploymentFlavorAccessor.class);
- private static final UDTMapper<Version> versionMapper =
- noSqlDb.getMappingManager().udtMapper(Version.class);
- @Override
- protected Mapper<DeploymentFlavorEntity> getMapper() {
- return mapper;
- }
-
- @Override
- protected Object[] getKeys(DeploymentFlavorEntity entity) {
- return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
- entity.getId()};
- }
-
- @Override
- public Collection<DeploymentFlavorEntity> list(DeploymentFlavorEntity entity) {
- return accessor.list(entity.getVspId(), versionMapper.toUDT(entity.getVersion())).all();
- }
-
- @Override
- public void update(DeploymentFlavorEntity entity) {
- accessor.updateCompositionData(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
- entity.getId(), entity.getCompositionData());
- }
-
- @Override
- public void registerVersioning(String versionableEntityType) {
- VersionableEntityMetadata metadata = new VersionableEntityMetadata(
- mapper.getTableMetadata().getName(),
- mapper.getTableMetadata().getPartitionKey().get(0).getName(),
- mapper.getTableMetadata().getPartitionKey().get(1).getName());
-
-
- metadata.setUniqueValuesMetadata(Collections.singletonList(new UniqueValueMetadata(
- VendorSoftwareProductConstants.UniqueValues.DEPLOYMENT_FLAVOR_NAME,
- Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(),
- mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
-
- VersioningManagerFactory.getInstance().createInterface()
- .register(versionableEntityType, metadata);
- }
-
- @Override
- public void deleteAll(String vspId, Version version) {
- accessor.deleteAll(vspId, version);
- }
-
- @Accessor
- interface DeploymentFlavorAccessor {
- @Query(
- "select vsp_id, version, deployment_flavor_id, composition_data from vsp_deployment_flavor where vsp_id=?"
- + " and version=?")
- Result<DeploymentFlavorEntity> list(String vspId, UDTValue version);
-
- @Query(
- "insert into vsp_deployment_flavor (vsp_id, version, deployment_flavor_id, composition_data) values (?,?,?,?)")
- ResultSet updateCompositionData(String vspId, UDTValue version, String id,
- String compositionData);
-
- @Query("delete from vsp_deployment_flavor where vsp_id=? and version=?")
- ResultSet deleteAll(String vspId, Version version);
-
- }
+public class DeploymentFlavorDaoCassandraImpl extends CassandraBaseDao<DeploymentFlavorEntity>
+ implements DeploymentFlavorDao {
+ private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
+ private static final Mapper<DeploymentFlavorEntity> mapper =
+ noSqlDb.getMappingManager().mapper(DeploymentFlavorEntity.class);
+ private static final DeploymentFlavorAccessor accessor =
+ noSqlDb.getMappingManager().createAccessor(DeploymentFlavorAccessor.class);
+ private static final UDTMapper<Version> versionMapper =
+ noSqlDb.getMappingManager().udtMapper(Version.class);
+
+ @Override
+ protected Mapper<DeploymentFlavorEntity> getMapper() {
+ return mapper;
+ }
+
+ @Override
+ protected Object[] getKeys(DeploymentFlavorEntity entity) {
+ return new Object[]{entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId()};
+ }
+
+ @Override
+ public Collection<DeploymentFlavorEntity> list(DeploymentFlavorEntity entity) {
+ return accessor.list(entity.getVspId(), versionMapper.toUDT(entity.getVersion())).all();
+ }
+
+ @Override
+ public void update(DeploymentFlavorEntity entity) {
+ accessor.updateCompositionData(entity.getVspId(), versionMapper.toUDT(entity.getVersion()),
+ entity.getId(), entity.getCompositionData());
+ }
+
+ @Override
+ public void registerVersioning(String versionableEntityType) {
+ VersionableEntityMetadata metadata = new VersionableEntityMetadata(
+ mapper.getTableMetadata().getName(),
+ mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName());
+
+
+ metadata.setUniqueValuesMetadata(Collections.singletonList(new UniqueValueMetadata(
+ VendorSoftwareProductConstants.UniqueValues.DEPLOYMENT_FLAVOR_NAME,
+ Arrays.asList(mapper.getTableMetadata().getPartitionKey().get(0).getName(),
+ mapper.getTableMetadata().getPartitionKey().get(1).getName(), "name"))));
+
+ ActionVersioningManagerFactory.getInstance().createInterface()
+ .register(versionableEntityType, metadata);
+ }
+
+ @Override
+ public void deleteAll(String vspId, Version version) {
+ accessor.deleteAll(vspId, version);
+ }
+
+ @Accessor
+ interface DeploymentFlavorAccessor {
+ @Query(
+ "select vsp_id, version, deployment_flavor_id, composition_data from vsp_deployment_flavor where vsp_id=?"
+ + " and version=?")
+ Result<DeploymentFlavorEntity> list(String vspId, UDTValue version);
+
+ @Query(
+ "insert into vsp_deployment_flavor (vsp_id, version, deployment_flavor_id, composition_data) values (?,?,?,?)")
+ ResultSet updateCompositionData(String vspId, UDTValue version, String id,
+ String compositionData);
+
+ @Query("delete from vsp_deployment_flavor where vsp_id=? and version=?")
+ ResultSet deleteAll(String vspId, Version version);
+
+ }
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ImageDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ImageDaoImpl.java
index 24217830e4..441f8fbbf9 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ImageDaoImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ImageDaoImpl.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * 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.openecomp.sdc.vendorsoftwareproduct.dao.impl;
import com.datastax.driver.core.ResultSet;
@@ -7,21 +23,20 @@ import com.datastax.driver.mapping.Result;
import com.datastax.driver.mapping.UDTMapper;
import com.datastax.driver.mapping.annotations.Accessor;
import com.datastax.driver.mapping.annotations.Query;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
import org.openecomp.core.dao.impl.CassandraBaseDao;
import org.openecomp.core.nosqldb.api.NoSqlDb;
import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.ActionVersioningManagerFactory;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.types.UniqueValueMetadata;
import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
public class ImageDaoImpl extends CassandraBaseDao<ImageEntity> implements ImageDao {
private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
@@ -45,7 +60,7 @@ public class ImageDaoImpl extends CassandraBaseDao<ImageEntity> implements Image
VendorSoftwareProductConstants.UniqueValues.IMAGE_NAME,
Arrays.asList("vsp_id", "version", "component_id", "name"))));
- VersioningManagerFactory.getInstance().createInterface()
+ ActionVersioningManagerFactory.getInstance().createInterface()
.register(versionableEntityType, metadata);
}
@@ -111,12 +126,12 @@ public class ImageDaoImpl extends CassandraBaseDao<ImageEntity> implements Image
"insert into vsp_component_image (vsp_id, version, component_id, image_id, "
+ "composition_data) values (?,?,?,?,?)")
ResultSet updateCompositionData(String vspId, UDTValue version, String componentId, String id,
- String compositionData);
+ String compositionData);
@Query("update vsp_component_image set questionnaire_data=? where vsp_id=? and version=?"
+ " and component_id=? and image_id=?")
ResultSet updateQuestionnaireData(String questionnaireData, String vspId, UDTValue version,
- String componentId, String computeId);
+ String componentId, String computeId);
@Query("delete from vsp_component_image where vsp_id=? and version=?")
ResultSet deleteByVspId(String vspId, UDTValue version);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
index 8d9a8eed93..482536342b 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java
@@ -15,11 +15,17 @@
*/
package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
import com.amdocs.zusammen.datatypes.SessionContext;
import com.amdocs.zusammen.datatypes.item.Action;
import com.amdocs.zusammen.datatypes.item.ElementContext;
import com.amdocs.zusammen.datatypes.item.Info;
+import java.io.ByteArrayInputStream;
+import java.util.Collection;
+import java.util.stream.Collectors;
import org.openecomp.core.zusammen.api.ZusammenAdaptor;
import org.openecomp.sdc.datatypes.model.ElementType;
import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
@@ -27,18 +33,11 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.Eleme
import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor.ElementToVSPQuestionnaireConvertor;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.ActionVersioningManagerFactory;
import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdc.versioning.types.VersionableEntityMetadata;
import org.openecomp.sdc.versioning.types.VersionableEntityStoreType;
-import java.io.ByteArrayInputStream;
-import java.util.Collection;
-import java.util.stream.Collectors;
-
-import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
-import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
-
public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareProductInfoDao {
private static final String EMPTY_DATA = "{}";
@@ -54,7 +53,7 @@ public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareP
new VersionableEntityMetadata(VersionableEntityStoreType.Zusammen, "VendorSoftwareProduct",
null, null);
- VersioningManagerFactory.getInstance().createInterface()
+ ActionVersioningManagerFactory.getInstance().createInterface()
.register(versionableEntityType, metadata);
}