org.openqa.grid.common
Class RegistrationRequest

java.lang.Object
  extended by org.openqa.grid.common.RegistrationRequest

public class RegistrationRequest
extends Object

helper to register to the grid. Using JSON to exchange the object between the node and grid.


Field Summary
static String APP
           
static String AUTO_REGISTER
           
static String BROWSER
           
static String CLEAN_SNAPSHOT
           
static String CLEAN_UP_CYCLE
           
static String HOST
           
static String HUB_HOST
           
static String HUB_PORT
           
static String MAX_INSTANCES
           
static String MAX_SESSION
           
static String MAX_TESTS_BEFORE_CLEAN
           
static String NODE_POLLING
           
static String PATH
           
static String PLATFORM
           
static String PORT
           
static String PROXY_CLASS
           
static String REGISTER_CYCLE
           
static String REMOTE_HOST
           
static String SELENIUM_PROTOCOL
           
static String SERVLETS
           
static String TIME_OUT
           
static String UNREGISTER_IF_STILL_DOWN_AFTER
           
static String VERSION
           
 
Constructor Summary
RegistrationRequest()
           
 
Method Summary
 void addDesiredCapability(org.openqa.selenium.remote.DesiredCapabilities c)
           
 void addDesiredCapability(Map<String,Object> c)
           
static RegistrationRequest build(String... args)
           
 String[] getArgs()
           
 org.json.JSONObject getAssociatedJSON()
           
 List<org.openqa.selenium.remote.DesiredCapabilities> getCapabilities()
           
 int getConfigAsInt(String param, int defaultValue)
           
 String getConfigAsString(String param)
           
 Map<String,Object> getConfiguration()
           
 String getDescription()
           
 String getId()
           
 String getName()
           
static RegistrationRequest getNewInstance(String json)
          Create an object from a registration request formatted as a json string.
 org.json.JSONObject getRegistrationRequest()
           
 RemoteControlConfiguration getRemoteControlConfiguration()
           
 String getRemoteProxyClass()
          if a PROXY_CLASS is specified in the request, the proxy created following this request will be of that type.
 GridRole getRole()
           
 void loadFromJSON(String resource)
          add config, but overwrite capabilities.
 void setCapabilities(List<org.openqa.selenium.remote.DesiredCapabilities> capabilities)
           
 void setConfiguration(Map<String,Object> configuration)
           
 void setDescription(String description)
           
 void setId(String id)
           
 void setName(String name)
           
 void setRole(GridRole role)
           
 String toJSON()
           
 void validate()
          Validate the current setting and throw a config exception is an invalid setup is detected.
static RegistrationRequest webdriverNoCapabilities()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP

public static final String APP
See Also:
Constant Field Values

MAX_INSTANCES

public static final String MAX_INSTANCES
See Also:
Constant Field Values

SELENIUM_PROTOCOL

public static final String SELENIUM_PROTOCOL
See Also:
Constant Field Values

PATH

public static final String PATH
See Also:
Constant Field Values

BROWSER

public static final String BROWSER
See Also:
Constant Field Values

PLATFORM

public static final String PLATFORM
See Also:
Constant Field Values

VERSION

public static final String VERSION
See Also:
Constant Field Values

REGISTER_CYCLE

public static final String REGISTER_CYCLE
See Also:
Constant Field Values

PROXY_CLASS

public static final String PROXY_CLASS
See Also:
Constant Field Values

CLEAN_UP_CYCLE

public static final String CLEAN_UP_CYCLE
See Also:
Constant Field Values

TIME_OUT

public static final String TIME_OUT
See Also:
Constant Field Values

REMOTE_HOST

public static final String REMOTE_HOST
See Also:
Constant Field Values

MAX_SESSION

public static final String MAX_SESSION
See Also:
Constant Field Values

AUTO_REGISTER

public static final String AUTO_REGISTER
See Also:
Constant Field Values

NODE_POLLING

public static final String NODE_POLLING
See Also:
Constant Field Values

UNREGISTER_IF_STILL_DOWN_AFTER

public static final String UNREGISTER_IF_STILL_DOWN_AFTER
See Also:
Constant Field Values

MAX_TESTS_BEFORE_CLEAN

public static final String MAX_TESTS_BEFORE_CLEAN
See Also:
Constant Field Values

CLEAN_SNAPSHOT

public static final String CLEAN_SNAPSHOT
See Also:
Constant Field Values

HOST

public static final String HOST
See Also:
Constant Field Values

PORT

public static final String PORT
See Also:
Constant Field Values

HUB_HOST

public static final String HUB_HOST
See Also:
Constant Field Values

HUB_PORT

public static final String HUB_PORT
See Also:
Constant Field Values

SERVLETS

public static final String SERVLETS
See Also:
Constant Field Values
Constructor Detail

RegistrationRequest

public RegistrationRequest()
Method Detail

getId

public String getId()

setId

public void setId(String id)

getName

public String getName()

setName

public void setName(String name)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getCapabilities

public List<org.openqa.selenium.remote.DesiredCapabilities> getCapabilities()

addDesiredCapability

public void addDesiredCapability(org.openqa.selenium.remote.DesiredCapabilities c)

addDesiredCapability

public void addDesiredCapability(Map<String,Object> c)

setCapabilities

public void setCapabilities(List<org.openqa.selenium.remote.DesiredCapabilities> capabilities)

getConfiguration

public Map<String,Object> getConfiguration()

setConfiguration

public void setConfiguration(Map<String,Object> configuration)

toJSON

public String toJSON()

getAssociatedJSON

public org.json.JSONObject getAssociatedJSON()

getConfigAsString

public String getConfigAsString(String param)

getConfigAsInt

public int getConfigAsInt(String param,
                          int defaultValue)

getNewInstance

public static RegistrationRequest getNewInstance(String json)
Create an object from a registration request formatted as a json string.

Parameters:
json -
Returns:
create a request from the JSON request received.

getRemoteProxyClass

public String getRemoteProxyClass()
if a PROXY_CLASS is specified in the request, the proxy created following this request will be of that type. If nothing is specified, it will use RemoteProxy

Returns:
null if no class was specified.

webdriverNoCapabilities

public static RegistrationRequest webdriverNoCapabilities()

build

public static RegistrationRequest build(String... args)

getRegistrationRequest

public org.json.JSONObject getRegistrationRequest()

loadFromJSON

public void loadFromJSON(String resource)
add config, but overwrite capabilities.

Parameters:
resource -

getRole

public GridRole getRole()

setRole

public void setRole(GridRole role)

getRemoteControlConfiguration

public RemoteControlConfiguration getRemoteControlConfiguration()

getArgs

public String[] getArgs()

validate

public void validate()
              throws GridConfigurationException
Validate the current setting and throw a config exception is an invalid setup is detected.

Throws:
GridConfigurationException


Copyright © 2012. All Rights Reserved.