CSIT Fix for SDC-2585
[sdc.git] / catalog-model / src / main / java / org / openecomp / sdc / be / model / operations / api / IComponentInstanceOperation.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.model.operations.api;
22
23 import fj.data.Either;
24 import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
25 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
26 import org.openecomp.sdc.be.model.ComponentInstance;
27 import org.openecomp.sdc.be.model.ComponentInstanceInput;
28 import org.openecomp.sdc.be.model.ComponentInstanceProperty;
29 import org.openecomp.sdc.be.resources.data.ComponentInstanceData;
30
31 public interface IComponentInstanceOperation {
32
33     public Either<Integer, StorageOperationStatus> increaseAndGetResourceInstanceSpecificCounter(String resourceInstanceId, GraphPropertiesDictionary counterType, boolean inTransaction);
34
35     /**
36      * Adds Attribute to resource instance
37      *
38      * @param resourceInstanceAttribute
39      *            * @param resourceInstanceId * @param index * @param inTransaction
40      * @return
41      **/
42     public Either<ComponentInstanceProperty, StorageOperationStatus> addAttributeValueToResourceInstance(ComponentInstanceProperty resourceInstanceAttribute, String resourceInstanceId, Integer index, boolean inTransaction);
43
44     /**
45      * Updates Attribute on resource instance
46      *
47      * @param attribute
48      * @param resourceInstanceId
49      * @param inTransaction
50      * @return
51      */
52     public Either<ComponentInstanceProperty, StorageOperationStatus> updateAttributeValueInResourceInstance(ComponentInstanceProperty attribute, String resourceInstanceId, boolean inTransaction);
53
54
55     public Either<ComponentInstanceInput, StorageOperationStatus> addInputValueToResourceInstance(ComponentInstanceInput input, String resourceInstanceId, Integer innerElement, boolean b);
56
57     public Either<ComponentInstanceInput, StorageOperationStatus> updateInputValueInResourceInstance(ComponentInstanceInput input, String resourceInstanceId, boolean b);
58
59
60     public StorageOperationStatus updateCustomizationUUID(String componentInstanceId);
61     /**
62      * updates componentInstance modificationTime on graph node
63      * @param componentInstance
64      * @param componentInstanceType
65      * @param modificationTime
66      * @param inTransaction
67      * @return
68      */
69     public Either<ComponentInstanceData, StorageOperationStatus> updateComponentInstanceModificationTimeAndCustomizationUuidOnGraph(ComponentInstance componentInstance, NodeTypeEnum componentInstanceType, Long modificationTime, boolean inTransaction);
70
71 }