Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.automation.client
Interface AutomationClient

All Known Implementing Classes:
AbstractAutomationClient, AsyncAutomationClient, HttpAutomationClient, JavaClient

public interface AutomationClient

The connection to the automation service is done the first time you create a session. To create a session you need to pass the authentication information. If null is passed as the user name an anonymous session will be created. Note that anonymous sessions are not always accepted by a Nuxeo Server (it depends on the server configuration).

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

Author:
Bogdan Stefanescu

Method Summary
<T> T
getAdapter(Object objToAdapt, Class<T> adapterType)
          Adapts the given object to the given type.
 String getBaseUrl()
          Gets the automation service URL.
 Session getSession()
          Creates a new session.
 void getSession(AsyncCallback<Session> cb)
          Creates a new session.
 Session getSession(LoginCallback loginCb)
          Create a new session using the given login callback to gather login info.
 void getSession(LoginCallback loginCb, AsyncCallback<Session> cb)
          Create asynchronously a new session using the given login callback to gather login info.
 Session getSession(String username, String password)
          Creates a new session using the given login.
 void getSession(String username, String password, AsyncCallback<Session> cb)
          Creates asynchronously a new session using the given login.
 void registerAdapter(AdapterFactory<?> factory)
          Register an adapter for a given type.
 void shutdown()
          Cleanup any resources held by this client.
 

Method Detail

getBaseUrl

String getBaseUrl()
Gets the automation service URL.


getSession

Session getSession()
Creates a new session. If no interceptors configured connect anonymously.


getSession

void getSession(AsyncCallback<Session> cb)
Creates a new session. If no interceptors configured connect anonymously.


getSession

Session getSession(LoginCallback loginCb)
Create a new session using the given login callback to gather login info. The given callback will be notified after the session is created.


getSession

void getSession(LoginCallback loginCb,
                AsyncCallback<Session> cb)
Create asynchronously a new session using the given login callback to gather login info. The given callback will be notified after the session is created.


getSession

Session getSession(String username,
                   String password)
Creates a new session using the given login.


getSession

void getSession(String username,
                String password,
                AsyncCallback<Session> cb)
Creates asynchronously a new session using the given login. The given callback will be notified after the session is created.


getAdapter

<T> T getAdapter(Object objToAdapt,
                 Class<T> adapterType)
Adapts the given object to the given type. Return the adapter instance if any, otherwise null.

Optional operation. Framework that doesn't supports reflection like GWT must throw UnsupportedOperationException


registerAdapter

void registerAdapter(AdapterFactory<?> factory)
Register an adapter for a given type. Registration is not thread safe. You should register adapters at initialization time. An adapter type can be bound to a single adaptable type.

Parameters:
typeToAdapt -
adapterType -

shutdown

void shutdown()
Cleanup any resources held by this client. After a shutdown the client is no more usable.


Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.