Package org.apache.ldap.common.message

Examples of org.apache.ldap.common.message.LockableAttributeImpl


                Object val = rec.getIndexKey();
                String attrId = index.getAttribute().getName();
                Attribute attr = attributes.get( attrId );
                if ( attr == null)
                {
                    attr = new LockableAttributeImpl( attrId );
                }
                attr.add( val );
                attributes.put( attr );
            }
        }

        // Get all existance mappings for this id creating a special key
        // that looks like so 'existance[attribute]' and the value is set to id
        NamingEnumeration list = existanceIdx.listReverseIndices( id );
        StringBuffer val = new StringBuffer();
        while ( list.hasMore() )
        {
            IndexRecord rec = ( IndexRecord ) list.next();
            val.append( "_existance[" );
            val.append( rec.getIndexKey() );
            val.append( "]" );

            String valStr = val.toString();
            Attribute attr = attributes.get( valStr );
            if ( attr == null )
            {
                attr = new LockableAttributeImpl( valStr );
            }
            attr.add( rec.getEntryId() );
            attributes.put( attr );
            val.setLength( 0 );
        }

        // Get all parent child mappings for this entry as the parent using the
        // key 'child' with many entries following it.
        list = hierarchyIdx.listIndices( id );
        Attribute childAttr = new LockableAttributeImpl( "_child" );
        attributes.put( childAttr );
        while ( list.hasMore() )
        {
            IndexRecord rec = ( IndexRecord ) list.next();
            childAttr.add( rec.getEntryId() );
        }

        return attributes;
    }
