Examples of EntryAttribute


Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

        if ( ( names == null ) || ( names.size() == 0 ) )
        {
            return;
        }
       
        EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_NAME_AT ) );

        for ( String name:names )
        {
            attr.add( name );
        }
       
        entry.put( attr );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

            modifier.setSamType( SamType.getTypeByOrdinal( Integer.parseInt( samType ) ) );
        }

        if ( entry.get( KerberosAttribute.KRB5_KEY_AT ) != null )
        {
            EntryAttribute krb5key = entry.get( KerberosAttribute.KRB5_KEY_AT );
           
            try
            {
                Map<EncryptionType, EncryptionKey> keyMap = modifier.reconstituteKeyMap( krb5key );
                modifier.setKeyMap( keyMap );
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

        if ( parentId == null )
        {
            throw new LdapNameNotFoundException( I18n.err( I18n.ERR_216, parentDn ) );
        }

        EntryAttribute objectClass = entry.get( OBJECT_CLASS_AT );

        if ( objectClass == null )
        {
            String msg = I18n.err( I18n.ERR_217, entryDn.getName(), entry );
            ResultCodeEnum rc = ResultCodeEnum.OBJECT_CLASS_VIOLATION;
            NamingException e = new LdapSchemaViolationException( msg, rc );
            e.setResolvedName( entryDn );
            throw e;
        }

        // Start adding the system userIndices
        // Why bother doing a lookup if this is not an alias.
        // First, the ObjectClass index
        for ( Value<?> value : objectClass )
        {
            objectClassIdx.add( value.getString(), id );
        }

        if ( objectClass.contains( SchemaConstants.ALIAS_OC ) )
        {
            EntryAttribute aliasAttr = entry.get( ALIASED_OBJECT_NAME_AT );
            addAliasIndices( id, entryDn, aliasAttr.getString() );
        }

        if ( !Character.isDigit( entryDn.toNormName().charAt( 0 ) ) )
        {
            throw new IllegalStateException( I18n.err( I18n.ERR_218, entryDn.toNormName() ) );
        }

        ndnIdx.add( entryDn.toNormName(), id );
        updnIdx.add( entryDn.getName(), id );
        oneLevelIdx.add( parentId, id );

        // Update the EntryCsn index
        EntryAttribute entryCsn = entry.get( ENTRY_CSN_AT );

        if ( entryCsn == null )
        {
            String msg = I18n.err( I18n.ERR_219, entryDn.getName(), entry );
            throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
        }

        entryCsnIdx.add( entryCsn.getString(), id );

        // Update the EntryUuid index
        EntryAttribute entryUuid = entry.get( ENTRY_UUID_AT );

        if ( entryUuid == null )
        {
            String msg = I18n.err( I18n.ERR_220, entryDn.getName(), entry );
            throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
        }

        entryUuidIdx.add( entryUuid.getString(), id );

        Long tempId = parentId;

        while ( ( tempId != null ) && ( tempId != 0 ) && ( tempId != 1 ) )
        {
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

    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 );
        }

        for ( Value<?> value : objectClass )
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

        {
            entry.removeAttributes( attrType );
        }
        else
        {
            EntryAttribute entryAttr = entry.get( attrType );

            for ( Value<?> value : mods )
            {
                entryAttr.remove( value );
                /*
                if ( value instanceof ServerStringValue )
                {
                    entryAttr.remove( value.getString() );
                }
                else
                {
                    entryAttr.remove( value.getBytes() );
                }
                */
            }

            // if nothing is left just remove empty attribute
            if ( entryAttr.size() == 0 )
            {
                entry.removeAttributes( entryAttr.getId() );
            }
        }

        // Aliases->single valued comp/partial attr removal is not relevant here
        if ( modsOid.equals( SchemaConstants.ALIASED_OBJECT_NAME_AT_OID ) )
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

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

        for ( AttributeType attributeType : mods.getAttributeTypes() )
        {
            EntryAttribute attr = mods.get( attributeType );

            switch ( modOp )
            {
                case ADD_ATTRIBUTE:
                    add( id, entry, attr );
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

        if ( entry == null )
        {
            return false;
        }
       
        EntryAttribute oc = entry.get( SchemaConstants.OBJECT_CLASS_AT );

        if ( oc == null )
        {
            LOG.warn( "could not find objectClass attribute in entry: " + entry );
            return false;
        }

        if ( !oc.contains( SchemaConstants.REFERRAL_OC ) )
        {
            return false;
        }
        else
        {
            // We have a referral ObjectClass, let's check that the ref is
            // valid, accordingly to the RFC

            // Get the 'ref' attributeType
            EntryAttribute refAttr = entry.get( SchemaConstants.REF_AT );

            if ( refAttr == null )
            {
                // very unlikely, as we have already checked the entry in SchemaInterceptor
                String message = I18n.err( I18n.ERR_42 );
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

                {
                    attributeType = schemaManager.lookupAttributeTypeRegistry( attribute.getId() );
                }
               
                // Create a new ServerAttribute.
                EntryAttribute serverAttribute = new DefaultServerAttribute( attributeType, attribute );
               
                // And store it
                add( serverAttribute );
            }
            catch ( NamingException ne )
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

            String message = I18n.err( I18n.ERR_102 );
            LOG.errormessage  );
            throw new UnsupportedOperationException( message );
        }

        EntryAttribute attribute = attributes.get( attributeType );
       
        if ( attribute != null )
        {
            // This Attribute already exist, we add the values
            // into it
            attribute.add( values );
        }
        else
        {
            // We have to create a new Attribute and set the values.
            // The upId, which is set to null, will be setup by the
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.EntryAttribute

            String message = I18n.err( I18n.ERR_101 );
            LOG.error( message );
            throw new IllegalArgumentException( message );
        }
       
        EntryAttribute attribute = attributes.get( attributeType );
       
        if ( attribute != null )
        {
            // This Attribute already exist, we add the values
            // into it
            attribute.add( values );
        }
        else
        {
            // We have to create a new Attribute and set the values.
            // The upId, which is set to null, will be setup by the
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.