Examples of DefaultEntryAttribute


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

   
   
    @Test
    public void testCreateServerModification()
    {
        EntryAttribute attribute = new DefaultEntryAttribute( "cn" );
        attribute.add( "test1", "test2" );
       
        Modification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
        Modification clone = mod.clone();
       
        attribute.remove( "test2" );
       
        EntryAttribute clonedAttribute = clone.getAttribute();
       
        assertEquals( 1, mod.getAttribute().size() );
        assertTrue( mod.getAttribute().contains( "test1" ) );
View Full Code Here

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

   
   
    @Test
    public void testSerializationModificationADD() throws ClassNotFoundException, IOException
    {
        EntryAttribute attribute = new DefaultEntryAttribute( "cn" );
        attribute.add( "test1", "test2" );
       
        DefaultModification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
       
        Modification modSer = deserializeValue( serializeValue( mod ) );
       
View Full Code Here

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

   
   
    @Test
    public void testSerializationModificationREPLACE() throws ClassNotFoundException, IOException
    {
        EntryAttribute attribute = new DefaultEntryAttribute( "cn" );
        attribute.add( "test1", "test2" );
       
        DefaultModification mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
       
        Modification modSer = deserializeValue( serializeValue( mod ) );
       
View Full Code Here

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

   
   
    @Test
    public void testSerializationModificationREMOVE() throws ClassNotFoundException, IOException
    {
        EntryAttribute attribute = new DefaultEntryAttribute( "cn" );
        attribute.add( "test1", "test2" );
       
        DefaultModification mod = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute );
       
        Modification modSer = deserializeValue( serializeValue( mod ) );
       
View Full Code Here

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

    {
        Dn dn = new Dn( "dc=apache, dc=com" );
       
        Entry deletedEntry = new DefaultEntry( dn );
       
        EntryAttribute oc = new DefaultEntryAttribute( "objectClass" );
        oc.add( "top", "person" );
       
        deletedEntry.put( oc );
       
        deletedEntry.put( "cn", "test" );
        deletedEntry.put( "sn", "apache" );
View Full Code Here

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

    @Test
    public void testReverseModifyDelExistingOuValue() throws LdapException
    {
        Entry modifiedEntry = buildEntry();
       
        EntryAttribute ou = new DefaultEntryAttribute( "ou" );
        ou.add( "apache", "acme corp" );
        modifiedEntry.put( ou );

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

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

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

        assertNotNull( reversed );
View Full Code Here

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

    }


    private void addModification( ModificationOperation modOp, String attributeName, byte[]... attributeValue )
    {
        EntryAttribute attr = new DefaultEntryAttribute( attributeName, attributeValue );
        addModification( attr, modOp );
    }
View Full Code Here

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

    }


    private void addModification( ModificationOperation modOp, String attributeName, String... attributeValue )
    {
        EntryAttribute attr = new DefaultEntryAttribute( attributeName, attributeValue );
        addModification( attr, modOp );
    }
View Full Code Here

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

     *
     * @param type The attribute's name
     */
    public void addAttributeTypeAndValues( String type )
    {
        currentAttribute = new DefaultEntryAttribute( type );

        Modification modification = new DefaultModification( currentOperation, currentAttribute );
        getDecorated().addModification( modification );
    }
View Full Code Here

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

     *
     * @param type The attribute's type
     */
    public void addAttribute( String type ) throws LdapException
    {
        currentAttribute = new DefaultEntryAttribute( type );

        getDecorated().getEntry().put( currentAttribute );
    }
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.