2 * ============LICENSE_START=======================================================
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 is a trademark and service mark of AT&T Intellectual Property.
24 package org.onap.crud.service;
26 import org.onap.aai.cl.api.Logger;
27 import org.onap.aai.cl.eelf.LoggerFactory;
28 import org.onap.crud.logging.LoggingUtil;
30 import javax.servlet.http.HttpServletRequest;
31 import javax.ws.rs.GET;
32 import javax.ws.rs.Path;
33 import javax.ws.rs.PathParam;
34 import javax.ws.rs.Produces;
35 import javax.ws.rs.core.Context;
36 import javax.ws.rs.core.HttpHeaders;
37 import javax.ws.rs.core.Response;
38 import javax.ws.rs.core.Response.Status;
39 import javax.ws.rs.core.UriInfo;
42 public class JaxrsEchoService {
44 private static Logger logger = LoggerFactory.getInstance()
45 .getLogger(JaxrsEchoService.class.getName());
46 private static Logger auditLogger = LoggerFactory.getInstance()
47 .getAuditLogger(JaxrsEchoService.class.getName());
51 @Produces("text/plain")
52 public String ping(@PathParam("input") String input,
53 @Context HttpHeaders headers,
54 @Context UriInfo info,
55 @Context HttpServletRequest req) {
57 LoggingUtil.initMdcContext(req, headers);
58 LoggingUtil.logRestRequest(logger, auditLogger, req, Response.status(Status.OK)
59 .entity("OK").build());
61 return "Hello, " + input + ".";