Sync Integ to Master
[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 java.util.List;
24 import java.util.Map;
25
26 import org.apache.commons.lang3.tuple.ImmutablePair;
27 import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge;
28 import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
29 import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
30 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
31 import org.openecomp.sdc.be.model.ArtifactDefinition;
32 import org.openecomp.sdc.be.model.ComponentInstance;
33 import org.openecomp.sdc.be.model.ComponentInstanceInput;
34 import org.openecomp.sdc.be.model.ComponentInstanceProperty;
35 import org.openecomp.sdc.be.model.RelationshipInfo;
36 import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
37 import org.openecomp.sdc.be.model.User;
38 import org.openecomp.sdc.be.resources.data.AttributeValueData;
39 import org.openecomp.sdc.be.resources.data.CapabilityData;
40 import org.openecomp.sdc.be.resources.data.ComponentInstanceData;
41 import org.openecomp.sdc.be.resources.data.RequirementData;
42 import org.openecomp.sdc.exception.ResponseFormat;
43
44 import fj.data.Either;
45
46 public interface IComponentInstanceOperation {
47
48         public Either<Integer, StorageOperationStatus> increaseAndGetResourceInstanceSpecificCounter(String resourceInstanceId, GraphPropertiesDictionary counterType, boolean inTransaction);
49
50         /**
51          * Adds Attribute to resource instance
52          * 
53          * @param resourceInstanceAttribute
54          *            * @param resourceInstanceId * @param index * @param inTransaction
55          * @return
56          **/
57         public Either<ComponentInstanceProperty, StorageOperationStatus> addAttributeValueToResourceInstance(ComponentInstanceProperty resourceInstanceAttribute, String resourceInstanceId, Integer index, boolean inTransaction);
58
59         /**
60          * Updates Attribute on resource instance
61          * 
62          * @param attribute
63          * @param resourceInstanceId
64          * @param inTransaction
65          * @return
66          */
67         public Either<ComponentInstanceProperty, StorageOperationStatus> updateAttributeValueInResourceInstance(ComponentInstanceProperty attribute, String resourceInstanceId, boolean inTransaction);
68
69
70         public Either<ComponentInstanceInput, StorageOperationStatus> addInputValueToResourceInstance(ComponentInstanceInput input, String resourceInstanceId, Integer innerElement, boolean b);
71
72         public Either<ComponentInstanceInput, StorageOperationStatus> updateInputValueInResourceInstance(ComponentInstanceInput input, String resourceInstanceId, boolean b);
73
74
75         public StorageOperationStatus updateCustomizationUUID(String componentInstanceId);
76         /**
77          * updates componentInstance modificationTime on graph node
78          * @param componentInstance
79          * @param componentInstanceType
80          * @param modificationTime
81          * @param inTransaction
82          * @return
83          */
84         public Either<ComponentInstanceData, StorageOperationStatus> updateComponentInstanceModificationTimeAndCustomizationUuidOnGraph(ComponentInstance componentInstance, NodeTypeEnum componentInstanceType, Long modificationTime, boolean inTransaction);
85
86 }