Examples of InMemoryDirectoryServer


Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

    InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=MyDomain");
    config.addAdditionalBindCredentials("cn=Directory Manager", "password");
    config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("default", ldapPort));
    config.setSchema(null);

    ds = new InMemoryDirectoryServer(config);
    ds.startListening();
  }
View Full Code Here

Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

                                                      final String ldifFile) throws LDAPException, IOException {
        final InMemoryListenerConfig listenerConfig = InMemoryListenerConfig.createLDAPConfig("default", port);
        final InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(new DN(baseDN));
        config.setListenerConfigs(listenerConfig);
        config.addAdditionalBindCredentials(authDN, authPassword);
        final InMemoryDirectoryServer server = new InMemoryDirectoryServer(config);
        server.add(new Entry(baseDN, new Attribute("objectclass", "domain", "top")));
        loadData(server, ldifFile);
        server.startListening();
        return server;
    }
View Full Code Here

Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

     * @throws Throwable If there was an error starting the server, executing the wrapped statement or shutting the
     *                   wrapped server.
     */
    @Override
    public void evaluate() throws Throwable {
        final InMemoryDirectoryServer server = DirectoryServerUtils.startServer(annotation.port(), annotation.baseDN(),
                annotation.authDN(), annotation.authPassword(), annotation.ldifFile());
        try {
            base.evaluate();
        } finally {
            DirectoryServerUtils.stopServer(server);
View Full Code Here

Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

          InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(rootDN);
          config.addAdditionalBindCredentials(bindUserName, bindPassword);
          config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("default", port));
          config.setSchema(null);

          InMemoryDirectoryServer ds = new InMemoryDirectoryServer(config);
          ds.importFromLDIF(true, new LDIFReader(ldifFile));
          ds.startListening();

          logger.info("LDAP Server started at ldap://localhost:" + port);
        }
      }
    } catch (Exception e) {
View Full Code Here

Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

          InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(rootDN);
          config.addAdditionalBindCredentials(bindUserName, bindPassword);
          config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("default", port));
          config.setSchema(null);

          InMemoryDirectoryServer ds = new InMemoryDirectoryServer(config);
          ds.importFromLDIF(true, new LDIFReader(ldifFile));
          ds.startListening();

          logger.info("LDAP Server started at ldap://localhost:" + port);
        }
      }
    } catch (Exception e) {
View Full Code Here

Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

    InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=MyDomain");
    config.addAdditionalBindCredentials("cn=Directory Manager", "password");
    config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("default", ldapPort));
    config.setSchema(null);

    ds = new InMemoryDirectoryServer(config);
    ds.startListening();
  }
View Full Code Here

Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

     * @throws Throwable If there was an error starting the server, executing the wrapped statement or shutting the
     *                   wrapped server.
     */
    @Override
    public void evaluate() throws Throwable {
        final InMemoryDirectoryServer server = startServer();
        try {
            base.evaluate();
        } finally {
            stopServer(server);
        }
View Full Code Here

Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

    private InMemoryDirectoryServer startServer() throws LDAPException, IOException {
        final InMemoryListenerConfig listenerConfig = InMemoryListenerConfig.createLDAPConfig("default", annotation.port());
        final InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(new DN(annotation.baseDN()));
        config.setListenerConfigs(listenerConfig);
        config.addAdditionalBindCredentials(annotation.authDN(), annotation.authPassword());
        final InMemoryDirectoryServer server = new InMemoryDirectoryServer(config);
        server.add(new Entry(annotation.baseDN(), new Attribute("objectclass", "domain", "top")));
        loadData(server);
        server.startListening();
        return server;
    }
View Full Code Here

Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

            throws LDIFException, LDAPException, IOException {
        final InMemoryListenerConfig listenerConfig = InMemoryListenerConfig.createLDAPConfig("default", port);
        final InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig(new DN(baseDN));
        config.setListenerConfigs(listenerConfig);
        config.addAdditionalBindCredentials(authDN, authPassword);
        final InMemoryDirectoryServer server = new InMemoryDirectoryServer(config);
        server.add(new Entry(baseDN, new Attribute("objectclass", "domain", "top")));
        server.startListening();
        for (final String ldifFile : ldifFiles) {
            loadData(server, ldifFile);
        }
        return server;
    }
View Full Code Here

Examples of com.unboundid.ldap.listener.InMemoryDirectoryServer

     * @throws Throwable If there was an error starting the server, executing the wrapped statement or shutting the
     *                   wrapped server.
     */
    @Override
    public void evaluate() throws Throwable {
        final InMemoryDirectoryServer server;
        if (annotation.ldifFiles().length == 0) {
            server = DirectoryServerUtils.startServer(annotation.port(), annotation.baseDN(),
                    annotation.authDN(), annotation.authPassword(), annotation.ldifFile());
        } else {
            server = DirectoryServerUtils.startServer(annotation.port(), annotation.baseDN(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.