2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2020 Nordix Foundation
4 * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
5 * Modifications Copyright (C) 2021 Pantheon.tech
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.onap.cps.api.impl;
24 import java.util.Collection;
25 import org.onap.cps.api.CpsAdminService;
26 import org.onap.cps.spi.CpsAdminPersistenceService;
27 import org.onap.cps.spi.model.Anchor;
28 import org.springframework.beans.factory.annotation.Autowired;
29 import org.springframework.stereotype.Component;
31 @Component("CpsAdminServiceImpl")
32 public class CpsAdminServiceImpl implements CpsAdminService {
35 private CpsAdminPersistenceService cpsAdminPersistenceService;
38 public void createDataspace(final String dataspaceName) {
39 cpsAdminPersistenceService.createDataspace(dataspaceName);
43 public void createAnchor(final String dataspaceName, final String schemaSetName, final String anchorName) {
44 cpsAdminPersistenceService.createAnchor(dataspaceName, schemaSetName, anchorName);
48 public Collection<Anchor> getAnchors(final String dataspaceName) {
49 return cpsAdminPersistenceService.getAnchors(dataspaceName);
53 public Anchor getAnchor(final String dataspaceName, final String anchorName) {
54 return cpsAdminPersistenceService.getAnchor(dataspaceName, anchorName);
58 public void deleteAnchor(final String dataspaceName, final String anchorName) {
59 cpsAdminPersistenceService.deleteAnchor(dataspaceName, anchorName);