diff options
author | 2018-07-29 16:13:45 +0300 | |
---|---|---|
committer | 2018-07-29 16:20:34 +0300 | |
commit | 5b593496b8f1b8e8be8d7d2dbcc223332e65a49b (patch) | |
tree | 2f9dfc45191e723da69cf74be7829784e9741b94 /catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogicProvider.java | |
parent | 9200382f2ce7b4bb729aa287d0878004b2d2b4f9 (diff) |
re base code
Change-Id: I12a5ca14a6d8a87e9316b9ff362eb131105f98a5
Issue-ID: SDC-1566
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogicProvider.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogicProvider.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogicProvider.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogicProvider.java new file mode 100644 index 0000000000..3025084239 --- /dev/null +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentBusinessLogicProvider.java @@ -0,0 +1,37 @@ +package org.openecomp.sdc.be.components.impl; + +import org.openecomp.sdc.be.components.impl.exceptions.ComponentException; +import org.openecomp.sdc.be.config.BeEcompErrorManager; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.springframework.stereotype.Component; + +@Component +public class ComponentBusinessLogicProvider { + + private final ResourceBusinessLogic resourceBusinessLogic; + private final ServiceBusinessLogic serviceBusinessLogic; + private final ProductBusinessLogic productBusinessLogic; + + public ComponentBusinessLogicProvider(ResourceBusinessLogic resourceBusinessLogic, ServiceBusinessLogic serviceBusinessLogic, ProductBusinessLogic productBusinessLogic) { + this.resourceBusinessLogic = resourceBusinessLogic; + this.serviceBusinessLogic = serviceBusinessLogic; + this.productBusinessLogic = productBusinessLogic; + } + + public ComponentBusinessLogic getInstance(ComponentTypeEnum componentTypeEnum) { + switch (componentTypeEnum) { + case SERVICE: + return serviceBusinessLogic; + case PRODUCT: + return productBusinessLogic; + case RESOURCE: + case RESOURCE_INSTANCE: + return resourceBusinessLogic; + default: + BeEcompErrorManager.getInstance().logBeSystemError("getComponentBL"); + throw new ComponentException(ActionStatus.INVALID_CONTENT_PARAM, componentTypeEnum.getValue()); + } + } + +} |