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

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


    {
        LdapDN dn = new LdapDN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
        dn.normalize( attributeRegistry.getNormalizerMapping() );

        List<Modification> mods = new ArrayList<Modification>();
        ServerAttribute attrib = new DefaultServerAttribute( SchemaConstants.SN_AT,
            attributeRegistry.lookup( SchemaConstants.SN_AT_OID ) );
       
        String attribVal = "Johnny";
        attrib.add( attribVal );
       
        Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
        mods.add( add );
       
        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
View Full Code Here


    {
        LdapDN dn = new LdapDN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
        dn.normalize( attributeRegistry.getNormalizerMapping() );

        List<Modification> mods = new ArrayList<Modification>();
        ServerAttribute attrib = new DefaultServerAttribute( SchemaConstants.SN_AT,
            attributeRegistry.lookup( SchemaConstants.SN_AT_OID ) );
       
        Modification add = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attrib );
        mods.add( add );
       
View Full Code Here

        entry.add( "entryUUID", SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
       
        store.add( entry );
       
        List<Modification> mods = new ArrayList<Modification>();
        ServerAttribute attrib = new DefaultServerAttribute( SchemaConstants.OU_AT,
            attributeRegistry.lookup( SchemaConstants.OU_AT_OID ) );
       
        String attribVal = "Marketing";
        attrib.add( attribVal );
       
        Modification add = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
        mods.add( add );
       
        ServerEntry lookedup = store.lookup( store.getEntryId( dn.toNormName() ) );
View Full Code Here

                /*
                 * If entry does not have attribute for collective attribute then create it.
                 */
                if ( entryColAttr == null )
                {
                    entryColAttr = new DefaultServerAttribute( attrId, atRegistry.lookup( attrId ) );
                    entry.put( entryColAttr );
                }

                /*
                 *  Add all the collective attribute values in the subentry
View Full Code Here

        String modifyTimestamp = DateUtils.getGeneralizedTime();
       
        List<Modification> mods = new ArrayList<Modification>( 2 );
       
        mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE,
            new DefaultServerAttribute(
                ApacheSchemaConstants.SCHEMA_MODIFY_TIMESTAMP_AT,
                registries.getAttributeTypeRegistry().lookup( ApacheSchemaConstants.SCHEMA_MODIFY_TIMESTAMP_AT ),
                modifyTimestamp ) ) );
       
        mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE,
            new DefaultServerAttribute(
                ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT,
                registries.getAttributeTypeRegistry().lookup( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT ),
                modifiersName ) ) );
       
        LdapDN name = new LdapDN( ServerDNConstants.SCHEMA_TIMESTAMP_ENTRY_DN );
View Full Code Here

        // Add our modification items.
        newModsList.add(
            new ServerModification(
                ModificationOperation.REPLACE_ATTRIBUTE,
                new DefaultServerAttribute(
                    KerberosAttribute.KRB5_PRINCIPAL_NAME_AT,
                    atRegistry.lookup( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ),
                    principalName ) ) );
        newModsList.add(
            new ServerModification(
                ModificationOperation.REPLACE_ATTRIBUTE,
                new DefaultServerAttribute(
                    KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT,
                    atRegistry.lookup( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT ),
                    Integer.toString( kvno ) ) ) );
       
        ServerAttribute attribute = getKeyAttribute( modContext.getSession()
View Full Code Here


    private ServerAttribute getKeyAttribute( Registries registries, Map<EncryptionType, EncryptionKey> keys ) throws Exception
    {
        ServerAttribute keyAttribute =
            new DefaultServerAttribute( KerberosAttribute.KRB5_KEY_AT,
                registries.getAttributeTypeRegistry().lookup( KerberosAttribute.KRB5_KEY_AT ) );

        Iterator<EncryptionKey> it = keys.values().iterator();

        while ( it.hasNext() )
        {
            try
            {
                keyAttribute.add( EncryptionKeyEncoder.encode( it.next() ) );
            }
            catch ( IOException ioe )
            {
                log.error( "Error encoding EncryptionKey.", ioe );
            }
View Full Code Here

    /**
     * Generate the comparators attribute from the registry
     */
    private ServerAttribute generateComparators() throws NamingException
    {
        ServerAttribute attr = new DefaultServerAttribute(
            registries.getAttributeTypeRegistry().lookup( SchemaConstants.COMPARATORS_AT ) );

        Iterator<ComparatorDescription> list =
            registries.getComparatorRegistry().comparatorDescriptionIterator();
       
        while ( list.hasNext() )
        {
            ComparatorDescription description = list.next();
            attr.add( SchemaUtils.render( description ) );
        }

        return attr;
    }
View Full Code Here

    }


    private ServerAttribute generateNormalizers() throws NamingException
    {
        ServerAttribute attr = new DefaultServerAttribute(
            registries.getAttributeTypeRegistry().lookup( SchemaConstants.NORMALIZERS_AT ) );

        Iterator<NormalizerDescription> list = registries.getNormalizerRegistry().normalizerDescriptionIterator();

        while ( list.hasNext() )
        {
            NormalizerDescription normalizer = list.next();
            attr.add( SchemaUtils.render( normalizer ) );
        }
       
        return attr;
    }
View Full Code Here

    }


    private ServerAttribute generateSyntaxCheckers() throws NamingException
    {
        ServerAttribute attr = new DefaultServerAttribute(
            registries.getAttributeTypeRegistry().lookup( SchemaConstants.SYNTAX_CHECKERS_AT ) );

        Iterator<SyntaxCheckerDescription> list =
            registries.getSyntaxCheckerRegistry().syntaxCheckerDescriptionIterator();

        while ( list.hasNext() )
        {
            SyntaxCheckerDescription syntaxCheckerDescription = list.next();
            attr.add( SchemaUtils.render( syntaxCheckerDescription ) );
        }
       
        return attr;
    }
View Full Code Here

TOP

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

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.