From 5db1e77ef9e2c43fd723dc629346baf3660fdf1b Mon Sep 17 00:00:00 2001 From: Daniel Silverthorn Date: Tue, 6 Feb 2018 15:19:01 -0500 Subject: 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 --- src/main/java/org/onap/crud/dao/GraphDao.java | 4 ++-- src/main/java/org/onap/crud/dao/champ/ChampDao.java | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/main/java/org/onap/crud/dao') 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 getVertices(String type, Map filter) throws CrudException; + public List getVertices(String type, Map 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 getVertices(String type, Map filter, HashSet properties) throws CrudException; + public List getVertices(String type, Map filter, HashSet 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 getVertices(String type, Map filter) throws CrudException { - return getVertices(type, filter, new HashSet()); + public List getVertices(String type, Map filter, String version) throws CrudException { + return getVertices(type, filter, new HashSet(), version); } @Override - public List getVertices(String type, Map filter, HashSet properties) throws CrudException { + public List getVertices(String type, Map filter, HashSet properties, String version) throws CrudException { filter.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type); List 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>() { - }.getType()); + return Vertex.collectionFromJson(getResult.getResult(), version); } else { // We didn't find a vertex with the supplied id, so just throw an // exception. -- cgit 1.2.3-korg