2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2025 OpenInfra Foundation Europe
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.dmi.rest.stub.controller;
23 import java.util.List;
24 import org.onap.cps.ncmp.dmi.provmns.model.ClassNameIdGetDataNodeSelectorParameter;
25 import org.onap.cps.ncmp.dmi.provmns.model.Resource;
26 import org.onap.cps.ncmp.dmi.provmns.model.ResourceOneOf;
27 import org.onap.cps.ncmp.dmi.provmns.model.Scope;
28 import org.onap.cps.ncmp.dmi.provmns.rest.api.DefaultApi;
29 import org.springframework.http.HttpStatus;
30 import org.springframework.http.ResponseEntity;
32 public class ProvMnsStubController implements DefaultApi {
35 * Replaces a complete single resource or creates it if it does not exist.
37 * @param className Class name of the targeted resource
38 * @param id Identifier of the targeted resource
39 * @param resource Resource representation of the resource to be created or replaced
40 * @return {@code ResponseEntity} The representation of the updated resource is returned in the response
44 public ResponseEntity<Resource> classNameidPut(final String className, final String id, final Resource resource) {
45 return new ResponseEntity<>(resource, HttpStatus.OK);
49 * Reads one or multiple resources.
51 * @param className Class name of the targeted resource
52 * @param id Identifier of the targeted resource
53 * @param scope Extends the set of targeted resources beyond the base
54 * resource identified with the authority and path component of
56 * @param filter Reduces the targeted set of resources by applying a filter to
57 * the scoped set of resource representations. Only resources
58 * representations for which the filter construct evaluates to
59 * "true" are targeted.
60 * @param attributes Attributes of the scoped resources to be returned. The
61 * value is a comma-separated list of attribute names.
62 * @param fields Attribute fields of the scoped resources to be returned. The
63 * value is a comma-separated list of JSON pointers to the
65 * @param dataNodeSelector dataNodeSelector object
66 * @return {@code ResponseEntity} The resources identified in the request for retrieval are returned
67 * in the response message body.
70 public ResponseEntity<Resource> classNameidGet(final String className, final String id, final Scope scope,
71 final String filter, final List<String> attributes,
72 final List<String> fields,
73 final ClassNameIdGetDataNodeSelectorParameter dataNodeSelector) {
74 return new ResponseEntity<>(new ResourceOneOf("exampleResourceId"), HttpStatus.OK);
78 * Patches (Create, Update or Delete) one or multiple resources.
80 * @param className Class name of the targeted resource
81 * @param id Identifier of the targeted resource
82 * @param resource Resource representation of the resource to be created or replaced
83 * @return {@code ResponseEntity} The updated resource representations are returned in the response message body.
86 public ResponseEntity<Resource> classNameidPatch(final String className, final String id, final Resource resource) {
87 return new ResponseEntity<>(resource, HttpStatus.OK);
91 * Delete one or multiple resources.
93 * @param className Class name of the targeted resource
94 * @param id Identifier of the targeted resource
95 * @return {@code ResponseEntity} The response body is empty, HTTP status returned.
98 public ResponseEntity<Void> classNameidDelete(final String className, final String id) {
99 return new ResponseEntity<>(HttpStatus.OK);