diff options
author | imamSidero <imam.hussain@est.tech> | 2022-10-24 17:20:46 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-10-25 13:05:19 +0000 |
commit | 3d79660270cc259688e0ba20150286c1680c7559 (patch) | |
tree | 72fbec98f6e785c4d1ff89c193c8d0778606fefe /catalog-model/src | |
parent | 47f96dd966663f7f46b719451c0752721a2940a3 (diff) |
Add default baseType to the substitution type
Enabling default baseType in substitution type to be selected
Issue-ID: SDC-4229
Signed-off-by: Imam hussain <imam.hussain@est.tech>
Change-Id: I869ede4c4e030adc3c4418c28ed787b4c10248dd
Diffstat (limited to 'catalog-model/src')
2 files changed, 14 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 ebc563268e..e942ee1fde 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 @@ -96,6 +96,8 @@ public interface IElementOperation { */ boolean isBaseTypeRequired(String categoryName); + String getDefaultBaseType(String categoryName); + 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 127d778f73..bf74a264f8 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 @@ -426,6 +426,18 @@ public class ElementOperation implements IElementOperation { private Configuration getConfiguration() { return ConfigurationManager.getConfigurationManager().getConfiguration(); } + @Override + public String getDefaultBaseType(final String categoryName) { + final Map<String, CategoryBaseTypeConfig> categoriesSpecificBaseTypeMap = getConfiguration().getServiceBaseNodeTypes(); + if (MapUtils.isEmpty(categoriesSpecificBaseTypeMap)) { + return null; + } + final CategoryBaseTypeConfig categoryBaseTypeConfig = categoriesSpecificBaseTypeMap.get(categoryName); + if (categoryBaseTypeConfig == null) { + return null; + } + return categoryBaseTypeConfig.getDefaultBaseType(); + } @Override public boolean isBaseTypeRequired(final String categoryName) { |