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;
24 import java.util.List;
28 import org.onap.aai.schemaif.definitions.EdgeSchema;
29 import org.onap.aai.schemaif.definitions.VertexSchema;
31 public interface SchemaProvider {
34 * Load the schema into memory
36 public void loadSchema() throws SchemaProviderException;
39 * Get the identifier for the more recent version of the schema
41 * @return The schema version identifier
43 public String getLatestSchemaVersion() throws SchemaProviderException;
46 * Get the schema definition for a vertex
48 * @param vertexName - Name of the vertex
49 * @param schemaVersion - Version of the schema to use
51 * @return The vertex schema definition
53 public VertexSchema getVertexSchema(String vertexName, String schemaVersion) throws SchemaProviderException;
56 * Get the schema definition for an edge
58 * @param edgeType - Type of the edge
59 * @param sourceVertex - The source vertex for the edge
60 * @param targetVertex - The target vertex for the edge
61 * @param schemaVersion - Version of the schema to use
63 * @return The edge schema definition
65 public EdgeSchema getEdgeSchema(String edgeType, String sourceVertex, String targetVertex, String version) 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 schemaVersion - Version of the schema to use
73 * @return The list of edge schema definitions
75 public 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 schemaVersion - Version of the schema to use
84 * @return The list of edge schema definitions
86 public Set<EdgeSchema> getEdgeSchemaForSourceTarget(String sourceType, String targetType, String version) throws SchemaProviderException;
89 * Get vertex map for a schema version
91 * @param schemaVersion - Version of the schema to use
93 * @return The list of vertex types
95 public Map<String, VertexSchema> getVertexMap(String schemaVersion) throws SchemaProviderException;