2 * ============LICENSE_START=======================================================
4 * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ============LICENSE_END=========================================================
20 package org.onap.policy.drools.server.restful;
22 import io.swagger.annotations.Api;
23 import io.swagger.annotations.ApiOperation;
24 import java.util.Properties;
25 import javax.ws.rs.Consumes;
26 import javax.ws.rs.GET;
27 import javax.ws.rs.Path;
28 import javax.ws.rs.Produces;
29 import javax.ws.rs.core.MediaType;
30 import javax.ws.rs.core.Response;
31 import org.onap.policy.common.endpoints.event.comm.TopicSource;
32 import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler;
33 import org.onap.policy.drools.legacy.config.LegacyConfigFeature;
36 * REST Legacy Configuration Manager.
39 @Path("/policy/pdp/engine/legacy/config")
40 @Produces({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML})
41 @Consumes({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML})
43 public class RestLegacyConfigManager {
50 @ApiOperation(value = "Retrieves the legacy configuration properties",
51 notes = "Legacy Configuration Properties", response = Properties.class)
52 public Response properties() {
53 return Response.status(Response.Status.OK)
54 .entity(LegacyConfigFeature.getLegacyConfig().getProperties()).build();
58 * GET the topic source.
62 @ApiOperation(value = "Retrieves the legacy configuration topic source",
63 notes = "Legacy Configuration Source", response = TopicSource.class)
64 public Response source() {
65 return Response.status(Response.Status.OK)
66 .entity(LegacyConfigFeature.getLegacyConfig().getSource()).build();