summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-model/src/main/java')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/config/ContainerInstanceTypesData.java18
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java6
2 files changed, 19 insertions, 5 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/config/ContainerInstanceTypesData.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/config/ContainerInstanceTypesData.java
index 341d5222a1..a355aa9607 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/config/ContainerInstanceTypesData.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/config/ContainerInstanceTypesData.java
@@ -47,8 +47,8 @@ public class ContainerInstanceTypesData {
* @param resourceTypeToCheck the resource instance type that will be added to the container component
* @return {@code true} if the resource instance is allowed, {@code false} otherwise
*/
- public boolean isAllowedForServiceComponent(final ResourceTypeEnum resourceTypeToCheck) {
- final List<String> allowedResourceInstanceTypeList = getComponentAllowedList(ComponentTypeEnum.SERVICE, null);
+ public boolean isAllowedForServiceComponent(final ResourceTypeEnum resourceTypeToCheck, final String modelName) {
+ final List<String> allowedResourceInstanceTypeList = getServiceAllowedList(modelName);
if (CollectionUtils.isEmpty(allowedResourceInstanceTypeList)) {
return false;
}
@@ -69,6 +69,20 @@ public class ContainerInstanceTypesData {
}
return allowedResourceInstanceTypeList.contains(resourceToCheck.getValue());
}
+
+ /**
+ * Gets the list of allowed component instances for a service of the given model.
+ *
+ * @param model the model
+ * @return the list of allowed component instances
+ */
+ public List<String> getServiceAllowedList(final String modelName) {
+ List<String> allowedInstanceResourceType = getComponentAllowedList(ComponentTypeEnum.SERVICE, null);
+ if (modelName == null || modelName.isEmpty() || modelName.equals("SDC AID")){
+ allowedInstanceResourceType.remove("VFC");
+ }
+ return allowedInstanceResourceType;
+ }
/**
* Gets the list of allowed component instances for a component type.
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java
index 2dcc4362d9..d477b8ce6a 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacade.java
@@ -2150,11 +2150,11 @@ public class ToscaOperationFacade {
}
private void fillNodeTypePropsMap(final Map<GraphPropertyEnum, Object> hasProps, final Map<GraphPropertyEnum, Object> hasNotProps,
- final String internalComponentType) {
+ final String internalComponentType, String modelName) {
final Configuration configuration = ConfigurationManager.getConfigurationManager().getConfiguration();
final List<String> allowedTypes;
if (ComponentTypeEnum.SERVICE.getValue().equalsIgnoreCase(internalComponentType)) {
- allowedTypes = containerInstanceTypesData.getComponentAllowedList(ComponentTypeEnum.SERVICE, null);
+ allowedTypes = containerInstanceTypesData.getServiceAllowedList(modelName);
} else {
final ResourceTypeEnum resourceType = ResourceTypeEnum.getTypeIgnoreCase(internalComponentType);
allowedTypes = containerInstanceTypesData.getComponentAllowedList(ComponentTypeEnum.RESOURCE, resourceType);
@@ -2197,7 +2197,7 @@ public class ToscaOperationFacade {
if (VertexTypeEnum.NODE_TYPE == internalVertexType) {
hasProps.put(GraphPropertyEnum.IS_ABSTRACT, isAbstract);
if (internalComponentType != null) {
- fillNodeTypePropsMap(hasProps, hasNotProps, internalComponentType);
+ fillNodeTypePropsMap(hasProps, hasNotProps, internalComponentType, modelName);
}
} else {
fillTopologyTemplatePropsMap(hasProps, hasNotProps, componentTypeEnum);