Search in sources :

Example 6 with AttributesFactory

use of org.apache.directory.api.ldap.model.schema.AttributesFactory in project directory-ldap-api by apache.

the class DefaultSchemaLoader method loadMatchingRuleUses.

/**
 * {@inheritDoc}
 */
@Override
public List<Entry> loadMatchingRuleUses(Schema... schemas) throws LdapException, IOException {
    List<Entry> matchingRuleUseEntries = new ArrayList<>();
    if (schemas == null) {
        return matchingRuleUseEntries;
    }
    AttributesFactory factory = new AttributesFactory();
    for (Schema schema : schemas) {
        Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
        for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
            SchemaObject schemaObject = schemaObjectWrapper.get();
            if (schemaObject instanceof MatchingRuleUse) {
                MatchingRuleUse matchingRuleUse = (MatchingRuleUse) schemaObject;
                Entry matchingRuleUseEntry = factory.convert(matchingRuleUse, schema, null);
                matchingRuleUseEntries.add(matchingRuleUseEntry);
            }
        }
    }
    return matchingRuleUseEntries;
}
Also used : SchemaObject(org.apache.directory.api.ldap.model.schema.SchemaObject) DefaultEntry(org.apache.directory.api.ldap.model.entry.DefaultEntry) Entry(org.apache.directory.api.ldap.model.entry.Entry) AttributesFactory(org.apache.directory.api.ldap.model.schema.AttributesFactory) MatchingRuleUse(org.apache.directory.api.ldap.model.schema.MatchingRuleUse) DefaultSchema(org.apache.directory.api.ldap.model.schema.registries.DefaultSchema) Schema(org.apache.directory.api.ldap.model.schema.registries.Schema) ArrayList(java.util.ArrayList) SchemaObjectWrapper(org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper)

Example 7 with AttributesFactory

use of org.apache.directory.api.ldap.model.schema.AttributesFactory in project directory-ldap-api by apache.

the class DefaultSchemaLoader method loadDitStructureRules.

/**
 * {@inheritDoc}
 */
@Override
public List<Entry> loadDitStructureRules(Schema... schemas) throws LdapException, IOException {
    List<Entry> ditStructureRuleEntries = new ArrayList<>();
    if (schemas == null) {
        return ditStructureRuleEntries;
    }
    AttributesFactory factory = new AttributesFactory();
    for (Schema schema : schemas) {
        Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
        for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
            SchemaObject schemaObject = schemaObjectWrapper.get();
            if (schemaObject instanceof DitStructureRule) {
                DitStructureRule ditStructureRule = (DitStructureRule) schemaObject;
                Entry ditStructureRuleEntry = factory.convert(ditStructureRule, schema, null);
                ditStructureRuleEntries.add(ditStructureRuleEntry);
            }
        }
    }
    return ditStructureRuleEntries;
}
Also used : SchemaObject(org.apache.directory.api.ldap.model.schema.SchemaObject) DefaultEntry(org.apache.directory.api.ldap.model.entry.DefaultEntry) Entry(org.apache.directory.api.ldap.model.entry.Entry) AttributesFactory(org.apache.directory.api.ldap.model.schema.AttributesFactory) DitStructureRule(org.apache.directory.api.ldap.model.schema.DitStructureRule) DefaultSchema(org.apache.directory.api.ldap.model.schema.registries.DefaultSchema) Schema(org.apache.directory.api.ldap.model.schema.registries.Schema) ArrayList(java.util.ArrayList) SchemaObjectWrapper(org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper)

Example 8 with AttributesFactory

use of org.apache.directory.api.ldap.model.schema.AttributesFactory in project directory-ldap-api by apache.

the class DefaultSchemaLoader method loadDitContentRules.

/**
 * {@inheritDoc}
 */
@Override
public List<Entry> loadDitContentRules(Schema... schemas) throws LdapException, IOException {
    List<Entry> ditContentRuleEntries = new ArrayList<>();
    if (schemas == null) {
        return ditContentRuleEntries;
    }
    AttributesFactory factory = new AttributesFactory();
    for (Schema schema : schemas) {
        Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
        for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
            SchemaObject schemaObject = schemaObjectWrapper.get();
            if (schemaObject instanceof DitContentRule) {
                DitContentRule ditContentRule = (DitContentRule) schemaObject;
                Entry ditContentRuleEntry = factory.convert(ditContentRule, schema, null);
                ditContentRuleEntries.add(ditContentRuleEntry);
            }
        }
    }
    return ditContentRuleEntries;
}
Also used : SchemaObject(org.apache.directory.api.ldap.model.schema.SchemaObject) DefaultEntry(org.apache.directory.api.ldap.model.entry.DefaultEntry) Entry(org.apache.directory.api.ldap.model.entry.Entry) AttributesFactory(org.apache.directory.api.ldap.model.schema.AttributesFactory) DefaultSchema(org.apache.directory.api.ldap.model.schema.registries.DefaultSchema) Schema(org.apache.directory.api.ldap.model.schema.registries.Schema) ArrayList(java.util.ArrayList) SchemaObjectWrapper(org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper) DitContentRule(org.apache.directory.api.ldap.model.schema.DitContentRule)

Aggregations

ArrayList (java.util.ArrayList)8 DefaultEntry (org.apache.directory.api.ldap.model.entry.DefaultEntry)8 Entry (org.apache.directory.api.ldap.model.entry.Entry)8 AttributesFactory (org.apache.directory.api.ldap.model.schema.AttributesFactory)8 SchemaObject (org.apache.directory.api.ldap.model.schema.SchemaObject)8 SchemaObjectWrapper (org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper)8 DefaultSchema (org.apache.directory.api.ldap.model.schema.registries.DefaultSchema)8 Schema (org.apache.directory.api.ldap.model.schema.registries.Schema)8 AttributeType (org.apache.directory.api.ldap.model.schema.AttributeType)1 DitContentRule (org.apache.directory.api.ldap.model.schema.DitContentRule)1 DitStructureRule (org.apache.directory.api.ldap.model.schema.DitStructureRule)1 LdapSyntax (org.apache.directory.api.ldap.model.schema.LdapSyntax)1 MatchingRule (org.apache.directory.api.ldap.model.schema.MatchingRule)1 MatchingRuleUse (org.apache.directory.api.ldap.model.schema.MatchingRuleUse)1 NameForm (org.apache.directory.api.ldap.model.schema.NameForm)1 ObjectClass (org.apache.directory.api.ldap.model.schema.ObjectClass)1