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;
}
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;
}
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;
}
Aggregations