diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java index 888ad2b71c..7353a1205f 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceMergeDataBusinessLogic.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,10 +17,10 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.components.merge.instance; import fj.data.Either; +import java.util.List; import org.openecomp.sdc.be.components.impl.exceptions.ByActionStatusComponentException; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.impl.ComponentsUtils; @@ -34,8 +34,6 @@ import org.openecomp.sdc.common.log.wrappers.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; -import java.util.List; - /** * Created by chaya on 9/12/2017. */ @@ -43,14 +41,11 @@ import java.util.List; public class ComponentInstanceMergeDataBusinessLogic { private static final Logger log = Logger.getLogger(ComponentInstanceMergeDataBusinessLogic.class); - @Autowired @Lazy private List<ComponentInstanceMergeInterface> componentInstancesMergeBLs; - @Autowired private ToscaOperationFacade toscaOperationFacade; - @Autowired private ComponentsUtils componentsUtils; @@ -61,10 +56,12 @@ public class ComponentInstanceMergeDataBusinessLogic { /** * Saves all containerComponents data before deleting, in order to merge once creating a new instance + * * @param containerComponent * @param currentResourceInstance */ - public DataForMergeHolder saveAllDataBeforeDeleting(org.openecomp.sdc.be.model.Component containerComponent, ComponentInstance currentResourceInstance, Component originComponent) { + public DataForMergeHolder saveAllDataBeforeDeleting(org.openecomp.sdc.be.model.Component containerComponent, + ComponentInstance currentResourceInstance, Component originComponent) { DataForMergeHolder dataHolder = new DataForMergeHolder(); for (ComponentInstanceMergeInterface compInstMergeBL : componentInstancesMergeBLs) { compInstMergeBL.saveDataBeforeMerge(dataHolder, containerComponent, currentResourceInstance, originComponent); @@ -74,14 +71,16 @@ public class ComponentInstanceMergeDataBusinessLogic { /** * Merges inputs and instance inputs/props of the new Container component with the old container component data (before deleting) + * * @param containerComponent * @param newContainerComponentId * @param newInstanceId * @return */ - public Component mergeComponentUserOrigData(User user, DataForMergeHolder dataHolder, org.openecomp.sdc.be.model.Component containerComponent, String newContainerComponentId, String newInstanceId) { - - Either<Component, StorageOperationStatus> componentWithInstancesInputsAndProperties = getComponentWithInstancesMergeEntities(newContainerComponentId); + public Component mergeComponentUserOrigData(User user, DataForMergeHolder dataHolder, org.openecomp.sdc.be.model.Component containerComponent, + String newContainerComponentId, String newInstanceId) { + Either<Component, StorageOperationStatus> componentWithInstancesInputsAndProperties = getComponentWithInstancesMergeEntities( + newContainerComponentId); if (componentWithInstancesInputsAndProperties.isRight()) { log.error("Component with id {} was not found", newContainerComponentId); StorageOperationStatus storageOperationStatus = componentWithInstancesInputsAndProperties.right().value(); @@ -89,7 +88,7 @@ public class ComponentInstanceMergeDataBusinessLogic { throw new ByActionStatusComponentException(actionStatus); } Component updatedContainerComponent = componentWithInstancesInputsAndProperties.left().value(); - componentInstancesMergeBLs.forEach(c-> c.mergeDataAfterCreate(user, dataHolder, updatedContainerComponent, newInstanceId)); + componentInstancesMergeBLs.forEach(c -> c.mergeDataAfterCreate(user, dataHolder, updatedContainerComponent, newInstanceId)); return updatedContainerComponent; } |