Fix issue with patch requests
[aai/gizmo.git] / src / main / java / org / onap / crud / dao / GraphDao.java
index bc42b15..7834bb2 100644 (file)
@@ -23,6 +23,7 @@
  */
 package org.onap.crud.dao;
 
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 
@@ -33,9 +34,9 @@ import org.onap.crud.exception.CrudException;
 
 public interface GraphDao {
 
-  public Vertex getVertex(String id) throws CrudException;
+  public Vertex getVertex(String id, String version) throws CrudException;
 
-  public Vertex getVertex(String id, String type) throws CrudException;
+  public Vertex getVertex(String id, String type, String version) throws CrudException;
 
   /**
    * Retrieve all of the edges which are incident to the vertex with the
@@ -61,6 +62,21 @@ public interface GraphDao {
    */
   public List<Vertex> getVertices(String type, Map<String, Object> filter) 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.
+   * @param properties
+   *          - The properties to retrieve with the vertex
+   * @return - A collection of vertices.
+   * @throws CrudException
+   */
+  public List<Vertex> getVertices(String type, Map<String, Object> filter, HashSet<String> properties) throws CrudException;
+
   /**
    * Retrieve an {@link Edge} from the graph database by specifying its unique
    * identifier.
@@ -95,7 +111,7 @@ public interface GraphDao {
    * @return - The {@link Vertex} object that was created.
    * @throws CrudException
    */
-  public Vertex addVertex(String type, Map<String, Object> properties) throws CrudException;
+  public Vertex addVertex(String type, Map<String, Object> properties, String version) throws CrudException;
 
   /**
    * Updates an existing {@link Vertex}.
@@ -107,7 +123,7 @@ public interface GraphDao {
    * @return - The udpated vertex.
    * @throws CrudException
    */
-  public Vertex updateVertex(String id, String type, Map<String, Object> properties) throws CrudException;
+  public Vertex updateVertex(String id, String type, Map<String, Object> properties, String version) throws CrudException;
 
   /**
    * Removes the specified vertex from the graph data base.
@@ -135,7 +151,7 @@ public interface GraphDao {
    * @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;
+  public Edge addEdge(String type, Vertex source, Vertex target, Map<String, Object> properties, String version) throws CrudException;
 
   /**
    * Updates an existing {@link Edge}.
@@ -166,12 +182,12 @@ public interface GraphDao {
 
   public boolean transactionExists(String id) throws CrudException;
 
-  public Vertex addVertex(String type, Map<String, Object> properties, String txId) throws CrudException;
+  public Vertex addVertex(String type, Map<String, Object> properties, String version, String txId) throws CrudException;
 
-  public Edge addEdge(String type, Vertex source, Vertex target, Map<String, Object> properties, String txId)
+  public Edge addEdge(String type, Vertex source, Vertex target, Map<String, Object> properties, String version, String txId)
       throws CrudException;
 
-  public Vertex updateVertex(String id, String type, Map<String, Object> properties, String txId) throws CrudException;
+  public Vertex updateVertex(String id, String type, Map<String, Object> properties, String version, String txId) throws CrudException;
 
   public Edge updateEdge(Edge edge, String txId) throws CrudException;