public abstract class JavaClient extends Object implements AutomationClient
When your implementation is designed for running in environment that supports limited Java API like GWT or portable
devices you may need to directly implement the AutomationClient interface.
| Modifier and Type | Field and Description |
|---|---|
protected AdapterManager |
adapters |
protected ExecutorService |
async |
protected String |
url |
| Modifier | Constructor and Description |
|---|---|
protected |
JavaClient(String url) |
|
JavaClient(String url,
ExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncExec(Runnable runnable) |
protected abstract JavaSession |
createSession(LoginInfo login)
Create a valid session using the authenticated login.
|
<T> T |
getAdapter(Session session,
Class<T> adapterType)
Adapts the given object to the given type.
|
AdapterManager |
getAdapterManager() |
String |
getBaseUrl()
Gets the automation service URL.
|
Session |
getSession()
Creates a new session.
|
Session |
getSession(LoginCallback cb)
Create a new session using the given login callback to gather login info.
|
Session |
getSession(String username,
String password)
Creates a new session using the given login.
|
protected abstract LoginInfo |
login(String username,
String password)
Validate the credentials.
|
void |
registerAdapter(AdapterFactory<?> factory)
Register an adapter for a given type.
|
void |
shutdown()
Cleanup any resources held by this client.
|
void |
shutdown(long timeout)
TODO Move this in interface?
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSession, getSession, registerPojoMarshaller, setRequestInterceptorprotected AdapterManager adapters
protected ExecutorService async
protected JavaClient(String url)
public JavaClient(String url, ExecutorService executor)
protected abstract LoginInfo login(String username, String password)
username - password - protected abstract JavaSession createSession(LoginInfo login)
login - public String getBaseUrl()
AutomationClientgetBaseUrl in interface AutomationClientpublic AdapterManager getAdapterManager()
public <T> T getAdapter(Session session, Class<T> adapterType)
AutomationClient
Optional operation. Framework that doesn't supports reflection like GWT must throw
UnsupportedOperationException
getAdapter in interface AutomationClientpublic void registerAdapter(AdapterFactory<?> factory)
AutomationClientregisterAdapter in interface AutomationClientpublic Session getSession(LoginCallback cb)
AutomationClientgetSession in interface AutomationClientpublic Session getSession(String username, String password)
AutomationClientgetSession in interface AutomationClientpublic Session getSession()
AutomationClientgetSession in interface AutomationClientpublic void shutdown()
AutomationClientshutdown in interface AutomationClientpublic void shutdown(long timeout)
timeout - Copyright © 2019 Nuxeo. All rights reserved.