Class Node

  • All Implemented Interfaces:
    org.openqa.selenium.remote.http.HttpHandler, org.openqa.selenium.remote.http.Routable, HasReadyState
    Direct Known Subclasses:
    LocalNode, RemoteNode

    public abstract class Node
    extends java.lang.Object
    implements HasReadyState, org.openqa.selenium.remote.http.Routable
    A place where individual webdriver sessions are running. Those sessions may be in-memory, or only reachable via localhost and a network. Or they could be something else entirely.

    This class responds to the following URLs:

    Verb URL Template Meaning
    POST /se/grid/node/session Attempts to start a new session for the given node. The posted data should be a json-serialized Capabilities instance. Returns a serialized Session. Subclasses of Node are expected to register the session with the SessionMap.
    GET /se/grid/node/session/{sessionId} Finds the Session identified by sessionId and returns the JSON-serialized form.
    DELETE /se/grid/node/session/{sessionId} Stops the Session identified by sessionId. It is expected that this will also cause the session to removed from the SessionMap.
    GET /se/grid/node/owner/{sessionId} Allows the node to be queried about whether or not it owns the Session identified by sessionId. This returns a boolean.
    * /session/{sessionId}/* The request is forwarded to the Session identified by sessionId. When the Quit command is called, the Session should remove itself from the SessionMap.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean draining  
      protected org.openqa.selenium.remote.tracing.Tracer tracer  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Node​(org.openqa.selenium.remote.tracing.Tracer tracer, NodeId id, java.net.URI uri, Secret registrationSecret)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void drain()  
      org.openqa.selenium.remote.http.HttpResponse execute​(org.openqa.selenium.remote.http.HttpRequest req)  
      abstract org.openqa.selenium.remote.http.HttpResponse executeWebDriverCommand​(org.openqa.selenium.remote.http.HttpRequest req)  
      abstract HealthCheck getHealthCheck()  
      NodeId getId()  
      java.lang.String getNodeVersion()  
      com.google.common.collect.ImmutableMap<java.lang.String,​java.lang.String> getOsInfo()  
      abstract Session getSession​(org.openqa.selenium.remote.SessionId id)  
      abstract NodeStatus getStatus()  
      org.openqa.selenium.io.TemporaryFilesystem getTemporaryFilesystem​(org.openqa.selenium.remote.SessionId id)  
      java.net.URI getUri()  
      boolean isDraining()  
      abstract boolean isSessionOwner​(org.openqa.selenium.remote.SessionId id)  
      abstract boolean isSupporting​(org.openqa.selenium.Capabilities capabilities)  
      boolean matches​(org.openqa.selenium.remote.http.HttpRequest req)  
      abstract org.openqa.selenium.internal.Either<org.openqa.selenium.WebDriverException,​CreateSessionResponse> newSession​(CreateSessionRequest sessionRequest)  
      abstract void stop​(org.openqa.selenium.remote.SessionId id)  
      abstract org.openqa.selenium.remote.http.HttpResponse uploadFile​(org.openqa.selenium.remote.http.HttpRequest req, org.openqa.selenium.remote.SessionId id)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.openqa.selenium.remote.http.Routable

        with
    • Field Detail

      • tracer

        protected final org.openqa.selenium.remote.tracing.Tracer tracer
      • draining

        protected boolean draining
    • Constructor Detail

      • Node

        protected Node​(org.openqa.selenium.remote.tracing.Tracer tracer,
                       NodeId id,
                       java.net.URI uri,
                       Secret registrationSecret)
    • Method Detail

      • getId

        public NodeId getId()
      • getUri

        public java.net.URI getUri()
      • getNodeVersion

        public java.lang.String getNodeVersion()
      • getOsInfo

        public com.google.common.collect.ImmutableMap<java.lang.String,​java.lang.String> getOsInfo()
      • executeWebDriverCommand

        public abstract org.openqa.selenium.remote.http.HttpResponse executeWebDriverCommand​(org.openqa.selenium.remote.http.HttpRequest req)
      • getSession

        public abstract Session getSession​(org.openqa.selenium.remote.SessionId id)
                                    throws org.openqa.selenium.NoSuchSessionException
        Throws:
        org.openqa.selenium.NoSuchSessionException
      • getTemporaryFilesystem

        public org.openqa.selenium.io.TemporaryFilesystem getTemporaryFilesystem​(org.openqa.selenium.remote.SessionId id)
                                                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • uploadFile

        public abstract org.openqa.selenium.remote.http.HttpResponse uploadFile​(org.openqa.selenium.remote.http.HttpRequest req,
                                                                                org.openqa.selenium.remote.SessionId id)
      • stop

        public abstract void stop​(org.openqa.selenium.remote.SessionId id)
                           throws org.openqa.selenium.NoSuchSessionException
        Throws:
        org.openqa.selenium.NoSuchSessionException
      • isSessionOwner

        public abstract boolean isSessionOwner​(org.openqa.selenium.remote.SessionId id)
      • isSupporting

        public abstract boolean isSupporting​(org.openqa.selenium.Capabilities capabilities)
      • getStatus

        public abstract NodeStatus getStatus()
      • getHealthCheck

        public abstract HealthCheck getHealthCheck()
      • isDraining

        public boolean isDraining()
      • drain

        public abstract void drain()
      • matches

        public boolean matches​(org.openqa.selenium.remote.http.HttpRequest req)
        Specified by:
        matches in interface org.openqa.selenium.remote.http.Routable
      • execute

        public org.openqa.selenium.remote.http.HttpResponse execute​(org.openqa.selenium.remote.http.HttpRequest req)
        Specified by:
        execute in interface org.openqa.selenium.remote.http.HttpHandler