org.apache.chemistry.opencmis.client.api
Interface SessionFactory


public interface SessionFactory

Entry point into the OpenCMIS Client API. The SessionFactory class implementation needs to be retrieved by any runtime lookup call. This can for instance be a J2EE JNDI lookup or an OSGi service lookup.

The entries of the parameter map are defined by SessionParameter class which is part of the commons package. Parameters specify connection settings (user name, authentication, connection url, binding type (soap or atom pub) ...).

The Session class which is constructed is either the session base class which is the default implementation or it can be derived from that implementing special behavior for the session.

Sample code:

SessionFactory factory = ... // use a runtime lookup service

Map parameter = ...
parameter.put(SessionParameter.USER, "Otto");
parameter.put(SessionParameter.PASSWORD, "****");

parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost/cmis/atom");
parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameter.put(SessionParameter.REPOSITORY_ID, "myRepository");
...
Session session = factory.createSession(parameter);


Method Summary
 Session createSession(Map<String,String> parameters)
          Creates a new session.
 List<Repository> getRepositories(Map<String,String> parameters)
          Returns all repositories that are available at the endpoint.
 

Method Detail

createSession

Session createSession(Map<String,String> parameters)
Creates a new session.

Parameters:
parameters - a Map of name/value pairs with parameters for the session
Returns:
a Session connected to the CMIS repository
Throws:
CmisBaseException - if the connection could not be established
See Also:
SessionParameter

getRepositories

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



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