d942d26c88701ec4213aed148223b0dc19b71a96
[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.ncmp.api.models.NcmpServiceCmHandle;
30 import org.onap.cps.spi.model.ModuleReference;
31
32 /*
33  * Datastore interface for handling CPS data.
34  */
35 public interface NetworkCmProxyDataService {
36
37     /**
38      * Registration of New CM Handles.
39      *
40      * @param dmiPluginRegistration Dmi Plugin Registration
41      */
42     void updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
43
44     /**
45      * Get resource data for data store pass-through operational
46      * using dmi.
47      *
48      * @param cmHandleId cm handle identifier
49      * @param resourceIdentifier resource identifier
50      * @param acceptParamInHeader accept param
51      * @param optionsParamInQuery options query
52      * @param topicParamInQuery topic name for (triggering) async responses
53      * @return {@code Object} resource data
54      */
55     Object getResourceDataOperationalForCmHandle(String cmHandleId,
56                                                  String resourceIdentifier,
57                                                  String acceptParamInHeader,
58                                                  String optionsParamInQuery,
59                                                  String topicParamInQuery);
60
61     /**
62      * Get resource data for data store pass-through running
63      * using dmi.
64      *
65      * @param cmHandleId cm handle identifier
66      * @param resourceIdentifier resource identifier
67      * @param acceptParamInHeader accept param
68      * @param optionsParamInQuery options query
69      * @param topicParamInQuery topic query
70      * @return {@code Object} resource data
71      */
72     Object getResourceDataPassThroughRunningForCmHandle(String cmHandleId,
73                                                         String resourceIdentifier,
74                                                         String acceptParamInHeader,
75                                                         String optionsParamInQuery,
76                                                         String topicParamInQuery);
77
78     /**
79      * Write resource data for data store pass-through running
80      * using dmi for given cm-handle.
81      *  @param cmHandleId cm handle identifier
82      * @param resourceIdentifier resource identifier
83      * @param operation required operation
84      * @param requestBody request body to create resource
85      * @param contentType content type in body
86      * @return {@code Object} return data
87      */
88     Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId,
89                                                         String resourceIdentifier,
90                                                         OperationEnum operation,
91                                                         String requestBody,
92                                                         String contentType);
93
94     /**
95      * Retrieve module references for the given cm handle.
96      *
97      * @param cmHandleId cm handle identifier
98      * @return a collection of modules names and revisions
99      */
100     Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandleId);
101
102     /**
103      * Query cm handle identifiers for the given collection of module names.
104      *
105      * @param moduleNames module names.
106      * @return a collection of cm handle identifiers. The schema set for each cm handle must include all the
107      *         given module names
108      */
109     Collection<String> executeCmHandleHasAllModulesSearch(Collection<String> moduleNames);
110
111     /**
112      * Query cm handle details by cm handle's name.
113      *
114      * @param cmHandleId cm handle identifier
115      * @return a collection of cm handle details.
116      */
117     NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId);
118
119 }