Merge "patch operation for ncmp running"
[cps.git] / cps-ncmp-service / src / main / java / org / onap / cps / ncmp / api / NetworkCmProxyDataService.java
1 /*
2  *  ============LICENSE_START=======================================================
3  *  Copyright (C) 2021 highstreet technologies GmbH
4  *  Modifications Copyright (C) 2021-2022 Nordix Foundation
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  *
13  *  Unless required by applicable law or agreed to in writing, software
14  *  distributed under the License is distributed on an "AS IS" BASIS,
15  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  *  See the License for the specific language governing permissions and
17  *  limitations under the License.
18  *
19  *  SPDX-License-Identifier: Apache-2.0
20  *  ============LICENSE_END=========================================================
21  */
22
23 package org.onap.cps.ncmp.api;
24
25 import static org.onap.cps.ncmp.api.impl.operations.DmiRequestBody.OperationEnum;
26
27 import java.util.Collection;
28 import org.onap.cps.ncmp.api.models.DmiPluginRegistration;
29 import org.onap.cps.spi.model.ModuleReference;
30
31 /*
32  * Datastore interface for handling CPS data.
33  */
34 public interface NetworkCmProxyDataService {
35
36     /**
37      * Registration of New CM Handles.
38      *
39      * @param dmiPluginRegistration Dmi Plugin Registration
40      */
41     void updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
42
43     /**
44      * Get resource data for data store pass-through operational
45      * using dmi.
46      *
47      * @param cmHandle cm handle
48      * @param resourceIdentifier resource identifier
49      * @param acceptParamInHeader accept param
50      * @param optionsParamInQuery options query
51      * @return {@code Object} resource data
52      */
53     Object getResourceDataOperationalForCmHandle(String cmHandle,
54                                                  String resourceIdentifier,
55                                                  String acceptParamInHeader,
56                                                  String optionsParamInQuery);
57
58     /**
59      * Get resource data for data store pass-through running
60      * using dmi.
61      *
62      * @param cmHandle cm handle
63      * @param resourceIdentifier resource identifier
64      * @param acceptParamInHeader accept param
65      * @param optionsParamInQuery options query
66      * @return {@code Object} resource data
67      */
68     Object getResourceDataPassThroughRunningForCmHandle(String cmHandle,
69                                                         String resourceIdentifier,
70                                                         String acceptParamInHeader,
71                                                         String optionsParamInQuery);
72
73     /**
74      * Write resource data for data store pass-through running
75      * using dmi for given cm-handle.
76      *  @param cmHandle cm handle
77      * @param resourceIdentifier resource identifier
78      * @param operation required operation
79      * @param requestBody request body to create resource
80      * @param contentType content type in body
81      * @return {@code Object} return data
82      */
83     Object writeResourceDataPassThroughRunningForCmHandle(String cmHandle,
84                                                         String resourceIdentifier,
85                                                         OperationEnum operation,
86                                                         String requestBody,
87                                                         String contentType);
88
89     /**
90      * Retrieve module references for the given cm handle.
91      *
92      * @param cmHandle cm handle
93      * @return a collection of modules names and revisions
94      */
95     Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandle);
96
97     /**
98      * Query cm handle identifiers for the given collection of module names.
99      *
100      * @param moduleNames module names.
101      * @return a collection of cm handle identifiers. The schema set for each cm handle must include all the
102      *         given module names
103      */
104     Collection<String> executeCmHandleHasAllModulesSearch(Collection<String> moduleNames);
105
106 }