Search in sources :

Example 1 with Schema

use of com.unboundid.ldap.sdk.schema.Schema in project spring-boot by spring-projects.

the class EmbeddedLdapAutoConfiguration method setSchema.

private void setSchema(InMemoryDirectoryServerConfig config, Resource resource) {
    try {
        Schema defaultSchema = Schema.getDefaultStandardSchema();
        Schema schema = Schema.getSchema(resource.getInputStream());
        config.setSchema(Schema.mergeSchemas(defaultSchema, schema));
    } catch (Exception ex) {
        throw new IllegalStateException("Unable to load schema " + resource.getDescription(), ex);
    }
}
Also used : Schema(com.unboundid.ldap.sdk.schema.Schema) LDAPException(com.unboundid.ldap.sdk.LDAPException)

Aggregations

LDAPException (com.unboundid.ldap.sdk.LDAPException)1 Schema (com.unboundid.ldap.sdk.schema.Schema)1