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