diff options
Diffstat (limited to 'catalog-model')
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) { |