use of org.apache.directory.api.ldap.model.schema.AttributesFactory in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadNameForms.
/**
* {@inheritDoc}
*/
@Override
public List<Entry> loadNameForms(Schema... schemas) throws LdapException, IOException {
List<Entry> nameFormEntries = new ArrayList<>();
if (schemas == null) {
return nameFormEntries;
}
AttributesFactory factory = new AttributesFactory();
for (Schema schema : schemas) {
Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
SchemaObject schemaObject = schemaObjectWrapper.get();
if (schemaObject instanceof NameForm) {
NameForm nameForm = (NameForm) schemaObject;
Entry nameFormEntry = factory.convert(nameForm, schema, null);
nameFormEntries.add(nameFormEntry);
}
}
}
return nameFormEntries;
}
use of org.apache.directory.api.ldap.model.schema.AttributesFactory in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadMatchingRules.
/**
* {@inheritDoc}
*/
@Override
public List<Entry> loadMatchingRules(Schema... schemas) throws LdapException, IOException {
List<Entry> matchingRuleEntries = new ArrayList<>();
if (schemas == null) {
return matchingRuleEntries;
}
AttributesFactory factory = new AttributesFactory();
for (Schema schema : schemas) {
Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
SchemaObject schemaObject = schemaObjectWrapper.get();
if (schemaObject instanceof MatchingRule) {
MatchingRule matchingRule = (MatchingRule) schemaObject;
Entry matchingRuleEntry = factory.convert(matchingRule, schema, null);
matchingRuleEntries.add(matchingRuleEntry);
}
}
}
return matchingRuleEntries;
}
use of org.apache.directory.api.ldap.model.schema.AttributesFactory in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadObjectClasses.
/**
* {@inheritDoc}
*/
@Override
public List<Entry> loadObjectClasses(Schema... schemas) throws LdapException, IOException {
List<Entry> objectClassEntries = new ArrayList<>();
if (schemas == null) {
return objectClassEntries;
}
AttributesFactory factory = new AttributesFactory();
for (Schema schema : schemas) {
Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
SchemaObject schemaObject = schemaObjectWrapper.get();
if (schemaObject instanceof ObjectClass) {
ObjectClass objectClass = (ObjectClass) schemaObject;
Entry objectClassEntry = factory.convert(objectClass, schema, null);
objectClassEntries.add(objectClassEntry);
}
}
}
return objectClassEntries;
}
use of org.apache.directory.api.ldap.model.schema.AttributesFactory in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadAttributeTypes.
/**
* {@inheritDoc}
*/
@Override
public List<Entry> loadAttributeTypes(Schema... schemas) throws LdapException, IOException {
List<Entry> attributeTypeEntries = new ArrayList<>();
if (schemas == null) {
return attributeTypeEntries;
}
AttributesFactory factory = new AttributesFactory();
for (Schema schema : schemas) {
Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
SchemaObject schemaObject = schemaObjectWrapper.get();
if (schemaObject instanceof AttributeType) {
AttributeType attributeType = (AttributeType) schemaObject;
Entry attributeTypeEntry = factory.convert(attributeType, schema, null);
attributeTypeEntries.add(attributeTypeEntry);
}
}
}
return attributeTypeEntries;
}
use of org.apache.directory.api.ldap.model.schema.AttributesFactory in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadSyntaxes.
/**
* {@inheritDoc}
*/
@Override
public List<Entry> loadSyntaxes(Schema... schemas) throws LdapException, IOException {
List<Entry> syntaxEntries = new ArrayList<>();
if (schemas == null) {
return syntaxEntries;
}
AttributesFactory factory = new AttributesFactory();
for (Schema schema : schemas) {
Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
SchemaObject schemaObject = schemaObjectWrapper.get();
if (schemaObject instanceof LdapSyntax) {
LdapSyntax ldapSyntax = (LdapSyntax) schemaObject;
Entry ldapSyntaxEntry = factory.convert(ldapSyntax, schema, null);
syntaxEntries.add(ldapSyntaxEntry);
}
}
}
return syntaxEntries;
}
Aggregations