summaryrefslogtreecommitdiffstats
path: root/catalog-model/src
diff options
context:
space:
mode:
authorshikha0203 <shivani.khare@est.tech>2023-03-22 11:52:31 +0000
committershikha0203 <shivani.khare@est.tech>2023-05-12 14:14:13 +0100
commitf21f1b1b1f474e311409693f5a49780101cb5bc5 (patch)
tree00d781848cd960267b05297310502f0d31559879 /catalog-model/src
parent5c909bca9391467ac075384f2bca5e1497265da8 (diff)
Enable using substitution mapping type directly
Issue-ID: SDC-4435 Signed-off-by: shikha0203 <shivani.khare@est.tech> Change-Id: Ia3120eb6f03ad861dc87de64a2cb81a61e048f4e
Diffstat (limited to 'catalog-model/src')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IElementOperation.java4
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ElementOperation.java12
2 files changed, 16 insertions, 0 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IElementOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IElementOperation.java
index e942ee1fde..05568b42f6 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IElementOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/api/IElementOperation.java
@@ -98,6 +98,10 @@ public interface IElementOperation {
String getDefaultBaseType(String categoryName);
+ default boolean isDoNotExtendBaseType(String categoryName) {
+ return false;
+ }
+
Either<CategoryDefinition, ActionStatus> getCategory(NodeTypeEnum nodeType, String categoryId);
Either<SubCategoryDefinition, ActionStatus> getSubCategoryUniqueForType(NodeTypeEnum nodeType, String normalizedName);
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ElementOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ElementOperation.java
index bf74a264f8..882a34dfed 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ElementOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ElementOperation.java
@@ -454,6 +454,18 @@ public class ElementOperation implements IElementOperation {
return categoryBaseTypeConfig.isRequired();
}
+ @Override
+ public boolean isDoNotExtendBaseType(final String categoryName) {
+ final Map<String, CategoryBaseTypeConfig> categoriesSpecificBaseTypeMap = getConfiguration().getServiceBaseNodeTypes();
+ if (MapUtils.isEmpty(categoriesSpecificBaseTypeMap)) {
+ return false;
+ }
+ final CategoryBaseTypeConfig categoryBaseTypeConfig = categoriesSpecificBaseTypeMap.get(categoryName);
+ if (categoryBaseTypeConfig == null) {
+ return false;
+ }
+ return categoryBaseTypeConfig.isDoNotExtendBaseType();
+ }
private List<String> getCategoryBaseTypes(final String categoryName) {
final Optional<CategoryBaseTypeConfig> categoryBaseTypeConfigOptional = getCategoryBaseTypeConfig(categoryName);
if (categoryBaseTypeConfigOptional.isEmpty()) {