@Test public void testUpdateReadonlyMultidir() throws Exception { MultiDirectory readonlyMultidir = (MultiDirectory) directoryService.getDirectory("readonlymulti"); try (MultiDirectorySession readonlyDir = readonlyMultidir.getSession(); Session dir1 = memdir1.getSession(); Session dir2 = memdir2.getSession(); Session dir3 = memdir3.getSession()) { DocumentModel e = readonlyDir.getEntry("1"); assertEquals("foo1", e.getProperty("schema3", "thefoo")); assertEquals("bar1", e.getProperty("schema3", "thebar")); e.setProperty("schema3", "thefoo", "fffooo1"); e.setProperty("schema3", "thebar", "babar1"); try { readonlyDir.updateEntry(e); fail("Should not be able to update entry"); } catch (DirectorySecurityException ee) { } e = readonlyDir.getEntry("1"); assertEquals("foo1", e.getProperty("schema3", "thefoo")); assertEquals("bar1", e.getProperty("schema3", "thebar")); assertEquals("foo1", dir1.getEntry("1").getProperty("schema1", "foo")); assertEquals("bar1", dir2.getEntry("1").getProperty("schema2", "bar")); assertNull(dir3.getEntry("1")); } }
@Override public MultiDirectorySession getSession() { MultiDirectorySession session = new MultiDirectorySession(this); addSession(session); return session; }
MultiDirectory extends AbstractDirectory { @Override public MultiDirectorySession getSession() { MultiDirectorySession session = new MultiDirectorySession(this); addSession(session); return session; } }
MultiDirectory extends AbstractDirectory { @Override public MultiDirectorySession getSession() { MultiDirectorySession session = new MultiDirectorySession(this); addSession(session); return session; } MultiDirectory(MultiDirectoryDescriptor descriptor); }
MultiDirectory extends AbstractDirectory { @Override public MultiDirectorySession getSession() { MultiDirectorySession session = new MultiDirectorySession(this); addSession(session); return session; } MultiDirectory(MultiDirectoryDescriptor descriptor); @Override MultiDirectoryDescriptor getDescriptor(); @Override MultiDirectorySession getSession(); @Override List<Reference> getReferences(String referenceFieldName); @Override void invalidateDirectoryCache(); }
MultiDirectory extends AbstractDirectory { @Override public MultiDirectorySession getSession() { MultiDirectorySession session = new MultiDirectorySession(this); addSession(session); return session; } MultiDirectory(MultiDirectoryDescriptor descriptor); @Override MultiDirectoryDescriptor getDescriptor(); @Override MultiDirectorySession getSession(); @Override List<Reference> getReferences(String referenceFieldName); @Override void invalidateDirectoryCache();  }