public class SessionForkManager
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SessionForkManager.ForkedSessionConfigs
Class for client configs necessary for replicating the original session
|
private static class |
SessionForkManager.SingletonHolder
Initialization on demand idiom singleton holder
|
| Modifier and Type | Field and Description |
|---|---|
private static java.util.concurrent.ScheduledExecutorService |
EXECUTOR_SERVICE
Executor Service for scheduled cleanup of expired tokens
|
static CentralLogger |
LOG
Logger.
|
static java.lang.String |
PARAM_NAME_TOKEN
The search / path parameter name of the one time token
|
private static java.util.Map<java.lang.String,SessionForkManager.ForkedSessionConfigs> |
TOKEN_CONFIGS_PAIRS
Map of generated tokens and corresponding configs
|
private static java.util.concurrent.atomic.AtomicInteger |
TOKEN_COUNTER
Counter for tokens.
|
private static int |
TOKEN_LIFESPAN_SEC
Lifespan of tokens in seconds.
|
| Constructor and Description |
|---|
SessionForkManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
forkNewSession(java.lang.String cfgOverrides,
java.lang.String authBlob)
Collects relevant client configs for replicating the original session, generates a one-time token and
opens the login page address in browser, passing in the token as parameter.
|
SessionForkManager.ForkedSessionConfigs |
getConfigsForToken(java.lang.String token)
Returns the configs corresponding to the token.
|
static SessionForkManager |
getInstance()
Static method for access to the singleton instance of the manager
|
public static final java.lang.String PARAM_NAME_TOKEN
public static final CentralLogger LOG
private static final java.util.concurrent.atomic.AtomicInteger TOKEN_COUNTER
private static final int TOKEN_LIFESPAN_SEC
private static final java.util.concurrent.ScheduledExecutorService EXECUTOR_SERVICE
private static final java.util.Map<java.lang.String,SessionForkManager.ForkedSessionConfigs> TOKEN_CONFIGS_PAIRS
public static SessionForkManager getInstance()
public void forkNewSession(java.lang.String cfgOverrides,
java.lang.String authBlob)
cfgOverrides - Client build optionsauthBlob - Authentication datapublic SessionForkManager.ForkedSessionConfigs getConfigsForToken(java.lang.String token)
token - The one time tokennull if token has expired, otherwise SessionForkManager.ForkedSessionConfigs.