summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main/java/org
diff options
context:
space:
mode:
authorRishi Chail <rishi.chail@est.tech>2020-12-17 12:55:49 +0000
committerGerrit Code Review <gerrit@onap.org>2020-12-17 12:55:49 +0000
commit1d9845679de45007db30eee42c105edcffd972fb (patch)
tree51434e7dfb545150d31c832690b1fd4464bc06a6 /cps-service/src/main/java/org
parentb9f857d3bf6d7fa8f9d0d5fa1796113d43e6e50d (diff)
parent8a1e3c9f90d2111835460fc042b4a63f93b80384 (diff)
Merge "Associate anchor to schema set"
Diffstat (limited to 'cps-service/src/main/java/org')
-rw-r--r--cps-service/src/main/java/org/onap/cps/api/CpsAdminService.java13
-rw-r--r--cps-service/src/main/java/org/onap/cps/api/impl/CpsAdminServiceImpl.java4
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java13
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/model/Anchor.java22
4 files changed, 29 insertions, 23 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 a2c05bfe5a..5090e3a3c4 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
@@ -21,6 +21,7 @@
package org.onap.cps.api;
import java.util.Collection;
+import org.checkerframework.checker.nullness.qual.NonNull;
import org.onap.cps.spi.exceptions.CpsException;
import org.onap.cps.spi.model.Anchor;
@@ -30,13 +31,14 @@ import org.onap.cps.spi.model.Anchor;
public interface CpsAdminService {
/**
- * Create an anchor using provided anchorDetails object.
+ * Create an Anchor.
*
- * @param anchor the anchor details object.
- * @return the anchor name.
+ * @param dataspaceName dataspace name
+ * @param schemaSetName schema set name
+ * @param anchorName anchor name
* @throws CpsException if input data is invalid.
*/
- String createAnchor(Anchor anchor);
+ void createAnchor(@NonNull String dataspaceName, @NonNull String schemaSetName, @NonNull String anchorName);
/**
* Read all anchors in the given a dataspace.
@@ -44,5 +46,6 @@ public interface CpsAdminService {
* @param dataspaceName dataspace name
* @return a collection of anchors
*/
- Collection<Anchor> getAnchors(String dataspaceName);
+ @NonNull
+ Collection<Anchor> getAnchors(@NonNull 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 5d9bc015fd..f93a827079 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
@@ -34,8 +34,8 @@ public class CpsAdminServiceImpl implements CpsAdminService {
private CpsAdminPersistenceService cpsAdminPersistenceService;
@Override
- public String createAnchor(final Anchor anchor) {
- return cpsAdminPersistenceService.createAnchor(anchor);
+ public void createAnchor(final String dataspaceName, final String schemaSetName, final String anchorName) {
+ cpsAdminPersistenceService.createAnchor(dataspaceName, schemaSetName, anchorName);
}
@Override
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 4e88d49a63..1b7ddb724c 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
@@ -22,6 +22,7 @@
package org.onap.cps.spi;
import java.util.Collection;
+import org.checkerframework.checker.nullness.qual.NonNull;
import org.onap.cps.spi.model.Anchor;
/*
@@ -32,10 +33,12 @@ public interface CpsAdminPersistenceService {
/**
* Create an Anchor.
*
- * @param anchor the anchorDetails object.
- * @return the anchor name.
+ * @param dataspaceName dataspace name
+ * @param schemaSetName schema set name
+ * @param anchorName anchor name
*/
- String createAnchor(Anchor anchor);
+ void createAnchor(@NonNull String dataspaceName, @NonNull String schemaSetName, @NonNull String anchorName);
+
/**
* Read all anchors in the given a dataspace.
@@ -43,5 +46,7 @@ public interface CpsAdminPersistenceService {
* @param dataspaceName dataspace name
* @return a collection of anchors
*/
- Collection<Anchor> getAnchors(String dataspaceName);
+ @NonNull
+ Collection<Anchor> getAnchors(@NonNull String dataspaceName);
+
}
diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/Anchor.java b/cps-service/src/main/java/org/onap/cps/spi/model/Anchor.java
index cd1c774476..456f733935 100644
--- a/cps-service/src/main/java/org/onap/cps/spi/model/Anchor.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/model/Anchor.java
@@ -21,23 +21,21 @@
package org.onap.cps.spi.model;
import java.io.Serializable;
-import java.util.Map;
-import lombok.Getter;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
import lombok.NoArgsConstructor;
-import lombok.Setter;
-@Setter
-@Getter
+@Data
+@Builder
@NoArgsConstructor
+@AllArgsConstructor
public class Anchor implements Serializable {
- // anchor will support both a single module and schema set until CPS-99 is complete
private static final long serialVersionUID = 1464791260718603291L;
- private String anchorName;
+
+ private String name;
private String dataspaceName;
- private String namespace;
- private String revision;
- private String moduleSetName;
- private Map<String, String> externalReferences;
- private String xpath;
+ private String schemaSetName;
+
} \ No newline at end of file