@SuppressWarnings("unchecked") @Test public void testGetEntryWithLdapTreeRef() { assumeTrue(isExternalServer()); LDAPDirectory unitDir = (LDAPDirectory) dirService.getDirectory("unitDirectory"); try (Session session = groupDir.getSession(); Session unitSession = unitDir.getSession()) { DocumentModel entry = session.getEntry("subgroup"); assertNotNull(entry); assertEquals("subgroup", entry.getId()); assertEquals("subgroup", entry.getProperty(GROUP_SCHEMANAME, "groupname")); List<String> members = (List<String>) entry.getProperty(GROUP_SCHEMANAME, "members"); assertNotNull(members); assertEquals(1, members.size()); List<String> subGroups = (List<String>) entry.getProperty(GROUP_SCHEMANAME, "subGroups"); assertNotNull(subGroups); assertEquals(0, subGroups.size()); List<String> parentGroups = (List<String>) entry.getProperty(GROUP_SCHEMANAME, "parentGroups"); assertNotNull(parentGroups); if (hasDynGroupSchema()) { assertEquals(1, parentGroups.size()); assertEquals(Arrays.asList("dyngroup1"), parentGroups); } else { assertEquals(0, parentGroups.size()); } List<String> ldapDirectChildren = (List<String>) entry.getProperty(GROUP_SCHEMANAME, "ldapDirectChildren"); assertNotNull(ldapDirectChildren); assertEquals(1, ldapDirectChildren.size()); assertTrue(ldapDirectChildren.contains("subsubgroup")); List<String> ldapChildren = (List<String>) entry.getProperty(GROUP_SCHEMANAME, "ldapChildren"); assertNotNull(ldapChildren); assertEquals(2, ldapChildren.size()); assertTrue(ldapChildren.contains("subsubgroup")); assertTrue(ldapChildren.contains("subsubsubgroup")); List<String> ldapDirectParents = (List<String>) entry.getProperty(GROUP_SCHEMANAME, "ldapDirectParents"); assertNotNull(ldapDirectParents); assertEquals(1, ldapDirectParents.size()); assertTrue(ldapDirectParents.contains("group")); List<String> ldapParents = (List<String>) entry.getProperty(GROUP_SCHEMANAME, "ldapParents"); assertNotNull(ldapParents); assertEquals(1, ldapParents.size()); assertTrue(ldapParents.contains("group")); List<String> ldapUnitDirectChildren = (List<String>) entry.getProperty(GROUP_SCHEMANAME, "ldapUnitDirectChildren"); assertNotNull(ldapUnitDirectChildren); assertEquals(1, ldapUnitDirectChildren.size()); assertTrue(ldapUnitDirectChildren.contains("subunit")); List<String> ldapUnitDirectParents = (List<String>) entry.getProperty(GROUP_SCHEMANAME, "ldapUnitDirectParents"); assertNotNull(ldapUnitDirectParents); assertEquals(0, ldapUnitDirectParents.size()); DocumentModel unitEntry = unitSession.getEntry("subunit"); assertNotNull(unitEntry); assertEquals("subunit", unitEntry.getId()); assertEquals("subunit", unitEntry.getProperty(GROUP_SCHEMANAME, "groupname")); ldapUnitDirectChildren = (List<String>) unitEntry.getProperty(GROUP_SCHEMANAME, "ldapUnitDirectChildren"); assertNotNull(ldapUnitDirectChildren); assertEquals(0, ldapUnitDirectChildren.size()); ldapUnitDirectParents = (List<String>) unitEntry.getProperty(GROUP_SCHEMANAME, "ldapUnitDirectParents"); assertNotNull(ldapUnitDirectParents); assertEquals(1, ldapUnitDirectParents.size()); assertTrue(ldapUnitDirectParents.contains("subgroup")); } }
@Override public LDAPDirectory getDirectory() { return (LDAPDirectory) directory; }
LDAPSession extends BaseSession { @Override public LDAPDirectory getDirectory() { return (LDAPDirectory) directory; } }
LDAPSession extends BaseSession { @Override public LDAPDirectory getDirectory() { return (LDAPDirectory) directory; } LDAPSession(LDAPDirectory directory); }
LDAPSession extends BaseSession { @Override public LDAPDirectory getDirectory() { return (LDAPDirectory) directory; } LDAPSession(LDAPDirectory directory); @Override LDAPDirectory getDirectory(); DirContext getContext(); @Override void deleteEntryWithoutReferences(String id); @Override boolean hasEntry(String id); @Override void deleteEntry(String id, Map<String, String> map); @Override DocumentModel getEntryFromSource(String id, boolean fetchReferences); @Override DocumentModelList query(Map<String, Serializable> filter, Set<String> fulltext, Map<String, String> orderBy,
            boolean fetchReferences, int limit, int offset); @Override DocumentModelList query(QueryBuilder queryBuilder, boolean fetchReferences); @Override List<String> queryIds(QueryBuilder queryBuilder); @Override void close(); @Override boolean authenticate(String username, String password); @Override boolean isAuthenticating(); boolean rdnMatchesIdField(); @Override // useful for the log function String toString(); @Override DocumentModel createEntry(DocumentModel entry); }
LDAPSession extends BaseSession { @Override public LDAPDirectory getDirectory() { return (LDAPDirectory) directory; } LDAPSession(LDAPDirectory directory); @Override LDAPDirectory getDirectory(); DirContext getContext(); @Override void deleteEntryWithoutReferences(String id); @Override boolean hasEntry(String id); @Override void deleteEntry(String id, Map<String, String> map); @Override DocumentModel getEntryFromSource(String id, boolean fetchReferences); @Override DocumentModelList query(Map<String, Serializable> filter, Set<String> fulltext, Map<String, String> orderBy,
            boolean fetchReferences, int limit, int offset); @Override DocumentModelList query(QueryBuilder queryBuilder, boolean fetchReferences); @Override List<String> queryIds(QueryBuilder queryBuilder); @Override void close(); @Override boolean authenticate(String username, String password); @Override boolean isAuthenticating(); boolean rdnMatchesIdField(); @Override // useful for the log function String toString(); @Override DocumentModel createEntry(DocumentModel entry);  }