Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.automation.client.jaxrs.spi
Class JavaClient

java.lang.Object
  extended by org.nuxeo.ecm.automation.client.jaxrs.spi.JavaClient
All Implemented Interfaces:
AutomationClient

public abstract class JavaClient
extends Object
implements AutomationClient

Abstract class for clients running on real JVMs.

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 AutomationClient interface.

Author:
Bogdan Stefanescu

Constructor Summary
JavaClient(String url, ExecutorService executor)
           
 
Method Summary
 void asyncExec(Runnable runnable)
           
<T> T
getAdapter(Object objToAdapt, Class<T> adapterType)
          Adapts the given object to the given type.
 AdapterManager getAdapterManager()
           
 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 cb)
          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.
 void shutdown(long timeout)
          TODO Move this in interface?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaClient

public JavaClient(String url,
                  ExecutorService executor)
Method Detail

getBaseUrl

public String getBaseUrl()
Description copied from interface: AutomationClient
Gets the automation service URL.

Specified by:
getBaseUrl in interface AutomationClient

getAdapterManager

public AdapterManager getAdapterManager()

asyncExec

public void asyncExec(Runnable runnable)

getAdapter

public <T> T getAdapter(Object objToAdapt,
                        Class<T> adapterType)
Description copied from interface: AutomationClient
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

Specified by:
getAdapter in interface AutomationClient

registerAdapter

public void registerAdapter(AdapterFactory<?> factory)
Description copied from interface: AutomationClient
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.

Specified by:
registerAdapter in interface AutomationClient

getSession

public void getSession(LoginCallback loginCb,
                       AsyncCallback<Session> cb)
Description copied from interface: AutomationClient
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.

Specified by:
getSession in interface AutomationClient

getSession

public void getSession(AsyncCallback<Session> cb)
Description copied from interface: AutomationClient
Creates a new session. If no interceptors configured connect anonymously.

Specified by:
getSession in interface AutomationClient

getSession

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

Specified by:
getSession in interface AutomationClient

getSession

public Session getSession(LoginCallback cb)
Description copied from interface: AutomationClient
Create a new session using the given login callback to gather login info. The given callback will be notified after the session is created.

Specified by:
getSession in interface AutomationClient

getSession

public Session getSession(String username,
                          String password)
Description copied from interface: AutomationClient
Creates a new session using the given login.

Specified by:
getSession in interface AutomationClient

getSession

public Session getSession()
Description copied from interface: AutomationClient
Creates a new session. If no interceptors configured connect anonymously.

Specified by:
getSession in interface AutomationClient

shutdown

public void shutdown()
Description copied from interface: AutomationClient
Cleanup any resources held by this client. After a shutdown the client is no more usable.

Specified by:
shutdown in interface AutomationClient

shutdown

public void shutdown(long timeout)
TODO Move this in interface?

Parameters:
timeout -

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.