Add collaboration feature
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-software-product-lib / openecomp-sdc-vendor-software-product-api / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / services / composition / CompositionEntityDataManager.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.vendorsoftwareproduct.services.composition;
22
23 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
24 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity;
25 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
26 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity;
27 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity;
28 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
29 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component;
30 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData;
31 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
32 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
33 import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
34 import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput;
35 import org.openecomp.sdc.versioning.dao.types.Version;
36
37 import java.util.Collection;
38 import java.util.Map;
39 import java.util.Set;
40
41 public interface CompositionEntityDataManager {
42
43   Map<CompositionEntityId, Collection<String>> validateEntitiesQuestionnaire();
44
45   void addEntity(CompositionEntity entity, SchemaTemplateInput schemaTemplateInput);
46
47   CompositionEntityValidationData validateEntity(CompositionEntity entity,
48                                                  SchemaTemplateContext schemaTemplateContext,
49                                                  SchemaTemplateInput schemaTemplateInput);
50
51   void buildTrees();
52
53   void addErrorsToTrees(Map<CompositionEntityId, Collection<String>> errors);
54
55   Set<CompositionEntityValidationData> getEntityListWithErrors();
56
57   Collection<CompositionEntityValidationData> getTrees();
58
59   void saveCompositionData(String vspId, Version version, CompositionData compositionData);
60
61   Set<CompositionEntityValidationData> getAllErrorsByVsp(String vspId);
62
63   void saveComponents(String vspId, Version version, CompositionData compositionData,
64                       Map<String, String> networkIdByName);
65
66   void saveNicsByComponent(String vspId, Version version, Map<String, String> networkIdByName,
67                            Component component, String componentId);
68
69   Map<String, String> saveNetworks(String vspId, Version version, CompositionData compositionData);
70
71   NetworkEntity createNetwork(NetworkEntity network);
72
73   ComponentEntity createComponent(ComponentEntity component);
74
75   NicEntity createNic(NicEntity nic);
76
77   DeploymentFlavorEntity createDeploymentFlavor(DeploymentFlavorEntity deploymentFlavor);
78
79   ImageEntity createImage(ImageEntity image);
80
81   void saveComputesFlavorByComponent(String vspId, Version version, Component component,
82                                      String componentId);
83
84   void saveImagesByComponent(String vspId, Version version, Component component,
85                              String componentId);
86
87 }