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

Examples of org.apache.directory.shared.ldap.entry.ServerModification


            else
            {
                op = ModificationOperation.ADD_ATTRIBUTE;
            }

            modList.add( new ServerModification( op, result ) );
        }

        return modList;
    }
View Full Code Here


                        if ( opAttr.size() < 1 )
                        {
                            op = ModificationOperation.REMOVE_ATTRIBUTE;
                        }

                        modList.add( new ServerModification( op, opAttr ) );
                    }
                }
            }
            // need to add references to the subentry
            else if ( isNewEntrySelected && !isOldEntrySelected )
            {
                for ( String attribute : SUBENTRY_OPATTRS )
                {
                    ModificationOperation op = ModificationOperation.ADD_ATTRIBUTE;
                    AttributeType type = schemaManager.lookupAttributeTypeRegistry( attribute );
                    EntryAttribute opAttr = new DefaultServerAttribute( attribute, type );
                    opAttr.add( subentryDn );
                    modList.add( new ServerModification( op, opAttr ) );
                }
            }
        }

        return modList;
View Full Code Here

       
        List<Modification> mods = new ArrayList<Modification>(2);
       
        EntryAttribute newPasswordAttribute = new DefaultServerAttribute(
            schemaManager.lookupAttributeTypeRegistry( SchemaConstants.USER_PASSWORD_AT ), StringTools.getBytesUtf8( newPassword ) );
        mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, newPasswordAttribute ) );
       
        EntryAttribute principalAttribute = new DefaultServerAttribute(
            schemaManager.lookupAttributeTypeRegistry( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ), principal.getName() );
        mods.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, principalAttribute ) );
       
        //FIXME check if keyderivation is necessary
       
        ServerEntry entry = StoreUtils.findPrincipalEntry( session, searchBaseDn, principal.getName() );
        session.modify( entry.getDn(), mods );
View Full Code Here

    public void testSerializationModificationADD() throws ClassNotFoundException, IOException, LdapException
    {
        EntryAttribute attribute = new DefaultServerAttribute( atCN );
        attribute.add( "test1", "test2" );
       
        ServerModification mod = new ServerModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
       
        Modification modSer = deserializeValue( serializeValue( mod ) );
       
        assertEquals( mod, modSer );
    }
View Full Code Here

    public void testSerializationModificationREPLACE() throws ClassNotFoundException, IOException, LdapException
    {
        EntryAttribute attribute = new DefaultServerAttribute( atCN );
        attribute.add( "test1", "test2" );
       
        ServerModification mod = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
       
        Modification modSer = deserializeValue( serializeValue( mod ) );
       
        assertEquals( mod, modSer );
    }
View Full Code Here

    public void testSerializationModificationREMOVE() throws ClassNotFoundException, IOException, LdapException
    {
        EntryAttribute attribute = new DefaultServerAttribute( atCN );
        attribute.add( "test1", "test2" );
       
        ServerModification mod = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute );
       
        Modification modSer = deserializeValue( serializeValue( mod ) );
       
        assertEquals( mod, modSer );
    }
View Full Code Here

   
   
    @Test
    public void testSerializationModificationNoAttribute() throws ClassNotFoundException, IOException, LdapException
    {
        ServerModification mod = new ServerModification();
       
        mod.setOperation( ModificationOperation.ADD_ATTRIBUTE );
       
        try
        {
            deserializeValue( serializeValue( mod ) );
            fail();
View Full Code Here

       
        List<Modification> serverModifications = new ArrayList<Modification>( mods.size() );
       
        for ( Modification mod:mods )
        {
            serverModifications.add( new ServerModification( directoryService.getSchemaManager(), mod ) );
        }
       
        ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );

        opContext.setLogChange( log );
View Full Code Here

       
        List<Modification> serverModifications = new ArrayList<Modification>( mods.size() );
       
        for ( Modification mod:mods )
        {
            serverModifications.add( new ServerModification( directoryService.getSchemaManager(), mod ) );
        }

        ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );
       
        setReferralHandling( opContext, ignoreReferral );
View Full Code Here

        // Inject the ModifiersName AT if it's not present
        EntryAttribute attribute = new DefaultServerAttribute(
            MODIFIERS_NAME_ATTRIBUTE_TYPE,
            getPrincipal().getName());

        Modification modifiersName = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );

        mods.add( modifiersName );
       
        // Inject the ModifyTimestamp AT if it's not present
        attribute = new DefaultServerAttribute(
            MODIFY_TIMESTAMP_ATTRIBUTE_TYPE,
            DateUtils.getGeneralizedTime() );
       
        Modification timestamp = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );

        mods.add( timestamp );
       
        // Go down in the chain
        nextInterceptor.modify( opContext );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.entry.ServerModification

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.