Generates route list the same way dialog does.
@param response
@return
@throws ParseException
167295
public static List<RouteHeader> getRouteList(Response response, HeaderFactory headerFactory) throws ParseException {
		// we have record route set, as we are client, this is reversed
		final ArrayList<RouteHeader> routeList = new ArrayList<RouteHeader>();
		final ListIterator<?> rrLit = response.getHeaders(RecordRouteHeader.NAME);
		while (rrLit.hasNext()) {
			final RecordRouteHeader rrh = (RecordRouteHeader) rrLit.next();
			final RouteHeader rh = headerFactory.createRouteHeader(rrh.getAddress());
			final Iterator<?> pIt = rrh.getParameterNames();
			while (pIt.hasNext()) {
				final String pName = (String) pIt.next();
				rh.setParameter(pName, rrh.getParameter(pName));
			}
			routeList.add(0, rh);
		}
		return routeList;
	}
357177
public NextJourney createNextJourney(PlannedJourneyProvider journeyProvider, HtmlResponse response) { // almost copied from super
        String path = response.getRoutingPath();
        final boolean redirectTo = response.isRedirectTo();
        if (path.indexOf(":") < 0) {
            if (!path.startsWith("/")) {
                path = buildActionPath(getActionDef().getComponentName()) + path;
            }
            if (!redirectTo && isHtmlForward(path)) {
                path = filterHtmlPath(path);
            }
        }
        return newNextJourney(journeyProvider, path, redirectTo, response.isAsIs(), response.getViewObject());
    }
771817
public static List<FlatRow> toRows(Iterable<ReadRowsResponse> responses) {
    final ArrayList<FlatRow> result = new ArrayList<>();
    RowMerger rowMerger = new RowMerger(new StreamObserver<FlatRow>() {
      @Override
      public void onNext(FlatRow value) {
        result.add(value);
      }

      @Override
      public void onError(Throwable t) {
        if (t instanceof RuntimeException) {
          throw (RuntimeException) t;
        } else {
          throw new IllegalStateException(t);
        }
      }

      @Override
      public void onCompleted() {
      }
    });
    for (ReadRowsResponse response : responses) {
      rowMerger.onNext(response);
    }
    rowMerger.onCompleted();
    return result;
  }
241505
protected static String responseToJson(Response response) throws JsonProcessingException {
        ObjectMapper mapper = ApiModelMixinModule.setupObjectMapper(new ObjectMapper());
        mapper.enable(SerializationFeature.INDENT_OUTPUT);
        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
        return mapper.writeValueAsString(response);
    }
1358431
private void addResponsesToAction(ControllerRouteModel<Raml> elem, Action action) {

        // get all mimeTypes defined in @Route.produces
        LOGGER.debug("responsesMimes.size:"+elem.getResponseMimes().size());
        List<String> mimes = new ArrayList<>();
        mimes.addAll(elem.getResponseMimes());

        // if no mimeTypes defined, no response specifications
        if(mimes.isEmpty()){
            return;
        }

        int i=0;
        // iterate over @response.code javadoc annotation
        for (String code : elem.getResponseCodes()) {
            LOGGER.debug("code:"+code);

            // get mimeType in order of declaration, else get first
            String mime;
            if(mimes.size()>i){
                mime = mimes.get(i);
            } else {
                mime = mimes.get(0);
            }

            Response resp = new Response();

            // add @response.description javadoc annotation if exist
            if(elem.getResponseDescriptions().size()>i){
                resp.setDescription(elem.getResponseDescriptions().get(i));
            }

            // add @response.body javadoc annotation if exist
            if(elem.getResponseBodies().size()>i){
                MimeType mimeType = new MimeType(mime);
                mimeType.setExample(elem.getResponseBodies().get(i).toString());

                resp.setBody(Collections.singletonMap(mime, mimeType));
            }

            action.getResponses().put(code, resp);
            i++;
        }
    }
331366
private Collection<String> buildQueueNames(Response response) {
		Collection<String> queueNames = new HashSet<>();
		
		Collection<String> detectionSystemNames = appSensorServer.getConfiguration().getRelatedDetectionSystems(response.getDetectionSystem());
		
		for(String detectionSystemName : detectionSystemNames) {
			queueNames.add(RabbitMqUtils.buildResponseQueueName(detectionSystemName));
		}

		return queueNames;
	}
550445
public Observable<UsageListResultInner> listAsync(String location) {
        return listWithServiceResponseAsync(location).map(new Func1<ServiceResponse<UsageListResultInner>, UsageListResultInner>() {
            @Override
            public UsageListResultInner call(ServiceResponse<UsageListResultInner> response) {
                return response.body();
            }
        });
    }
429012
public void get(String path, Route route, ResponseTransformer transformer) {
        addRoute(HttpMethod.get, ResponseTransformerRouteImpl.create(path, route, transformer));
    }
1249338
public String generateJSON(Collection<Route> routes) {
        Swagger swagger = build(routes);
        String json = Json.pretty(swagger);
        return json;
    }
