Package org.openqa.selenium.grid.node
Class Node
- java.lang.Object
-
- org.openqa.selenium.grid.node.Node
-
- All Implemented Interfaces:
HttpHandler
,Routable
,HasReadyState
- Direct Known Subclasses:
LocalNode
,RemoteNode
public abstract class Node extends java.lang.Object implements HasReadyState, 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 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
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
drain()
HttpResponse
execute(HttpRequest req)
abstract HttpResponse
executeWebDriverCommand(HttpRequest req)
abstract HealthCheck
getHealthCheck()
NodeId
getId()
java.lang.String
getNodeVersion()
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>
getOsInfo()
abstract Session
getSession(SessionId id)
abstract NodeStatus
getStatus()
TemporaryFilesystem
getTemporaryFilesystem(SessionId id)
java.net.URI
getUri()
boolean
isDraining()
abstract boolean
isSessionOwner(SessionId id)
abstract boolean
isSupporting(Capabilities capabilities)
boolean
matches(HttpRequest req)
abstract Either<WebDriverException,CreateSessionResponse>
newSession(CreateSessionRequest sessionRequest)
abstract void
stop(SessionId id)
abstract HttpResponse
uploadFile(HttpRequest req, SessionId id)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openqa.selenium.status.HasReadyState
isReady
-
-
-
-
Field Detail
-
tracer
protected final Tracer tracer
-
draining
protected boolean draining
-
-
Method Detail
-
getId
public NodeId getId()
-
getUri
public java.net.URI getUri()
-
getNodeVersion
public java.lang.String getNodeVersion()
-
getOsInfo
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getOsInfo()
-
newSession
public abstract Either<WebDriverException,CreateSessionResponse> newSession(CreateSessionRequest sessionRequest)
-
executeWebDriverCommand
public abstract HttpResponse executeWebDriverCommand(HttpRequest req)
-
getSession
public abstract Session getSession(SessionId id) throws NoSuchSessionException
- Throws:
NoSuchSessionException
-
getTemporaryFilesystem
public TemporaryFilesystem getTemporaryFilesystem(SessionId id) throws java.io.IOException
- Throws:
java.io.IOException
-
uploadFile
public abstract HttpResponse uploadFile(HttpRequest req, SessionId id)
-
stop
public abstract void stop(SessionId id) throws NoSuchSessionException
- Throws:
NoSuchSessionException
-
isSessionOwner
public abstract boolean isSessionOwner(SessionId id)
-
isSupporting
public abstract boolean isSupporting(Capabilities capabilities)
-
getStatus
public abstract NodeStatus getStatus()
-
getHealthCheck
public abstract HealthCheck getHealthCheck()
-
isDraining
public boolean isDraining()
-
drain
public abstract void drain()
-
matches
public boolean matches(HttpRequest req)
-
execute
public HttpResponse execute(HttpRequest req)
- Specified by:
execute
in interfaceHttpHandler
-
-