Package org.apache.directory.server.core.api

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


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

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


                }

                break;

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

            default:
                throw new IllegalStateException( I18n.err( I18n.ERR_476, entry.getChangeType() ) );
        }
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

        {
            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

                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 ( LdapReferralException 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.getModifications() );
                break;

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

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

        try
        {
            akarasuluSession.modify( new Dn( "uid=admin,ou=system" ), mod );
            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

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.