Delete anchor part 1: service and persistence layers
[cps.git] / cps-service / src / main / java / org / onap / cps / api / impl / CpsAdminServiceImpl.java
1 /*
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
10  *
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.
17  *
18  *  SPDX-License-Identifier: Apache-2.0
19  *  ============LICENSE_END=========================================================
20  */
21
22 package org.onap.cps.api.impl;
23
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;
30
31 @Component("CpsAdminServiceImpl")
32 public class CpsAdminServiceImpl implements CpsAdminService {
33
34     @Autowired
35     private CpsAdminPersistenceService cpsAdminPersistenceService;
36
37     @Override
38     public void createDataspace(final String dataspaceName) {
39         cpsAdminPersistenceService.createDataspace(dataspaceName);
40     }
41
42     @Override
43     public void createAnchor(final String dataspaceName, final String schemaSetName, final String anchorName) {
44         cpsAdminPersistenceService.createAnchor(dataspaceName, schemaSetName, anchorName);
45     }
46
47     @Override
48     public Collection<Anchor> getAnchors(final String dataspaceName) {
49         return cpsAdminPersistenceService.getAnchors(dataspaceName);
50     }
51
52     @Override
53     public Anchor getAnchor(final String dataspaceName, final String anchorName) {
54         return cpsAdminPersistenceService.getAnchor(dataspaceName, anchorName);
55     }
56
57     @Override
58     public void deleteAnchor(final String dataspaceName, final String anchorName) {
59         cpsAdminPersistenceService.deleteAnchor(dataspaceName, anchorName);
60     }
61 }