public class WebClientBuilderOptions extends java.lang.Object implements ClientBuilderOptions, WebConfigurationConstants
This class MUST NOT BE USED from client side, as it uses a direct access to the server. Also, this class can be instantiated only from threads with a P2J context for the running P2J server.
| Modifier and Type | Field and Description |
|---|---|
private BaseClientBuilderOptions |
baseOptions
Base options.
|
private java.util.Map<java.lang.String,java.lang.String> |
dirOptions
Options storage.
|
private WebDriverType |
driverType
The web driver type.
|
private java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.String>> |
overriddenOptions
Storage for overridden options.
|
private java.lang.String |
projectToken
Project token
|
private static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
tokenConfigsCachedPairs
Cache for configs (resolved by
readConfigs()), stored by project token. |
CONNECTION_RESTORED_MESSAGE, CONNECTION_TIMEOUT, DELAY_BETWEEN_CONNECT_TRIES, DELAY_BETWEEN_PING_TRIES, ENABLE_DEBUG_LOGGING, INFINITE_TIMEOUT, MAX_BINARY_MESSAGE_SIZE, MAX_LOST_PINGS, MAX_TEXT_MESSAGE_SIZE, MAX_WEB_SOCKET_IDLE_TIMEOUT, OUTPUT_AGGREGATION_SIZE, OUTPUT_BUFFER_SIZE, PING_PONG_INTERVAL, REQUEST_HEADER_SIZE, RESPONSE_HEADER_SIZE, SERVER_UNAVAILABLE_MESSAGE, TRY_TO_CONNECT_MESSAGE, WATCH_DOG_TIMEOUT| Constructor and Description |
|---|
WebClientBuilderOptions(WebDriverType driverType)
Public constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private static <T> void |
add(java.util.Map<java.lang.String,java.lang.String> options,
ConfigItem<T> clientConfig,
T defaultValue)
Convenience method to add to the options map the name and value of the client config.
|
private static <T> void |
add(java.util.Map<java.lang.String,java.lang.String> options,
ConfigItem<T> clientConfig,
T defaultValue,
boolean quoteStrings)
Convenience method to add to the options map the name and value of the client config.
|
(package private) java.lang.String |
get(ConfigItem clientConfig)
Returns the value stored for the client config parameter.
|
BaseClientBuilderOptions |
getBaseOptions()
Returns the base client options.
|
(package private) java.util.Map<java.lang.String,java.lang.String> |
getDefaults()
Returns the default web client options.
|
WebDriverType |
getDriverType()
Returns the
driverType. |
(package private) java.util.Map<java.lang.String,java.lang.String> |
getOverriddenOptions()
Returns the default web client options.
|
java.lang.String |
getProjectToken()
Returns the
projectToken. |
(package private) void |
override(java.lang.String name,
java.lang.String value)
Add the given named option to the overridden options map.
|
(package private) static java.util.Map<java.lang.String,java.lang.String> |
readConfigs()
Reads the configuration from the directory and calculates certain runtime values that will be used by
web client launching.
|
void |
reset()
Resets the thread local value of
overriddenOptions. |
private static final java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> tokenConfigsCachedPairs
readConfigs()), stored by project token. The values are
unmodifiable maps of ConfigItem.name() : value.private final java.util.Map<java.lang.String,java.lang.String> dirOptions
private final BaseClientBuilderOptions baseOptions
private final java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.String>> overriddenOptions
private final WebDriverType driverType
private final java.lang.String projectToken
public WebClientBuilderOptions(WebDriverType driverType)
driverType - The web driver type: gui, chui, embedded.java.lang.IllegalStateException - If this is called from P2J clients.public void reset()
overriddenOptions.public WebDriverType getDriverType()
driverType.public java.lang.String getProjectToken()
projectToken.static java.util.Map<java.lang.String,java.lang.String> readConfigs()
public BaseClientBuilderOptions getBaseOptions()
getBaseOptions in interface ClientBuilderOptionsvoid override(java.lang.String name,
java.lang.String value)
name - The option namevalue - The option valuejava.lang.String get(ConfigItem clientConfig)
clientConfig - The client config.java.util.Map<java.lang.String,java.lang.String> getDefaults()
java.util.Map<java.lang.String,java.lang.String> getOverriddenOptions()
private static <T> void add(java.util.Map<java.lang.String,java.lang.String> options,
ConfigItem<T> clientConfig,
T defaultValue)
T - The type of the client config value.options - The options map of client config name : value pairs.clientConfig - The client config.defaultValue - The default value.private static <T> void add(java.util.Map<java.lang.String,java.lang.String> options,
ConfigItem<T> clientConfig,
T defaultValue,
boolean quoteStrings)
T - The type of the client config value.options - The options map of client config name : value pairs.clientConfig - The client config.defaultValue - The default value.quoteStrings - Flag to add quotes to the string.