2 * ============LICENSE_START=======================================================
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
22 package org.onap.aai.schemaif;
27 import org.onap.aai.schemaif.definitions.EdgeSchema;
28 import org.onap.aai.schemaif.definitions.VertexSchema;
30 public interface SchemaProvider {
33 * Load the schema into memory
35 void loadSchema() throws SchemaProviderException;
38 * Get the identifier for the more recent version of the schema
40 * @return The schema version identifier
42 String getLatestSchemaVersion() throws SchemaProviderException;
45 * Get the schema definition for a vertex
47 * @param vertexName - Name of the vertex
48 * @param schemaVersion - Version of the schema to use
50 * @return The vertex schema definition
52 VertexSchema getVertexSchema(String vertexName, String schemaVersion) throws SchemaProviderException;
55 * Get the schema definition for an edge
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
62 * @return The edge schema definition
64 EdgeSchema getEdgeSchema(String edgeType, String sourceVertex, String targetVertex, String version)
65 throws SchemaProviderException;
68 * Get the list of edge definitions which are adjacent to the given vertex
70 * @param vertexType - Type of the vertex
71 * @param version - Version of the schema to use
73 * @return The list of edge schema definitions
75 Set<EdgeSchema> getAdjacentEdgeSchema(String vertexType, String version) throws SchemaProviderException;
78 * Get the list of edge definitions which are valid for the given source and target
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
84 * @return The list of edge schema definitions
86 Set<EdgeSchema> getEdgeSchemaForSourceTarget(String sourceType, String targetType, String version)
87 throws SchemaProviderException;
90 * Get vertex map for a schema version
92 * @param schemaVersion - Version of the schema to use
94 * @return The list of vertex types
96 Map<String, VertexSchema> getVertexMap(String schemaVersion) throws SchemaProviderException;