Reduce the number of problems in aai-common by removing unused imports
[aai/aai-common.git] / aai-schema-abstraction / src / main / java / org / onap / aai / schemaif / SchemaProvider.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
6  * Copyright © 2019 Amdocs
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.aai.schemaif;
23
24 import java.util.Map;
25 import java.util.Set;
26
27 import org.onap.aai.schemaif.definitions.EdgeSchema;
28 import org.onap.aai.schemaif.definitions.VertexSchema;
29
30 public interface SchemaProvider {
31
32     /**
33      * Load the schema into memory
34      */
35     void loadSchema() throws SchemaProviderException;
36
37     /**
38      * Get the identifier for the more recent version of the schema
39      *
40      * @return The schema version identifier
41      */
42     String getLatestSchemaVersion() throws SchemaProviderException;
43
44     /**
45      * Get the schema definition for a vertex
46      *
47      * @param vertexName - Name of the vertex
48      * @param schemaVersion - Version of the schema to use
49      *
50      * @return The vertex schema definition
51      */
52     VertexSchema getVertexSchema(String vertexName, String schemaVersion) throws SchemaProviderException;
53
54     /**
55      * Get the schema definition for an edge
56      *
57      * @param edgeType - Type of the edge
58      * @param sourceVertex - The source vertex for the edge
59      * @param targetVertex - The target vertex for the edge
60      * @param version - Version of the schema to use
61      *
62      * @return The edge schema definition
63      */
64     EdgeSchema getEdgeSchema(String edgeType, String sourceVertex, String targetVertex, String version)
65             throws SchemaProviderException;
66
67     /**
68      * Get the list of edge definitions which are adjacent to the given vertex
69      *
70      * @param vertexType - Type of the vertex
71      * @param version - Version of the schema to use
72      *
73      * @return The list of edge schema definitions
74      */
75     Set<EdgeSchema> getAdjacentEdgeSchema(String vertexType, String version) throws SchemaProviderException;
76
77     /**
78      * Get the list of edge definitions which are valid for the given source and target
79      *
80      * @param sourceType - Type of the source vertex
81      * @param targetType - Type of the target vertex
82      * @param version - Version of the schema to use
83      *
84      * @return The list of edge schema definitions
85      */
86     Set<EdgeSchema> getEdgeSchemaForSourceTarget(String sourceType, String targetType, String version)
87             throws SchemaProviderException;
88
89     /**
90      * Get vertex map for a schema version
91      *
92      * @param schemaVersion - Version of the schema to use
93      *
94      * @return The list of vertex types
95      */
96     Map<String, VertexSchema> getVertexMap(String schemaVersion) throws SchemaProviderException;
97 }