public static ASGStatus toEnum(String s) { for (ASGStatus e : ASGStatus.values()) { if (e.name().equalsIgnoreCase(s)) { return e; } } throw new RuntimeException("Cannot find ASG enum for the given string " + s); } }
@Override public EurekaHttpResponse<Void> statusUpdate(String asgName, ASGStatus newStatus) { Response response = null; try { String urlPath = "asg/" + asgName + "/status"; response = jerseyClient.target(serviceUrl) .path(urlPath) .queryParam("value", newStatus.name()) .request() .header(PeerEurekaNode.HEADER_REPLICATION, "true") .put(Entity.text("")); return EurekaHttpResponse.status(response.getStatus()); } finally { if (response != null) { response.close(); } } }
public static ASGStatus toEnum(String s) { for (ASGStatus e : ASGStatus.values()) { if (e.name().equalsIgnoreCase(s)) { return e; } } throw new RuntimeException("Cannot find ASG enum for the given string " + s); } }
@Override public EurekaHttpResponse<Void> statusUpdate(String asgName, ASGStatus newStatus) { Response response = null; try { String urlPath = "asg/" + asgName + "/status"; response = jerseyClient.target(serviceUrl) .path(urlPath) .queryParam("value", newStatus.name()) .request() .header(PeerEurekaNode.HEADER_REPLICATION, "true") .put(Entity.text("")); return EurekaHttpResponse.status(response.getStatus()); } finally { if (response != null) { response.close(); } } }
@Override public EurekaHttpResponse<Void> statusUpdate(String asgName, ASGStatus newStatus) { ClientResponse response = null; try { String urlPath = "asg/" + asgName + "/status"; response = jerseyApacheClient.resource(serviceUrl) .path(urlPath) .queryParam("value", newStatus.name()) .header(PeerEurekaNode.HEADER_REPLICATION, "true") .put(ClientResponse.class); return EurekaHttpResponse.status(response.getStatus()); } finally { if (response != null) { response.close(); } } }
@Override public EurekaHttpResponse<Void> statusUpdate(String asgName, ASGStatus newStatus) { ClientResponse response = null; try { String urlPath = "asg/" + asgName + "/status"; response = jerseyApacheClient.resource(serviceUrl) .path(urlPath) .queryParam("value", newStatus.name()) .header(PeerEurekaNode.HEADER_REPLICATION, "true") .put(ClientResponse.class); return EurekaHttpResponse.status(response.getStatus()); } finally { if (response != null) { response.close(); } } }