use of org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper in project directory-ldap-api by apache.
the class DefaultSchemaLoader method updateSchemas.
private void updateSchemas(SchemaObject schemaObject) {
String schemaName = schemaObject.getSchemaName();
Schema schema;
if (Strings.isEmpty(schemaName) || "null".equals(schemaName)) {
schemaName = "default";
schema = schemaMap.get(schemaName);
} else {
schema = schemaMap.get(schemaName);
}
if (schema == null) {
schema = new DefaultSchema(this, schemaName);
schemaMap.put(schemaName, schema);
}
schema.getContent().add(new SchemaObjectWrapper(schemaObject));
}
use of org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadNormalizers.
/**
* {@inheritDoc}
*/
@Override
public List<Entry> loadNormalizers(Schema... schemas) throws LdapException, IOException {
List<Entry> normalizerEntries = new ArrayList<>();
if (schemas == null) {
return normalizerEntries;
}
for (Schema schema : schemas) {
Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
SchemaObject schemaObject = schemaObjectWrapper.get();
if (schemaObject instanceof NormalizerDescription) {
NormalizerDescription normalizerDescription = (NormalizerDescription) schemaObject;
Entry normalizerEntry = getEntry(normalizerDescription);
normalizerEntries.add(normalizerEntry);
}
}
}
return normalizerEntries;
}
use of org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadComparators.
/**
* {@inheritDoc}
*/
@Override
public List<Entry> loadComparators(Schema... schemas) throws LdapException, IOException {
List<Entry> comparatorEntries = new ArrayList<>();
if (schemas == null) {
return comparatorEntries;
}
for (Schema schema : schemas) {
Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
SchemaObject schemaObject = schemaObjectWrapper.get();
if (schemaObject instanceof LdapComparatorDescription) {
LdapComparatorDescription ldapComparatorDescription = (LdapComparatorDescription) schemaObject;
Entry lcEntry = getEntry(ldapComparatorDescription);
comparatorEntries.add(lcEntry);
}
}
}
return comparatorEntries;
}
use of org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper in project directory-ldap-api by apache.
the class DefaultSchemaLoader method loadSyntaxCheckers.
/**
* {@inheritDoc}
*/
@Override
public List<Entry> loadSyntaxCheckers(Schema... schemas) throws LdapException, IOException {
List<Entry> syntaxCheckerEntries = new ArrayList<>();
if (schemas == null) {
return syntaxCheckerEntries;
}
for (Schema schema : schemas) {
Set<SchemaObjectWrapper> schemaObjectWrappers = schema.getContent();
for (SchemaObjectWrapper schemaObjectWrapper : schemaObjectWrappers) {
SchemaObject schemaObject = schemaObjectWrapper.get();
if (schemaObject instanceof SyntaxCheckerDescription) {
SyntaxCheckerDescription syntaxCheckerDescription = (SyntaxCheckerDescription) schemaObject;
Entry syntaxCheckerEntry = getEntry(syntaxCheckerDescription);
syntaxCheckerEntries.add(syntaxCheckerEntry);
}
}
}
return syntaxCheckerEntries;
}
use of org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper 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