Class LocalDistributor
- java.lang.Object
-
- org.openqa.selenium.grid.distributor.Distributor
-
- org.openqa.selenium.grid.distributor.local.LocalDistributor
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,java.util.function.Predicate<HttpRequest>
,HttpHandler
,Routable
,HasReadyState
public class LocalDistributor extends Distributor implements java.lang.AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description LocalDistributor(Tracer tracer, EventBus bus, HttpClient.Factory clientFactory, SessionMap sessions, NewSessionQueue sessionQueue, SlotSelector slotSelector, Secret registrationSecret, java.time.Duration healthcheckInterval, boolean rejectUnsupportedCaps, java.time.Duration sessionRequestRetryInterval, int newSessionThreadPoolSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalDistributor
add(Node node)
void
close()
static Distributor
create(Config config)
boolean
drain(NodeId nodeId)
int
getActiveSlots()
protected java.util.Set<NodeStatus>
getAvailableNodes()
long
getDownNodeCount()
int
getIdleSlots()
DistributorStatus
getStatus()
long
getUpNodeCount()
boolean
isReady()
Either<SessionNotCreatedException,CreateSessionResponse>
newSession(SessionRequest request)
void
refresh()
void
remove(NodeId nodeId)
-
Methods inherited from class org.openqa.selenium.grid.distributor.Distributor
execute, matches, test
-
-
-
-
Constructor Detail
-
LocalDistributor
public LocalDistributor(Tracer tracer, EventBus bus, HttpClient.Factory clientFactory, SessionMap sessions, NewSessionQueue sessionQueue, SlotSelector slotSelector, Secret registrationSecret, java.time.Duration healthcheckInterval, boolean rejectUnsupportedCaps, java.time.Duration sessionRequestRetryInterval, int newSessionThreadPoolSize)
-
-
Method Detail
-
create
public static Distributor create(Config config)
-
isReady
public boolean isReady()
- Specified by:
isReady
in interfaceHasReadyState
-
add
public LocalDistributor add(Node node)
- Specified by:
add
in classDistributor
-
drain
public boolean drain(NodeId nodeId)
- Specified by:
drain
in classDistributor
-
remove
public void remove(NodeId nodeId)
- Specified by:
remove
in classDistributor
-
getStatus
public DistributorStatus getStatus()
- Specified by:
getStatus
in classDistributor
-
refresh
@Beta public void refresh()
-
getAvailableNodes
protected java.util.Set<NodeStatus> getAvailableNodes()
-
newSession
public Either<SessionNotCreatedException,CreateSessionResponse> newSession(SessionRequest request) throws SessionNotCreatedException
- Specified by:
newSession
in classDistributor
- Throws:
SessionNotCreatedException
-
getUpNodeCount
public long getUpNodeCount()
-
getDownNodeCount
public long getDownNodeCount()
-
getActiveSlots
public int getActiveSlots()
-
getIdleSlots
public int getIdleSlots()
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-