private List<URL> getRegistryURLs(GridRegistry registry) { Iterator<RemoteProxy> remoteProxyIterator = registry.getAllProxies().iterator(); List<URL> urlList = new ArrayList<>(); while (remoteProxyIterator.hasNext()) { RemoteProxy remoteProxy = remoteProxyIterator.next(); urlList.add(remoteProxy.getRemoteHost()); } return urlList; }
private List<URL> getRegistryURLs(Registry registry) { Iterator<RemoteProxy> remoteProxyIterator = registry.getAllProxies().iterator(); List<URL> urlList = new ArrayList<>(); while (remoteProxyIterator.hasNext()) { RemoteProxy remoteProxy = remoteProxyIterator.next(); urlList.add(remoteProxy.getRemoteHost()); } return urlList; }
public Void call() throws Exception { GridRegistry registry = HubHolder.getHub().getRegistry(); if (registry != null) { Iterator<RemoteProxy> it = registry.getAllProxies().iterator(); while (it.hasNext()) { RemoteProxy proxy = it.next(); if (remoteUrl.equals(proxy.getRemoteHost().toString())) { registry.removeIfPresent(proxy); } } } return null; }
public SeleniumTestSlot(TestSlot testSlot) { RemoteProxy proxy = testSlot.getProxy(); host = proxy.getRemoteHost(); capabilities = toCapabilities(testSlot); isReserved = testSlot.getSession() != null; }
public URL getRemoteHostForSession(String sessionId) { for (TestSession activeSession : registry.getActiveSessions()) { if (sessionId.equals(activeSession.getExternalKey().getKey())) { return activeSession.getSlot().getProxy().getRemoteHost(); } } throw new IllegalArgumentException("Invalid sessionId. No active session is present for id:" + sessionId); }
private void initSeLionRemoteProxySpecificValues(RemoteProxy proxy) { if (SeLionRemoteProxy.class.getCanonicalName().equals( proxy.getOriginalRegistrationRequest().getRemoteProxyClass())) { SeLionRemoteProxy srp = (SeLionRemoteProxy) proxy; // figure out if the proxy is scheduled to shutdown isShuttingDown = srp.isScheduledForRecycle(); // update the logsLocation if the proxy supports LogServlet if (srp.supportsViewLogs()) { logsLocation = proxy.getRemoteHost().toExternalForm() + "/extra/" + LogServlet.class.getSimpleName(); } totalSessionsStarted = srp.getTotalSessionsStarted(); totalSessionsComplete = srp.getTotalSessionsComplete(); uptimeInMinutes = srp.getUptimeInMinutes(); } }
private void initSeLionRemoteProxySpecificValues(RemoteProxy proxy) { if (SeLionRemoteProxy.class.getCanonicalName().equals( proxy.getOriginalRegistrationRequest().getConfiguration().proxy)) { SeLionRemoteProxy srp = (SeLionRemoteProxy) proxy; // figure out if the proxy is scheduled to shutdown isShuttingDown = srp.isScheduledForRecycle(); // update the logsLocation if the proxy supports LogServlet if (srp.supportsViewLogs()) { logsLocation = proxy.getRemoteHost().toExternalForm() + "/extra/" + LogServlet.class.getSimpleName(); } totalSessionsStarted = srp.getTotalSessionsStarted(); totalSessionsComplete = srp.getTotalSessionsComplete(); uptimeInMinutes = srp.getUptimeInMinutes(); } }
public Collection<SeleniumTestSlotGroup> call() { Map<URL, SeleniumTestSlotGroup> groups = new HashMap<URL, SeleniumTestSlotGroup>(); if (HubHolder.getHub() == null) { return Collections.emptyList(); } GridRegistry registry = HubHolder.getHub().getRegistry(); if (registry != null) { for (RemoteProxy proxy : registry.getAllProxies()) { for (TestSlot slot : proxy.getTestSlots()) { URL host = slot.getProxy().getRemoteHost(); SeleniumTestSlotGroup grp = groups.get(host); if (grp == null) { grp = new SeleniumTestSlotGroup(host); groups.put(host, grp); } grp.addTestSlot(new SeleniumTestSlot(slot)); } } } List<SeleniumTestSlotGroup> values = new ArrayList<SeleniumTestSlotGroup>(groups.values()); Collections.sort(values); return values; } });
localBuilder.append("listening on ").append(proxy.getRemoteHost());