summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib
diff options
context:
space:
mode:
authorsheetalm <sheetal.mudholkar@amdocs.com>2018-06-12 17:32:56 +0530
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-06-13 08:16:41 +0000
commit67e400cc929314f1d66accb2f2f47d489f6b0c4f (patch)
tree1f92e95dd1165944ec57de9e7318850a587cb1c4 /openecomp-be/lib
parentd932a21e9f99ef5e706975a73c4f17a145445fe1 (diff)
Fix for nfcparameters in component questionnaire
issue - nfc naming code and nfc function fields' values are wiped out with a VSP update Moved the above fields from composition to questionnaire Add BDD test. Add license to java files Change-Id: I2b746fedc17c19b716df35bf0dad2c212f15df30 Issue-ID: SDC-1419 Signed-off-by: sheetalm <sheetal.mudholkar@amdocs.com>
Diffstat (limited to 'openecomp-be/lib')
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/entityHealingConfiguration.json3
-rw-r--r--openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentDataHealer.java101
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java14
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireData.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/util/EnrichmentConstants.java24
-rw-r--r--openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricherTest.java12
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java43
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/General.java34
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.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/services/impl/composition/CompositionDataExtractorImpl.java13
10 files changed, 215 insertions, 94 deletions
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/entityHealingConfiguration.json b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/entityHealingConfiguration.json
index 51de9d0802..d8f6986a73 100644
--- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/entityHealingConfiguration.json
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/resources/entityHealingConfiguration.json
@@ -5,7 +5,8 @@
"org.openecomp.sdc.healing.healers.NetworkPackageHealer"
],
"data": [
- "org.openecomp.sdc.healing.healers.ToscaServiceModelHealer"
+ "org.openecomp.sdc.healing.healers.ToscaServiceModelHealer",
+ "org.openecomp.sdc.healing.healers.ComponentDataHealer"
]
},
"vlm": {
diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentDataHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentDataHealer.java
new file mode 100644
index 0000000000..da3ad81d58
--- /dev/null
+++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentDataHealer.java
@@ -0,0 +1,101 @@
+/*
+ * 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.healing.healers;
+
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import org.apache.commons.lang.StringUtils;
+import org.openecomp.sdc.healing.interfaces.Healer;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Collection;
+import java.util.Objects;
+
+public class ComponentDataHealer implements Healer {
+
+ private static final String VFC_CODE = "vfcCode"; //earlier present in composition data
+ private static final String NFC_FUNCTION = "nfcFunction";
+ private static final String NFC_NAMING_CODE = "nfcNamingCode";
+ private static final String GENERAL = "general";
+ private final ComponentDao componentDao;
+
+ public ComponentDataHealer() {
+ this.componentDao = ComponentDaoFactory.getInstance().createInterface();
+ }
+
+ @Override
+ public boolean isHealingNeeded(String itemId, Version version) {
+ final Collection<ComponentEntity> componentEntities =
+ componentDao.listCompositionAndQuestionnaire(itemId, version);
+ return Objects.nonNull(componentEntities) && !componentEntities.isEmpty() &&
+ componentEntities.stream().anyMatch(this::checkNfcParams);
+ }
+
+ private boolean checkNfcParams(ComponentEntity componentEntity) {
+ final String compositionData = componentEntity.getCompositionData();
+ if (!StringUtils.isEmpty(compositionData)) {
+ JsonParser jsonParser = new JsonParser();
+ JsonObject json = (JsonObject) jsonParser.parse(compositionData);
+ return Objects.nonNull(json.get(VFC_CODE)) || Objects.nonNull(json.get(NFC_FUNCTION));
+ }
+ return false;
+ }
+
+ @Override
+ public void heal(String itemId, Version version) throws Exception {
+ final Collection<ComponentEntity> componentEntities =
+ componentDao.listCompositionAndQuestionnaire(itemId, version);
+ if (Objects.nonNull(componentEntities) && !componentEntities.isEmpty()) {
+ componentEntities.forEach(componentEntity -> {
+ final String compositionData = componentEntity.getCompositionData();
+ updateComponentData(itemId, version, componentEntity, componentEntity.getQuestionnaireData(), compositionData);
+ });
+ }
+ }
+
+ private void updateComponentData(String itemId, Version version, ComponentEntity componentEntity,
+ String questionnaireData, String compositionData) {
+ if (!StringUtils.isEmpty(compositionData)) {
+ JsonParser jsonParser = new JsonParser();
+ JsonObject json = (JsonObject) jsonParser.parse(compositionData);
+ JsonObject questionnaireJson = (JsonObject) jsonParser.parse(questionnaireData);
+ moveAttribute(json, questionnaireJson, questionnaireJson.getAsJsonObject(GENERAL), VFC_CODE,
+ NFC_NAMING_CODE);
+ moveAttribute(json, questionnaireJson, questionnaireJson.getAsJsonObject(GENERAL), NFC_FUNCTION,
+ NFC_FUNCTION);
+ componentEntity.setCompositionData(json.toString());
+ componentDao.update(componentEntity);
+ componentEntity.setQuestionnaireData(questionnaireJson.toString());
+ componentDao.updateQuestionnaireData(itemId,version,componentEntity.getId(), questionnaireJson.toString());
+ }
+ }
+
+ private static void moveAttribute(JsonObject compositionJsonObj, JsonObject questJsonObject,
+ JsonObject general, String compositionAttrName, String questAttrName ) {
+ if (Objects.nonNull(compositionJsonObj.get(compositionAttrName))) {
+ if (general == null) {
+ general = new JsonObject();
+ }
+ general.addProperty(questAttrName, compositionJsonObj.get(compositionAttrName).getAsString());
+ questJsonObject.add(GENERAL, general);
+ compositionJsonObj.remove(compositionAttrName);
+ }
+ }
+}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java
index add04164c2..80e469771d 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java
@@ -21,8 +21,8 @@ import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MANDATO
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MAX_INSTANCES;
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MIN_INSTANCES;
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_CODE;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_FUNCTION;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_NAMING_CODE;
+import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.NFC_FUNCTION;
+import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.NFC_NAMING_CODE;
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VM_TYPE_TAG;
import static org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType.NATIVE_NODE;
import static org.openecomp.sdc.tosca.datatypes.ToscaNodeType.VFC_ABSTRACT_SUBSTITUTE;
@@ -70,7 +70,7 @@ public class AbstractSubstituteToscaEnricher {
final Map<String, List<String>> sourceToTargetDependencies = componentQuestionnaireData
.populateDependencies(vspId, version,
componentQuestionnaireData
- .getSourceToTargetComponent());
+ .getSourceToTargetComponent());
Map<String, List<ErrorMessage>> errors = new HashMap<>();
final ServiceTemplate serviceTemplate =
@@ -124,15 +124,15 @@ public class AbstractSubstituteToscaEnricher {
getValueFromQuestionnaireDetails(componentProperties, componentDisplayName,
HIGH_AVAIL_MODE));
- setProperty(nodeTemplate, VFC_NAMING_CODE,
+ setProperty(nodeTemplate, NFC_NAMING_CODE,
getValueFromQuestionnaireDetails(componentProperties, componentDisplayName,
- VFC_NAMING_CODE));
+ NFC_NAMING_CODE));
setProperty(nodeTemplate, VFC_CODE,
getValueFromQuestionnaireDetails(componentProperties, componentDisplayName, VFC_CODE));
- setProperty(nodeTemplate, VFC_FUNCTION,
- getValueFromQuestionnaireDetails(componentProperties, componentDisplayName, VFC_FUNCTION));
+ setProperty(nodeTemplate, NFC_FUNCTION,
+ getValueFromQuestionnaireDetails(componentProperties, componentDisplayName, NFC_FUNCTION));
if (componentProperties.get(componentDisplayName).get(MIN_INSTANCES) != null) {
nodeTemplate.getProperties().put(MIN_INSTANCES,
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireData.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireData.java
index 9ebe9e5e67..78242a6c61 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireData.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ComponentQuestionnaireData.java
@@ -1,5 +1,20 @@
-package org.openecomp.sdc.enrichment.impl.tosca;
+/*
+ * 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.enrichment.impl.tosca;
import org.openecomp.core.utilities.json.JsonUtil;
import org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants;
@@ -23,7 +38,7 @@ import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.HIGH_AV
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MANDATORY;
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MAX_INSTANCES;
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MIN_INSTANCES;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_NAMING_CODE;
+import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.NFC_NAMING_CODE;
public class ComponentQuestionnaireData {
@@ -64,16 +79,13 @@ public class ComponentQuestionnaireData {
sourceToTarget.put(component.getId(), componentData.getDisplayName());
- String vfc_code = componentData != null ? componentData.getVfcCode() : null;
- questionnaireParams.put(VFC_NAMING_CODE, vfc_code);
-
- String nfcCode = componentData.getNfcCode() != null ? componentData.getNfcCode() : null;
- questionnaireParams.put(EnrichmentConstants.VFC_CODE, nfcCode);
+ String nfcNamingCode = componentQuestionnaire.getGeneral().getNfcNamingCode() != null ?
+ componentQuestionnaire.getGeneral().getNfcNamingCode() : null;
+ questionnaireParams.put(NFC_NAMING_CODE, nfcNamingCode);
- String vfcDescription =
- componentData.getNfcFunction() != null ? componentData.getNfcFunction() :
- null;
- questionnaireParams.put(EnrichmentConstants.VFC_FUNCTION, vfcDescription);
+ String vfcDescription = componentQuestionnaire.getGeneral().getNfcFunction() != null ?
+ componentQuestionnaire.getGeneral().getNfcFunction() : null;
+ questionnaireParams.put(EnrichmentConstants.NFC_FUNCTION, vfcDescription);
if (componentQuestionnaire.getHighAvailabilityAndLoadBalancing() != null) {
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/util/EnrichmentConstants.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/util/EnrichmentConstants.java
index 036d64014a..18d28afb07 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/util/EnrichmentConstants.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/util/EnrichmentConstants.java
@@ -1,14 +1,34 @@
+/*
+ * 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.enrichment.impl.util;
public class EnrichmentConstants {
- public static final String VFC_NAMING_CODE = "nfc_naming_code";
+ public static final String NFC_NAMING_CODE = "nfc_naming_code";
public static final String MANDATORY = "mandatory";
public static final String HIGH_AVAIL_MODE = "high_availablity";
public static final String MIN_INSTANCES = "min_instances";
public static final String MAX_INSTANCES = "max_instances";
public static final String VM_TYPE_TAG = "vm_type_tag";
public static final String VFC_CODE = "nfc_code";
- public static final String VFC_FUNCTION = "nfc_function";
+ public static final String NFC_FUNCTION = "nfc_function";
+
+ private EnrichmentConstants() {
+
+ }
}
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricherTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricherTest.java
index 11cab5f0a5..d2fb48cb7d 100644
--- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricherTest.java
+++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricherTest.java
@@ -7,8 +7,8 @@ import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MANDATO
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MAX_INSTANCES;
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.MIN_INSTANCES;
import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_CODE;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_FUNCTION;
-import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.VFC_NAMING_CODE;
+import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.NFC_FUNCTION;
+import static org.openecomp.sdc.enrichment.impl.util.EnrichmentConstants.NFC_NAMING_CODE;
import org.apache.commons.collections.map.HashedMap;
import org.mockito.InjectMocks;
@@ -57,9 +57,9 @@ public class AbstractSubstituteToscaEnricherTest extends BaseToscaEnrichmentTest
Map<String, Object> innerProps = new HashMap<>();
innerProps.put(MANDATORY, "YES");
innerProps.put(HIGH_AVAIL_MODE, "geo-activestandby");
- innerProps.put(VFC_NAMING_CODE, "Code1");
+ innerProps.put(NFC_NAMING_CODE, "Code1");
innerProps.put(VFC_CODE, "pd_server_code");
- innerProps.put(VFC_FUNCTION, "pd_server_description");
+ innerProps.put(NFC_FUNCTION, "pd_server_description");
innerProps.put(MIN_INSTANCES, 1);
innerProps.put(MAX_INSTANCES, 2);
@@ -99,9 +99,9 @@ public class AbstractSubstituteToscaEnricherTest extends BaseToscaEnrichmentTest
Map<String, Object> innerProps = new HashedMap();
innerProps.put(MANDATORY, "NO");
innerProps.put(HIGH_AVAIL_MODE, "");
- innerProps.put(VFC_NAMING_CODE, "pd_server_code1");
+ innerProps.put(NFC_NAMING_CODE, "pd_server_code1");
innerProps.put(VFC_CODE, "pd_server_code");
- innerProps.put(VFC_FUNCTION, "pd_server_description");
+ innerProps.put(NFC_FUNCTION, "pd_server_description");
innerProps.put(MIN_INSTANCES, null);
innerProps.put(MAX_INSTANCES, null);
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java
index ba06d42fea..ec2b07b5cd 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComponentData.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.types.composition;
@@ -24,9 +20,6 @@ public class ComponentData implements CompositionDataEntity {
private String name;
private String description;
private String displayName;
- private String vfcCode;
- private String nfcCode;
- private String nfcFunction;
public String getName() {
return name;
@@ -52,22 +45,6 @@ public class ComponentData implements CompositionDataEntity {
this.displayName = displayName;
}
- public String getNfcCode() {
- return nfcCode;
- }
-
- public void setNfcCode(String nfcCode) {
- this.nfcCode = nfcCode;
- }
-
- public String getNfcFunction() {
- return nfcFunction;
- }
-
- public void setNfcFunction(String nfcFunction) {
- this.nfcFunction = nfcFunction;
- }
-
@Override
public int hashCode() {
int result = name.hashCode();
@@ -96,12 +73,4 @@ public class ComponentData implements CompositionDataEntity {
return displayName != null ? displayName.equals(that.displayName) : that.displayName == null;
}
-
- public String getVfcCode() {
- return vfcCode;
- }
-
- public void setVfcCode(String vfcCode) {
- this.vfcCode = vfcCode;
- }
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/General.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/General.java
index 7d64906741..0129fe0981 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/General.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/questionnaire/component/general/General.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.types.questionnaire.component.general;
@@ -29,6 +25,8 @@ public class General {
protected Recovery recovery;
private String dnsConfiguration;
private String vmCloneUsage;
+ private String nfcNamingCode;
+ private String nfcFunction;
public Hypervisor getHypervisor() {
return hypervisor;
@@ -69,4 +67,20 @@ public class General {
public void setVmCloneUsage(String vmCloneUsage) {
this.vmCloneUsage = vmCloneUsage;
}
+
+ public String getNfcNamingCode() {
+ return nfcNamingCode;
+ }
+
+ public void setNfcNamingCode(String nfcNamingCode) {
+ this.nfcNamingCode = nfcNamingCode;
+ }
+
+ public String getNfcFunction() {
+ return nfcFunction;
+ }
+
+ public void setNfcFunction(String nfcFunction) {
+ this.nfcFunction = nfcFunction;
+ }
}
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java
index 1f92e6d957..65f9046fc0 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/schemagenerator/ComponentQuestionnaireSchemaInput.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.types.schemagenerator;
@@ -24,12 +20,17 @@ import java.util.List;
import java.util.Map;
public class ComponentQuestionnaireSchemaInput implements SchemaTemplateInput {
+ private String componentDisplayName;
+ private boolean manual;
private List<String> nicNames;
private Map componentQuestionnaireData;
- public ComponentQuestionnaireSchemaInput(List<String> nicNames, Map componentQuestionnaireData) {
+ public ComponentQuestionnaireSchemaInput(List<String> nicNames, Map componentQuestionnaireData,
+ String componentDisplayName, boolean manual) {
this.nicNames = nicNames;
this.componentQuestionnaireData = componentQuestionnaireData;
+ this.componentDisplayName = componentDisplayName;
+ this.manual = manual;
}
public List<String> getNicNames() {
@@ -39,4 +40,12 @@ public class ComponentQuestionnaireSchemaInput implements SchemaTemplateInput {
public Map getComponentQuestionnaireData() {
return componentQuestionnaireData;
}
+
+ public String getComponentDisplayName() {
+ return componentDisplayName;
+ }
+
+ public boolean isManual() {
+ return manual;
+ }
}
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/services/impl/composition/CompositionDataExtractorImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java
index e314f5cad8..0e76d8a01b 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.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.services.impl.composition;
@@ -342,7 +338,6 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor {
ComponentData component = new ComponentData();
component.setName(computeNodeType);
component.setDisplayName(getComponentDisplayName(component.getName()));
- component.setVfcCode(component.getDisplayName());
Component componentModel = new Component();
componentModel.setData(component);