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

Examples of org.apache.directory.shared.ldap.entry.client.DefaultClientEntry


        LdifEntry forward = new LdifEntry();
        forward.setChangeType( ChangeType.Delete );
        forward.setDn( opContext.getDn() );
       
        Entry reverseEntry = new DefaultClientEntry( serverEntry.getDn() );
       
        for ( EntryAttribute attribute:serverEntry )
        {
            reverseEntry.add( ((ServerAttribute)attribute).toClientAttribute() );
        }

        LdifEntry reverse = LdifRevertor.reverseDel( opContext.getDn(), reverseEntry );
        opContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverse ) );
    }
View Full Code Here


            mods.add( mod );
           
            forward.addModificationItem( mod );
        }
       
        Entry clientEntry = new DefaultClientEntry( serverEntry.getDn() );
       
        for ( EntryAttribute attribute:serverEntry )
        {
            clientEntry.add( ((ServerAttribute)attribute).toClientAttribute() );
        }

        LdifEntry reverse = LdifRevertor.reverseModify(
            opContext.getDn(),
            mods,
View Full Code Here

    {
        DN entryDN = new DN( entryRdn + ",ou=system" );
        boolean result;
       
        // create the entry with the telephoneNumber attribute to compare
        Entry testEntry = new DefaultClientEntry( entryDN );
        testEntry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        testEntry.add( SchemaConstants.OU_AT, "testou" );
        testEntry.add( "telephoneNumber", "867-5309" ); // jenny don't change your number

        LdapConnection adminConnection = getAdminConnection();

        // create the entry as admin
        adminConnection.add( testEntry );
View Full Code Here

    {
        DN entryDN = new DN( entryRdn + ",ou=system" );
        boolean result;

        // create the entry with the telephoneNumber attribute to compare
        Entry testEntry = new DefaultClientEntry( entryDN );
        testEntry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        testEntry.add( SchemaConstants.OU_AT, "testou" );
        testEntry.add( "telephoneNumber", "867-5309" ); // jenny don't change your number

        LdapConnection adminConnection = getAdminConnection();

        adminConnection.add( testEntry );
View Full Code Here

    public boolean checkCanRenameAs( String uid, String password, String entryRdn, String newNameRdn ) throws Exception
    {
        DN entryDN = new DN( entryRdn + ",ou=system" );
        boolean result;
       
        Entry testEntry = new DefaultClientEntry( entryDN );
        testEntry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        testEntry.add( SchemaConstants.OU_AT, "testou" );
       
        LdapConnection adminConnection = getAdminConnection();

        // create the new entry as the admin user
        adminConnection.add( testEntry );
View Full Code Here

        throws Exception
    {
        DN entryDN = new DN( entryRdn + ",ou=system" );
        boolean result;
       
        Entry testEntry = new DefaultClientEntry( entryDN );
        testEntry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        testEntry.add( SchemaConstants.OU_AT, "testou" );
       
        LdapConnection adminConnection = getAdminConnection();

        // create the new entry as the admin user
        adminConnection.add( testEntry );
View Full Code Here

    {
        LdapConnection sysRoot = getAdminConnection( ldapServer );
        long revision = service.getChangeLog().getCurrentRevision();

        // add new test entry
        Entry entry = new DefaultClientEntry( new DN( "ou=test0,ou=system" ) );
        entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        entry.add( SchemaConstants.OU_AT, "test0" );
        sysRoot.add( entry );
       
        assertEquals( revision + 1, service.getChangeLog().getCurrentRevision() );

        Tag t0 = service.getChangeLog().tag();
        assertEquals( t0, service.getChangeLog().getLatest() );
        assertEquals( revision + 1, service.getChangeLog().getCurrentRevision() );
        assertEquals( revision + 1, t0.getRevision() );

        // add another test entry
        entry = new DefaultClientEntry( new DN( "ou=test1,ou=system" ) );
        entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        entry.put( SchemaConstants.OU_AT, "test1" );
        sysRoot.add( entry );
        assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );

        Tag t1 = service.getChangeLog().tag();
        assertEquals( t1, service.getChangeLog().getLatest() );
        assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );
        assertEquals( revision + 2, t1.getRevision() );

        ldapServer.stop();
        ldapServer.start();

        sysRoot = getAdminConnection( ldapServer );
        assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );
        assertEquals( t1, service.getChangeLog().getLatest() );
        assertEquals( revision + 2, t1.getRevision() );

        // add third test entry
        entry = new DefaultClientEntry( new DN( "ou=test2,ou=system" ) );
        entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        entry.put( SchemaConstants.OU_AT, "test2" );
        sysRoot.add( entry );
        assertEquals( revision + 3, service.getChangeLog().getCurrentRevision() );

        service.revert();
View Full Code Here

        Tag t0 = service.getChangeLog().tag();
        assertEquals( t0, service.getChangeLog().getLatest() );
        assertEquals( revision, service.getChangeLog().getCurrentRevision() );

        // add new test entry
        Entry entry = new DefaultClientEntry( new DN( "ou=test,ou=system" ) );
        entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        entry.put( SchemaConstants.OU_AT, "test" );
        sysRoot.add( entry );
        assertEquals( revision + 1, service.getChangeLog().getCurrentRevision() );

        ldapServer.stop();
        ldapServer.start();
View Full Code Here

    @Test
    public void testRevertAddOperations() throws Exception
    {
        LdapConnection sysRoot = getAdminConnection( ldapServer );
        Tag t0 = service.getChangeLog().tag();
        Entry entry = new DefaultClientEntry( new DN( "ou=test,ou=system" ) );
        entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        entry.put( SchemaConstants.OU_AT, "test" );
        sysRoot.add( entry );

        assertPresent( sysRoot, "ou=test,ou=system" );
        service.revert( t0.getRevision() );
View Full Code Here

    public boolean checkCanDeleteEntryAs( String uid, String password, String entryRdn ) throws Exception
    {
        DN entryDN = new DN( entryRdn + ",ou=system" );
       
        // create the entry with the telephoneNumber attribute to compare
        Entry testEntry = new DefaultClientEntry( entryDN );
        testEntry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        testEntry.add( SchemaConstants.OU_AT, "testou" );

        LdapConnection adminConnection = getAdminConnection();

        // create the entry as admin
        adminConnection.add( testEntry );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.entry.client.DefaultClientEntry

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.