Package org.apache.directory.shared.ldap.schema

Examples of org.apache.directory.shared.ldap.schema.AttributeType


        entry.put( JCLASSNAME_ATTR, obj.getClass().getName() );
        entry.put( JSERIALDATA_ATTR, serialize( obj ) );

        // Add all the class names this object can be cast to:
        Class<?>[] classes = obj.getClass().getClasses();
        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( JCLASSNAMES_ATTR );
        ServerAttribute javaClassNames = new DefaultServerAttribute( attributeType, JCLASSNAMES_ATTR );

        for ( int ii = 0; ii < classes.length; ii++ )
        {
            javaClassNames.add( classes[ii].getName() );
View Full Code Here


       
        if ( excludedAttributes != null )
        {
            for ( String attributeType:excludedAttributes)
            {
                AttributeType type = schemaManager.lookupAttributeTypeRegistry( attributeType );
                exclusions.add( type.getName() );
            }
        }

        if ( outputFile == null )
        {
View Full Code Here

        BaseRecordManager base = new BaseRecordManager( path );
        base.disableTransactions();
        CacheRecordManager recMan = new CacheRecordManager( base, new MRU( 1000 ) );

        JdbmMasterTable<ServerEntry> master = new JdbmMasterTable<ServerEntry>( recMan, schemaManager );
        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( "apacheUpdn" );
        JdbmIndex idIndex = new JdbmIndex();
        idIndex.setAttributeId( attributeType.getName() );
        idIndex.setWkDirPath( partitionDirectory );
        idIndex.setCacheSize( 1000 );
        idIndex.setNumDupLimit( 1000 );
        idIndex.init( schemaManager, attributeType, partitionDirectory );
View Full Code Here

                        .println( "# Cannot properly filter unrecognized attribute " + attr.getID() + " in " + dn );
                }
                continue;
            }

            AttributeType type = schemaManager.lookupAttributeTypeRegistry( attr.getID() );
            boolean isOperational = type.getUsage() != UsageEnum.USER_APPLICATIONS;
           
            if ( exclusions.contains( attr.getID() ) || ( isOperational && ( !includeOperational ) ) )
            {
                toRemove.add( attr.getID() );
            }
View Full Code Here

                        Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants( leaf.getAttribute() );

                        while ( descendants.hasNext() )
                        {
                            LeafNode newLeaf = null;
                            AttributeType descendant = descendants.next();

                            if ( leaf instanceof PresenceNode )
                            {
                                newLeaf = new PresenceNode( descendant.getOid() );
                            }
                            else if ( leaf instanceof ApproximateNode )
                            {
                                ApproximateNode approximateNode = ( ApproximateNode ) leaf;

                                newLeaf = new ApproximateNode( descendant.getOid(), approximateNode.getValue() );
                            }
                            else if ( leaf instanceof EqualityNode )
                            {
                                EqualityNode equalityNode = ( EqualityNode ) leaf;

                                newLeaf = new EqualityNode( descendant.getOid(), equalityNode.getValue() );
                            }
                            else if ( leaf instanceof GreaterEqNode )
                            {
                                GreaterEqNode greaterEqNode = ( GreaterEqNode ) leaf;

                                newLeaf = new GreaterEqNode( descendant.getOid(), greaterEqNode.getValue() );
                            }
                            else if ( leaf instanceof LessEqNode )
                            {
                                LessEqNode lessEqNode = ( LessEqNode ) leaf;

                                newLeaf = new LessEqNode( descendant.getOid(), lessEqNode.getValue() );
                            }
                            else if ( leaf instanceof ExtensibleNode )
                            {
                                ExtensibleNode extensibleNode = ( ExtensibleNode ) leaf;
                                newLeaf = new ExtensibleNode( descendant.getOid(), extensibleNode.getValue(),
                                    extensibleNode.getMatchingRuleId(), extensibleNode.hasDnAttributes() );
                            }
                            else if ( leaf instanceof SubstringNode )
                            {
                                SubstringNode substringNode = ( SubstringNode ) leaf;
                                newLeaf = new SubstringNode( descendant.getOid(), substringNode.getInitial(),
                                    substringNode.getFinal() );
                            }
                            else
                            {
                                throw new IllegalStateException( I18n.err( I18n.ERR_260, leaf ) );
View Full Code Here

            Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
                node.getAttribute() );

            while ( descendants.hasNext() )
            {
                AttributeType descendant = descendants.next();

                attr = ( ServerAttribute ) entry.get( descendant );

                if ( attr != null && evaluate( attr ) )
                {
View Full Code Here

    {
        try
        {
            Value<?> normalized = null;

            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( attribute );

            if ( attributeType.getSyntax().isHumanReadable() )
            {
                normalized = new ClientStringValue(
                    (String) ncn.normalizeByName( attribute, value.getString() ) );
            }
            else
View Full Code Here

        for ( EntryAttribute attribute:entry )
        {
            try
            {
                // First get the AttributeType
                AttributeType attributeType = null;

                if ( attribute instanceof ServerAttribute )
                {
                    attributeType = ((ServerAttribute)attribute).getAttributeType();
                }
View Full Code Here

    public void add( EntryAttribute... attributes ) throws NamingException
    {
        for ( EntryAttribute attribute:attributes )
        {
            ServerAttribute serverAttribute = (ServerAttribute)attribute;
            AttributeType attributeType = serverAttribute.getAttributeType();
           
            if ( this.attributes.containsKey( attributeType ) )
            {
                // We already have an attribute with the same AttributeType
                // Just add the new values into it.
View Full Code Here

            return false;
        }
       
        try
        {
            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( id );
           
            if ( attributeType == null )
            {
                return false;
            }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.schema.AttributeType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.