Class AbstractHttpCommandCodec

java.lang.Object
org.openqa.selenium.remote.codec.AbstractHttpCommandCodec
All Implemented Interfaces:
CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
Direct Known Subclasses:
W3CHttpCommandCodec

public abstract class AbstractHttpCommandCodec extends Object implements CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
A command codec that adheres to the W3C's WebDriver wire protocol.
See Also:
  • Constructor Details

    • AbstractHttpCommandCodec

      public AbstractHttpCommandCodec()
  • Method Details

    • delete

      protected static AbstractHttpCommandCodec.CommandSpec delete(String path)
    • get

      protected static AbstractHttpCommandCodec.CommandSpec get(String path)
    • post

      protected static AbstractHttpCommandCodec.CommandSpec post(String path)
    • isSupported

      public boolean isSupported(String commandName)
      Specified by:
      isSupported in interface CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
      Returns:
      Whether this CommandCodec supports the given command name.
    • encode

      public org.openqa.selenium.remote.http.HttpRequest encode(Command command)
      Description copied from interface: CommandCodec
      Encodes a command.
      Specified by:
      encode in interface CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
      Parameters:
      command - the command to encode.
      Returns:
      the encoded command.
    • amendParameters

      protected abstract Map<String,?> amendParameters(String name, Map<String,?> parameters)
    • decode

      public Command decode(org.openqa.selenium.remote.http.HttpRequest encodedCommand)
      Description copied from interface: CommandCodec
      Decodes a command.
      Specified by:
      decode in interface CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
      Parameters:
      encodedCommand - the command to decode.
      Returns:
      the decoded command.
    • defineCommand

      public void defineCommand(String name, org.openqa.selenium.remote.http.HttpMethod method, String pathPattern)
      Defines a new command mapping.
      Specified by:
      defineCommand in interface CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
      Parameters:
      name - The command name.
      method - The HTTP method to use for the command.
      pathPattern - The URI path pattern for the command. When encoding a command, each path segment prefixed with a ":" will be replaced with the corresponding parameter from the encoded command.
    • alias

      public void alias(String commandName, String isAnAliasFor)
      Description copied from interface: CommandCodec
      Allow commands to have aliases.
      Specified by:
      alias in interface CommandCodec<org.openqa.selenium.remote.http.HttpRequest>
      Parameters:
      commandName - The command being added.
      isAnAliasFor - The command name that this is an alias for.
    • defineCommand

      protected void defineCommand(String name, AbstractHttpCommandCodec.CommandSpec spec)