Package org.apache.directory.server.core.entry

Examples of org.apache.directory.server.core.entry.ServerEntry


                getFilter( schemaManager, principal ), AliasDerefMode.DEREF_ALWAYS, null );
   
            cursor.beforeFirst();
            if ( cursor.next() )
            {
                ServerEntry entry = cursor.get();
                LOG.debug( "Found entry {} for kerberos principal name {}", entry, principal );
               
                while ( cursor.next() )
                {
                    LOG.error( I18n.err( I18n.ERR_149, principal, cursor.next() ) );
View Full Code Here


     * @return the attributes of the metaSchema entry representing the objectClass
     * @throws NamingException if there are any problems
     */
    public ServerEntry getAttributes( ObjectClass objectClass, Schema schema, SchemaManager schemaManager ) throws NamingException
    {
        ServerEntry entry = new DefaultServerEntry( schemaManager );

        entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, MetaSchemaConstants.META_OBJECT_CLASS_OC );
        entry.put( MetaSchemaConstants.M_TYPE_OBJECT_CLASS_AT, objectClass.getType().toString() );
        entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
        entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
       
        injectCommon( objectClass, entry, schemaManager );

        // handle the superior objectClasses
        if ( objectClass.getSuperiorOids() != null && objectClass.getSuperiorOids().size() != 0 )
        {
            EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT ) );
           
            for ( String superior:objectClass.getSuperiorOids() )
            {
                attr.add( superior );
            }
           
            entry.put( attr );
        }

        // add the must list
        if ( objectClass.getMustAttributeTypeOids() != null && objectClass.getMustAttributeTypeOids().size() != 0 )
        {
            EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_MUST_AT ) );

            for ( String mustOid :objectClass.getMustAttributeTypeOids() )
            {
                attr.add( mustOid );
            }
           
            entry.put( attr );
        }
       
        // add the may list
        if ( objectClass.getMayAttributeTypeOids() != null && objectClass.getMayAttributeTypeOids().size() != 0 )
        {
            EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_MAY_AT ) );

            for ( String mayOid :objectClass.getMayAttributeTypeOids() )
            {
                attr.add( mayOid );
            }
           
            entry.put( attr );
        }
       
        return entry;
    }
View Full Code Here

    }

   
    private ClonedServerEntry createEntry( String dn ) throws Exception
    {
        ServerEntry entry = new DefaultServerEntry( schemaManager );
        entry.setDn( new DN( dn ).normalize( schemaManager.getNormalizerMapping() ) );
        entry.put( SchemaConstants.ENTRY_CSN_AT, defaultCSNFactory.newInstance().toString() );
        entry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
       
        ClonedServerEntry clonedEntry = new ClonedServerEntry( entry );

        return clonedEntry;
    }
View Full Code Here

            // Move to the first entry in the cursor
            cursor.beforeFirst();
           
            while ( cursor.next() )
            {
                ServerEntry entry = cursor.get();

                // Lock the referralManager
                lockWrite();
               
                // Add it at the right place
View Full Code Here

        // Move to the first entry in the cursor
        cursor.beforeFirst();
       
        while ( cursor.next() )
        {
            ServerEntry entry = cursor.get();
           
            // Add it at the right place
            removeReferral( entry );
        }
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public boolean isReferral( DN dn )
    {
        ServerEntry parent = referrals.getParentElement( dn );
       
        if ( parent != null )
        {
            return dn.equals( parent.getDn() );
        }
        else
        {
            return false;
        }
View Full Code Here

        if ( idx != null )
        {
            return idx.forward( type.getOid(), indexEntry.getId() );
        }

        ServerEntry entry = indexEntry.getObject();

        // resuscitate the entry if it has not been and set entry in IndexEntry
        if ( null == entry )
        {
            entry = db.lookup( indexEntry.getId() );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public synchronized void delete( Long id ) throws Exception
    {
        ServerEntry entry = lookup( id );
        Long parentId = getParentId( id );

        EntryAttribute objectClass = entry.get( OBJECT_CLASS_AT );

        if ( objectClass.contains( SchemaConstants.ALIAS_OC ) )
        {
            dropAliasIndices( id );
        }
View Full Code Here

        {
            throw new Exception( I18n.err( I18n.ERR_215 ) );
        }

        Long id = getEntryId( dn.getNormName() );
        ServerEntry entry = ( ServerEntry ) master.get( id );

        for ( AttributeType attributeType : mods.getAttributeTypes() )
        {
            EntryAttribute attr = mods.get( attributeType );
View Full Code Here


    public void modify( DN dn, List<Modification> mods ) throws Exception
    {
        Long id = getEntryId( dn.getNormName() );
        ServerEntry entry = ( ServerEntry ) master.get( id );

        for ( Modification mod : mods )
        {
            ServerAttribute attrMods = ( ServerAttribute ) mod.getAttribute();
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.entry.ServerEntry

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.