+ @Override
+ public String process(String urlContext, String queryParams, Map<String, List<String>> headers)
+ throws DataRouterException {
+ String response;
+ ChameleonAction action = resolveChameleonAction(urlContext);
+ String chameleonURL = buildUrl(urlContext, queryParams, action);
+ logger.info(QueryMsgs.QUERY_INFO, "Routing request to Chameleon service URL: " + chameleonURL);
+
+ headers = headers == null ? new HashMap<String, List<String>>() : headers;
+ headers.put("X-FromAppId", Arrays.asList(DataRouterConstants.DATA_ROUTER_SERVICE_NAME));
+ OperationResult result = restClient.get(chameleonURL, headers, MediaType.APPLICATION_JSON_TYPE);
+
+ try {
+ response = parseResponse(urlContext, result, action);
+ } catch (DataRouterException ex) {
+ logger.info(QueryMsgs.QUERY_ERROR,
+ "Error while calling Chameleon service URL: " + chameleonURL + " failure cause: " + result.getFailureCause());
+ throw ex;