Class SessionSlot

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

  • Constructor Details

  • Method Details

    • getId

      public UUID getId()
    • getStereotype

      public Capabilities getStereotype()
    • reserve

      public void reserve()
    • tryReserve

      public boolean tryReserve(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 HttpResponse execute(HttpRequest req) throws UncheckedIOException
      Specified by:
      execute in interface HttpHandler
      Throws:
      UncheckedIOException
    • test

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

    • isSupportingCdp

      public boolean isSupportingCdp()
    • isSupportingBiDi

      public boolean isSupportingBiDi()
    • hasRelayFactory

      public boolean hasRelayFactory()
    • isRelayServiceUp

      public boolean isRelayServiceUp()
    • getConnectionCounter

      public AtomicLong getConnectionCounter()