582850
public Observable<ServiceResponse<Page<ApplicationGatewaySslPredefinedPolicyInner>>> listAvailableSslPredefinedPoliciesWithServiceResponseAsync() {
        return listAvailableSslPredefinedPoliciesSinglePageAsync()
            .concatMap(new Func1<ServiceResponse<Page<ApplicationGatewaySslPredefinedPolicyInner>>, Observable<ServiceResponse<Page<ApplicationGatewaySslPredefinedPolicyInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ApplicationGatewaySslPredefinedPolicyInner>>> call(ServiceResponse<Page<ApplicationGatewaySslPredefinedPolicyInner>> page) {
                    String nextPageLink = page.body().nextPageLink();
                    if (nextPageLink == null) {
                        return Observable.just(page);
                    }
                    return Observable.just(page).concatWith(listAvailableSslPredefinedPoliciesNextWithServiceResponseAsync(nextPageLink));
                }
            });
    }
10550
protected final <R extends Response> R logResponse(R response) {
    LOGGER.trace("{} - Sending {}", context.getCluster().member().address(), response);
    return response;
  }
485803
@Override
  protected String parseResponse(final HttpResponse response)
      throws HttpResponseException, IOException {
    final StatusLine statusLine = response.getStatusLine();
    final String responseBody = response.getEntity() != null ?
        EntityUtils.toString(response.getEntity()) : "";

    if (statusLine.getStatusCode() >= 300) {

      logger.error(String.format("unable to parse response as the response status is %s",
          statusLine.getStatusCode()));

      throw new HttpResponseException(statusLine.getStatusCode(), responseBody);
    }

    return responseBody;
  }
254550
function toRouteMap(routeList) {
	var routeMap = {};
	for (var i = 0, len = routeList.length; i < len; i++) {
		var route = routeList[i];
		routeMap[route['path']] = route;
	}
	return routeMap;
}
866500
private List<EnrollmentTerm> parseEnrollmentTermList(final List<Response> responses) {
        return responses.stream().
                map(this::parseEnrollmentTermList).
                flatMap(Collection::stream).
                collect(Collectors.toList());
    }
519288
@Override
    public List<Queue> parse(String text) throws ParseException {
        final List<Queue> queues;
        if (StringUtils.isNotBlank(text)) {
            queues = new LinkedList<Queue>();
            String separator = "\n";
            if (text.indexOf("\r\n") > 0) {
                separator = "\r\n";
            }
            final String[] lines = text.split(separator);
            Queue queue = null;
            for (final String line : lines) {
                Matcher matcher = PATTERN_QUEUE.matcher(line);
                if (matcher.matches()) {
                    if (queue != null) {
                        queues.add(queue);
                    }
                    queue = new Queue();
                    final String name = matcher.group(1);
                    queue.setName(name);
                } else if (StringUtils.isNotBlank(line)) {
                    String[] temp = Utils.splitFirst(line, CHAR_EQUALS);
                    if (temp.length == 2) {
                        final String key = temp[0].trim().toLowerCase();
                        final String value = temp[1].trim();
                        if ("queue_type".equals(key)) {
                            queue.setQueueType(value);
                        } else if ("priority".equals(key)) {
                            try {
                                queue.setPriority(Integer.parseInt(value));
                            } catch (NumberFormatException nfe) {
                                LOGGER.log(Level.WARNING, "Failed parsing queue priority: " + nfe.getMessage(), nfe);
                                queue.setPriority(-1);
                            }
                        } else if ("total_jobs".equals(key)) {
                            try {
                                queue.setTotalJobs(Integer.parseInt(value));
                            } catch (NumberFormatException nfe) {
                                LOGGER.log(Level.WARNING, "Failed parsing queue total jobs: " + nfe.getMessage(), nfe);
                                queue.setPriority(-1);
                            }
                        } else if ("state_count".equals(key)) {
                            queue.setStateCount(value);
                        } else if ("mtime".equals(key)) {
                            queue.setMtime(value);
                        } else if ("max_user_run".equals(key)) {
                            try {
                                queue.setMaxUserRun(Integer.parseInt(value));
                            } catch (NumberFormatException nfe) {
                                LOGGER.log(Level.WARNING, "Failed parsing queue max user run: " + nfe.getMessage(),
                                        nfe);
                                queue.setPriority(-1);
                            }
                        } else if ("enabled".equals(key)) {
                            queue.setEnabled(Boolean.parseBoolean(value));
                        } else if ("started".equals(key)) {
                            queue.setStarted(Boolean.parseBoolean(value));
                        } else if (key.startsWith("resources_max.")) {
                            queue.getResourcesMax().put(key, value);
                        } else if (key.startsWith("resources_min.")) {
                            queue.getResourcesMin().put(key, value);
                        } else if (key.startsWith("resources_assigned.")) {
                            queue.getResourcesAssigned().put(key, value);
                        } else if (key.startsWith("resources_default.")) {
                            queue.getResourcesDefault().put(key, value);
                        } else {
                            LOGGER.info("Unmmaped key, value: " + key + ", " + value);
                        }
                    }
                }
            }
            if (queue != null) {
                queues.add(queue);
            }
            return queues;
        } else {
            return Collections.emptyList();
        }
    }
1339122
protected void onPostDispatch(Request request, Response response) {
        application.getRoutePostDispatchListeners().onPostDispatch(request, response);
    }
265276
public Observable<Page<RouteFilterInner>> listAsync() {
        return listWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<RouteFilterInner>>, Page<RouteFilterInner>>() {
                @Override
                public Page<RouteFilterInner> call(ServiceResponse<Page<RouteFilterInner>> response) {
                    return response.body();
                }
            });
    }