public abstract class JavaSession extends Object implements Session
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 Session interface.
| Modifier and Type | Field and Description |
|---|---|
protected JavaClient |
client |
protected LoginInfo |
login |
protected OperationRegistry |
registry |
| Constructor and Description |
|---|
JavaSession(JavaClient client,
LoginInfo login,
OperationRegistry registry) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Remove any resources held by this session.
|
protected OperationRequest |
createOperationRequest(JavaSession session,
OperationDocumentation op,
Map<String,Object> ctx) |
void |
execute(OperationRequest request,
AsyncCallback<Object> cb) |
<T> T |
getAdapter(Class<T> type)
Get an adapter of the current session.
|
AutomationClient |
getClient()
Get the client that created this session.
|
void |
getFile(String path,
AsyncCallback<Blob> cb) |
void |
getFiles(String path,
AsyncCallback<Blobs> cb) |
LoginInfo |
getLogin()
Get the login used to authenticate against the server
|
OperationDocumentation |
getOperation(String id) |
Map<String,OperationDocumentation> |
getOperations() |
protected OperationRegistry |
getRegistry() |
OperationRequest |
newRequest(String id)
Create a new operation request given an operation ID.
|
OperationRequest |
newRequest(String id,
Map<String,Object> ctx)
Create a new operation request given an operation ID and an operation
context map.
|
protected final JavaClient client
protected final LoginInfo login
protected final OperationRegistry registry
public JavaSession(JavaClient client, LoginInfo login, OperationRegistry registry)
protected OperationRequest createOperationRequest(JavaSession session, OperationDocumentation op, Map<String,Object> ctx)
public AutomationClient getClient()
Sessionpublic LoginInfo getLogin()
Sessionpublic <T> T getAdapter(Class<T> type)
Session
Optional operation. Environments that cannot support this method (like
GWT) must throw UnsupportedOperationException
getAdapter in interface SessionAutomationClient.getAdapter(Object, Class)public void execute(OperationRequest request, AsyncCallback<Object> cb)
public void getFile(String path, AsyncCallback<Blob> cb) throws Exception
public void getFiles(String path, AsyncCallback<Blobs> cb) throws Exception
public OperationRequest newRequest(String id) throws Exception
SessionnewRequest in interface Sessionid - the ID of the operation to be executed.Exceptionpublic OperationRequest newRequest(String id, Map<String,Object> ctx) throws Exception
SessionnewRequest in interface Sessionid - the operation idctx - the context map to be used when executing the operation on
the server.Exceptionprotected OperationRegistry getRegistry()
public OperationDocumentation getOperation(String id)
getOperation in interface Sessionpublic Map<String,OperationDocumentation> getOperations()
getOperations in interface SessionCopyright © 2018. All rights reserved.