2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021 highstreet technologies GmbH
4 * Modifications Copyright (C) 2021-2023 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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 * SPDX-License-Identifier: Apache-2.0
21 * ============LICENSE_END=========================================================
24 package org.onap.cps.ncmp.api;
26 import java.util.Collection;
28 import org.onap.cps.ncmp.api.impl.operations.OperationType;
29 import org.onap.cps.ncmp.api.inventory.CompositeState;
30 import org.onap.cps.ncmp.api.models.CmHandleQueryApiParameters;
31 import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters;
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.ncmp.api.models.ResourceDataBatchRequest;
36 import org.onap.cps.spi.FetchDescendantsOption;
37 import org.onap.cps.spi.model.ModuleDefinition;
38 import org.onap.cps.spi.model.ModuleReference;
41 * Datastore interface for handling CPS data.
43 public interface NetworkCmProxyDataService {
46 * Registration of New CM Handles.
48 * @param dmiPluginRegistration Dmi Plugin Registration
49 * @return dmiPluginRegistrationResponse
51 DmiPluginRegistrationResponse updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
54 * Get resource data for given data store using dmi.
56 * @param datastoreName datastore name
57 * @param cmHandleId cm handle identifier
58 * @param resourceIdentifier resource identifier
59 * @param optionsParamInQuery options query
60 * @param topicParamInQuery topic name for (triggering) async responses
61 * @param requestId unique requestId for async request
62 * @return {@code Object} resource data
64 Object getResourceDataForCmHandle(String datastoreName,
66 String resourceIdentifier,
67 String optionsParamInQuery,
68 String topicParamInQuery,
72 * Get resource data for operational.
74 * @param datastoreName datastore name
75 * @param cmHandleId cm handle identifier
76 * @param resourceIdentifier resource identifier
77 * @Link FetchDescendantsOption fetch descendants option
78 * @return {@code Object} resource data
80 Object getResourceDataForCmHandle(String datastoreName,
82 String resourceIdentifier,
83 FetchDescendantsOption fetchDescendantsOption);
86 * Get resource data for batch of cm handles using dmi.
88 * @param topicParamInQuery topic name for (triggering) async responses
89 * @param resourceDataBatchRequest cm handle identifiers
91 void requestResourceDataForCmHandleBatch(String topicParamInQuery,
92 ResourceDataBatchRequest
93 resourceDataBatchRequest,
98 * Write resource data for data store pass-through running using dmi for given cm-handle.
100 * @param cmHandleId cm handle identifier
101 * @param resourceIdentifier resource identifier
102 * @param operationType required operation type
103 * @param requestBody request body to create resource
104 * @param contentType content type in body
105 * @return {@code Object} return data
107 Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId,
108 String resourceIdentifier,
109 OperationType operationType,
114 * Retrieve module references for the given cm handle.
116 * @param cmHandleId cm handle identifier
117 * @return a collection of modules names and revisions
119 Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandleId);
122 * Retrieve module definitions for the given cm handle.
124 * @param cmHandleId cm handle identifier
125 * @return a collection of module definition (moduleName, revision and yang resource content)
127 Collection<ModuleDefinition> getModuleDefinitionsByCmHandleId(String cmHandleId);
130 * Query cm handle details by cm handle's name.
132 * @param cmHandleId cm handle identifier
133 * @return a collection of cm handle details.
135 NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId);
138 * Get cm handle public properties by cm handle id.
140 * @param cmHandleId cm handle identifier
141 * @return a collection of cm handle public properties.
143 Map<String, String> getCmHandlePublicProperties(String cmHandleId);
146 * Get cm handle composite state by cm handle id.
148 * @param cmHandleId cm handle identifier
149 * @return a cm handle composite state
151 CompositeState getCmHandleCompositeState(String cmHandleId);
154 * Query and return cm handles that match the given query parameters.
156 * @param cmHandleQueryApiParameters the cm handle query parameters
157 * @return collection of cm handles
159 Collection<NcmpServiceCmHandle> executeCmHandleSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
162 * Query and return cm handle ids that match the given query parameters.
164 * @param cmHandleQueryApiParameters the cm handle query parameters
165 * @return collection of cm handle ids
167 Collection<String> executeCmHandleIdSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
170 * Set the data sync enabled flag, along with the data sync state to true or false based on the cm handle id.
172 * @param cmHandleId cm handle id
173 * @param dataSyncEnabled data sync enabled flag
175 void setDataSyncEnabled(String cmHandleId, boolean dataSyncEnabled);
178 * Get all cm handle IDs by DMI plugin identifier.
180 * @param dmiPluginIdentifier DMI plugin identifier
181 * @return collection of cm handle IDs
183 Collection<String> getAllCmHandleIdsByDmiPluginIdentifier(String dmiPluginIdentifier);
186 * Get all cm handle IDs by various search criteria.
188 * @param cmHandleQueryServiceParameters cm handle query parameters
189 * @return collection of cm handle IDs
191 Collection<String> executeCmHandleIdSearchForInventory(CmHandleQueryServiceParameters
192 cmHandleQueryServiceParameters);