Remove node data model, home areas based on workspaces instead.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / auth / CmsSessionImpl.java
index 863f7c202511bee640d447c129cd3981a35b12a3..ce38cf0ee94514ed445661707bb9d27e180e6563 100644 (file)
@@ -123,11 +123,15 @@ public class CmsSessionImpl implements CmsSession {
        private Subject getSubject() {
                return Subject.getSubject(initialContext);
        }
-       
+
        public Set<SecretKey> getSecretKeys() {
                return getSubject().getPrivateCredentials(SecretKey.class);
        }
 
+       public Session newDataSession(String cn, String workspace, Repository repository) {
+               return login(repository, workspace);
+       }
+
        public synchronized Session getDataSession(String cn, String workspace, Repository repository) {
                // FIXME make it more robust
                if (workspace == null)
@@ -178,6 +182,8 @@ public class CmsSessionImpl implements CmsSession {
                if (additionalDataSessions.contains(session)) {
                        JcrUtils.logoutQuietly(session);
                        additionalDataSessions.remove(session);
+                       if (log.isTraceEnabled())
+                               log.trace("Remove additional data session " + session);
                        return;
                }
                String path = cn + '/' + session.getWorkspace().getName();
@@ -187,6 +193,8 @@ public class CmsSessionImpl implements CmsSession {
                Session registeredSession = dataSessions.get(path);
                if (session != registeredSession)
                        log.warn("Data session " + path + " not consistent for " + userDn);
+               if (log.isTraceEnabled())
+                       log.trace("Released data session " + session + " for " + path);
                notifyAll();
        }