public class DefaultSession extends Object implements Session
| Modifier and Type | Field and Description |
|---|---|
protected AbstractAutomationClient |
client |
protected Connector |
connector |
protected String |
defaultSchemas |
protected LoginInfo |
login |
| Constructor and Description |
|---|
DefaultSession(AbstractAutomationClient client,
Connector connector,
LoginInfo login) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Remove any resources held by this session.
|
Object |
execute(OperationRequest request) |
<T> T |
getAdapter(Class<T> type)
Get an adapter of the current session.
|
AutomationClient |
getClient()
Get the client that created this session.
|
Connector |
getConnector() |
String |
getDefaultSchemas()
Get the default schemas that should be sent by the server.
|
Blob |
getFile(String path)
Get a file from the server given a path identifying the file.
|
Blobs |
getFiles(String path)
Get a collection of files from the server given the path identifying the collection.
|
LoginInfo |
getLogin()
Get the login used to authenticate against the server
|
OperationDocumentation |
getOperation(String id) |
Map<String,OperationDocumentation> |
getOperations() |
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.
|
void |
setDefaultSchemas(String defaultSchemas)
Set the default schemas that should be sent by the server.
|
protected final AbstractAutomationClient client
protected String defaultSchemas
public DefaultSession(AbstractAutomationClient client, Connector connector, LoginInfo login)
public AutomationClient getClient()
Sessionpublic Connector getConnector()
public 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 String getDefaultSchemas()
SessionThis is a comma separated String (ex: dublincore,file)
default value is null (let the server decide what to send)
when Automation server convert the Documents to JSON, it will use this list to select what properties should be sent. You can explicitly set the X-NXDocumentProperties header at request level. If defaultSchemas, the request that don't already have the header set will inherit the default value.
getDefaultSchemas in interface Sessionpublic void setDefaultSchemas(String defaultSchemas)
SessionThis is a comma separated String (ex: dublincore,file)
when Automation server convert the Documents to JSON, it will use this list to select what properties should be sent. You can explicitly set the X-NXDocumentProperties header at request level. If defaultSchemas, the request that don't already have the header set will inherit the default value.
setDefaultSchemas in interface SessiondefaultSchemas - list of schemas as a comma separated stringpublic Object execute(OperationRequest request) throws IOException
execute in interface SessionIOExceptionpublic Blob getFile(String path) throws IOException
SessiongetFile in interface Sessionpath - the file pathIOExceptionpublic Blobs getFiles(String path) throws IOException
SessiongetFiles in interface Sessionpath - the file pathIOExceptionpublic OperationRequest newRequest(String id)
SessionnewRequest in interface Sessionid - the ID of the operation to be executed.public OperationRequest newRequest(String id, Map<String,Object> ctx)
SessionnewRequest in interface Sessionid - the operation idctx - the context map to be used when executing the operation on the server.public OperationDocumentation getOperation(String id)
getOperation in interface Sessionpublic Map<String,OperationDocumentation> getOperations()
getOperations in interface SessionCopyright © 2018 Nuxeo. All rights reserved.