public abstract class AbstractAutomationClient extends Object implements AutomationClient
| Modifier and Type | Field and Description |
|---|---|
protected AdapterManager |
adapterManager |
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(Session session,
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.
|
Session |
getSession(LoginCallback loginCb)
Create 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.
|
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 |
registerPojoMarshaller(Class clazz)
Marshaller registration for pojo bean
|
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 |
setSharedRegistryExpirationDelay(long delay) |
void |
shutdown()
Cleanup any resources held by this client.
|
protected final AdapterManager adapterManager
protected volatile OperationRegistry registry
protected RequestInterceptor requestInterceptor
protected AbstractAutomationClient(String url)
public RequestInterceptor getRequestInterceptor()
public void setRequestInterceptor(RequestInterceptor interceptor)
setRequestInterceptor in interface AutomationClientpublic String getBaseUrl()
AutomationClientgetBaseUrl in interface AutomationClientpublic void setBasicAuth(String username, String password)
protected OperationRegistry getRegistry()
public void registerAdapter(AdapterFactory<?> factory)
AutomationClientregisterAdapter in interface AutomationClientpublic <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 AutomationClientprotected OperationRegistry connect(Connector connector) throws IOException
IOExceptionpublic void shutdown()
AutomationClientshutdown in interface AutomationClientpublic Session getSession() throws IOException
AutomationClientgetSession in interface AutomationClientIOExceptionpublic Session getSession(String username, String password) throws IOException
AutomationClientgetSession in interface AutomationClientIOExceptionpublic Session getSession(String token) throws IOException
AutomationClientgetSession in interface AutomationClientIOExceptionprotected Session getSession(RequestInterceptor interceptor) throws IOException
IOExceptionpublic Session getSession(TokenCallback cb) throws IOException
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 AutomationClientIOExceptionpublic Session getSession(LoginCallback loginCb)
AutomationClientgetSession in interface AutomationClientprotected Session login(Connector connector) throws IOException
IOExceptionprotected Session createSession(Connector connector, LoginInfo login)
protected abstract Connector newConnector()
public void setSharedRegistryExpirationDelay(long delay)
public void registerPojoMarshaller(Class clazz)
AutomationClientregisterPojoMarshaller in interface AutomationClientclazz - the pojo bean to add to MarshallingCopyright © 2018 Nuxeo. All rights reserved.