Removing Drools-pdp swagger annotations
[policy/drools-pdp.git] / feature-legacy-config / src / main / java / org / onap / policy / drools / server / restful / RestLegacyConfigManager.java
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP
4  * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
5  * Modifications Copyright (C) 2023 Nordix Foundation.
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  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.drools.server.restful;
22
23 import javax.ws.rs.Consumes;
24 import javax.ws.rs.GET;
25 import javax.ws.rs.Path;
26 import javax.ws.rs.Produces;
27 import javax.ws.rs.core.MediaType;
28 import javax.ws.rs.core.Response;
29 import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler;
30 import org.onap.policy.drools.legacy.config.LegacyConfigFeature;
31
32 /**
33  * REST Legacy Configuration Manager.
34  */
35
36 @Path("/policy/pdp/engine/legacy/config")
37 @Produces({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML})
38 @Consumes({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML})
39 public class RestLegacyConfigManager implements LegacyApi {
40
41     /**
42      * GET properties.
43      */
44     @Override
45     @GET
46     @Path("properties")
47     public Response properties() {
48         return Response.status(Response.Status.OK)
49                        .entity(LegacyConfigFeature.getLegacyConfig().getProperties()).build();
50     }
51
52     /**
53      * GET the topic source.
54      */
55     @Override
56     @GET
57     @Path("topic/source")
58     public Response source() {
59         return Response.status(Response.Status.OK)
60                        .entity(LegacyConfigFeature.getLegacyConfig().getSource()).build();
61     }
62 }