X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Facr%2FSingleUserContentRepository.java;h=cac407495a70be147447e9c27986ccecf448cbe4;hb=da9d144b6b241e1526a3bd255dff905a7969a5bc;hp=09efa72740c2118f0d6251301badcf316e577407;hpb=fdf44255df56ae179b904e4ab326bf595674800e;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/acr/SingleUserContentRepository.java b/org.argeo.cms/src/org/argeo/cms/acr/SingleUserContentRepository.java index 09efa7274..cac407495 100644 --- a/org.argeo.cms/src/org/argeo/cms/acr/SingleUserContentRepository.java +++ b/org.argeo.cms/src/org/argeo/cms/acr/SingleUserContentRepository.java @@ -4,6 +4,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Locale; import java.util.Objects; +import java.util.UUID; import javax.security.auth.Subject; import javax.security.auth.x500.X500Principal; @@ -21,6 +22,8 @@ public class SingleUserContentRepository extends AbstractContentRepository { private final Subject subject; private final Locale locale; + private UUID uuid; + // the single session private CmsContentSession contentSession; @@ -34,6 +37,9 @@ public class SingleUserContentRepository extends AbstractContentRepository { this.subject = subject; this.locale = locale; + + // TODO use an UUID factory + this.uuid = UUID.randomUUID(); } @Override @@ -45,7 +51,7 @@ public class SingleUserContentRepository extends AbstractContentRepository { initRootContentProvider(null); if (contentSession != null) throw new IllegalStateException("Repository is already started, stop it first."); - contentSession = new CmsContentSession(this, subject, locale); + contentSession = new CmsContentSession(this, uuid, subject, locale); } @Override @@ -70,7 +76,7 @@ public class SingleUserContentRepository extends AbstractContentRepository { @Override protected CmsContentSession newSystemSession() { - return new CmsContentSession(this, subject, Locale.getDefault()); + return new CmsContentSession(this, uuid, subject, Locale.getDefault()); } public static void main(String... args) {