Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.automation.client
Interface Session

All Known Implementing Classes:
DefaultSession, JavaSession

public interface Session

Author:
Bogdan Stefanescu

Method Summary
 void close()
          Remove any resources held by this session.
 Object execute(OperationRequest request)
           
 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.
 Blob getFile(String path)
          Get a file from the server given a path identifying the file.
 void getFile(String path, AsyncCallback<Blob> cb)
           
 Blobs getFiles(String path)
          Get a collection of files from the server given the path identifying the collection.
 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()
           
 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.
 

Method Detail

getClient

AutomationClient getClient()
Get the client that created this session.

Returns:
the client. cannot be null.

getLogin

LoginInfo getLogin()
Get the login used to authenticate against the server

Returns:
the login. cannot be null.

newRequest

OperationRequest newRequest(String id)
                            throws Exception
Create a new operation request given an operation ID.

Parameters:
id - the ID of the operation to be executed.
Returns:
the operation request
Throws:
Exception

newRequest

OperationRequest newRequest(String id,
                            Map<String,Object> ctx)
                            throws Exception
Create a new operation request given an operation ID and an operation context map.

Parameters:
id - the operation id
ctx - the context map to be used when executing the operation on the server.
Returns:
the operation request
Throws:
Exception

execute

Object execute(OperationRequest request)
               throws Exception
Throws:
Exception

execute

void execute(OperationRequest request,
             AsyncCallback<Object> cb)

getFile

Blob getFile(String path)
             throws Exception
Get a file from the server given a path identifying the file.

Parameters:
path - the file path
Returns:
a blob representation of the file
Throws:
Exception

getFiles

Blobs getFiles(String path)
               throws Exception
Get a collection of files from the server given the path identifying the collection.

Parameters:
path - the file path
Returns:
a collection of files represented as blobs.
Throws:
Exception

getFile

void getFile(String path,
             AsyncCallback<Blob> cb)
             throws Exception
Throws:
Exception

getFiles

void getFiles(String path,
              AsyncCallback<Blobs> cb)
              throws Exception
Throws:
Exception

getOperation

OperationDocumentation getOperation(String id)

getOperations

Map<String,OperationDocumentation> getOperations()

getAdapter

<T> T getAdapter(Class<T> type)
Get an adapter of the current session. Adapters can be used to define custom API over a Nuxeo Automation Session.

Optional operation. Environments that cannot support this method (like GWT) must throw UnsupportedOperationException

See Also:
AutomationClient.getAdapter(Object, Class)

close

void close()
Remove any resources held by this session. The session will no more be used again.


Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.