2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
20 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 package org.onap.aai.ajsc_aai;
24 //import java.util.HashMap;
25 //import java.util.Map;
27 //import javax.ws.rs.GET;
28 //import javax.ws.rs.HeaderParam;
29 //import javax.ws.rs.Path;
30 //import javax.ws.rs.PathParam;
31 //import javax.ws.rs.Produces;
33 //import org.slf4j.Logger;
34 //import org.slf4j.LoggerFactory;
35 //import org.springframework.web.context.ContextLoader;
36 //import org.springframework.web.context.WebApplicationContext;
38 //import ajsc.ErrorMessageLookupService;
40 //@Path("/errormessage")
41 //public class JaxrsErrorMessageLookupService {
43 //private final static Logger logger = LoggerFactory
44 //.getLogger(ErrorMessageLookupService.class);
49 //@param input the input
50 //@param errorCode the error code
51 //@param appId the app id
52 //@param operation the operation
53 //@param messageText the message text
54 //@param isRESTService the is REST service
55 //@param faultEntity the fault entity
56 //@param ConvID the conv ID
60 //@Produces("text/plain")
61 //public String getMessage(@PathParam("input") String input,
62 //@HeaderParam("errorCode") String errorCode,
63 //@HeaderParam("appId") String appId,
64 //@HeaderParam("operation") String operation,
65 //@HeaderParam("messageText") String messageText,
66 //@HeaderParam("isRESTService") String isRESTService,
67 //@HeaderParam("faultEntity") String faultEntity,
68 //@HeaderParam("ConvID") String ConvID) {
70 //Map<String, String> headers = new HashMap<String, String>();
71 //headers.put(errorCode, errorCode);
72 //headers.put(appId, appId);
73 //headers.put(operation, operation);
74 //headers.put(messageText, messageText);
75 //headers.put(isRESTService, isRESTService);
76 //headers.put(faultEntity, faultEntity);
77 //headers.put(ConvID, ConvID);
79 //WebApplicationContext applicationContext = ContextLoader
80 //.getCurrentWebApplicationContext();
82 //ErrorMessageLookupService e = (ErrorMessageLookupService) applicationContext
83 //.getBean("errorMessageLookupService");
85 //String message = e.getExceptionDetails(appId, operation, errorCode,
86 //messageText,isRESTService, faultEntity, ConvID);
88 //System.out.println("Error code = " + errorCode);
89 //System.out.println("appId = " + appId);
90 //System.out.println("operation = " + operation);
91 //System.out.println("messageText = " + messageText);
92 //System.out.println("isRESTService = " + isRESTService);
93 //System.out.println("faultEntity = " + faultEntity);
94 //System.out.println("ConvID = " + ConvID);
95 //return "The exception message is:\n " + message;