diff options
author | Shwetank Dave <shwetank.dave@amdocs.com> | 2017-08-02 17:10:38 -0400 |
---|---|---|
committer | Shwetank Dave <shwetank.dave@amdocs.com> | 2017-08-03 11:28:39 -0400 |
commit | e9c94429a8ada3e55854515060df817945b73d87 (patch) | |
tree | 3c5a9ac766d99570d542c1996f1321c99e5498e5 /src/main/java/org/openecomp/crud/dao/GraphDao.java | |
parent | 27ff75c77611a8bdae37c7c0092787938c63a786 (diff) |
[AAI-26] Adding gizmo data to the repository.
Change-Id: I183f837d45acbfe3c673fde1acf8768d5e3fd37b
Signed-off-by: Shwetank Dave <shwetank.dave@amdocs.com>
Diffstat (limited to 'src/main/java/org/openecomp/crud/dao/GraphDao.java')
-rw-r--r-- | src/main/java/org/openecomp/crud/dao/GraphDao.java | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/src/main/java/org/openecomp/crud/dao/GraphDao.java b/src/main/java/org/openecomp/crud/dao/GraphDao.java new file mode 100644 index 0000000..20b568c --- /dev/null +++ b/src/main/java/org/openecomp/crud/dao/GraphDao.java @@ -0,0 +1,138 @@ +/** + * ============LICENSE_START======================================================= + * Gizmo + * ================================================================================ + * Copyright © 2017 AT&T Intellectual Property. + * Copyright © 2017 Amdocs + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.openecomp.crud.dao; + +import org.openecomp.crud.entity.Edge; +import org.openecomp.crud.entity.Vertex; +import org.openecomp.crud.exception.CrudException; + +import java.util.List; +import java.util.Map; + +public interface GraphDao { + + public Vertex getVertex(String id, String type) throws CrudException; + + /** + * Retrieve all of the edges which are incident to the vertex with the specified identifier. + * + * @param id - The unique identifier of the vertex to retrieve the edges for. + * @return - A collection of edges. + * @throws CrudException + */ + public List<Edge> getVertexEdges(String id) throws CrudException; + + /** + * Retrieve a collection of {@link Vertex} objects which match the supplied type label + * and filter properties. + * + * @param type - The vertex type that we want to retrieve. + * @param filter - The parameters to filter our results by. + * @return - A collection of vertices. + * @throws CrudException + */ + public List<Vertex> getVertices(String type, Map<String, Object> filter) throws CrudException; + + /** + * Retrieve an {@link Edge} from the graph database by specifying its unique identifier. + * + * @param id - The unique identifier for the Edge to be retrieved. + * @return - The Edge corresponding to the specified identifier. + * @throws CrudException + */ + public Edge getEdge(String id, String type) throws CrudException; + + /** + * Retrieve a collection of {@link Edge} objects with a given type and which match a set of + * supplied filter parameters. + * + * @param type - The type of edges that we are interested in. + * @param filter - The parameters that we want to filter our edges by. + * @return - A collection of edges which match the supplied filter parameters. + * @throws CrudException + */ + public List<Edge> getEdges(String type, Map<String, Object> filter) throws CrudException; + + /** + * Insert a new {@link Vertex} into the graph data store. + * + * @param type - The type label to assign to the vertex. + * @param properties - The properties to associated with this vertex. + * @return - The {@link Vertex} object that was created. + * @throws CrudException + */ + public Vertex addVertex(String type, Map<String, Object> properties) throws CrudException; + + /** + * Updates an existing {@link Vertex}. + * + * @param id - The unique identifier of the vertex to be updated. + * @param properties - The properties to associate with the vertex. + * @return - The udpated vertex. + * @throws CrudException + */ + public Vertex updateVertex(String id, String type, Map<String, Object> properties) + throws CrudException; + + /** + * Removes the specified vertex from the graph data base. + * + * <p>NOTE: The vertex MUST contain NO incident edges before it can be deleted. + * + * @param id - The unique identifier of the vertex to be deleted. + * @throws CrudException + */ + public void deleteVertex(String id, String type) throws CrudException; + + /** + * Adds an edge to the graph database. + * + * @param type - The 'type' label to apply to the edge. + * @param source - The source vertex for this edge. + * @param target - The target vertex for this edge. + * @param properties - The properties map to associate with this edge. + * @return - The {@link Edge} object that was created. + * @throws CrudException + */ + public Edge addEdge(String type, Vertex source, Vertex target, Map<String, Object> properties) + throws CrudException; + + /** + * Updates an existing {@link Edge}. + * + * @param id - The unique identifier of the edge to be updated. + * @param properties - The properties to associate with the edge. + * @return - The update edge. + * @throws CrudException + */ + public Edge updateEdge(Edge edge) throws CrudException; + + /** + * Remove the specified edge from the graph data base. + * + * @param id - The unique identifier of the edge to be deleted. + * @throws CrudException + */ + public void deleteEdge(String id, String type) throws CrudException; +} |