getCmisSession method
Return either a new CmisSession or one from the cache if we have one
Implementation
CmisSession? getCmisSession(String? urlPrefix,
[String? serviceUrlPrefix,
String? userName,
String? password,
String? repId]) {
/// Check for an existing session
if (_sessionMap.containsKey(repId)) {
return _sessionMap[repId!];
}
// Generate a new one
final newSession = CmisSession(
urlPrefix, httpAdapter, environmentSupport, serviceUrlPrefix, repId);
// Login if asked
if ((userName != null) && (password != null)) {
newSession.login(userName, password);
}
// Add to the map
if (repId != null) {
_sessionMap[repId] = newSession;
}
// Return the new session
return newSession;
}