/** * Constructor. * * @param apiRequest The request for which the response is being processed * @param objectMappers Jackson mappers to use for processing JSON */ public MappingResponseProcessor(DataApiRequest apiRequest, ObjectMappersSuite objectMappers) { this.apiRequest = apiRequest; this.mappers = buildResultSetMapperList(apiRequest); this.headers = buildHeaderList(); this.responseContext = new ResponseContext(apiRequest.getDimensionFields()); this.objectMappers = objectMappers; }
ResponseContext responseContext = new ResponseContext(new LinkedHashMap<>()); if (throwable instanceof ResponseException) { ResponseException responseException = (ResponseException) throwable;
apiMetricColumnNames.add("pageViews"); ResponseContext responseContext = new ResponseContext(); responseContext.put("headers", new MultivaluedHashMap<>()); responseContext.put("apiMetricColumnNames", apiMetricColumnNames); ResponseContext errorResponseContext = new ResponseContext(); errorResponseContext.put("headers", new MultivaluedHashMap<>()); errorResponseContext.put(ResponseContextKeys.STATUS.getName(), 500);
apiMetricColumnNames.add("pageViews"); ResponseContext responseContext = new ResponseContext(); responseContext.put("headers", new MultivaluedHashMap<>()); responseContext.put("apiMetricColumnNames", apiMetricColumnNames); ResponseContext errorResponseContext = new ResponseContext(); errorResponseContext.put("headers", new MultivaluedHashMap<>()); errorResponseContext.put(ResponseContextKeys.STATUS.getName(), 500);