Package org.openqa.selenium.grid.node
Class Node
java.lang.Object
org.openqa.selenium.grid.node.Node
- All Implemented Interfaces:
org.openqa.selenium.remote.http.HttpHandler,org.openqa.selenium.remote.http.Routable,HasReadyState
- Direct Known Subclasses:
LocalNode,RemoteNode
public abstract class Node
extends Object
implements HasReadyState, org.openqa.selenium.remote.http.Routable
A place where individual webdriver sessions are running. Those sessions may be in-memory, or only
reachable via localhost and a network. Or they could be something else entirely.
This class responds to the following URLs:
| Verb | URL Template | Meaning |
|---|---|---|
| POST | /se/grid/node/session | Attempts to start a new session for the given node. The posted data should be a
json-serialized Capabilities instance. Returns a serialized Session.
Subclasses of Node are expected to register the session with the
SessionMap. |
| GET | /se/grid/node/session/{sessionId} | Finds the Session identified by sessionId and returns the JSON-serialized
form. |
| DELETE | /se/grid/node/session/{sessionId} | Stops the Session identified by sessionId. It is expected that this will
also cause the session to removed from the
SessionMap. |
| GET | /se/grid/node/owner/{sessionId} | Allows the node to be queried about whether or not it owns the Session identified
by sessionId. This returns a boolean. |
| DELETE | /se/grid/node/connection/{sessionId} | Notifies the node about closure of a websocket connection for the Session
identified by sessionId. |
| POST | /se/grid/node/connection/{sessionId} | Allows the node to be ask about whether or not new websocket connections are allowed for the Session
identified by sessionId. This returns a boolean. |
| * | /session/{sessionId}/* | The request is forwarded to the Session identified by sessionId. When the
Quit command is called, the Session should remove itself from the
SessionMap. |
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtomicBooleanprotected final AtomicBooleanprotected final org.openqa.selenium.remote.tracing.Tracer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.openqa.selenium.remote.http.HttpResponsedownloadFile(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) abstract voiddrain()org.openqa.selenium.remote.http.HttpResponseexecute(org.openqa.selenium.remote.http.HttpRequest req) abstract org.openqa.selenium.remote.http.HttpResponseexecuteWebDriverCommand(org.openqa.selenium.remote.http.HttpRequest req) org.openqa.selenium.io.TemporaryFilesystemgetDownloadsFilesystem(org.openqa.selenium.remote.SessionId id) abstract HealthCheckgetId()abstract SessiongetSession(org.openqa.selenium.remote.SessionId id) abstract NodeStatusorg.openqa.selenium.io.TemporaryFilesystemgetUploadsFilesystem(org.openqa.selenium.remote.SessionId id) getUri()booleanbooleanabstract booleanisSessionOwner(org.openqa.selenium.remote.SessionId id) abstract booleanisSupporting(org.openqa.selenium.Capabilities capabilities) booleanmatches(org.openqa.selenium.remote.http.HttpRequest req) abstract org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException, CreateSessionResponse> newSession(CreateSessionRequest sessionRequest) voidregister()abstract voidreleaseConnection(org.openqa.selenium.remote.SessionId id) abstract voidstop(org.openqa.selenium.remote.SessionId id) abstract booleantryAcquireConnection(org.openqa.selenium.remote.SessionId id) abstract org.openqa.selenium.remote.http.HttpResponseuploadFile(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openqa.selenium.status.HasReadyState
isReadyMethods inherited from interface org.openqa.selenium.remote.http.Routable
with
-
Field Details
-
tracer
protected final org.openqa.selenium.remote.tracing.Tracer tracer -
draining
-
registered
-
-
Constructor Details
-
Node
-
-
Method Details
-
getId
-
getUri
-
getNodeVersion
-
getOsInfo
-
newSession
public abstract org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException,CreateSessionResponse> newSession(CreateSessionRequest sessionRequest) -
executeWebDriverCommand
public abstract org.openqa.selenium.remote.http.HttpResponse executeWebDriverCommand(org.openqa.selenium.remote.http.HttpRequest req) -
getSession
public abstract Session getSession(org.openqa.selenium.remote.SessionId id) throws org.openqa.selenium.NoSuchSessionException - Throws:
org.openqa.selenium.NoSuchSessionException
-
getUploadsFilesystem
public org.openqa.selenium.io.TemporaryFilesystem getUploadsFilesystem(org.openqa.selenium.remote.SessionId id) throws IOException - Throws:
IOException
-
getDownloadsFilesystem
public org.openqa.selenium.io.TemporaryFilesystem getDownloadsFilesystem(org.openqa.selenium.remote.SessionId id) throws IOException - Throws:
IOException
-
uploadFile
public abstract org.openqa.selenium.remote.http.HttpResponse uploadFile(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) -
downloadFile
public abstract org.openqa.selenium.remote.http.HttpResponse downloadFile(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) -
stop
public abstract void stop(org.openqa.selenium.remote.SessionId id) throws org.openqa.selenium.NoSuchSessionException - Throws:
org.openqa.selenium.NoSuchSessionException
-
isSessionOwner
public abstract boolean isSessionOwner(org.openqa.selenium.remote.SessionId id) -
tryAcquireConnection
public abstract boolean tryAcquireConnection(org.openqa.selenium.remote.SessionId id) -
releaseConnection
public abstract void releaseConnection(org.openqa.selenium.remote.SessionId id) -
isSupporting
public abstract boolean isSupporting(org.openqa.selenium.Capabilities capabilities) -
getStatus
-
getHealthCheck
-
getSessionTimeout
-
isDraining
public boolean isDraining() -
isRegistered
public boolean isRegistered() -
register
public void register() -
drain
public abstract void drain() -
matches
public boolean matches(org.openqa.selenium.remote.http.HttpRequest req) - Specified by:
matchesin interfaceorg.openqa.selenium.remote.http.Routable
-
execute
public org.openqa.selenium.remote.http.HttpResponse execute(org.openqa.selenium.remote.http.HttpRequest req) - Specified by:
executein interfaceorg.openqa.selenium.remote.http.HttpHandler
-