aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/crud/dao
diff options
context:
space:
mode:
authorDaniel Silverthorn <daniel.silverthorn@amdocs.com>2018-02-06 15:19:01 -0500
committerDaniel Silverthorn <daniel.silverthorn@amdocs.com>2018-02-06 15:23:57 -0500
commit5db1e77ef9e2c43fd723dc629346baf3660fdf1b (patch)
tree179f5e4a88c8cb2e45fb67307bf5038b84fdc626 /src/main/java/org/onap/crud/dao
parent4ff47ab5934ce146e194db88f3c0096f42b7d1d7 (diff)
Allow filtering by reserved properties
Allow filtering by reserved properties and return them in group and single gets Change-Id: I897a6e807d93f6fe9f6875519dd433e52c2a1705 Issue-ID: AAI-702 Signed-off-by: Daniel Silverthorn <daniel.silverthorn@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap/crud/dao')
-rw-r--r--src/main/java/org/onap/crud/dao/GraphDao.java4
-rw-r--r--src/main/java/org/onap/crud/dao/champ/ChampDao.java9
2 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/org/onap/crud/dao/GraphDao.java b/src/main/java/org/onap/crud/dao/GraphDao.java
index 7834bb2..283e1a1 100644
--- a/src/main/java/org/onap/crud/dao/GraphDao.java
+++ b/src/main/java/org/onap/crud/dao/GraphDao.java
@@ -60,7 +60,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 +75,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
diff --git a/src/main/java/org/onap/crud/dao/champ/ChampDao.java b/src/main/java/org/onap/crud/dao/champ/ChampDao.java
index cd0e66f..7174bfc 100644
--- a/src/main/java/org/onap/crud/dao/champ/ChampDao.java
+++ b/src/main/java/org/onap/crud/dao/champ/ChampDao.java
@@ -160,12 +160,12 @@ public class ChampDao implements GraphDao {
}
@Override
- public List<Vertex> getVertices(String type, Map<String, Object> filter) throws CrudException {
- return getVertices(type, filter, new HashSet<String>());
+ public List<Vertex> getVertices(String type, Map<String, Object> filter, String version) throws CrudException {
+ return getVertices(type, filter, new HashSet<String>(), version);
}
@Override
- 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 {
filter.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
List<NameValuePair> queryParams = convertToNameValuePair(filter);
@@ -176,8 +176,7 @@ public class ChampDao implements GraphDao {
OperationResult getResult = client.get(url, createHeader(), MediaType.APPLICATION_JSON_TYPE);
if (getResult.getResultCode() == 200) {
- return champGson.fromJson(getResult.getResult(), new TypeToken<List<Vertex>>() {
- }.getType());
+ return Vertex.collectionFromJson(getResult.getResult(), version);
} else {
// We didn't find a vertex with the supplied id, so just throw an
// exception.