Add default baseType to the substitution type
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / impl / ElementBusinessLogic.java
index 42fa95e..176cded 100644 (file)
@@ -1291,6 +1291,26 @@ public class ElementBusinessLogic extends BaseBusinessLogic {
         if (ActionStatus.OK != status) {
             return Either.right(status);
         }
-        return Either.left(elementOperation.getBaseTypes(categoryName, modelName));
+        return Either.left(elementOperation.getServiceBaseTypes(categoryName, modelName));
+    }
+
+    /**
+     * Checks if a category requires a base type.
+     *
+     * @param categoryName the category name
+     * @return {@code true} if a base type is required, {@code false} otherwise.
+     */
+    public boolean isBaseTypeRequired(final String categoryName) {
+        return elementOperation.isBaseTypeRequired(categoryName);
+    }
+
+    /**
+     * Fetches default baseType from the template.
+     *
+     * @param categoryName the category name
+     * @return defaultBaseType mapped to the corresponding category name.
+     */
+    public String getDefaultBaseType(final String categoryName) {
+        return elementOperation.getDefaultBaseType(categoryName);
     }
 }