Class HttpCommandExecutor

java.lang.Object
org.openqa.selenium.remote.HttpCommandExecutor
All Implemented Interfaces:
CommandExecutor
Direct Known Subclasses:
DriverCommandExecutor

public class HttpCommandExecutor extends Object implements CommandExecutor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Map<String, CommandInfo>
     
    final org.openqa.selenium.remote.http.HttpClient
    Deprecated, for removal: This API element is subject to removal in a future version.
    this field will become protected in 4.52; read it from a subclass instead.
    protected @Nullable CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
     
    protected final @Nullable org.openqa.selenium.remote.http.HttpClient.Factory
    Deprecated, for removal: This API element is subject to removal in a future version.
    this field will be removed in 4.52; keep a reference to the factory in the subclass instead.
    protected @Nullable ResponseCodec<org.openqa.selenium.remote.http.HttpResponse>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    HttpCommandExecutor(URL addressOfRemoteServer)
    Deprecated, for removal: This API element is subject to removal in a future version.
    HttpCommandExecutor(Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer)
    Deprecated, for removal: This API element is subject to removal in a future version.
    HttpCommandExecutor(Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer, org.openqa.selenium.remote.http.ClientConfig config)
    Deprecated, for removal: This API element is subject to removal in a future version.
    HttpCommandExecutor(Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory)
    Deprecated, for removal: This API element is subject to removal in a future version.
    HttpCommandExecutor(Map<String, CommandInfo> additionalCommands, org.openqa.selenium.remote.http.ClientConfig config, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory)
    Deprecated, for removal: This API element is subject to removal in a future version.
    HttpCommandExecutor(org.openqa.selenium.remote.http.ClientConfig config)
    Deprecated, for removal: This API element is subject to removal in a future version.
    HttpCommandExecutor(org.openqa.selenium.remote.http.HttpClient httpClient, URL addressOfRemoteServer)
    Creates an HttpCommandExecutor that supports only standard commands.
    HttpCommandExecutor(org.openqa.selenium.remote.http.HttpClient httpClient, Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer)
    Creates an HttpCommandExecutor that supports non-standard additionalCommands in addition to the standard.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Adds or updates additional commands.
    protected void
    defineCommand(String commandName, CommandInfo info)
    It may be useful to extend the commands understood by this HttpCommandExecutor at run time, and this can be achieved via this method.
    execute(Command command)
     
    Returns an immutable view of the additional commands.
    Deprecated, for removal: This API element is subject to removal in a future version.
    static org.openqa.selenium.remote.http.HttpClient.Factory
    Deprecated, for removal: This API element is subject to removal in a future version.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • additionalCommands

      protected final Map<String, CommandInfo> additionalCommands
    • client

      @Deprecated(forRemoval=true, since="4.50.0") public final org.openqa.selenium.remote.http.HttpClient client
      Deprecated, for removal: This API element is subject to removal in a future version.
      this field will become protected in 4.52; read it from a subclass instead.
    • httpClientFactory

      @Deprecated(forRemoval=true, since="4.50.0") protected final @Nullable org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory
      Deprecated, for removal: This API element is subject to removal in a future version.
      this field will be removed in 4.52; keep a reference to the factory in the subclass instead.
      The factory that created client, or null when the executor was created from an HttpClient.
    • commandCodec

      protected @Nullable CommandCodec<org.openqa.selenium.remote.http.HttpRequest> commandCodec
    • responseCodec

      protected @Nullable ResponseCodec<org.openqa.selenium.remote.http.HttpResponse> responseCodec
  • Constructor Details

    • HttpCommandExecutor

      @Deprecated(forRemoval=true, since="4.50.0") public HttpCommandExecutor(URL addressOfRemoteServer)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • HttpCommandExecutor

      @Deprecated(forRemoval=true, since="4.50.0") public HttpCommandExecutor(org.openqa.selenium.remote.http.ClientConfig config)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • HttpCommandExecutor

      public HttpCommandExecutor(org.openqa.selenium.remote.http.HttpClient httpClient, URL addressOfRemoteServer)
      Creates an HttpCommandExecutor that supports only standard commands.
      Parameters:
      httpClient - the HttpClient to execute commands with
      addressOfRemoteServer - URL of remote end Selenium server
    • HttpCommandExecutor

      public HttpCommandExecutor(org.openqa.selenium.remote.http.HttpClient httpClient, Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer)
      Creates an HttpCommandExecutor that supports non-standard additionalCommands in addition to the standard.
      Parameters:
      httpClient - the HttpClient to execute commands with
      additionalCommands - additional commands to allow the command executor to process
      addressOfRemoteServer - URL of remote end Selenium server
    • HttpCommandExecutor

      @Deprecated(forRemoval=true, since="4.50.0") public HttpCommandExecutor(Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an HttpCommandExecutor that supports non-standard additionalCommands in addition to the standard.
      Parameters:
      additionalCommands - additional commands to allow the command executor to process
      addressOfRemoteServer - URL of remote end Selenium server
    • HttpCommandExecutor

      @Deprecated(forRemoval=true, since="4.50.0") public HttpCommandExecutor(Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer, org.openqa.selenium.remote.http.ClientConfig config)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • HttpCommandExecutor

      @Deprecated(forRemoval=true, since="4.50.0") public HttpCommandExecutor(Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • HttpCommandExecutor

      @Deprecated(forRemoval=true, since="4.50.0") public HttpCommandExecutor(Map<String, CommandInfo> additionalCommands, org.openqa.selenium.remote.http.ClientConfig config, org.openqa.selenium.remote.http.HttpClient.Factory httpClientFactory)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getDefaultClientFactory

      @Deprecated(forRemoval=true, since="4.50.0") public static org.openqa.selenium.remote.http.HttpClient.Factory getDefaultClientFactory()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getAdditionalCommands

      public Map<String, CommandInfo> getAdditionalCommands()
      Returns an immutable view of the additional commands.
      Returns:
      an unmodifiable map of additional commands.
    • addAdditionalCommand

      protected void addAdditionalCommand(String commandName, CommandInfo info)
      Adds or updates additional commands. This method is protected to allow subclasses to define their commands.
      Parameters:
      commandName - the name of the command to add or update.
      info - the CommandInfo for the command.
    • defineCommand

      protected void defineCommand(String commandName, CommandInfo info)
      It may be useful to extend the commands understood by this HttpCommandExecutor at run time, and this can be achieved via this method. Note, this is protected, and expected usage is for subclasses only to call this.
      Parameters:
      commandName - The name of the command to use.
      info - CommandInfo for the command name provided
    • getAddressOfRemoteServer

      @Deprecated(forRemoval=true, since="4.50.0") public URL getAddressOfRemoteServer()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • execute

      public Response execute(Command command) throws IOException
      Specified by:
      execute in interface CommandExecutor
      Throws:
      IOException