Package org.apache.directory.shared.ldap.model.entry

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


        ModifyRequestImpl req0 = getRequest();
        Attribute attr = new DefaultAttribute( "attr3" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        Modification item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        ModifyRequestImpl req1 = getRequest();
        attr = new DefaultAttribute( "attr4" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        assertFalse( req0.equals( req1 ) );
        assertFalse( req1.equals( req0 ) );
    }
View Full Code Here


        ModifyRequestImpl req0 = getRequest();
        Attribute attr = new DefaultAttribute( "attr3" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        Modification item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        ModifyRequestImpl req1 = getRequest();
        attr = new DefaultAttribute( "attr3" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        attr.add( "val3" );
        item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        assertFalse( req0.equals( req1 ) );
        assertFalse( req1.equals( req0 ) );
    }
View Full Code Here

                {
                    Attribute attr = new DefaultAttribute( "attr0" );
                    attr.add( "val0" );
                    attr.add( "val1" );
                    attr.add( "val2" );
                    Modification item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
                    list.add( item );
   
                    attr = new DefaultAttribute( "attr1" );
                    attr.add( "val3" );
                    item = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attr );
                    list.add( item );
   
                    attr = new DefaultAttribute( "attr2" );
                    attr.add( "val4" );
                    attr.add( "val5" );
                    item = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attr );
                    list.add( item );
                }
                catch ( LdapInvalidAttributeValueException liave )
                {
                    // Can't happen
View Full Code Here

        ou.add( "apache", "acme corp" );
        modifiedEntry.put( ou );

        Dn dn = new Dn( "cn=test, ou=system" );

        Modification mod = new DefaultModification(
            ModificationOperation.REMOVE_ATTRIBUTE,
            new DefaultAttribute( "ou", "acme corp" ) );

        LdifEntry reversed = LdifRevertor.reverseModify( dn,
                Collections.<Modification>singletonList( mod ), modifiedEntry );
View Full Code Here

        ou.add( "apache", "acme corp" );
        modifiedEntry.put( ou );

        Dn dn = new Dn( "cn=test, ou=system" );

        Modification mod = new DefaultModification(
            ModificationOperation.REMOVE_ATTRIBUTE,
            new DefaultAttribute( "ou" ) );

        LdifEntry reversed = LdifRevertor.reverseModify( dn,
                Collections.<Modification>singletonList( mod ), modifiedEntry );
View Full Code Here

        Attribute ou = new DefaultAttribute( "ou", "apache", "acme corp" );
        modifiedEntry.put( ou );
       
        Dn dn = new Dn( "cn=test, ou=system" );
       
        Modification mod = new DefaultModification(
            ModificationOperation.REMOVE_ATTRIBUTE, ou );

        LdifEntry reversed = LdifRevertor.reverseModify( dn,
                Collections.<Modification>singletonList( mod ), modifiedEntry );
View Full Code Here

        Attribute ouModified = new DefaultAttribute( "ou" );
        ouModified.add( "directory" );
        ouModified.add( "BigCompany inc." );
       
        Modification mod = new DefaultModification(
            ModificationOperation.REPLACE_ATTRIBUTE, ouModified );

        LdifEntry reversed = LdifRevertor.reverseModify( dn,
                Collections.<Modification>singletonList( mod ), modifiedEntry );
View Full Code Here

        Attribute newOu = new DefaultAttribute( "ou" );
        newOu.add( "apache" );
        newOu.add( "acme corp" );

       
        Modification mod = new DefaultModification(
            ModificationOperation.REPLACE_ATTRIBUTE, newOu );

        LdifEntry reversed = LdifRevertor.reverseModify( dn,
                Collections.<Modification>singletonList( mod ), modifiedEntry );
View Full Code Here

        ou.add( "acme corp" );
        modifiedEntry.put( ou );
       
        Dn dn = new Dn( "cn=test, ou=system" );
       
        Modification mod = new DefaultModification(
            ModificationOperation.REPLACE_ATTRIBUTE, new DefaultAttribute( "ou" ) );

        LdifEntry reversed = LdifRevertor.reverseModify( dn,
                Collections.<Modification>singletonList( mod ), modifiedEntry );
View Full Code Here

       
        List<Modification> modifications = new ArrayList<Modification>();

        // First, inject the 'ou'
       
        Modification mod = new DefaultModification(
            ModificationOperation.ADD_ATTRIBUTE, new DefaultAttribute( "ou", "BigCompany inc." ) );
        modifications.add( mod );

        // Remove the 'l'
        mod = new DefaultModification(
            ModificationOperation.REMOVE_ATTRIBUTE, new DefaultAttribute( "l" ) );
        modifications.add( mod );
       
        // Add 'l=FR'
        mod = new DefaultModification(
            ModificationOperation.ADD_ATTRIBUTE, new DefaultAttribute( "l", "FR" ) );
        modifications.add( mod );

        // Replace it with 'l=USA'
        mod = new DefaultModification(
            ModificationOperation.REPLACE_ATTRIBUTE, new DefaultAttribute( "l", "USA" ) );
        modifications.add( mod );

        // Replace the ou value
        mod = new DefaultModification(
            ModificationOperation.REPLACE_ATTRIBUTE, new DefaultAttribute( "ou", "apache" ) );
        modifications.add( mod );
       
        LdifEntry reversedEntry = LdifRevertor.reverseModify( dn, modifications, initialEntry.getEntry() );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.entry.DefaultModification

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.