public interface AutomationClient
When you attempt to create a new session using the same authentication info as an already created session the session will be reused (TODO this is optional for implementors?)
Note for implementors: the implementation should provide a constructor that initialize the base URL
Modifier and Type | Method and Description |
---|---|
<T> T |
getAdapter(Session session,
Class<T> adapterType)
Adapts the given object to the given type.
|
String |
getBaseUrl()
Gets the automation service URL.
|
Session |
getSession()
Creates a new session.
|
Session |
getSession(LoginCallback loginCb)
Create a new session using the given login callback to gather login info.
|
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 getSession(String)
|
void |
registerAdapter(AdapterFactory<?> factory)
Register an adapter for a given type.
|
void |
registerPojoMarshaller(Class clazz)
Marshaller registration for pojo bean
|
void |
setRequestInterceptor(RequestInterceptor interceptor) |
void |
shutdown()
Cleanup any resources held by this client.
|
void setRequestInterceptor(RequestInterceptor interceptor)
interceptor
- String getBaseUrl()
Session getSession() throws IOException
IOException
Session getSession(LoginCallback loginCb) throws IOException
IOException
Session getSession(String username, String password) throws IOException
IOException
Session getSession(String token) throws IOException
IOException
Session getSession(TokenCallback cb) throws IOException
TokenCallback.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)
getSession(String)
IOException
<T> T getAdapter(Session session, Class<T> adapterType)
Optional operation. Framework that doesn't supports reflection like GWT must throw
UnsupportedOperationException
void registerAdapter(AdapterFactory<?> factory)
typeToAdapt
- adapterType
- void registerPojoMarshaller(Class clazz)
clazz
- the pojo bean to add to Marshallingvoid shutdown()
Copyright © 2015 Nuxeo SA. All rights reserved.