2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2020-2023 Nordix Foundation
4 * Modifications Copyright (C) 2020-2022 Bell Canada.
5 * Modifications Copyright (C) 2021 Pantheon.tech
6 * Modifications Copyright (C) 2022 TechMahindra Ltd.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
20 * SPDX-License-Identifier: Apache-2.0
21 * ============LICENSE_END=========================================================
24 package org.onap.cps.api;
26 import java.util.Collection;
27 import org.onap.cps.spi.exceptions.AlreadyDefinedException;
28 import org.onap.cps.spi.exceptions.CpsException;
29 import org.onap.cps.spi.model.Anchor;
30 import org.onap.cps.spi.model.Dataspace;
35 public interface CpsAdminService {
40 * @param dataspaceName dataspace name
41 * @throws AlreadyDefinedException if dataspace with same name already exists
43 void createDataspace(String dataspaceName);
48 * @param dataspaceName the name of the dataspace to delete
50 void deleteDataspace(String dataspaceName);
53 * Get dataspace by given dataspace name.
55 * @param dataspaceName dataspace name
58 Dataspace getDataspace(String dataspaceName);
64 * @return a collection of dataspaces
66 Collection<Dataspace> getAllDataspaces();
71 * @param dataspaceName dataspace name
72 * @param schemaSetName schema set name
73 * @param anchorName anchor name
74 * @throws CpsException if input data is invalid.
76 void createAnchor(String dataspaceName, String schemaSetName, String anchorName);
79 * Read all anchors in the given dataspace.
81 * @param dataspaceName dataspace name
82 * @return a collection of anchors
84 Collection<Anchor> getAnchors(String dataspaceName);
87 * Read all anchors associated with the given schema-set in the given dataspace.
89 * @param dataspaceName dataspace name
90 * @param schemaSetName schema-set name
91 * @return a collection of anchors
93 Collection<Anchor> getAnchors(String dataspaceName, String schemaSetName);
96 * Read all anchors associated with the given schema-sets in the given dataspace.
98 * @param dataspaceName dataspace name
99 * @param schemaSetNames schema-set names
100 * @return a collection of anchors
102 Collection<Anchor> getAnchors(String dataspaceName, Collection<String> schemaSetNames);
105 * Get an anchor in the given dataspace using the anchor name.
107 * @param dataspaceName dataspace name
108 * @param anchorName anchor name
111 Anchor getAnchor(String dataspaceName, String anchorName);
114 * Delete anchor by name in given dataspace.
116 * @param dataspaceName dataspace name
117 * @param anchorName anchor name
119 void deleteAnchor(String dataspaceName, String anchorName);
122 * Delete anchors by name in given dataspace.
124 * @param dataspaceName dataspace name
125 * @param anchorNames anchor names
127 void deleteAnchors(String dataspaceName, Collection<String> anchorNames);
130 * Query anchor names for the given module names in the provided dataspace.
132 * @param dataspaceName dataspace name
133 * @param moduleNames a collection of module names
134 * @return a collection of anchor names in the given dataspace. The schema set for each anchor must include all the
137 Collection<String> queryAnchorNames(String dataspaceName, Collection<String> moduleNames);