2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2022-2023 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.impl.inventory;
23 import java.util.Collection;
24 import java.util.List;
26 import org.onap.cps.spi.FetchDescendantsOption;
27 import org.onap.cps.spi.model.DataNode;
29 public interface CmHandleQueries {
32 * Query CmHandles based on additional (private) properties.
34 * @param additionalPropertyQueryPairs private properties for query
35 * @return Ids of CmHandles which have these private properties
37 Collection<String> queryCmHandleAdditionalProperties(Map<String, String> additionalPropertyQueryPairs);
40 * Query CmHandles based on public properties.
42 * @param publicPropertyQueryPairs public properties for query
43 * @return CmHandles which have these public properties
45 Collection<String> queryCmHandlePublicProperties(Map<String, String> publicPropertyQueryPairs);
48 * Query CmHandles based on Trust Level.
50 * @param trustLevelPropertyQueryPairs trust level properties for query
51 * @return CmHandles which have desired trust level
53 Collection<String> queryCmHandlesByTrustLevel(Map<String, String> trustLevelPropertyQueryPairs);
56 * Method which returns cm handles by the cm handles state.
58 * @param cmHandleState cm handle state
59 * @return a list of cm handles
61 List<DataNode> queryCmHandlesByState(CmHandleState cmHandleState);
64 * Method to return data nodes with ancestor representing the cm handles.
66 * @param cpsPath cps path for which the cmHandle is requested
67 * @return a list of data nodes representing the cm handles.
69 List<DataNode> queryCmHandleAncestorsByCpsPath(String cpsPath,
70 FetchDescendantsOption fetchDescendantsOption);
73 * Method to return data nodes representing the cm handles.
75 * @param cpsPath cps path for which the cmHandle is requested
76 * @return a list of data nodes representing the cm handles.
78 List<DataNode> queryNcmpRegistryByCpsPath(String cpsPath, FetchDescendantsOption fetchDescendantsOption);
81 * Method to check the state of a cm handle with given id.
83 * @param cmHandleId cm handle id
84 * @param requiredCmHandleState the required state of the cm handle
85 * @return a boolean, true if the state is equal to the required state
87 boolean cmHandleHasState(String cmHandleId, CmHandleState requiredCmHandleState);
90 * Method which returns cm handles by the operational sync state of cm handle.
92 * @param dataStoreSyncState sync state
93 * @return a list of cm handles
95 List<DataNode> queryCmHandlesByOperationalSyncState(DataStoreSyncState dataStoreSyncState);
98 * Get all cm handles ids by DMI plugin identifier.
100 * @param dmiPluginIdentifier DMI plugin identifier
101 * @return collection of cm handles
103 Collection<String> getCmHandleIdsByDmiPluginIdentifier(String dmiPluginIdentifier);