Merge "Reinstate Spring Boot 3.0 after revert"
[cps.git] / cps-ncmp-service / src / main / java / org / onap / cps / ncmp / api / inventory / CmHandleQueries.java
1 /*
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
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  *  SPDX-License-Identifier: Apache-2.0
18  *  ============LICENSE_END=========================================================
19  */
20
21 package org.onap.cps.ncmp.api.inventory;
22
23 import java.util.Collection;
24 import java.util.List;
25 import java.util.Map;
26 import org.onap.cps.spi.FetchDescendantsOption;
27 import org.onap.cps.spi.model.DataNode;
28
29 public interface CmHandleQueries {
30
31     /**
32      * Query CmHandles based on additional (private) properties.
33      *
34      * @param additionalPropertyQueryPairs private properties for query
35      * @return Ids of CmHandles which have these private properties
36      */
37     Collection<String> queryCmHandleAdditionalProperties(Map<String, String> additionalPropertyQueryPairs);
38
39     /**
40      * Query CmHandles based on public properties.
41      *
42      * @param publicPropertyQueryPairs public properties for query
43      * @return CmHandles which have these public properties
44      */
45     Collection<String> queryCmHandlePublicProperties(Map<String, String> publicPropertyQueryPairs);
46
47     /**
48      * Method which returns cm handles by the cm handles state.
49      *
50      * @param cmHandleState cm handle state
51      * @return a list of cm handles
52      */
53     List<DataNode> queryCmHandlesByState(CmHandleState cmHandleState);
54
55     /**
56      * Method to return data nodes representing the cm handles.
57      *
58      * @param cpsPath cps path for which the cmHandle is requested
59      * @return a list of data nodes representing the cm handles.
60      */
61     List<DataNode> queryCmHandleDataNodesByCpsPath(String cpsPath, FetchDescendantsOption fetchDescendantsOption);
62
63     /**
64      * Method to check the state of a cm handle with given id.
65      *
66      * @param cmHandleId            cm handle id
67      * @param requiredCmHandleState the required state of the cm handle
68      * @return a boolean, true if the state is equal to the required state
69      */
70     boolean cmHandleHasState(String cmHandleId, CmHandleState requiredCmHandleState);
71
72     /**
73      * Method which returns cm handles by the operational sync state of cm handle.
74      *
75      * @param dataStoreSyncState sync state
76      * @return a list of cm handles
77      */
78     List<DataNode> queryCmHandlesByOperationalSyncState(DataStoreSyncState dataStoreSyncState);
79
80     /**
81      * Get all cm handles ids by DMI plugin identifier.
82      *
83      * @param dmiPluginIdentifier DMI plugin identifier
84      * @return collection of cm handles
85      */
86     Collection<String> getCmHandleIdsByDmiPluginIdentifier(String dmiPluginIdentifier);
87 }