Class LocalNode
java.lang.Object
org.openqa.selenium.grid.node.Node
org.openqa.selenium.grid.node.local.LocalNode
- All Implemented Interfaces:
Closeable,AutoCloseable,org.openqa.selenium.remote.http.HttpHandler,org.openqa.selenium.remote.http.Routable,HasReadyState
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.openqa.selenium.grid.node.Node
draining, registered, tracer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLocalNode(org.openqa.selenium.remote.tracing.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.Builderbuilder(org.openqa.selenium.remote.tracing.Tracer tracer, EventBus bus, URI uri, URI gridUri, Secret registrationSecret) voidclose()org.openqa.selenium.remote.http.HttpResponsedownloadFile(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) voiddrain()org.openqa.selenium.remote.http.HttpResponseexecuteWebDriverCommand(org.openqa.selenium.remote.http.HttpRequest req) org.openqa.selenium.remote.http.HttpResponsefireSessionEvent(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) Fires a custom session event to the remote server event bus.intintorg.openqa.selenium.io.TemporaryFilesystemgetDownloadsFilesystem(org.openqa.selenium.remote.SessionId sessionId) floatgetLoad()intgetSession(org.openqa.selenium.remote.SessionId id) intorg.openqa.selenium.io.TemporaryFilesystemgetUploadsFilesystem(org.openqa.selenium.remote.SessionId id) longbooleanisReady()booleanisSessionOwner(org.openqa.selenium.remote.SessionId id) booleanisSupporting(org.openqa.selenium.Capabilities capabilities) org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException, CreateSessionResponse> newSession(CreateSessionRequest sessionRequest) voidreleaseConnection(org.openqa.selenium.remote.SessionId id) voidResets the consecutive session creation failure counter.voidstop(org.openqa.selenium.remote.SessionId id) booleantryAcquireConnection(org.openqa.selenium.remote.SessionId id) org.openqa.selenium.remote.http.HttpResponseuploadFile(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) Methods inherited from class org.openqa.selenium.grid.node.Node
execute, getId, getNodeVersion, getOsInfo, getSessionTimeout, getUri, isDraining, isRegistered, matches, registerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openqa.selenium.remote.http.Routable
with
-
Constructor Details
-
LocalNode
protected LocalNode(org.openqa.selenium.remote.tracing.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
public static LocalNode.Builder builder(org.openqa.selenium.remote.tracing.Tracer tracer, EventBus bus, URI uri, URI gridUri, Secret registrationSecret) -
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
public boolean isSupporting(org.openqa.selenium.Capabilities capabilities) - Specified by:
isSupportingin classNode
-
newSession
public org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException,CreateSessionResponse> newSession(CreateSessionRequest sessionRequest) - Specified by:
newSessionin classNode
-
isSessionOwner
public boolean isSessionOwner(org.openqa.selenium.remote.SessionId id) - Specified by:
isSessionOwnerin classNode
-
tryAcquireConnection
public boolean tryAcquireConnection(org.openqa.selenium.remote.SessionId id) throws org.openqa.selenium.NoSuchSessionException - Specified by:
tryAcquireConnectionin classNode- Throws:
org.openqa.selenium.NoSuchSessionException
-
releaseConnection
public void releaseConnection(org.openqa.selenium.remote.SessionId id) - Specified by:
releaseConnectionin classNode
-
getSession
public Session getSession(org.openqa.selenium.remote.SessionId id) throws org.openqa.selenium.NoSuchSessionException - Specified by:
getSessionin classNode- Throws:
org.openqa.selenium.NoSuchSessionException
-
getUploadsFilesystem
public org.openqa.selenium.io.TemporaryFilesystem getUploadsFilesystem(org.openqa.selenium.remote.SessionId id) throws IOException - Overrides:
getUploadsFilesystemin classNode- Throws:
IOException
-
getDownloadsFilesystem
public org.openqa.selenium.io.TemporaryFilesystem getDownloadsFilesystem(org.openqa.selenium.remote.SessionId sessionId) - Overrides:
getDownloadsFilesystemin classNode
-
executeWebDriverCommand
public org.openqa.selenium.remote.http.HttpResponse executeWebDriverCommand(org.openqa.selenium.remote.http.HttpRequest req) - Specified by:
executeWebDriverCommandin classNode
-
downloadFile
public org.openqa.selenium.remote.http.HttpResponse downloadFile(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) - Specified by:
downloadFilein classNode
-
uploadFile
public org.openqa.selenium.remote.http.HttpResponse uploadFile(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) - Specified by:
uploadFilein classNode
-
fireSessionEvent
public org.openqa.selenium.remote.http.HttpResponse fireSessionEvent(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id) 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
public void stop(org.openqa.selenium.remote.SessionId id) throws org.openqa.selenium.NoSuchSessionException -
getStatus
-
getHealthCheck
- Specified by:
getHealthCheckin classNode
-
drain
public void drain()
-