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

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


    {
        LdapConnection sysRoot = getAdminConnection( ldapServer );
        Tag t0 = service.getChangeLog().tag();

        // 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 );

        // assert presence
        assertPresent( sysRoot, "ou=test,ou=system" );
View Full Code Here


    @Test
    public void testRevertDeleteOperations() throws Exception
    {
        LdapConnection sysRoot = getAdminConnection( ldapServer );
        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 );

        // tag after the addition before deletion
        Tag t0 = service.getChangeLog().tag();
        assertPresent( sysRoot, "ou=test,ou=system" );
View Full Code Here

    @Test
    public void testRevertRenameOperations() throws Exception
    {
        LdapConnection sysRoot = getAdminConnection( ldapServer );
        Entry entry = new DefaultClientEntry( new DN( "ou=oldname,ou=system" ) );
        entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        entry.put( SchemaConstants.OU_AT, "oldname" );
        sysRoot.add( entry );

        // tag after the addition before rename
        Tag t0 = service.getChangeLog().tag();
        assertPresent( sysRoot, "ou=oldname,ou=system" );
View Full Code Here

    @Test
    public void testRevertModifyOperations() throws Exception
    {
        LdapConnection sysRoot = getAdminConnection( ldapServer );
        Entry entry = new DefaultClientEntry( new DN( "ou=test5,ou=system" ) );
        entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
        entry.put( SchemaConstants.OU_AT, "test5" );
        sysRoot.add( entry );

        // -------------------------------------------------------------------
        // Modify ADD Test
        // -------------------------------------------------------------------

        // tag after the addition before modify ADD
        Tag t0 = service.getChangeLog().tag();
        assertPresent( sysRoot, "ou=test5,ou=system" );

        // modify the test entry to add description and test new attr appears
        ModifyRequest modReq = new ModifyRequest( entry.getDn() );
        modReq.add( "description", "a desc value" );
        sysRoot.modify( modReq );

        Entry resusitated = ( ( SearchResultEntry ) sysRoot.lookup( "ou=test5,ou=system" ) ).getEntry();
        assertNotNull( resusitated );
View Full Code Here

        DN entryDN = new DN( entryRdn + ",ou=system" );
        boolean result = true;
       
        // 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

    public void testPasswordCompare() throws Exception
    {
        LdapConnection adminCtx = getAdminConnection();

        DN userDN = new DN( "uid=bob,ou=users,ou=system" );
        Entry user = new DefaultClientEntry( userDN );
        user.add( SchemaConstants.UID_AT, "bob" );
        user.add( SchemaConstants.USER_PASSWORD_AT, "bobspassword" );
        user.add( SchemaConstants.OBJECT_CLASS_AT, "person", "organizationalPerson", "inetOrgPerson" );
        user.add( SchemaConstants.SN_AT, "bob" );
        user.add( SchemaConstants.CN_AT, "bob" );

        adminCtx.add( user );

        CompareResponse resp = adminCtx.compare( userDN, "userPassword", "bobspassword" );
        assertEqualsResultCodeEnum.COMPARE_TRUE, resp.getLdapResult().getResultCode() );
View Full Code Here

     * Test the copy constructor of a ClientEntry
     */
    @Test
    public void testCopyConstructorClientEntry() throws LdapException
    {
        Entry clientEntry = new DefaultClientEntry();
        clientEntry.setDn( new DN( "ou=system" ) );
        clientEntry.add( "cn", "test1", "test2" );
        clientEntry.add( "objectClass", "top", "person" );
       
        Entry copyEntry = new DefaultServerEntry( schemaManager, clientEntry );
       
        assertTrue( copyEntry instanceof ServerEntry );
        assertTrue( copyEntry.contains( "objectClass", "top", "person" ) );
        assertTrue( copyEntry.contains( "cn", "test1", "test2" ) );
       
        clientEntry.removeAttributes( "cn" );

        assertTrue( copyEntry.contains( "objectClass", "top", "person" ) );
        assertTrue( copyEntry.contains( "cn", "test1", "test2" ) );
    }
View Full Code Here

        Entry[] attributes = new DefaultClientEntry[count];
        for ( int ii = 0; ii < count; ii++ )
        {
            try
            {
                attributes[ii] = new DefaultClientEntry();
                attributes[ii].add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
                attributes[ii].add( SchemaConstants.OU_AT, String.valueOf( ii ) );
                attributes[ii].add( SchemaConstants.OU_AT, "testEntry" );
                attributes[ii].add( "telephoneNumber", String.valueOf( count ) );
            }
View Full Code Here

    {
        // create the non-admin user
        createUser( "billyd", "billyd" );

        // create an entry subordinate to the user
        Entry phoneBook = new DefaultClientEntry( new DN( "ou=phoneBook,uid=billyd,ou=users,ou=system" ) );
        phoneBook.add( SchemaConstants.OU_AT, "phoneBook" );
        phoneBook.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );

        getAdminConnection().add( phoneBook );

        // now add a subentry that enables anyone to search below their own entries
        createAccessControlSubentry( "anybodySearchTheirSubordinates", "{ " + "identificationTag \"searchAci\", "
View Full Code Here

            // First, add 1000 entries in the server
            for ( int i = 0; i < 1000; i++ )
            {
                String dn = "cn=user" + i + "," + BASE;
                Entry kate = new DefaultClientEntry( new DN( dn ) );

                kate.add( "objectclass", "top", "person" );
                kate.add( "sn", "Bush" );
                kate.add( "cn", "user" + i );

                asyncCnx.add( kate );
            }

            // Searches for all the entries in ou=system
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.