Se Br
Se Br

Reputation: 101

How to get schema of LDAP server by UnboundID?

I'm trying to get schema of In-Memory Directory Server by using UnboundID. For in-memory ds i used custom schema: before import from LDIF file i clear schema.

Code:

//...
    public static void main(String[] args) {
        //...
        InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("o=DFAT");
        config.addAdditionalBindCredentials("uid=1000", "root");
        config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("LDAP", null, 389, null));
        config.setSchema(null);
        InMemoryDirectoryServer server = new InMemoryDirectoryServer(config);
        server.importFromLDIF(true, "dump.ldif");
        server.startListening();
        LDAPConnection connection = server.getConnection("LDAP");
        assert(connection.getSchema() != null); // failed - schema null
        //...
    }

Upvotes: 2

Views: 466

Answers (0)

Related Questions