public interface RemoteProxy extends java.lang.Comparable<RemoteProxy>
The proxy keeps a state of what is happening on the remote server and knows if a new test can be run on the remote server. There are several reasons why a test could not be run on the specified remote server, for instance: if the RemoteProxy decides the remote server has reached the maximum number of concurrent sessions, or if the client has requested DesiredCapabilities we don't support e.g. asking for Chrome when we only support Firefox.
Modifier and Type | Method and Description |
---|---|
default TestSlot |
createTestSlot(SeleniumProtocol protocol,
java.util.Map<java.lang.String,java.lang.Object> capabilities)
Create a new TestSlot.
|
CapabilityMatcher |
getCapabilityHelper()
Returns the capability matcher that will be used to by the remote proxy
to determine whether its test slots can run a requested test session.
|
GridNodeConfiguration |
getConfig()
Returns the configuration the node was initialized with.
|
HtmlRenderer |
getHtmlRender()
Returns the object responsible for rendering any information about the proxy in a Web application.
|
org.openqa.selenium.remote.http.HttpClient |
getHttpClient(java.net.URL url)
Deprecated.
|
org.openqa.selenium.remote.http.HttpClient |
getHttpClient(java.net.URL url,
int connectionTimeout,
int readTimeout) |
java.lang.String |
getId()
Returns the unique id for the node.
|
long |
getLastSessionStart() |
int |
getMaxNumberOfConcurrentTestSessions()
Returns the maximum number of concurrent tests that can run on this node.
|
TestSession |
getNewSession(java.util.Map<java.lang.String,java.lang.Object> requestedCapability)
Creates and returns a new test session if the current node has the resources and is ready to run the test.
|
RegistrationRequest |
getOriginalRegistrationRequest()
Returns the request sent from the node to the hub to register the proxy.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProxyStatus()
Renders the status of the node as JSON.
|
<T extends GridRegistry> |
getRegistry()
Retrieves the handle to the registry this remote proxy is registered with.
|
java.net.URL |
getRemoteHost()
Get the host the node is on.
|
float |
getResourceUsageInPercent()
Return how much resources are currently used on the proxy.
|
java.util.List<TestSlot> |
getTestSlots()
Each test running on the node will occupy a test slot.
|
int |
getTimeOut()
Indicates how long a node should wait for a seemingly non-responsive test session before deciding it has timed out.
|
int |
getTotalUsed()
Returns the total number of test slots used on this node.
|
boolean |
hasCapability(java.util.Map<java.lang.String,java.lang.Object> requestedCapability)
Checks if the node has the capability requested.
|
boolean |
isBusy()
Indicates whether the node has any test slots in use.
|
void |
setupTimeoutListener()
If the RemoteProxy implementation also implements TimeoutListener, then this method
will start up the thread used to monitor timeouts and handle cleanup of timed out resources.
|
void |
teardown()
If the RemoteProxy implementation also implements TimeoutListener, then this method
will stop the thread used to monitor timeouts.
|
default TestSlot createTestSlot(SeleniumProtocol protocol, java.util.Map<java.lang.String,java.lang.Object> capabilities)
protocol
- a SeleniumProtocol
object that identifies the request flavor.capabilities
- the type of test the client is interested in performing.java.util.List<TestSlot> getTestSlots()
<T extends GridRegistry> T getRegistry()
CapabilityMatcher getCapabilityHelper()
void setupTimeoutListener()
java.lang.String getId()
void teardown()
GridNodeConfiguration getConfig()
RegistrationRequest getOriginalRegistrationRequest()
int getMaxNumberOfConcurrentTestSessions()
java.net.URL getRemoteHost()
TestSession getNewSession(java.util.Map<java.lang.String,java.lang.Object> requestedCapability)
requestedCapability
- the type of test the client is interested in performing.null
otherwiseint getTotalUsed()
HtmlRenderer getHtmlRender()
int getTimeOut()
org.openqa.selenium.remote.http.HttpClient getHttpClient(java.net.URL url)
getHttpClient(URL, int, int)
HttpClient
for a particular URL
.org.openqa.selenium.remote.http.HttpClient getHttpClient(java.net.URL url, int connectionTimeout, int readTimeout)
url
- URLconnectionTimeout
- intreadTimeout
- intHttpClient
for a particular URL
.java.util.Map<java.lang.String,java.lang.Object> getProxyStatus()
boolean hasCapability(java.util.Map<java.lang.String,java.lang.Object> requestedCapability)
CapabilityMatcher.matches(Map, Map)
hasCapability = true
doesn't mean the test cast start just now, only that the proxy will be
able to run a test requiring that capability at some point.requestedCapability
- the type of test the client is interested in performing.true
if presentboolean isBusy()
true
if the node has any test slots in use.float getResourceUsageInPercent()
long getLastSessionStart()