View Full Code Here


        // add all the values in mods to the same attribute in the entry
        Attribute entryAttrToAddTo = entry.get( mods.getID() );

        if ( entryAttrToAddTo == null )
        {
            entryAttrToAddTo = new LockableAttributeImpl( mods.getID() );
            entry.put( entryAttrToAddTo );
        }

        for ( int ii = 0; ii < mods.size(); ii++ )
        {
View Full Code Here

         */

        Attribute rdnAttr = entry.get( newRdnAttr );
        if ( rdnAttr == null )
        {
            rdnAttr = new LockableAttributeImpl( newRdnAttr );
        }

        // add the new Rdn value only if it is not already present in the entry
        if ( ! rdnAttr.contains( newRdnValue ) )
        {
View Full Code Here

         * objectClass: top
         * objectClass: javaObject
         * objectClass: javaContainer
         * objectClass: javaSerializedObject
         */
        Attribute objectClass = new LockableAttributeImpl( "objectClass" );
        objectClass.add( TOP_ATTR );
        objectClass.add( JOBJECT_ATTR );
        objectClass.add( JCONTAINER_ATTR );
        objectClass.add( JSERIALIZEDOBJ_ATTR );
        entry.put( objectClass );

        // Add the javaClassName and javaSerializedData attributes
        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();
        Attribute javaClassNames = new LockableAttributeImpl( JCLASSNAMES_ATTR );

        for ( int ii = 0; ii < classes.length; ii++ )
        {
            javaClassNames.add( classes[ii].getName() );
        }

        entry.put( javaClassNames );
    }
View Full Code Here

                    Attribute entryColAttr = entry.get( attrId );

                    // if entry does not have attribute for colattr then create it
                    if ( entryColAttr == null )
                    {
                        entryColAttr = new LockableAttributeImpl( attrId );
                        entry.put( entryColAttr );
                    }

                    // add all the collective attribute values in the subentry to entry
                    for ( int jj = 0; jj < subentryColAttr.size(); jj++ )
View Full Code Here

     */
    public DefaultDirectoryPartitionNexus( Attributes rootDSE )
    {
        // setup that root DSE
        this.rootDSE = rootDSE;
        Attribute attr = new LockableAttributeImpl( "subschemaSubentry" );
        attr.add( "cn=schema,ou=system" );
        rootDSE.put( attr );

        attr = new LockableAttributeImpl( "supportedLDAPVersion" );
        rootDSE.put( attr );
        attr.add( "3" );

        attr = new LockableAttributeImpl( "supportedFeatures" );
        rootDSE.put( attr );
        attr.add( "1.3.6.1.4.1.4203.1.5.1" );

        attr = new LockableAttributeImpl( "objectClass" );
        rootDSE.put( attr );
        attr.add( "top" );
        attr.add( "extensibleObject" );

        attr = new LockableAttributeImpl( NAMINGCTXS_ATTR );
        rootDSE.put( attr );

        attr = new LockableAttributeImpl( VENDORNAME_ATTR );
        attr.add( ASF );
        rootDSE.put( attr );

        attr = new LockableAttributeImpl( VENDORVERSION_ATTR );
        attr.add( "$Rev: 326212 $" );
        rootDSE.put( attr );
    }
View Full Code Here

                    if ( role.equalsIgnoreCase( AUTONOUMOUS_AREA ) )
                    {
                        operational = subentryAttrs.get( AUTONOUMOUS_AREA_SUBENTRY );
                        if ( operational == null )
                        {
                            operational = new LockableAttributeImpl( AUTONOUMOUS_AREA_SUBENTRY );
                            subentryAttrs.put( operational );
                        }
                    }
                    else if ( role.equalsIgnoreCase( AC_AREA ) || role.equalsIgnoreCase( AC_INNERAREA ) )
                    {
                        operational = subentryAttrs.get( AC_SUBENTRY );
                        if ( operational == null )
                        {
                            operational = new LockableAttributeImpl( AC_SUBENTRY );
                            subentryAttrs.put( operational );
                        }
                    }
                    else if ( role.equalsIgnoreCase( SCHEMA_AREA ) )
                    {
                        operational = subentryAttrs.get( SCHEMA_AREA_SUBENTRY );
                        if ( operational == null )
                        {
                            operational = new LockableAttributeImpl( SCHEMA_AREA_SUBENTRY );
                            subentryAttrs.put( operational );
                        }
                    }
                    else if ( role.equalsIgnoreCase( COLLECTIVE_AREA ) ||
                              role.equalsIgnoreCase( COLLECTIVE_INNERAREA ) )
                    {
                        operational = subentryAttrs.get( COLLECTIVE_ATTRIBUTE_SUBENTRIES );
                        if ( operational == null )
                        {
                            operational = new LockableAttributeImpl( COLLECTIVE_ATTRIBUTE_SUBENTRIES );
                            subentryAttrs.put( operational );
                        }
                    }
                    else
                    {
View Full Code Here

                        if ( role.equalsIgnoreCase( AUTONOUMOUS_AREA ) )
                        {
                            operational = entry.get( AUTONOUMOUS_AREA_SUBENTRY );
                            if ( operational == null )
                            {
                                operational = new LockableAttributeImpl( AUTONOUMOUS_AREA_SUBENTRY );
                                entry.put( operational );
                            }
                        }
                        else if ( role.equalsIgnoreCase( AC_AREA ) || role.equalsIgnoreCase( AC_INNERAREA ) )
                        {
                            operational = ( Attribute ) entry.get( AC_SUBENTRY );
                            if ( operational == null )
                            {
                                operational = new LockableAttributeImpl( AC_SUBENTRY );
                                entry.put( operational );
                            }
                        }
                        else if ( role.equalsIgnoreCase( SCHEMA_AREA ) )
                        {
                            operational = ( Attribute ) entry.get( SCHEMA_AREA_SUBENTRY );
                            if ( operational == null )
                            {
                                operational = new LockableAttributeImpl( SCHEMA_AREA_SUBENTRY );
                                entry.put( operational );
                            }
                        }
                        else if ( role.equalsIgnoreCase( COLLECTIVE_AREA ) ||
                                  role.equalsIgnoreCase( COLLECTIVE_INNERAREA ) )
                        {
                            operational = ( Attribute ) entry.get( COLLECTIVE_ATTRIBUTE_SUBENTRIES );
                            if ( operational == null )
                            {
                                operational = new LockableAttributeImpl( COLLECTIVE_ATTRIBUTE_SUBENTRIES );
                                entry.put( operational );
                            }
                        }
                        else
                        {
View Full Code Here

                        opAttr = ( Attribute ) opAttr.clone();
                    }
                    else
                    {
                        op = DirContext.ADD_ATTRIBUTE;
                        opAttr = new LockableAttributeImpl( SUBENTRY_OPATTRS[ii] );
                    }

                    opAttr.add( subentryDn );
                    modList.add( new ModificationItem( op, opAttr ) );
                }
View Full Code Here

            if ( role.equalsIgnoreCase( AUTONOUMOUS_AREA ) )
            {
                operational = ( Attribute ) entry.get( AUTONOUMOUS_AREA_SUBENTRY ).clone();
                if ( operational == null )
                {
                    operational = new LockableAttributeImpl( AUTONOUMOUS_AREA_SUBENTRY );
                    operational.add( newName.toString() );
                }
                else
                {
                    operational.remove( oldName.toString() );
                    operational.add( newName.toString() );
                }
            }
            else if ( role.equalsIgnoreCase( AC_AREA ) || role.equalsIgnoreCase( AC_INNERAREA ) )
            {
                operational = ( Attribute ) entry.get( AC_SUBENTRY ).clone();
                if ( operational == null )
                {
                    operational = new LockableAttributeImpl( AC_SUBENTRY );
                    operational.add( newName.toString() );
                }
                else
                {
                    operational.remove( oldName.toString() );
                    operational.add( newName.toString() );
                }
            }
            else if ( role.equalsIgnoreCase( SCHEMA_AREA ) )
            {
                operational = ( Attribute ) entry.get( SCHEMA_AREA_SUBENTRY ).clone();
                if ( operational == null )
                {
                    operational = new LockableAttributeImpl( SCHEMA_AREA_SUBENTRY );
                    operational.add( newName.toString() );
                }
                else
                {
                    operational.remove( oldName.toString() );
                    operational.add( newName.toString() );
                }
            }
            else if ( role.equalsIgnoreCase( COLLECTIVE_AREA ) ||
                      role.equalsIgnoreCase( COLLECTIVE_INNERAREA ) )
            {
                operational = ( Attribute ) entry.get( COLLECTIVE_ATTRIBUTE_SUBENTRIES ).clone();
                if ( operational == null )
                {
                    operational = new LockableAttributeImpl( COLLECTIVE_ATTRIBUTE_SUBENTRIES );
                    operational.add( newName.toString() );
                }
                else
                {
                    operational.remove( oldName.toString() );
View Full Code Here

TOP

Related Classes of org.apache.ldap.common.message.LockableAttributeImpl

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.