}
// get the service factory class name
String serviceFactoryClassname = (String) session.get(SessionParameter.LOCAL_FACTORY);
if (serviceFactoryClassname == null) {
throw new CmisConnectionException("Factory class not set!");
}
try {
// gather parameters from session
Map<String, String> parameters = new HashMap<String, String>();
for (String key : session.getKeys()) {
Object value = session.get(key);
if (value instanceof String) {
parameters.put(key, (String) value);
}
}
// create and initialize factory
factory = (CmisServiceFactory) Class.forName(serviceFactoryClassname).newInstance();
factory.init(parameters);
} catch (Exception e) {
throw new CmisConnectionException("Factory cannot be created: " + e.getMessage(), e);
}
repositoryService = new RepositoryServiceImpl(session, factory);
navigationService = new NavigationServiceImpl(session, factory);
objectService = new ObjectServiceImpl(session, factory);