public interface SessionFactory
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, etc.).
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.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);
Modifier and Type | Method and Description |
---|---|
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.
|
Session createSession(Map<String,String> parameters)
parameters
- a Map
of name/value pairs with parameters for the
sessionSession
connected to the CMIS repositoryCmisBaseException
- if the connection could not be establishedSessionParameter
List<Repository> getRepositories(Map<String,String> parameters)
createSession(Map)
for parameter details. The parameter
SessionParameter.REPOSITORY_ID
should not be set.Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.