@ThreadSafe public class DefaultGridRegistry extends BaseGridRegistry implements GridRegistry
Modifier and Type | Class and Description |
---|---|
protected static class |
DefaultGridRegistry.UncaughtExceptionHandler |
httpClientFactory, hub
KEY
Constructor and Description |
---|
DefaultGridRegistry() |
DefaultGridRegistry(Hub hub) |
Modifier and Type | Method and Description |
---|---|
void |
add(RemoteProxy proxy)
Add a proxy to the list of proxy available for the grid to managed and link the proxy to the
registry.
|
void |
addNewSessionRequest(RequestHandler handler)
Add a new session request to the registry
|
void |
clearNewSessionRequests()
Clear all new session requests in the registry
|
void |
forceRelease(TestSlot testSlot,
SessionTerminationReason reason)
Releases the test slot, WITHOUT running any listener.
|
java.util.Set<TestSession> |
getActiveSessions() |
ProxySet |
getAllProxies() |
java.lang.Iterable<org.openqa.selenium.remote.DesiredCapabilities> |
getDesiredCapabilities() |
TestSession |
getExistingSession(ExternalSessionKey externalKey)
gets the test existing session associated to this external key.
|
int |
getNewSessionRequestCount() |
RemoteProxy |
getProxyById(java.lang.String id)
Get the
RemoteProxy using the id provided |
TestSession |
getSession(ExternalSessionKey externalKey)
Gets the test session associated to this external key.
|
java.util.List<RemoteProxy> |
getUsedProxies() |
static GridRegistry |
newInstance(Hub hub)
Creates a new
GridRegistry and starts it. |
void |
removeIfPresent(RemoteProxy proxy)
Remove the
RemoteProxy specified from the registry |
boolean |
removeNewSessionRequest(RequestHandler request)
Remove a new session request from the registry
|
void |
setThrowOnCapabilityNotPresent(boolean throwOnCapabilityNotPresent)
If throwOnCapabilityNotPresent is set to true, the hub will reject test request for a
capability that is not on the grid.
|
void |
start()
Start the registry
|
void |
stop()
Stop the registry
|
void |
terminate(TestSession session,
SessionTerminationReason reason)
Ends this test session for the hub, releasing the resources in the hub / registry.
|
getHttpClient, getHub, setHub
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHttpClient, getHub, setHub
public DefaultGridRegistry()
public DefaultGridRegistry(Hub hub)
public void start()
GridRegistry
start
in interface GridRegistry
public static GridRegistry newInstance(Hub hub)
GridRegistry
and starts it.hub
- the Hub
to associate this registry withpublic void terminate(TestSession session, SessionTerminationReason reason)
terminate
in interface GridRegistry
session
- The session to terminatereason
- the reason for terminationpublic void removeIfPresent(RemoteProxy proxy)
GridRegistry
RemoteProxy
specified from the registryremoveIfPresent
in interface GridRegistry
GridRegistry.removeIfPresent(RemoteProxy)
public void forceRelease(TestSlot testSlot, SessionTerminationReason reason)
GridRegistry
forceRelease
in interface GridRegistry
testSlot
- test slot to be releasedreason
- reason for terminationGridRegistry.forceRelease(TestSlot, SessionTerminationReason)
public void stop()
GridRegistry
stop
in interface GridRegistry
GridRegistry.stop()
public void addNewSessionRequest(RequestHandler handler)
GridRegistry
addNewSessionRequest
in interface GridRegistry
handler
- the RequestHandler
GridRegistry.addNewSessionRequest(RequestHandler)
public void add(RemoteProxy proxy)
GridRegistry
add
in interface GridRegistry
proxy
- The proxy to addGridRegistry.add(RemoteProxy)
public void setThrowOnCapabilityNotPresent(boolean throwOnCapabilityNotPresent)
GridRegistry
If set to false, the test will be queued hoping a new proxy will register later offering that capability.
setThrowOnCapabilityNotPresent
in interface GridRegistry
throwOnCapabilityNotPresent
- true to throw if capability not presentGridRegistry.setThrowOnCapabilityNotPresent(boolean)
public ProxySet getAllProxies()
getAllProxies
in interface GridRegistry
ProxySet
of all of the connected proxies/nodesGridRegistry.getAllProxies()
public java.util.List<RemoteProxy> getUsedProxies()
getUsedProxies
in interface GridRegistry
List
of all of the proxies/nodes which are in useGridRegistry.getUsedProxies()
public TestSession getSession(ExternalSessionKey externalKey)
GridRegistry
getSession
in interface GridRegistry
externalKey
- the external session keyGridRegistry.getSession(ExternalSessionKey)
public TestSession getExistingSession(ExternalSessionKey externalKey)
GridRegistry
getExistingSession
in interface GridRegistry
externalKey
- the external session keyGridRegistry.getExistingSession(ExternalSessionKey)
public int getNewSessionRequestCount()
getNewSessionRequestCount
in interface GridRegistry
GridRegistry.getNewSessionRequestCount()
public void clearNewSessionRequests()
GridRegistry
clearNewSessionRequests
in interface GridRegistry
GridRegistry.clearNewSessionRequests()
public boolean removeNewSessionRequest(RequestHandler request)
GridRegistry
removeNewSessionRequest
in interface GridRegistry
request
- the RequestHandler
GridRegistry.removeNewSessionRequest(RequestHandler)
public java.lang.Iterable<org.openqa.selenium.remote.DesiredCapabilities> getDesiredCapabilities()
getDesiredCapabilities
in interface GridRegistry
DesiredCapabilities
in the new session queueGridRegistry.getDesiredCapabilities()
public java.util.Set<TestSession> getActiveSessions()
getActiveSessions
in interface GridRegistry
Set
of active TestSession
sGridRegistry.getActiveSessions()
public RemoteProxy getProxyById(java.lang.String id)
GridRegistry
RemoteProxy
using the id providedgetProxyById
in interface GridRegistry
id
- the string identifierRemoteProxy
GridRegistry.getProxyById(String)