@Test public void testUpdateEntry() throws Exception { try (Session dir1 = memdir1.getSession(); Session dir2 = memdir2.getSession(); Session dir3 = memdir3.getSession()) { DocumentModel e = dir.getEntry("1"); assertEquals("foo1", e.getProperty("schema3", "thefoo")); assertEquals("bar1", e.getProperty("schema3", "thebar")); e.setProperty("schema3", "thefoo", "fffooo1"); e.setProperty("schema3", "thebar", "babar1"); dir.updateEntry(e); e = dir.getEntry("1"); assertEquals("fffooo1", e.getProperty("schema3", "thefoo")); assertEquals("babar1", e.getProperty("schema3", "thebar")); assertEquals("fffooo1", dir1.getEntry("1").getProperty("schema1", "foo")); assertEquals("babar1", dir2.getEntry("1").getProperty("schema2", "bar")); assertNull(dir3.getEntry("1")); e = dir.getEntry("3"); assertEquals("foo3", e.getProperty("schema3", "thefoo")); assertEquals("bar3", e.getProperty("schema3", "thebar")); e.setProperty("schema3", "thefoo", "fffooo3"); e.setProperty("schema3", "thebar", "babar3"); dir.updateEntry(e); e = dir.getEntry("3"); assertEquals("fffooo3", e.getProperty("schema3", "thefoo")); assertEquals("babar3", e.getProperty("schema3", "thebar")); assertNull(dir1.getEntry("3")); assertNull(dir2.getEntry("3")); assertNotNull(dir3.getEntry("3")); assertEquals("fffooo3", dir3.getEntry("3").getProperty("schema3", "thefoo")); assertEquals("babar3", dir3.getEntry("3").getProperty("schema3", "thebar")); } }
@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();  }