Refactoring Consolidation Service
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / property / PropertyDecelerator.java
1 package org.openecomp.sdc.be.components.property;
2
3 import java.util.List;
4
5 import org.openecomp.sdc.be.model.Component;
6 import org.openecomp.sdc.be.model.ComponentInstancePropInput;
7 import org.openecomp.sdc.be.model.InputDefinition;
8 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
9
10 import fj.data.Either;
11
12 public interface PropertyDecelerator {
13
14     /**
15      * creates a list of inputs from the given list of properties and updates the properties accordingly
16      * @param component the container
17      * @param propertiesOwnerId the id of the owner of the properties to declare (e.g ComponentInstance, Policy, Group etc)
18      * @param propsToDeclare the list of properties that are being declared as inputs
19      * @return the list of inputs that were created from the given properties
20      */
21     Either<List<InputDefinition>, StorageOperationStatus> declarePropertiesAsInputs(Component component, String propertiesOwnerId, List<ComponentInstancePropInput> propsToDeclare);
22
23     /**
24      * returns the values of declared properties to each original state before it was declared as an input.
25      * this function is to be called when an input, that was created by declaring a property, is deleted.
26      * @param component the container of the input to be deleted
27      * @param input the input to be deleted
28      */
29     StorageOperationStatus unDeclarePropertiesAsInputs(Component component, InputDefinition input);
30
31 }