NCMP : Replacing the word 'Batch' as 'DataOperation'.
[cps.git] / cps-ncmp-rest / src / main / java / org / onap / cps / ncmp / rest / controller / handlers / TaskManagementDefaultHandler.java
1 /*
2  *  ============LICENSE_START=======================================================
3  *  Copyright (C) 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.rest.controller.handlers;
22
23 import java.util.function.Supplier;
24 import org.onap.cps.ncmp.api.models.DataOperationRequest;
25 import org.onap.cps.spi.FetchDescendantsOption;
26
27 public interface TaskManagementDefaultHandler {
28
29     String NO_REQUEST_ID = null;
30     String NO_TOPIC = null;
31     Supplier<Object> NO_OBJECT_SUPPLIER = null;
32
33     default Supplier<Object> getTaskSupplierForGetRequest(final String datastoreName,
34                                                           final String cmHandleId,
35                                                           final String resourceIdentifier,
36                                                           final String optionsParamInQuery,
37                                                           final String topicParamInQuery,
38                                                           final String requestId,
39                                                           final boolean includeDescendant) {
40         return NO_OBJECT_SUPPLIER;
41     }
42
43     default Supplier<Object> getTaskSupplierForQueryRequest(final String cmHandleId,
44                                                             final String resourceIdentifier,
45                                                             final boolean includeDescendant) {
46         return NO_OBJECT_SUPPLIER;
47     }
48
49     default void sendDataOperationRequestAsynchronously(final String topicParamInQuery,
50                                                         final DataOperationRequest
51                                                                     dataOperationRequest,
52                                                         final String requestId) {
53     }
54
55     static FetchDescendantsOption getFetchDescendantsOption(final boolean includeDescendants) {
56         return includeDescendants ? FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS
57                 : FetchDescendantsOption.OMIT_DESCENDANTS;
58     }
59 }