Class Distributor
java.lang.Object
org.openqa.selenium.grid.distributor.Distributor
- All Implemented Interfaces:
Predicate<HttpRequest>
,HttpHandler
,Routable
,HasReadyState
- Direct Known Subclasses:
LocalDistributor
,RemoteDistributor
public abstract class Distributor
extends Object
implements HasReadyState, Predicate<HttpRequest>, Routable
Responsible for being the central place where the
Node
s on which Session
s run are
determined.
This class responds to the following URLs:
Verb | URL Template | Meaning |
---|---|---|
POST | /session | This is exactly the same as the New Session command from the WebDriver spec. |
POST | /se/grid/distributor/node | Adds a new Node to this distributor.
Please read the javadocs for Node for
how the Node should be serialized. |
DELETE | /se/grid/distributor/node/{nodeId} | Remove the Node identified by nodeId
from this distributor. It is expected
that any sessions running on the Node are allowed to complete:
this simply means that no new
sessions will be scheduled on this Node. |
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Distributor
(Tracer tracer, HttpClient.Factory httpClientFactory, Secret registrationSecret) -
Method Summary
Modifier and TypeMethodDescriptionabstract Distributor
abstract boolean
execute
(HttpRequest req) abstract DistributorStatus
boolean
matches
(HttpRequest req) newSession
(SessionRequest request) abstract void
boolean
test
(HttpRequest httpRequest) 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 Details
-
tracer
-
-
Constructor Details
-
Distributor
protected Distributor(Tracer tracer, HttpClient.Factory httpClientFactory, Secret registrationSecret)
-
-
Method Details
-
newSession
public abstract Either<SessionNotCreatedException,CreateSessionResponse> newSession(SessionRequest request) throws SessionNotCreatedException - Throws:
SessionNotCreatedException
-
add
-
drain
-
remove
-
getStatus
-
test
- Specified by:
test
in interfacePredicate<HttpRequest>
-
matches
-
execute
- Specified by:
execute
in interfaceHttpHandler
- Throws:
UncheckedIOException
-