org.apache.chemistry.opencmis.client.runtime
Class SessionFactoryImpl

java.lang.Object
  extended by org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl
All Implemented Interfaces:
SessionFactory

public class SessionFactoryImpl
extends Object
implements SessionFactory

Default implementation of a session factory. Used by unit tests or applications that depend directly on runtime implementation.

SessionFactory sf = new SessionFactoryImpl();
Session s = sf.createSession(...);

Alternative factory lookup methods:

Context ctx = new DefaultContext();
SessionFactory = ctx.lookup(jndi_key);


Constructor Summary
protected SessionFactoryImpl()
           
 
Method Summary
 Session createSession(Map<String,String> parameters)
          Creates a new session.
 Session createSession(Map<String,String> parameters, ObjectFactory objectFactory, AuthenticationProvider authenticationProvider, Cache cache)
          Creates a new session.
 List<Repository> getRepositories(Map<String,String> parameters)
          Returns all repositories that are available at the endpoint.
 List<Repository> getRepositories(Map<String,String> parameters, ObjectFactory objectFactory, AuthenticationProvider authenticationProvider, Cache cache)
          Returns all repositories that are available at the endpoint.
static SessionFactoryImpl newInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionFactoryImpl

protected SessionFactoryImpl()
Method Detail

newInstance

public static SessionFactoryImpl newInstance()

createSession

public Session createSession(Map<String,String> parameters)
Description copied from interface: SessionFactory
Creates a new session.

Specified by:
createSession in interface SessionFactory
Parameters:
parameters - a Map of name/value pairs with parameters for the session
Returns:
a Session connected to the CMIS repository
See Also:
SessionParameter

createSession

public Session createSession(Map<String,String> parameters,
                             ObjectFactory objectFactory,
                             AuthenticationProvider authenticationProvider,
                             Cache cache)
Creates a new session. The provided object factory, authentication provider and cache instance override the values in the session parameters if they are not null.

Parameters:
T - a class implementing the Session interface
parameters - a Map of name/value pairs with parameters for the session
objectFactory - an object factory instance
authenticationProvider - an authentication provider instance
cache - a cache instance
Returns:
a Session connected to the CMIS repository
Throws:
CmisBaseException - if the connection could not be established
See Also:
SessionParameter

getRepositories

public List<Repository> getRepositories(Map<String,String> parameters)
Description copied from interface: SessionFactory
Returns all repositories that are available at the endpoint. See SessionFactory.createSession(Map) for parameter details. The parameter SessionParameter.REPOSITORY_ID should not be set.

Specified by:
getRepositories in interface SessionFactory

getRepositories

public List<Repository> getRepositories(Map<String,String> parameters,
                                        ObjectFactory objectFactory,
                                        AuthenticationProvider authenticationProvider,
                                        Cache cache)
Returns all repositories that are available at the endpoint. See createSession(Map, ObjectFactory, AuthenticationProvider, Cache) for parameter details. The parameter SessionParameter.REPOSITORY_ID should not be set.



Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.