diff options
Diffstat (limited to 'src/main/java/org/onap/crud/dao')
-rw-r--r-- | src/main/java/org/onap/crud/dao/GraphDao.java | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/crud/dao/champ/ChampDao.java | 9 |
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. |