c4cb95808a76fbf4200d80150b99de1ef8062fbb
[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.vendorsoftwareproduct;
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.NicEntity;
28 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component;
29 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData;
30 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId;
31 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
32 import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext;
33 import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput;
34 import org.openecomp.sdc.versioning.dao.types.Version;
35
36 import java.util.Collection;
37 import java.util.Map;
38 import java.util.Set;
39
40 public interface CompositionEntityDataManager {
41
42   Map<CompositionEntityId, Collection<String>> validateEntitiesQuestionnaire();
43
44   void addEntity(CompositionEntity entity, SchemaTemplateInput schemaTemplateInput);
45
46   CompositionEntityValidationData validateEntity(CompositionEntity entity,
47                                                  SchemaTemplateContext schemaTemplateContext,
48                                                  SchemaTemplateInput schemaTemplateInput);
49
50   void buildTrees();
51
52   void addErrorsToTrees(Map<CompositionEntityId, Collection<String>> errors);
53
54   Set<CompositionEntityValidationData> getEntityListWithErrors();
55
56   Collection<CompositionEntityValidationData> getTrees();
57
58   void saveCompositionData(String vspId, Version version, CompositionData compositionData);
59
60   Set<CompositionEntityValidationData> getAllErrorsByVsp(String vspId);
61
62   ComponentEntity createComponent(ComponentEntity component);
63
64   NicEntity createNic(NicEntity nic);
65
66   DeploymentFlavorEntity createDeploymentFlavor(DeploymentFlavorEntity deploymentFlavor);
67
68   ImageEntity createImage(ImageEntity image);
69
70   void saveComputesFlavorByComponent(String vspId, Version version, Component component,
71                                      String componentId);
72
73   void saveImagesByComponent(String vspId, Version version, Component component,
74                              String componentId);
75
76 }