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

Examples of org.apache.directory.shared.ldap.entry.DefaultServerEntry.removeAttributes()


        tuples = getTuples( new ProtectedItem.SelfValue( attrTypes ) );

        assertEquals( 1, filterA.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
            null, null, null, "cn", null, entry, null, null ).size() );

        entry.removeAttributes( "cn" );
        assertEquals( 0, filterA.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
            null, null, null, "cn", null, entry, null, null ).size() );

        tuples = getTuples( new ProtectedItem.SelfValue( attrTypes ) );
        assertEquals( 0, filterA.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
View Full Code Here


        // this should pass
        SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager.getObjectClassRegistry(), name, mod, modifyAttributes );

        // this should succeed since person is still in replaced set and is structural
        modifyAttributes.removeAttributes( atCN );
        AttributeType atOC = schemaManager.lookupAttributeTypeRegistry( "objectClass" );
        EntryAttribute objectClassesReplaced = new DefaultServerAttribute( atOC );
        objectClassesReplaced.add( "top" );
        objectClassesReplaced.add( "person" );
        modifyAttributes.put( objectClassesReplaced );
View Full Code Here

            assertEquals( e.getResultCode(), ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED );
        }

        // this should fail since the modify operation tries to delete all
        // objectClass attribute values
        modifyAttributes.removeAttributes( "cn" );
        objectClassesReplaced = new DefaultServerAttribute( atOC );
        modifyAttributes.put( objectClassesReplaced );
        try
        {
            SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager.getObjectClassRegistry(), name, mod, modifyAttributes );
View Full Code Here

        EntryAttribute attrSN = new DefaultServerAttribute( atSN, "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultServerAttribute( atPwd, BYTES1, BYTES2 );
       
        entry.put( attrOC, attrCN, attrSN, attrPWD );
       
        entry.removeAttributes( atCN, atSN );
       
        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
       
        List<EntryAttribute> removed = entry.removeAttributes( (AttributeType)null );
View Full Code Here

        entry.removeAttributes( atCN, atSN );
       
        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
       
        List<EntryAttribute> removed = entry.removeAttributes( (AttributeType)null );
        assertNull( removed );

        removed = entry.removeAttributes( atC );
        assertNull( removed );
    }
View Full Code Here

        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
       
        List<EntryAttribute> removed = entry.removeAttributes( (AttributeType)null );
        assertNull( removed );

        removed = entry.removeAttributes( atC );
        assertNull( removed );
    }
   
   
    /**
 
View Full Code Here

        assertFalse( clientEntry instanceof ServerEntry );
       
        assertTrue( clientEntry.containsAttribute( "cn", "objectClass" ) );
        assertEquals( dn, clientEntry.getDn() );
       
        serverEntry.removeAttributes( "cn" );
        assertTrue( clientEntry
            .contains( "cn", "test1", "test2" ) );
       
        serverEntry.remove"objectClass", "person" );
        assertTrue( clientEntry
View Full Code Here

        EntryAttribute attrSN = new DefaultServerAttribute( atSN, "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultServerAttribute( atPwd, BYTES1, BYTES2 );
       
        entry.put( attrOC, attrCN, attrSN, attrPWD );
       
        entry.removeAttributes( "CN", "SN" );
       
        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
       
        List<EntryAttribute> removed = entry.removeAttributes( "badId" );
View Full Code Here

        entry.removeAttributes( "CN", "SN" );
       
        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
       
        List<EntryAttribute> removed = entry.removeAttributes( "badId" );
        assertNull( removed );
       
        removed = entry.removeAttributes( "l" );
        assertNull( removed );
       
View Full Code Here

        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
       
        List<EntryAttribute> removed = entry.removeAttributes( "badId" );
        assertNull( removed );
       
        removed = entry.removeAttributes( "l" );
        assertNull( removed );
       
        removed = entry.removeAttributes( (String )null );
        assertNull( removed );
    }
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.