Examples of DefaultEntryAttribute


Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

            return "";
        }
        else
        {
            Entry entry = new DefaultEntry();
            EntryAttribute attribute = new DefaultEntryAttribute( "m-name" );

            for ( String name : names )
            {
                attribute.add( name );
            }

            entry.put( attribute );

            return LdifUtils.convertAttributesToLdif(entry);
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

            return "";
        }
        else
        {
            Entry entry = new DefaultEntry();
            EntryAttribute attribute = new DefaultEntryAttribute( "m-description", description );

            entry.put( attribute );

            return LdifUtils.convertAttributesToLdif( entry );
        }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

    protected String extensionsToLdif( String id ) throws LdapException
    {
        StringBuilder sb = new StringBuilder();

        Entry entry = new DefaultEntry();
        EntryAttribute attribute = new DefaultEntryAttribute( id );

        for ( String extension : extensions.keySet() )
        {
            attribute.add( extension );
        }

        sb.append( LdifUtils.convertAttributesToLdif( entry ) );

        return sb.toString();
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

                {
                    throw new LdapException( I18n.err( I18n.ERR_12083 ) );
                }

                // Stores the new Rdn
                EntryAttribute newRdn = new DefaultEntryAttribute( "newrdn", entry.getNewRdn() );
                sb.append( convertToLdif( newRdn, length ) );

                // Stores the deleteoldrdn flag
                sb.append( "deleteoldrdn: " );

                if ( entry.isDeleteOldRdn() )
                {
                    sb.append( "1" );
                }
                else
                {
                    sb.append( "0" );
                }

                sb.append( '\n' );

                // Stores the optional newSuperior
                if ( !Strings.isEmpty(entry.getNewSuperior()) )
                {
                    EntryAttribute newSuperior = new DefaultEntryAttribute( "newsuperior", entry.getNewSuperior() );
                    sb.append( convertToLdif( newSuperior, length ) );
                }

                break;
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

                     * do nothing as well. 
                     */
                    if ( ( mod.get() == null ) && ( previous == null ) )
                    {
                        reverseModification = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
                            new DefaultEntryAttribute( mod.getId() ) );
                        reverseModifications.add( 0, reverseModification );
                        continue;
                    }

                    if ( mod.get() == null )
                    {
                        reverseModification = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
                            previous );
                        reverseModifications.add( 0, reverseModification );
                        continue;
                    }

                    if ( previous == null )
                    {
                        EntryAttribute emptyAttribute = new DefaultEntryAttribute( mod.getId() );
                        reverseModification = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
                            emptyAttribute );
                        reverseModifications.add( 0, reverseModification );
                        continue;
                    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

                && !( ava.getNormType().equals( oldRdn.getNormType() ) && ava.getNormValue().getString().equals(
                    oldRdn.getNormValue().getString() ) ) )
            {
                // Create the modification, which is an Remove
                Modification modification = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
                    new DefaultEntryAttribute( ava.getUpType(), ava.getUpValue().getString() ) );

                restored.addModificationItem( modification );
            }
        }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

     */
    @Before
    public void initNames() throws Exception
    {

        EntryAttribute attrA = new DefaultEntryAttribute( "aa" );
        attrA.add( "aa" );
        EntryAttribute attrB = new DefaultEntryAttribute( "bb" );
        attrB.add( "bb" );
        EntryAttribute attrC = new DefaultEntryAttribute( "cc" );
        attrC.add( "cc" );
        EntryAttribute attrD = new DefaultEntryAttribute( "dd" );
        attrD.add( "dd" );

        Set<EntryAttribute> colA = new HashSet<EntryAttribute>();
        colA.add( attrA );
        colA.add( attrB );
        colA.add( attrC );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

     */
    @Before
    public void initNames() throws Exception
    {
        attributeA = new HashSet<EntryAttribute>();
        attributeA.add( new DefaultEntryAttribute( "aa", "aa" ) );
        attributeA.add( new DefaultEntryAttribute( "aa", "bb" ) );
        attributeA.add( new DefaultEntryAttribute( "aa", "cc" ) );
        // Sets aren't ordered, so adding order must not matter
        attributeB = new HashSet<EntryAttribute>();
        attributeB.add( new DefaultEntryAttribute( "aa", "bb" ) );
        attributeB.add( new DefaultEntryAttribute( "aa", "cc" ) );
        attributeB.add( new DefaultEntryAttribute( "aa", "aa" ) );
        attributeC = new HashSet<EntryAttribute>();
        attributeC.add( new DefaultEntryAttribute( "aa", "aa" ) );
        attributeC.add( new DefaultEntryAttribute( "bb", "bb" ) );
        attributeC.add( new DefaultEntryAttribute( "aa", "cc" ) );
        attributeD = new HashSet<EntryAttribute>();
        attributeD.add( new DefaultEntryAttribute( "aa", "aa" ) );
        attributeD.add( new DefaultEntryAttribute( "aa", "bb" ) );
        attributeD.add( new DefaultEntryAttribute( "aa", "dd" ) );
        attributeValueItemA = new AttributeValueItem( attributeA );
        attributeValueItemACopy = new AttributeValueItem( attributeA );
        attributeValueItemB = new AttributeValueItem( attributeB );
        attributeValueItemC = new AttributeValueItem( attributeC );
        attributeValueItemD = new AttributeValueItem( attributeD );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

            LOG.warn( msg );
            throw new IllegalArgumentException( msg );
        }

        byte[] bytecode = Base64.decode( byteCodeString.toCharArray() );
        EntryAttribute attr = new DefaultEntryAttribute( MetaSchemaConstants.M_BYTECODE_AT, bytecode );

        return attr;
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

        ModifyRequest req0 = new ModifyRequest()
        {
            public Collection<Modification> getModifications()
            {
                List<Modification> list = new ArrayList<Modification>();
                EntryAttribute attr = new DefaultEntryAttribute( "attr0" );
                attr.add( "val0" );
                attr.add( "val1" );
                attr.add( "val2" );
                Modification item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
                list.add( item );

                attr = new DefaultEntryAttribute( "attr1" );
                attr.add( "val3" );
                item = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attr );
                list.add( item );

                attr = new DefaultEntryAttribute( "attr2" );
                attr.add( "val4" );
                attr.add( "val5" );
                item = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attr );
                list.add( item );

                return list;
            }
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.