2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 package org.openecomp.sparky;
28 import com.att.ajsc.beans.PropertiesMapBean;
29 import com.att.ajsc.filemonitor.AJSCPropertiesMap;
31 import javax.ws.rs.GET;
32 import javax.ws.rs.Path;
33 import javax.ws.rs.PathParam;
34 import javax.ws.rs.Produces;
38 * The Class JaxrsEchoService.
40 @Path("/jaxrs-services")
41 public class JaxrsEchoService {
46 * @param input the input
50 @Path("/echo/{input}")
51 @Produces("text/plain")
52 public String ping(@PathParam("input") String input) {
59 * @param fileName the file name
60 * @param input the input
61 * @return the property
64 @Path("/property/{fileName}/{input:.*}")
65 @Produces("text/plain")
66 public String getProperty(@PathParam("fileName") String fileName,
67 @PathParam("input") String input) {
70 val = AJSCPropertiesMap.getProperty(fileName, input);
71 if (val == null || val.isEmpty() || val.length() < 1) {
72 val = PropertiesMapBean.getProperty(fileName, input);
74 } catch (Exception ex) {
75 System.out.println("*** Error retrieving property " + input + ": " + ex);
78 return "Property is not available";
80 return "Property value is, " + val + ".";