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