/** * Specify Response cache controls. * * @param routeContext */ protected void specifyCacheControls(RouteContext routeContext) { if (isNoCache) { log.debug("NoCache detected, response may not be cached"); routeContext.getResponse().noCache(); } }
@Override public void handle(RouteContext routeContext) { Response response = routeContext.getResponse().noCache().text(); Map<String, String> props = new HashMap<>(); for (String name : System.getProperties().stringPropertyNames()) { props.put(name, System.getProperty(name)); } try (BufferedWriter writer = new BufferedWriter(response.getWriter())) { writeSystemProperties(props, writer); writer.newLine(); writeEnv(System.getenv(), writer); writer.flush(); } catch (IOException e) { log.error(e.getMessage(), e); } }
@Override public void handle(RouteContext routeContext) { Map<String, String> settingsMap = settingsToMap(routeContext.getSettings()); Response response = routeContext.getResponse().noCache().text(); try (BufferedWriter writer = new BufferedWriter(response.getWriter())) { writeSettings(settingsMap, writer); writer.flush(); } catch (IOException e) { log.error(e.getMessage(), e); } }
@Override public void handle(RouteContext routeContext) { routeContext.getResponse().noCache().text().send("pong"); }
@Override public void handle(RouteContext routeContext) { Response response = routeContext.getResponse().noCache().text();
@Override public void handle(RouteContext routeContext) { Response response = routeContext.getResponse().noCache().text(); SortedMap<String, HealthCheck.Result> healthChecks = healthCheckRegistry.runHealthChecks(); if (healthChecks.isEmpty()) { response.notImplemented().send("The health checks are empty"); } else { boolean notHealthy = healthChecks.values().stream().anyMatch(hc -> !hc.isHealthy()); if (notHealthy) { response.internalError().send("The health is bad"); } else { response.ok().send("The health is good"); } } }
@Override public void handle(RouteContext routeContext) { Response response = routeContext.getResponse().noCache().text(); if (threadDump != null) { threadDump.dump(response.getOutputStream()); } else { response.internalError().send("Sorry your runtime environment does not allow to dump threads"); } }
/** * Specify Response cache controls. * * @param routeContext */ protected void specifyCacheControls(RouteContext routeContext) { if (isNoCache) { log.debug("NoCache detected, response may not be cached"); routeContext.getResponse().noCache(); } }
/** * Specify Response cache controls. * * @param context */ protected void specifyCacheControls(Context context) { if (isNoCache) { log.debug("NoCache detected, response may not be cached"); context.getResponse().noCache(); } }
/** * Specify Response cache controls. * * @param context */ protected void specifyCacheControls(Context context) { if (isNoCache) { log.debug("NoCache detected, response may not be cached"); context.getResponse().noCache(); } }
@Override public void handle(RouteContext routeContext) { Response response = routeContext.getResponse().noCache().text();
@Override public void handle(RouteContext routeContext) { Response response = routeContext.getResponse().noCache().text(); SortedMap<String, HealthCheck.Result> healthChecks = healthCheckRegistry.runHealthChecks(); if (healthChecks.isEmpty()) { response.notImplemented().send("The health checks are empty"); } else { boolean notHealthy = healthChecks.values().stream().anyMatch(hc -> !hc.isHealthy()); if (notHealthy) { response.internalError().send("The health is bad"); } else { response.ok().send("The health is good"); } } }
@Override public void handle(RouteContext routeContext) { Response response = routeContext.getResponse().noCache().text(); if (threadDump != null) { threadDump.dump(response.getOutputStream()); } else { response.internalError().send("Sorry your runtime environment does not allow to dump threads"); } }