package org.onap.cps.api;
-import org.onap.cps.exceptions.CpsValidationException;
+import java.util.Collection;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.onap.cps.spi.exceptions.CpsException;
+import org.onap.cps.spi.exceptions.DataspaceAlreadyDefinedException;
import org.onap.cps.spi.model.Anchor;
/**
public interface CpsAdminService {
/**
- * Create an anchor using provided anchorDetails object.
+ * Create dataspace.
*
- * @param anchor the anchor details object.
- * @return the anchor name.
- * @throws CpsValidationException if input data is invalid.
+ * @param dataspaceName dataspace name
+ * @throws DataspaceAlreadyDefinedException if dataspace with same name already exists
*/
- String createAnchor(Anchor anchor);
+ void createDataspace(@NonNull String dataspaceName);
+
+ /**
+ * Create an Anchor.
+ *
+ * @param dataspaceName dataspace name
+ * @param schemaSetName schema set name
+ * @param anchorName anchor name
+ * @throws CpsException if input data is invalid.
+ */
+ void createAnchor(@NonNull String dataspaceName, @NonNull String schemaSetName, @NonNull String anchorName);
+
+ /**
+ * Read all anchors in the given dataspace.
+ *
+ * @param dataspaceName dataspace name
+ * @return a collection of anchors
+ */
+ @NonNull
+ Collection<Anchor> getAnchors(@NonNull String dataspaceName);
+
+ /**
+ * Get an anchor in the given dataspace using the anchor name.
+ *
+ * @param dataspaceName dataspace name
+ * @param anchorName anchor name
+ * @return an anchor
+ */
+ @NonNull
+ Anchor getAnchor(@NonNull String dataspaceName, @NonNull String anchorName);
}