Search in sources :

Example 1 with ChangeLog

use of org.apache.directory.server.core.api.changelog.ChangeLog in project wildfly-camel by wildfly-extras.

the class DirectoryServiceBuilder method revert.

public static void revert(DirectoryService dirService, long revision) throws Exception {
    ChangeLog cl = dirService.getChangeLog();
    if (cl.isEnabled() && (revision < cl.getCurrentRevision())) {
        LOG.debug("Revert revision {}", revision);
        dirService.revert(revision);
    }
}
Also used : ChangeLog(org.apache.directory.server.core.api.changelog.ChangeLog)

Example 2 with ChangeLog

use of org.apache.directory.server.core.api.changelog.ChangeLog in project cloudstack by apache.

the class LdapDirectoryServerConnectionTest method testEmbeddedLdapServerInitialization.

@Test
public void testEmbeddedLdapServerInitialization() throws IndexNotFoundException {
    LdapServer ldapServer = embeddedLdapServer.getLdapServer();
    assertNotNull(ldapServer);
    DirectoryService directoryService = embeddedLdapServer.getDirectoryService();
    assertNotNull(directoryService);
    assertNotNull(directoryService.getSchemaPartition());
    assertNotNull(directoryService.getSystemPartition());
    assertNotNull(directoryService.getSchemaManager());
    assertNotNull(directoryService.getDnFactory());
    assertNotNull(directoryService.isDenormalizeOpAttrsEnabled());
    ChangeLog changeLog = directoryService.getChangeLog();
    assertNotNull(changeLog);
    assertFalse(changeLog.isEnabled());
    assertNotNull(directoryService.isStarted());
    assertNotNull(ldapServer.isStarted());
    List userList = new ArrayList(embeddedLdapServer.getUserIndexMap().keySet());
    java.util.Collections.sort(userList);
    List checkList = Arrays.asList("uid");
    assertEquals(userList, checkList);
}
Also used : LdapServer(org.apache.directory.server.ldap.LdapServer) ArrayList(java.util.ArrayList) DirectoryService(org.apache.directory.server.core.api.DirectoryService) ArrayList(java.util.ArrayList) List(java.util.List) ChangeLog(org.apache.directory.server.core.api.changelog.ChangeLog) Test(org.junit.Test)

Aggregations

ChangeLog (org.apache.directory.server.core.api.changelog.ChangeLog)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 DirectoryService (org.apache.directory.server.core.api.DirectoryService)1 LdapServer (org.apache.directory.server.ldap.LdapServer)1 Test (org.junit.Test)1