Create Endpoint For Get Cm Handles By Name
[cps.git] / cps-ncmp-service / src / main / java / org / onap / cps / ncmp / api / NetworkCmProxyDataService.java
1 /*
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  *  ================================================================================
7  *  Licensed under the Apache License, Version 2.0 (the "License");
8  *  you may not use this file except in compliance with the License.
9  *  You may obtain a copy of the License at
10  *
11  *        http://www.apache.org/licenses/LICENSE-2.0
12  *
13  *  Unless required by applicable law or agreed to in writing, software
14  *  distributed under the License is distributed on an "AS IS" BASIS,
15  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  *  See the License for the specific language governing permissions and
17  *  limitations under the License.
18  *
19  *  SPDX-License-Identifier: Apache-2.0
20  *  ============LICENSE_END=========================================================
21  */
22
23 package org.onap.cps.ncmp.api;
24
25 import static org.onap.cps.ncmp.api.impl.operations.DmiRequestBody.OperationEnum;
26
27 import java.util.Collection;
28 import org.onap.cps.ncmp.api.models.DmiPluginRegistration;
29 import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
30 import org.onap.cps.spi.model.ModuleReference;
31
32 /*
33  * Datastore interface for handling CPS data.
34  */
35 public interface NetworkCmProxyDataService {
36
37     /**
38      * Registration of New CM Handles.
39      *
40      * @param dmiPluginRegistration Dmi Plugin Registration
41      */
42     void updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
43
44     /**
45      * Get resource data for data store pass-through operational
46      * using dmi.
47      *
48      * @param cmHandleId cm handle identifier
49      * @param resourceIdentifier resource identifier
50      * @param acceptParamInHeader accept param
51      * @param optionsParamInQuery options query
52      * @return {@code Object} resource data
53      */
54     Object getResourceDataOperationalForCmHandle(String cmHandleId,
55                                                  String resourceIdentifier,
56                                                  String acceptParamInHeader,
57                                                  String optionsParamInQuery);
58
59     /**
60      * Get resource data for data store pass-through running
61      * using dmi.
62      *
63      * @param cmHandleId cm handle identifier
64      * @param resourceIdentifier resource identifier
65      * @param acceptParamInHeader accept param
66      * @param optionsParamInQuery options query
67      * @return {@code Object} resource data
68      */
69     Object getResourceDataPassThroughRunningForCmHandle(String cmHandleId,
70                                                         String resourceIdentifier,
71                                                         String acceptParamInHeader,
72                                                         String optionsParamInQuery);
73
74     /**
75      * Write resource data for data store pass-through running
76      * using dmi for given cm-handle.
77      *  @param cmHandleId cm handle identifier
78      * @param resourceIdentifier resource identifier
79      * @param operation required operation
80      * @param requestBody request body to create resource
81      * @param contentType content type in body
82      * @return {@code Object} return data
83      */
84     Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId,
85                                                         String resourceIdentifier,
86                                                         OperationEnum operation,
87                                                         String requestBody,
88                                                         String contentType);
89
90     /**
91      * Retrieve module references for the given cm handle.
92      *
93      * @param cmHandleId cm handle identifier
94      * @return a collection of modules names and revisions
95      */
96     Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandleId);
97
98     /**
99      * Query cm handle identifiers for the given collection of module names.
100      *
101      * @param moduleNames module names.
102      * @return a collection of cm handle identifiers. The schema set for each cm handle must include all the
103      *         given module names
104      */
105     Collection<String> executeCmHandleHasAllModulesSearch(Collection<String> moduleNames);
106
107     /**
108      * Query cm handle details by cm handle's name.
109      *
110      * @param cmHandleId cm handle identifier
111      * @return a collection of cm handle details.
112      */
113     NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId);
114
115 }