2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2022 Nordix Foundation
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.cps.ncmp.api.inventory;
23 import java.util.List;
26 import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
27 import org.onap.cps.spi.FetchDescendantsOption;
28 import org.onap.cps.spi.model.DataNode;
30 public interface CmHandleQueries {
33 * Query CmHandles based on PublicProperties.
35 * @param publicPropertyQueryPairs public properties for query
36 * @return CmHandles which have these public properties
38 Map<String, NcmpServiceCmHandle> queryCmHandlePublicProperties(Map<String, String> publicPropertyQueryPairs);
41 * Combine Maps of CmHandles.
43 * @param firstQuery first CmHandles Map
44 * @param secondQuery second CmHandles Map
45 * @return combined Map of CmHandles
47 Map<String, NcmpServiceCmHandle> combineCmHandleQueries(Map<String, NcmpServiceCmHandle> firstQuery,
48 Map<String, NcmpServiceCmHandle> secondQuery);
51 * Method which returns cm handles by the cm handles state.
53 * @param cmHandleState cm handle state
54 * @return a list of cm handles
56 List<DataNode> queryCmHandlesByState(CmHandleState cmHandleState);
59 * Method to return data nodes representing the cm handles.
61 * @param cpsPath cps path for which the cmHandle is requested
62 * @return a list of data nodes representing the cm handles.
64 List<DataNode> queryCmHandleDataNodesByCpsPath(String cpsPath, FetchDescendantsOption fetchDescendantsOption);
67 * Method to check the state of a cm handle with given id.
69 * @param cmHandleId cm handle id
70 * @param requiredCmHandleState the required state of the cm handle
71 * @return a boolean, true if the state is equal to the required state
73 boolean cmHandleHasState(String cmHandleId, CmHandleState requiredCmHandleState);
76 * Method which returns cm handles by the operational sync state of cm handle.
78 * @param dataStoreSyncState sync state
79 * @return a list of cm handles
81 List<DataNode> queryCmHandlesByOperationalSyncState(DataStoreSyncState dataStoreSyncState);
84 * Get all cm handles by DMI plugin identifier.
86 * @param dmiPluginIdentifier DMI plugin identifier
87 * @return set of cm handles
89 Set<NcmpServiceCmHandle> getCmHandlesByDmiPluginIdentifier(String dmiPluginIdentifier);