public abstract class AbstractAutomationClient extends Object implements AutomationClient
| Modifier and Type | Field and Description |
|---|---|
protected Map<Class<?>,List<AdapterFactory<?>>> |
adapters |
protected OperationRegistry |
registry |
protected RequestInterceptor |
requestInterceptor |
protected String |
url |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAutomationClient(String url) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncExec(Runnable runnable) |
protected OperationRegistry |
connect(Connector connector) |
protected Session |
createSession(Connector connector,
LoginInfo login) |
<T> T |
getAdapter(Object objToAdapt,
Class<T> adapterType)
Adapts the given object to the given type.
|
String |
getBaseUrl()
Gets the automation service URL.
|
protected OperationRegistry |
getRegistry() |
RequestInterceptor |
getRequestInterceptor()
Gets access to this request interceptor
|
Session |
getSession()
Creates a new session.
|
void |
getSession(AsyncCallback<Session> cb)
Creates a new session.
|
Session |
getSession(LoginCallback loginCb)
Create a new session using the given login callback to gather login info.
|
void |
getSession(LoginCallback loginCb,
AsyncCallback<Session> cb)
Create asynchronously a new session using the given login callback to
gather login info.
|
protected Session |
getSession(RequestInterceptor interceptor) |
Session |
getSession(String token)
Creates a new session using the given token.
|
Session |
getSession(String username,
String password)
Creates a new session using the given login.
|
void |
getSession(String username,
String password,
AsyncCallback<Session> cb)
Creates asynchronously a new session using the given login.
|
Session |
getSession(TokenCallback cb)
Creates a new session using the given token callback by following these
steps:
Look for a token saved locally using
TokenCallback.getLocalToken()
If it doesn't exist, use
TokenCallback#getRemoteToken(java.util.Map)) to acquire a token
remotely using the information gathered by
TokenCallback.getTokenParams(), and save the token locally using
TokenCallback.saveToken(String)
Get a session with the token using AutomationClient.getSession(String)
|
protected Session |
login(Connector connector) |
protected abstract Connector |
newConnector() |
void |
registerAdapter(AdapterFactory<?> factory)
Register an adapter for a given type.
|
void |
setBasicAuth(String username,
String password) |
void |
setRequestInterceptor(RequestInterceptor interceptor)
Can be used for intercepting requests before they are being sent to the
server.
|
void |
shutdown()
Cleanup any resources held by this client.
|
protected String url
protected volatile OperationRegistry registry
protected Map<Class<?>,List<AdapterFactory<?>>> adapters
protected RequestInterceptor requestInterceptor
protected AbstractAutomationClient(String url)
public void setRequestInterceptor(RequestInterceptor interceptor)
public RequestInterceptor getRequestInterceptor()
public String getBaseUrl()
AutomationClientgetBaseUrl in interface AutomationClientprotected OperationRegistry getRegistry()
public void registerAdapter(AdapterFactory<?> factory)
AutomationClientregisterAdapter in interface AutomationClientpublic <T> T getAdapter(Object objToAdapt, Class<T> adapterType)
AutomationClient
Optional operation. Framework that doesn't supports reflection like GWT
must throw UnsupportedOperationException
getAdapter in interface AutomationClientprotected OperationRegistry connect(Connector connector)
public void shutdown()
AutomationClientshutdown in interface AutomationClientpublic Session getSession()
AutomationClientgetSession in interface AutomationClientpublic Session getSession(String username, String password)
AutomationClientgetSession in interface AutomationClientpublic Session getSession(String token)
AutomationClientgetSession in interface AutomationClientprotected Session getSession(RequestInterceptor interceptor)
public Session getSession(TokenCallback cb)
AutomationClientTokenCallback.getLocalToken()TokenCallback#getRemoteToken(java.util.Map)) to acquire a token
remotely using the information gathered by
TokenCallback.getTokenParams(), and save the token locally using
TokenCallback.saveToken(String)AutomationClient.getSession(String)getSession in interface AutomationClientpublic void getSession(String username, String password, AsyncCallback<Session> cb)
AutomationClientgetSession in interface AutomationClientpublic Session getSession(LoginCallback loginCb)
AutomationClientgetSession in interface AutomationClientpublic void getSession(LoginCallback loginCb, AsyncCallback<Session> cb)
AutomationClientgetSession in interface AutomationClientpublic void getSession(AsyncCallback<Session> cb)
AutomationClientgetSession in interface AutomationClientpublic void asyncExec(Runnable runnable)
protected abstract Connector newConnector()
Copyright © 2021. All rights reserved.