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
 
   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.rest.controller.handlers;
 
  23 import java.util.function.Supplier;
 
  24 import org.onap.cps.ncmp.api.models.ResourceDataBatchRequest;
 
  25 import org.onap.cps.spi.FetchDescendantsOption;
 
  27 public interface TaskManagementDefaultHandler {
 
  29     String NO_REQUEST_ID = null;
 
  30     String NO_TOPIC = null;
 
  31     Supplier<Object> NO_OBJECT_SUPPLIER = null;
 
  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;
 
  43     default Supplier<Object> getTaskSupplierForQueryRequest(final String cmHandleId,
 
  44                                                             final String resourceIdentifier,
 
  45                                                             final boolean includeDescendant) {
 
  46         return NO_OBJECT_SUPPLIER;
 
  49     default void sendResourceDataBatchRequestAsynchronously(final String topicParamInQuery,
 
  50                                                             final ResourceDataBatchRequest
 
  51                                                                     resourceDataBatchRequest,
 
  52                                                             final String requestId) {
 
  55     static FetchDescendantsOption getFetchDescendantsOption(final boolean includeDescendants) {
 
  56         return includeDescendants ? FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS
 
  57                 : FetchDescendantsOption.OMIT_DESCENDANTS;