Java Code Examples for org.apache.directory.api.ldap.model.schema.registries.Schema#getContent()

The following examples show how to use org.apache.directory.api.ldap.model.schema.registries.Schema#getContent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 2
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 3
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 4
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 5
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 6
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 7
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 8
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 9
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 10
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}
 
Example 11
Source File: DefaultSchemaLoader.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
/**
 * {@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;
}