public static InstanceStatus toEnum(String s) { if (s != null) { try { return InstanceStatus.valueOf(s.toUpperCase()); } catch (IllegalArgumentException e) { // ignore and fall through to unknown logger.debug("illegal argument supplied to InstanceStatus.valueOf: {}, defaulting to {}", s, UNKNOWN); } } return UNKNOWN; } }
InstanceStatus newStatus = newStatusValue == null ? InstanceStatus.UNKNOWN : InstanceStatus.valueOf(newStatusValue); boolean isSuccess = registry.deleteStatusOverride(app.getName(), id, newStatus, lastDirtyTimestamp, "true".equals(isReplication));
private void handleAppsPut(HttpExchange httpExchange) throws IOException { EurekaHttpResponse<?> httpResponse; String path = httpExchange.getRequestURI().getPath(); Matcher matcher; if ((matcher = Pattern.compile("/v2/apps/([^/]+)/([^/]+)").matcher(path)).matches()) { String overriddenstatus = getQueryParam(httpExchange, "overriddenstatus"); httpResponse = requestHandler.sendHeartBeat( matcher.group(1), matcher.group(2), null, overriddenstatus == null ? null : InstanceStatus.valueOf(overriddenstatus) ); } else if ((matcher = Pattern.compile("/v2/apps/([^/]+)/([^/]+)/status").matcher(path)).matches()) { String newStatus = getQueryParam(httpExchange, "value"); httpResponse = requestHandler.statusUpdate( matcher.group(1), matcher.group(2), newStatus == null ? null : InstanceStatus.valueOf(newStatus), null ); } else { httpExchange.sendResponseHeaders(HttpServletResponse.SC_NOT_FOUND, 0); return; } mapResponse(httpExchange, httpResponse); }
InstanceStatus.valueOf(newStatus), lastDirtyTimestamp, "true".equals(isReplication));
&& !(InstanceStatus.UNKNOWN.name().equals(overriddenStatus)) && isFromReplicaNode) { registry.storeOverriddenStatusIfRequired(app.getAppName(), id, InstanceStatus.valueOf(overriddenStatus));
InstanceStatus newStatus = newStatusValue == null ? InstanceStatus.UNKNOWN : InstanceStatus.valueOf(newStatusValue); boolean isSuccess = registry.deleteStatusOverride(app.getName(), id, newStatus, lastDirtyTimestamp, "true".equals(isReplication));
private void handleAppsPut(HttpExchange httpExchange) throws IOException { EurekaHttpResponse<?> httpResponse; String path = httpExchange.getRequestURI().getPath(); Matcher matcher; if ((matcher = Pattern.compile("/v2/apps/([^/]+)/([^/]+)").matcher(path)).matches()) { String overriddenstatus = getQueryParam(httpExchange, "overriddenstatus"); httpResponse = requestHandler.sendHeartBeat( matcher.group(1), matcher.group(2), null, overriddenstatus == null ? null : InstanceStatus.valueOf(overriddenstatus) ); } else if ((matcher = Pattern.compile("/v2/apps/([^/]+)/([^/]+)/status").matcher(path)).matches()) { String newStatus = getQueryParam(httpExchange, "value"); httpResponse = requestHandler.statusUpdate( matcher.group(1), matcher.group(2), newStatus == null ? null : InstanceStatus.valueOf(newStatus), null ); } else { httpExchange.sendResponseHeaders(HttpServletResponse.SC_NOT_FOUND, 0); return; } mapResponse(httpExchange, httpResponse); }
public static InstanceStatus toEnum(String s) { if (s != null) { try { return InstanceStatus.valueOf(s.toUpperCase()); } catch (IllegalArgumentException e) { // ignore and fall through to unknown logger.debug("illegal argument supplied to InstanceStatus.valueOf: {}, defaulting to {}", s, UNKNOWN); } } return UNKNOWN; } }
InstanceStatus.valueOf(newStatus), lastDirtyTimestamp, "true".equals(isReplication));
&& !(InstanceStatus.UNKNOWN.name().equals(overriddenStatus)) && isFromReplicaNode) { registry.storeOverriddenStatusIfRequired(app.getAppName(), id, InstanceStatus.valueOf(overriddenStatus));