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
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 static org.onap.cps.ncmp.api.impl.operations.DmiRequestBody.OperationEnum;
28 import java.util.Collection;
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.CmHandleQueryServiceParameters;
34 import org.onap.cps.ncmp.api.models.DmiPluginRegistration;
35 import org.onap.cps.ncmp.api.models.DmiPluginRegistrationResponse;
36 import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
37 import org.onap.cps.spi.FetchDescendantsOption;
38 import org.onap.cps.spi.model.ModuleDefinition;
39 import org.onap.cps.spi.model.ModuleReference;
42 * Datastore interface for handling CPS data.
44 public interface NetworkCmProxyDataService {
47 * Registration of New CM Handles.
49 * @param dmiPluginRegistration Dmi Plugin Registration
50 * @return dmiPluginRegistrationResponse
52 DmiPluginRegistrationResponse updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
55 * Get resource data for data store pass-through operational
58 * @param cmHandleId cm handle identifier
59 * @param resourceIdentifier resource identifier
60 * @param optionsParamInQuery options query
61 * @param topicParamInQuery topic name for (triggering) async responses
62 * @param requestId unique requestId for async request
63 * @return {@code Object} resource data
65 Object getResourceDataOperationalForCmHandle(String cmHandleId,
66 String resourceIdentifier,
67 String optionsParamInQuery,
68 String topicParamInQuery,
72 * Get resource data for operational.
74 * @param cmHandleId cm handle identifier
75 * @param resourceIdentifier resource identifier
76 * @Link FetchDescendantsOption fetch descendants option
77 * @return {@code Object} resource data
79 Object getResourceDataOperational(String cmHandleId,
80 String resourceIdentifier,
81 FetchDescendantsOption fetchDescendantsOption);
84 * Get resource data for data store pass-through running
87 * @param cmHandleId cm handle identifier
88 * @param resourceIdentifier resource identifier
89 * @param optionsParamInQuery options query
90 * @param topicParamInQuery topic name for (triggering) async responses
91 * @param requestId unique requestId for async request
92 * @return {@code Object} resource data
94 Object getResourceDataPassThroughRunningForCmHandle(String cmHandleId,
95 String resourceIdentifier,
96 String optionsParamInQuery,
97 String topicParamInQuery,
101 * Write resource data for data store pass-through running
102 * using dmi for given cm-handle.
103 * @param cmHandleId cm handle identifier
104 * @param resourceIdentifier resource identifier
105 * @param operation required operation
106 * @param requestBody request body to create resource
107 * @param contentType content type in body
108 * @return {@code Object} return data
110 Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId,
111 String resourceIdentifier,
112 OperationEnum operation,
117 * Retrieve module references for the given cm handle.
119 * @param cmHandleId cm handle identifier
120 * @return a collection of modules names and revisions
122 Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandleId);
125 * Retrieve module definitions for the given cm handle.
127 * @param cmHandleId cm handle identifier
128 * @return a collection of module definition (moduleName, revision and yang resource content)
130 Collection<ModuleDefinition> getModuleDefinitionsByCmHandleId(String cmHandleId);
133 * Query cm handle details by cm handle's name.
135 * @param cmHandleId cm handle identifier
136 * @return a collection of cm handle details.
138 NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId);
141 * Get cm handle public properties by cm handle id.
143 * @param cmHandleId cm handle identifier
144 * @return a collection of cm handle public properties.
146 Map<String, String> getCmHandlePublicProperties(String cmHandleId);
149 * Get cm handle composite state by cm handle id.
151 * @param cmHandleId cm handle identifier
152 * @return a cm handle composite state
154 CompositeState getCmHandleCompositeState(String cmHandleId);
157 * Query and return cm handles that match the given query parameters.
159 * @param cmHandleQueryApiParameters the cm handle query parameters
160 * @return collection of cm handles
162 Set<NcmpServiceCmHandle> executeCmHandleSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
165 * Query and return cm handle ids that match the given query parameters.
167 * @param cmHandleQueryApiParameters the cm handle query parameters
168 * @return collection of cm handle ids
170 Set<String> executeCmHandleIdSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
173 * Set the data sync enabled flag, along with the data sync state to true or false based on the cm handle id.
175 * @param cmHandleId cm handle id
176 * @param dataSyncEnabled data sync enabled flag
178 void setDataSyncEnabled(String cmHandleId, boolean dataSyncEnabled);
181 * Get all cm handle IDs by DMI plugin identifier.
183 * @param dmiPluginIdentifier DMI plugin identifier
184 * @return set of cm handle IDs
186 Set<String> getAllCmHandleIdsByDmiPluginIdentifier(String dmiPluginIdentifier);
189 * Get all cm handle IDs by various search criteria.
191 * @param cmHandleQueryServiceParameters cm handle query parameters
192 * @return set of cm handle IDs
194 Set<String> executeCmHandleIdSearchForInventory(CmHandleQueryServiceParameters cmHandleQueryServiceParameters);