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.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;
40 * Datastore interface for handling CPS data.
42 public interface NetworkCmProxyDataService {
45 * Registration of New CM Handles.
47 * @param dmiPluginRegistration Dmi Plugin Registration
48 * @return dmiPluginRegistrationResponse
50 DmiPluginRegistrationResponse updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
53 * Get resource data for data store pass-through operational
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
63 Object getResourceDataOperationalForCmHandle(String cmHandleId,
64 String resourceIdentifier,
65 String optionsParamInQuery,
66 String topicParamInQuery,
70 * Get resource data for data store pass-through running
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
80 Object getResourceDataPassThroughRunningForCmHandle(String cmHandleId,
81 String resourceIdentifier,
82 String optionsParamInQuery,
83 String topicParamInQuery,
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
96 Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId,
97 String resourceIdentifier,
98 OperationEnum operation,
103 * Retrieve module references for the given cm handle.
105 * @param cmHandleId cm handle identifier
106 * @return a collection of modules names and revisions
108 Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandleId);
111 * Retrieve module definitions for the given cm handle.
113 * @param cmHandleId cm handle identifier
114 * @return a collection of module definition (moduleName, revision and yang resource content)
116 Collection<ModuleDefinition> getModuleDefinitionsByCmHandleId(String cmHandleId);
119 * Query cm handle details by cm handle's name.
121 * @param cmHandleId cm handle identifier
122 * @return a collection of cm handle details.
124 NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId);
127 * Get cm handle public properties by cm handle id.
129 * @param cmHandleId cm handle identifier
130 * @return a collection of cm handle public properties.
132 Map<String, String> getCmHandlePublicProperties(String cmHandleId);
135 * Get cm handle composite state by cm handle id.
137 * @param cmHandleId cm handle identifier
138 * @return a cm handle composite state
140 CompositeState getCmHandleCompositeState(String cmHandleId);
143 * Query and return cm handles that match the given query parameters.
145 * @param cmHandleQueryApiParameters the cm handle query parameters
146 * @return collection of cm handles
148 Set<NcmpServiceCmHandle> executeCmHandleSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
151 * Query and return cm handle ids that match the given query parameters.
153 * @param cmHandleQueryApiParameters the cm handle query parameters
154 * @return collection of cm handle ids
156 Set<String> executeCmHandleIdSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
159 * Set the data sync enabled flag, along with the data sync state to true or false based on the cm handle id.
161 * @param cmHandleId cm handle id
162 * @param dataSyncEnabled data sync enabled flag
164 void setDataSyncEnabled(String cmHandleId, boolean dataSyncEnabled);
167 * Get all cm handle IDs by DMI plugin identifier.
169 * @param dmiPluginIdentifier DMI plugin identifier
170 * @return set of cm handle IDs
172 Set<String> getAllCmHandleIdsByDmiPluginIdentifier(String dmiPluginIdentifier);