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

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


                        }
                        else
                        {
                            // Replace the existing values with the new values
                            // This is done by removing the Attribute
                            tempEntry.removeAttributes( attributeType );

                            // Create the new Attribute
                            Attribute newAttribute = createNewAttribute( attribute );

                            tempEntry.put( newAttribute );
View Full Code Here


        // Now remove the ObjectClass attribute if it has not been requested
        if ( ( lookupContext.getAttrsId() != null ) && ( lookupContext.getAttrsId().size() != 0 ) &&
            ( ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ) != null )
                && ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ).size() == 0 ) ) )
        {
            serverEntry.removeAttributes( SchemaConstants.OBJECT_CLASS_AT );
        }

        return serverEntry;
    }
View Full Code Here

        assertEquals( 1, entry.size() );
        assertNotNull( entry.get( "domainComponent" ) );
        assertEquals( 1, entry.get( "domainComponent" ).size() );
        assertNotNull( entry.get( "domainComponent" ).get() );
        assertNull( entry.get( "domainComponent" ).get().getValue() );
        entry.removeAttributes( "dc" );

        replaced = entry.put( "DC", strValue3 );
        assertNull( replaced );
        assertEquals( 1, entry.size() );
        assertNotNull( entry.get( "dc" ) );
View Full Code Here

                case REMOVE_ATTRIBUTE:
                    Attribute toBeRemoved = mod.getAttribute();

                    if ( toBeRemoved.size() == 0 )
                    {
                        targetEntry.removeAttributes( id );
                    }
                    else
                    {
                        existing = targetEntry.get( id );
View Full Code Here

        entry.add( "userCertificate;binary", Strings.getBytesUtf8( "secret" ) );
        assertTrue( entry.containsAttribute( "userCertificate;binary" ) );
        assertTrue( entry.containsAttribute( "userCertificate" ) );

        entry.removeAttributes( "userCertificate;binary" );
        assertFalse( entry.containsAttribute( "userCertificate;binary" ) );
        assertFalse( entry.containsAttribute( "userCertificate" ) );

        entry.add( "userCertificate", Strings.getBytesUtf8( "secret" ) );
        assertTrue( entry.containsAttribute( "userCertificate;binary" ) );
View Full Code Here

        Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2" );
        Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 );

        entry.put( attrOC, attrCN, attrSN, attrPWD );

        entry.removeAttributes( "CN", "SN" );

        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );

        entry.removeAttributes( "badId" );
View Full Code Here

        entry.removeAttributes( "CN", "SN" );

        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );

        entry.removeAttributes( "badId" );

        entry.removeAttributes( ( String ) null );
    }

View Full Code Here

        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );

        entry.removeAttributes( "badId" );

        entry.removeAttributes( ( String ) null );
    }


    /**
     * Test method for remove( EntryAttribute... )
View Full Code Here

                case REMOVE_ATTRIBUTE:
                    Attribute toBeRemoved = mod.getAttribute();

                    if ( toBeRemoved.size() == 0 )
                    {
                        targetEntry.removeAttributes( id );
                    }
                    else
                    {
                        existing = targetEntry.get( id );
View Full Code Here

        aciContext.setAttributeType( CN_AT );
        aciContext.setEntry( entry );
       
        assertEquals( 1, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null ).size() );

        entry.removeAttributes( "cn" );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
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.