Update license date and text
[aai/gizmo.git] / src / main / java / org / onap / crud / dao / GraphDao.java
index c62a788..29ea6da 100644 (file)
@@ -1,16 +1,15 @@
 /**
  * ============LICENSE_START=======================================================
- * Gizmo
+ * org.onap.aai
  * ================================================================================
- * Copyright © 2017 AT&T Intellectual Property.
- * Copyright © 2017 Amdocs
- * All rights reserved.
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 Amdocs
  * ================================================================================
  * 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
+ *       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,
@@ -18,8 +17,6 @@
  * 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.onap.crud.dao;
 
@@ -34,9 +31,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, Map<String, String> queryParams) throws CrudException;
 
   /**
    * Retrieve all of the edges which are incident to the vertex with the
@@ -44,10 +41,12 @@ public interface GraphDao {
    *
    * @param id
    *          - The unique identifier of the vertex to retrieve the edges for.
+   * @param queryParams
+   *             - query parameters to be passed         
    * @return - A collection of edges.
    * @throws CrudException
    */
-  public List<Edge> getVertexEdges(String id) throws CrudException;
+  public List<Edge> getVertexEdges(String id, Map<String, String> queryParams) throws CrudException;
 
   /**
    * Retrieve a collection of {@link Vertex} objects which match the supplied
@@ -60,7 +59,7 @@ public interface GraphDao {
    * @return - A collection of vertices.
    * @throws CrudException
    */
-  public List<Vertex> getVertices(String type, Map<String, Object> filter) throws CrudException;
+  public List<Vertex> getVertices(String type, Map<String, Object> filter, String version) throws CrudException;
 
   /**
    * Retrieve a collection of {@link Vertex} objects which match the supplied
@@ -75,7 +74,7 @@ public interface GraphDao {
    * @return - A collection of vertices.
    * @throws CrudException
    */
-  public List<Vertex> getVertices(String type, Map<String, Object> filter, HashSet<String> properties) throws CrudException;
+  public List<Vertex> getVertices(String type, Map<String, Object> filter, HashSet<String> properties, String version) throws CrudException;
 
   /**
    * Retrieve an {@link Edge} from the graph database by specifying its unique
@@ -83,10 +82,14 @@ public interface GraphDao {
    *
    * @param id
    *          - The unique identifier for the Edge to be retrieved.
+   * @param type
+   *          - The type that we want to retrieve.
+   * @param queryParams
+   *             - query parameters to be passed                
    * @return - The Edge corresponding to the specified identifier.
    * @throws CrudException
    */
-  public Edge getEdge(String id, String type) throws CrudException;
+  public Edge getEdge(String id, String type, Map<String, String> queryParams) throws CrudException;
 
   /**
    * Retrieve a collection of {@link Edge} objects with a given type and which
@@ -111,7 +114,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}.
@@ -123,7 +126,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.
@@ -151,7 +154,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}.
@@ -182,12 +185,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;