Merge "Kafka consumer can not be turned off"
[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.inventory.CompositeState;
32 import org.onap.cps.ncmp.api.models.CmHandleQueryApiParameters;
33 import org.onap.cps.ncmp.api.models.DmiPluginRegistration;
34 import org.onap.cps.ncmp.api.models.DmiPluginRegistrationResponse;
35 import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
36 import org.onap.cps.spi.model.ModuleReference;
37
38 /*
39  * Datastore interface for handling CPS data.
40  */
41 public interface NetworkCmProxyDataService {
42
43     /**
44      * Registration of New CM Handles.
45      *
46      * @param dmiPluginRegistration Dmi Plugin Registration
47      * @return dmiPluginRegistrationResponse
48      */
49     DmiPluginRegistrationResponse updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
50
51     /**
52      * Get resource data for data store pass-through operational
53      * using dmi.
54      *
55      * @param cmHandleId cm handle identifier
56      * @param resourceIdentifier resource identifier
57      * @param optionsParamInQuery options query
58      * @param topicParamInQuery topic name for (triggering) async responses
59      * @param requestId unique requestId for async request
60      * @return {@code Object} resource data
61      */
62     Object getResourceDataOperationalForCmHandle(String cmHandleId,
63                                                  String resourceIdentifier,
64                                                  String optionsParamInQuery,
65                                                  String topicParamInQuery,
66                                                  String requestId);
67
68     /**
69      * Get resource data for data store pass-through running
70      * using dmi.
71      *
72      * @param cmHandleId cm handle identifier
73      * @param resourceIdentifier resource identifier
74      * @param optionsParamInQuery options query
75      * @param topicParamInQuery topic name for (triggering) async responses
76      * @param requestId unique requestId for async request
77      * @return {@code Object} resource data
78      */
79     Object getResourceDataPassThroughRunningForCmHandle(String cmHandleId,
80                                                         String resourceIdentifier,
81                                                         String optionsParamInQuery,
82                                                         String topicParamInQuery,
83                                                         String requestId);
84
85     /**
86      * Write resource data for data store pass-through running
87      * using dmi for given cm-handle.
88      *  @param cmHandleId cm handle identifier
89      * @param resourceIdentifier resource identifier
90      * @param operation required operation
91      * @param requestBody request body to create resource
92      * @param contentType content type in body
93      * @return {@code Object} return data
94      */
95     Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId,
96                                                         String resourceIdentifier,
97                                                         OperationEnum operation,
98                                                         String requestBody,
99                                                         String contentType);
100
101     /**
102      * Retrieve module references for the given cm handle.
103      *
104      * @param cmHandleId cm handle identifier
105      * @return a collection of modules names and revisions
106      */
107     Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandleId);
108
109     /**
110      * Query cm handle details by cm handle's name.
111      *
112      * @param cmHandleId cm handle identifier
113      * @return a collection of cm handle details.
114      */
115     NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId);
116
117     /**
118      * Get cm handle public properties by cm handle id.
119      *
120      * @param cmHandleId cm handle identifier
121      * @return a collection of cm handle public properties.
122      */
123     Map<String, String> getCmHandlePublicProperties(String cmHandleId);
124
125     /**
126      * Get cm handle composite state by cm handle id.
127      *
128      * @param cmHandleId cm handle identifier
129      * @return a cm handle composite state
130      */
131     CompositeState getCmHandleCompositeState(String cmHandleId);
132
133     /**
134      * Query and return cm handles that match the given query parameters.
135      *
136      * @param cmHandleQueryApiParameters the cm handle query parameters
137      * @return collection of cm handles
138      */
139     Set<NcmpServiceCmHandle> executeCmHandleSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
140
141     /**
142      * Query and return cm handle ids that match the given query parameters.
143      *
144      * @param cmHandleQueryApiParameters the cm handle query parameters
145      * @return collection of cm handle ids
146      */
147     Set<String> executeCmHandleIdSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
148 }