use of org.openqa.grid.internal.ProxySet in project selenium_java by sergueik.
the class MyConsoleServlet method getResponse.
private JSONObject getResponse() throws IOException, JSONException {
JSONObject requestJSON = new JSONObject();
ProxySet proxies = this.getRegistry().getAllProxies();
Iterator<RemoteProxy> iterator = proxies.iterator();
JSONArray busyProxies = new JSONArray();
JSONArray freeProxies = new JSONArray();
while (iterator.hasNext()) {
RemoteProxy eachProxy = iterator.next();
if (eachProxy.isBusy()) {
busyProxies.put(eachProxy.getOriginalRegistrationRequest().getAssociatedJSON());
} else {
freeProxies.put(eachProxy.getOriginalRegistrationRequest().getAssociatedJSON());
}
}
requestJSON.put("BusyProxies", busyProxies);
requestJSON.put("FreeProxies", freeProxies);
return requestJSON;
}
Aggregations