Class LocalNode
java.lang.Object
org.openqa.selenium.grid.node.Node
org.openqa.selenium.grid.node.local.LocalNode
- All Implemented Interfaces:
Closeable, AutoCloseable, HttpHandler, Routable, HasReadyState
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class Node
draining, registered, tracer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLocalNode(Tracer tracer, EventBus bus, URI uri, URI gridUri, @Nullable HealthCheck healthCheck, int maxSessionCount, int drainAfterSessionCount, boolean cdpEnabled, boolean bidiEnabled, com.github.benmanes.caffeine.cache.Ticker ticker, Duration sessionTimeout, Duration heartbeatPeriod, List<SessionSlot> factories, Secret registrationSecret, boolean managedDownloadsEnabled, int connectionLimitPerSession, int nodeDownFailureThreshold, List<NodeCommandInterceptor> interceptors) -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalNode.Buildervoidclose()downloadFile(HttpRequest req, SessionId id) voiddrain()fireSessionEvent(HttpRequest req, SessionId id) Fires a custom session event to the remote server event bus.intintgetDownloadsFilesystem(SessionId sessionId) floatgetLoad()intgetSession(SessionId id) intlongbooleanisReady()booleanbooleanisSupporting(Capabilities capabilities) newSession(CreateSessionRequest sessionRequest) voidvoidResets the consecutive session creation failure counter.voidbooleanuploadFile(HttpRequest req, SessionId id) Methods inherited from class Node
execute, getId, getNodeVersion, getOsInfo, getSessionTimeout, getUri, isDraining, isRegistered, matches, register
-
Constructor Details
-
LocalNode
protected LocalNode(Tracer tracer, EventBus bus, URI uri, URI gridUri, @Nullable HealthCheck healthCheck, int maxSessionCount, int drainAfterSessionCount, boolean cdpEnabled, boolean bidiEnabled, com.github.benmanes.caffeine.cache.Ticker ticker, Duration sessionTimeout, Duration heartbeatPeriod, List<SessionSlot> factories, Secret registrationSecret, boolean managedDownloadsEnabled, int connectionLimitPerSession, int nodeDownFailureThreshold, List<NodeCommandInterceptor> interceptors)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
builder
-
isReady
public boolean isReady()- Specified by:
isReadyin interfaceHasReadyState
-
getCurrentSessionCount
public int getCurrentSessionCount() -
getMaxSessionCount
public int getMaxSessionCount() -
getAvailability
-
getTotalSlots
public int getTotalSlots() -
getUsedSlots
public long getUsedSlots() -
getLoad
public float getLoad() -
getConsecutiveSessionFailures
public int getConsecutiveSessionFailures() -
resetConsecutiveSessionFailures
public void resetConsecutiveSessionFailures()Resets the consecutive session creation failure counter. This can be used to recover a node that was marked as DOWN due to exceeding the failure threshold, for example after external intervention has resolved the underlying issue. -
getExternalUri
-
getGridUri
-
getNodeId
-
isSupporting
- Specified by:
isSupportingin classNode
-
newSession
public Either<WebDriverException, CreateSessionResponse> newSession(CreateSessionRequest sessionRequest) - Specified by:
newSessionin classNode
-
isSessionOwner
- Specified by:
isSessionOwnerin classNode
-
tryAcquireConnection
- Specified by:
tryAcquireConnectionin classNode- Throws:
NoSuchSessionException
-
releaseConnection
- Specified by:
releaseConnectionin classNode
-
getSession
- Specified by:
getSessionin classNode- Throws:
NoSuchSessionException
-
getUploadsFilesystem
- Overrides:
getUploadsFilesystemin classNode- Throws:
IOException
-
getDownloadsFilesystem
- Overrides:
getDownloadsFilesystemin classNode
-
executeWebDriverCommand
- Specified by:
executeWebDriverCommandin classNode
-
downloadFile
- Specified by:
downloadFilein classNode
-
uploadFile
- Specified by:
uploadFilein classNode
-
fireSessionEvent
Description copied from class:NodeFires a custom session event to the remote server event bus. This allows test code to trigger server-side utilities that subscribe to the event bus.Default implementation throws
UnsupportedOperationException. Subclasses that support session events should override this method.- Overrides:
fireSessionEventin classNode- Parameters:
req- the HTTP request containing the event dataid- the session ID- Returns:
- the HTTP response
-
stop
- Specified by:
stopin classNode- Throws:
NoSuchSessionException
-
getStatus
-
getHealthCheck
- Specified by:
getHealthCheckin classNode
-
drain
-