Class SessionSlot

java.lang.Object
org.openqa.selenium.grid.node.local.SessionSlot
All Implemented Interfaces:
Function<CreateSessionRequest,org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException,ActiveSession>>, Predicate<org.openqa.selenium.Capabilities>, org.openqa.selenium.remote.http.HttpHandler

public class SessionSlot extends Object implements org.openqa.selenium.remote.http.HttpHandler, Function<CreateSessionRequest,org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException,ActiveSession>>, Predicate<org.openqa.selenium.Capabilities>
  • Constructor Details

    • SessionSlot

      public SessionSlot(EventBus bus, org.openqa.selenium.Capabilities stereotype, SessionFactory factory)
  • Method Details

    • getId

      public UUID getId()
    • getStereotype

      public org.openqa.selenium.Capabilities getStereotype()
    • reserve

      public void reserve()
    • tryReserve

      public boolean tryReserve(org.openqa.selenium.Capabilities capabilities)
      Atomically attempts to reserve this slot if it's available and matches the given capabilities. This method is thread-safe and eliminates the need for external synchronization.
      Parameters:
      capabilities - the capabilities to test against this slot's stereotype
      Returns:
      true if the slot was successfully reserved, false if already reserved or capabilities don't match
    • release

      public void release()
    • isAvailable

      public boolean isAvailable()
    • getSession

      public @Nullable ActiveSession getSession()
    • stop

      public void stop()
    • stop

      public void stop(SessionClosedReason reason)
    • stop

      public void stop(SessionClosedReason reason, @Nullable NodeId nodeId, @Nullable URI nodeUri)
      Stops the session with full context for sidecar services.
      Parameters:
      reason - the reason for closing the session
      nodeId - the ID of the node where the session was running (may be null for backward compatibility)
      nodeUri - the URI of the node where the session was running (may be null for backward compatibility)
    • execute

      public org.openqa.selenium.remote.http.HttpResponse execute(org.openqa.selenium.remote.http.HttpRequest req) throws UncheckedIOException
      Specified by:
      execute in interface org.openqa.selenium.remote.http.HttpHandler
      Throws:
      UncheckedIOException
    • test

      public boolean test(org.openqa.selenium.Capabilities capabilities)
      Specified by:
      test in interface Predicate<org.openqa.selenium.Capabilities>
    • apply

      public org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException,ActiveSession> apply(CreateSessionRequest sessionRequest)
      Specified by:
      apply in interface Function<CreateSessionRequest,org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException,ActiveSession>>
    • isSupportingCdp

      public boolean isSupportingCdp()
    • isSupportingBiDi

      public boolean isSupportingBiDi()
    • hasRelayFactory

      public boolean hasRelayFactory()
    • isRelayServiceUp

      public boolean isRelayServiceUp()
    • getConnectionCounter

      public AtomicLong getConnectionCounter()