90e01c3980e9b6275bc434c45f0653768b6e0d20
[sdc.git] /
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 org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
24 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
25 import org.openecomp.sdc.be.model.ComponentInstance;
26 import org.openecomp.sdc.be.model.ComponentInstanceInput;
27 import org.openecomp.sdc.be.model.ComponentInstanceProperty;
28 import org.openecomp.sdc.be.resources.data.ComponentInstanceData;
29
30 import fj.data.Either;
31
32 public interface IComponentInstanceOperation {
33
34         public Either<Integer, StorageOperationStatus> increaseAndGetResourceInstanceSpecificCounter(String resourceInstanceId, GraphPropertiesDictionary counterType, boolean inTransaction);
35
36         /**
37          * Adds Attribute to resource instance
38          * 
39          * @param resourceInstanceAttribute
40          *            * @param resourceInstanceId * @param index * @param inTransaction
41          * @return
42          **/
43         public Either<ComponentInstanceProperty, StorageOperationStatus> addAttributeValueToResourceInstance(ComponentInstanceProperty resourceInstanceAttribute, String resourceInstanceId, Integer index, boolean inTransaction);
44
45         /**
46          * Updates Attribute on resource instance
47          * 
48          * @param attribute
49          * @param resourceInstanceId
50          * @param inTransaction
51          * @return
52          */
53         public Either<ComponentInstanceProperty, StorageOperationStatus> updateAttributeValueInResourceInstance(ComponentInstanceProperty attribute, String resourceInstanceId, boolean inTransaction);
54
55
56         public Either<ComponentInstanceInput, StorageOperationStatus> addInputValueToResourceInstance(ComponentInstanceInput input, String resourceInstanceId, Integer innerElement, boolean b);
57
58         public Either<ComponentInstanceInput, StorageOperationStatus> updateInputValueInResourceInstance(ComponentInstanceInput input, String resourceInstanceId, boolean b);
59
60
61         public StorageOperationStatus updateCustomizationUUID(String componentInstanceId);
62         /**
63          * updates componentInstance modificationTime on graph node
64          * @param componentInstance
65          * @param componentInstanceType
66          * @param modificationTime
67          * @param inTransaction
68          * @return
69          */
70         public Either<ComponentInstanceData, StorageOperationStatus> updateComponentInstanceModificationTimeAndCustomizationUuidOnGraph(ComponentInstance componentInstance, NodeTypeEnum componentInstanceType, Long modificationTime, boolean inTransaction);
71
72 }