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
- Direct Known Subclasses:
LocalNode
,RemoteNode
public abstract class Node extends java.lang.Object implements org.openqa.selenium.remote.http.Routable, org.openqa.selenium.remote.http.HttpHandler
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 serializedSession
. Subclasses ofNode
are expected to register the session with theSessionMap
.GET /se/grid/node/session/{sessionId} Finds the Session
identified bysessionId
and returns the JSON-serialized form.DELETE /se/grid/node/session/{sessionId} Stops the Session
identified bysessionId
. It is expected that this will also cause the session to removed from theSessionMap
.GET /se/grid/node/owner/{sessionId} Allows the node to be queried about whether or not it owns the Session
identified bysessionId
. This returns a boolean.* /session/{sessionId}/* The request is forwarded to the Session
identified bysessionId
. When the Quit command is called, theSession
should remove itself from theSessionMap
.
-
-
Field Summary
Fields Modifier and Type Field Description protected io.opentracing.Tracer
tracer
-
Constructor Summary
Constructors Modifier Constructor Description protected
Node(io.opentracing.Tracer tracer, java.util.UUID id, java.net.URI uri)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.openqa.selenium.remote.http.HttpResponse
execute(org.openqa.selenium.remote.http.HttpRequest req)
abstract org.openqa.selenium.remote.http.HttpResponse
executeWebDriverCommand(org.openqa.selenium.remote.http.HttpRequest req)
abstract HealthCheck
getHealthCheck()
java.util.UUID
getId()
abstract Session
getSession(org.openqa.selenium.remote.SessionId id)
abstract NodeStatus
getStatus()
java.net.URI
getUri()
protected abstract boolean
isSessionOwner(org.openqa.selenium.remote.SessionId id)
abstract boolean
isSupporting(org.openqa.selenium.Capabilities capabilities)
boolean
matches(org.openqa.selenium.remote.http.HttpRequest req)
abstract java.util.Optional<CreateSessionResponse>
newSession(CreateSessionRequest sessionRequest)
abstract void
stop(org.openqa.selenium.remote.SessionId id)
-
-
-
Method Detail
-
getId
public java.util.UUID getId()
-
getUri
public java.net.URI getUri()
-
newSession
public abstract java.util.Optional<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
-
stop
public abstract void stop(org.openqa.selenium.remote.SessionId id) throws org.openqa.selenium.NoSuchSessionException
- Throws:
org.openqa.selenium.NoSuchSessionException
-
isSessionOwner
protected abstract boolean isSessionOwner(org.openqa.selenium.remote.SessionId id)
-
isSupporting
public abstract boolean isSupporting(org.openqa.selenium.Capabilities capabilities)
-
getStatus
public abstract NodeStatus getStatus()
-
getHealthCheck
public abstract HealthCheck getHealthCheck()
-
matches
public boolean matches(org.openqa.selenium.remote.http.HttpRequest req)
- Specified by:
matches
in interfaceorg.openqa.selenium.remote.http.Routable
-
execute
public org.openqa.selenium.remote.http.HttpResponse execute(org.openqa.selenium.remote.http.HttpRequest req)
- Specified by:
execute
in interfaceorg.openqa.selenium.remote.http.HttpHandler
-
-