Merge "Merge 2 'query' end points in NCMP"
[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  *  Modifications Copyright (C) 2022 Bell Canada
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
11  *
12  *        http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  *  SPDX-License-Identifier: Apache-2.0
21  *  ============LICENSE_END=========================================================
22  */
23
24 package org.onap.cps.ncmp.api;
25
26 import static org.onap.cps.ncmp.api.impl.operations.DmiRequestBody.OperationEnum;
27
28 import java.util.Collection;
29 import java.util.Map;
30 import java.util.Set;
31 import org.onap.cps.ncmp.api.models.CmHandleQueryApiParameters;
32 import org.onap.cps.ncmp.api.models.DmiPluginRegistration;
33 import org.onap.cps.ncmp.api.models.DmiPluginRegistrationResponse;
34 import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
35 import org.onap.cps.spi.model.ModuleReference;
36
37 /*
38  * Datastore interface for handling CPS data.
39  */
40 public interface NetworkCmProxyDataService {
41
42     /**
43      * Registration of New CM Handles.
44      *
45      * @param dmiPluginRegistration Dmi Plugin Registration
46      * @return dmiPluginRegistrationResponse
47      */
48     DmiPluginRegistrationResponse updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
49
50     /**
51      * Get resource data for data store pass-through operational
52      * using dmi.
53      *
54      * @param cmHandleId cm handle identifier
55      * @param resourceIdentifier resource identifier
56      * @param optionsParamInQuery options query
57      * @param topicParamInQuery topic name for (triggering) async responses
58      * @param requestId unique requestId for async request
59      * @return {@code Object} resource data
60      */
61     Object getResourceDataOperationalForCmHandle(String cmHandleId,
62                                                  String resourceIdentifier,
63                                                  String optionsParamInQuery,
64                                                  String topicParamInQuery,
65                                                  String requestId);
66
67     /**
68      * Get resource data for data store pass-through running
69      * using dmi.
70      *
71      * @param cmHandleId cm handle identifier
72      * @param resourceIdentifier resource identifier
73      * @param optionsParamInQuery options query
74      * @param topicParamInQuery topic name for (triggering) async responses
75      * @param requestId unique requestId for async request
76      * @return {@code Object} resource data
77      */
78     Object getResourceDataPassThroughRunningForCmHandle(String cmHandleId,
79                                                         String resourceIdentifier,
80                                                         String optionsParamInQuery,
81                                                         String topicParamInQuery,
82                                                         String requestId);
83
84     /**
85      * Write resource data for data store pass-through running
86      * using dmi for given cm-handle.
87      *  @param cmHandleId cm handle identifier
88      * @param resourceIdentifier resource identifier
89      * @param operation required operation
90      * @param requestBody request body to create resource
91      * @param contentType content type in body
92      * @return {@code Object} return data
93      */
94     Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId,
95                                                         String resourceIdentifier,
96                                                         OperationEnum operation,
97                                                         String requestBody,
98                                                         String contentType);
99
100     /**
101      * Retrieve module references for the given cm handle.
102      *
103      * @param cmHandleId cm handle identifier
104      * @return a collection of modules names and revisions
105      */
106     Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandleId);
107
108     /**
109      * Query cm handle details by cm handle's name.
110      *
111      * @param cmHandleId cm handle identifier
112      * @return a collection of cm handle details.
113      */
114     NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId);
115
116     /**
117      * Get cm handle public properties by cm handle id.
118      *
119      * @param cmHandleId cm handle identifier
120      * @return a collection of cm handle public properties.
121      */
122     Map<String, String> getCmHandlePublicProperties(String cmHandleId);
123
124     /**
125      * Query and return cm handles that match the given query parameters.
126      *
127      * @param cmHandleQueryApiParameters the cm handle query parameters
128      * @return collection of cm handles
129      */
130     Set<NcmpServiceCmHandle> executeCmHandleSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
131
132     /**
133      * Query and return cm handle ids that match the given query parameters.
134      *
135      * @param cmHandleQueryApiParameters the cm handle query parameters
136      * @return collection of cm handle ids
137      */
138     Set<String> executeCmHandleIdSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
139 }