public class HttpCommandExecutor extends java.lang.Object implements CommandExecutor, NeedsLocalLogs
Modifier and Type | Field and Description |
---|---|
private HttpClient |
client |
private JsonHttpCommandCodec |
commandCodec |
private static HttpClient.Factory |
defaultClientFactory |
private LocalLogs |
logs |
private java.net.URL |
remoteServer |
private JsonHttpResponseCodec |
responseCodec |
Constructor and Description |
---|
HttpCommandExecutor(java.util.Map<java.lang.String,CommandInfo> additionalCommands,
java.net.URL addressOfRemoteServer)
Creates an
HttpCommandExecutor that supports non-standard
additionalCommands in addition to the standard. |
HttpCommandExecutor(java.util.Map<java.lang.String,CommandInfo> additionalCommands,
java.net.URL addressOfRemoteServer,
HttpClient.Factory httpClientFactory) |
HttpCommandExecutor(java.net.URL addressOfRemoteServer) |
Modifier and Type | Method and Description |
---|---|
protected void |
defineCommand(java.lang.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. |
Response |
execute(Command command) |
java.net.URL |
getAddressOfRemoteServer() |
private static HttpClient.Factory |
getDefaultClientFactory() |
private void |
log(java.lang.String logType,
org.openqa.selenium.logging.LogEntry entry) |
void |
setLocalLogs(LocalLogs logs) |
private static HttpClient.Factory defaultClientFactory
private final java.net.URL remoteServer
private final HttpClient client
private final JsonHttpCommandCodec commandCodec
private final JsonHttpResponseCodec responseCodec
private LocalLogs logs
public HttpCommandExecutor(java.net.URL addressOfRemoteServer)
public HttpCommandExecutor(java.util.Map<java.lang.String,CommandInfo> additionalCommands, java.net.URL addressOfRemoteServer)
HttpCommandExecutor
that supports non-standard
additionalCommands
in addition to the standard.additionalCommands
- additional commands to allow the command executor to processaddressOfRemoteServer
- URL of remote end Selenium serverpublic HttpCommandExecutor(java.util.Map<java.lang.String,CommandInfo> additionalCommands, java.net.URL addressOfRemoteServer, HttpClient.Factory httpClientFactory)
private static HttpClient.Factory getDefaultClientFactory()
protected void defineCommand(java.lang.String commandName, CommandInfo info)
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.commandName
- The name of the command to use.info
- CommandInfo for the command name providedpublic void setLocalLogs(LocalLogs logs)
setLocalLogs
in interface NeedsLocalLogs
private void log(java.lang.String logType, org.openqa.selenium.logging.LogEntry entry)
public java.net.URL getAddressOfRemoteServer()
public Response execute(Command command) throws java.io.IOException
execute
in interface CommandExecutor
java.io.IOException