Package org.apache.directory.server.core

Examples of org.apache.directory.server.core.CoreSession.modify()


        LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );
        CoreSession akarasuluSession = service.getSession( principal );

        try
        {
            akarasuluSession.modify(
                new DN( "uid=admin,ou=system" ), mods );
            fail( "User 'uid=admin,ou=system' should not be able to modify attributes on admin" );
        }
        catch ( Exception e )
        {
View Full Code Here


        try
        {
            // Call the underlying layer to delete the entry
            CoreSession coreSession = session.getCoreSession();
            coreSession.modify( req );
           
            // If success, here now, otherwise, we would have an exception.
            result.setResultCode( ResultCodeEnum.SUCCESS );
           
            // Write the DeleteResponse message
View Full Code Here

                ModificationOperation.ADD_ATTRIBUTE, attr );
            List<Modification> mods = new ArrayList<Modification>();
           
            mods.add( mod );
           
            session.modify( new DN( "cn=Emmanuel Lecharny,ou=Roles,c=MNN,o=WW,ou=system" ), mods );
            fail();
        }
        catch ( NameNotFoundException nnfe )
        {
            assertTrue( true );
View Full Code Here

                ModificationOperation.ADD_ATTRIBUTE, attr );
            List<Modification> mods = new ArrayList<Modification>();
           
            mods.add( mod );
           
            session.modify( new DN( "cn=Emmanuel Lecharny,ou=Roles,c=MNN,o=WW,ou=system" ), mods, true );
            fail();
        }
        catch ( NameNotFoundException nnfe )
        {
            assertTrue( true );
View Full Code Here

                ModificationOperation.ADD_ATTRIBUTE, attr );
            List<Modification> mods = new ArrayList<Modification>();
           
            mods.add( mod );
           
            session.modify( new DN( "ou=Roles,o=MNN,c=WW,ou=system" ), mods, false );
            fail();
        }
        catch ( ReferralException re )
        {
            int nbRefs = 0;
View Full Code Here

            ModificationOperation.ADD_ATTRIBUTE, attr );
        List<Modification> mods = new ArrayList<Modification>();
       
        mods.add( mod );
       
        session.modify( new DN( "ou=Roles,o=MNN,c=WW,ou=system" ), mods, true );
       
        // Now try to retrieve this attribute
        Attributes result = MNNCtx.getAttributes( "ou=Roles", new String[]{ "description" } );
       
        assertNotNull( result );
View Full Code Here

                }
               
                break;

            case( ChangeType.MODIFY_ORDINAL ):
                session.modify( dn, entry.getModificationItems() );
                break;

            default:
                throw new IllegalStateException( I18n.err( I18n.ERR_476, entry.getChangeType() ) );
        }
View Full Code Here

                    List<Modification> modifiedList = new ArrayList<Modification>();
                    modifiedList.add(serverModification);

                    try {
                        adminSession.modify(adminPrincipal.getClonedName(), modifiedList);
                    } catch (Exception e) {
                        String msg = "Failed changing connection user password.";
                        logger.error(msg, e);
                        throw new DirectoryServerException(msg, e);
                    }
View Full Code Here

        {
            Attribute attr = new DefaultAttribute( "Description", "this is a test" );
            Modification mod = new DefaultModification(
                ModificationOperation.ADD_ATTRIBUTE, attr );
           
            session.modify( new Dn( "cn=Emmanuel Lecharny,ou=Roles,c=MNN,o=WW,ou=system" ), mod );
            fail();
        }
        catch ( LdapNoSuchObjectException lnsoe )
        {
            assertTrue( true );
View Full Code Here

                ModificationOperation.ADD_ATTRIBUTE, attr );
            List<Modification> mods = new ArrayList<Modification>();
           
            mods.add( mod );
           
            session.modify( new Dn( "cn=Emmanuel Lecharny,ou=Roles,c=MNN,o=WW,ou=system" ), mods, true );
            fail();
        }
        catch ( LdapNoSuchObjectException lnsoe )
        {
            assertTrue( true );
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.