summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'cps-service/src/main/java')
-rw-r--r--cps-service/src/main/java/org/onap/cps/api/CpsAdminService.java9
-rw-r--r--cps-service/src/main/java/org/onap/cps/api/impl/CpsAdminServiceImpl.java6
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java10
3 files changed, 25 insertions, 0 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/api/CpsAdminService.java b/cps-service/src/main/java/org/onap/cps/api/CpsAdminService.java
index 98ea8ebd8d..a2c05bfe5a 100644
--- a/cps-service/src/main/java/org/onap/cps/api/CpsAdminService.java
+++ b/cps-service/src/main/java/org/onap/cps/api/CpsAdminService.java
@@ -20,6 +20,7 @@
package org.onap.cps.api;
+import java.util.Collection;
import org.onap.cps.spi.exceptions.CpsException;
import org.onap.cps.spi.model.Anchor;
@@ -36,4 +37,12 @@ public interface CpsAdminService {
* @throws CpsException if input data is invalid.
*/
String createAnchor(Anchor anchor);
+
+ /**
+ * Read all anchors in the given a dataspace.
+ *
+ * @param dataspaceName dataspace name
+ * @return a collection of anchors
+ */
+ Collection<Anchor> getAnchors(String dataspaceName);
}
diff --git a/cps-service/src/main/java/org/onap/cps/api/impl/CpsAdminServiceImpl.java b/cps-service/src/main/java/org/onap/cps/api/impl/CpsAdminServiceImpl.java
index b4deef6785..5d9bc015fd 100644
--- a/cps-service/src/main/java/org/onap/cps/api/impl/CpsAdminServiceImpl.java
+++ b/cps-service/src/main/java/org/onap/cps/api/impl/CpsAdminServiceImpl.java
@@ -20,6 +20,7 @@
package org.onap.cps.api.impl;
+import java.util.Collection;
import org.onap.cps.api.CpsAdminService;
import org.onap.cps.spi.CpsAdminPersistenceService;
import org.onap.cps.spi.model.Anchor;
@@ -36,4 +37,9 @@ public class CpsAdminServiceImpl implements CpsAdminService {
public String createAnchor(final Anchor anchor) {
return cpsAdminPersistenceService.createAnchor(anchor);
}
+
+ @Override
+ public Collection<Anchor> getAnchors(final String dataspaceName) {
+ return cpsAdminPersistenceService.getAnchors(dataspaceName);
+ }
}
diff --git a/cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java b/cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java
index 6709c1fb0b..4e88d49a63 100644
--- a/cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix Foundation. All rights reserved.
+ * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +21,7 @@
package org.onap.cps.spi;
+import java.util.Collection;
import org.onap.cps.spi.model.Anchor;
/*
@@ -34,4 +36,12 @@ public interface CpsAdminPersistenceService {
* @return the anchor name.
*/
String createAnchor(Anchor anchor);
+
+ /**
+ * Read all anchors in the given a dataspace.
+ *
+ * @param dataspaceName dataspace name
+ * @return a collection of anchors
+ */
+ Collection<Anchor> getAnchors(String dataspaceName);
}