Package org.apache.directory.server.core.entry

Examples of org.apache.directory.server.core.entry.ClonedServerEntry$EmptyEntry


            EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn ) );

            while ( list.next() )
            {
                ClonedServerEntry entry = list.get();

                comparatorList.add( entry );
            }
        }
View Full Code Here


            EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn ) );

            while ( list.next() )
            {
                ClonedServerEntry entry = list.get();

                normalizerList.add( entry );
            }
        }
View Full Code Here

            EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn ) );

            while ( list.next() )
            {
                ClonedServerEntry entry = list.get();

                objectClassList.add( entry );
            }
        }
View Full Code Here

             * NOTE: if this is done then this handler should extend the
             * a modified form of the ReferralAwareRequestHandler so it can
             * detect conditions where ancestors of the DN are referrals
             * and delegate appropriately.
             */
            ClonedServerEntry principalEntry = null;

            try
            {
                principalEntry = getLdapServer().getDirectoryService().getAdminSession().lookup( bindRequest.getName() );
            }
            catch ( NameNotFoundException e )
            {
                // this is OK
            }

            if ( principalEntry == null )
            {
                LOG.info( "The {} principalDN cannot be found in the server : bind failure.", bindRequest.getName() );
                InternalLdapResult result = bindRequest.getResultResponse().getLdapResult();
                result.setErrorMessage( "cannot bind the principalDn." );
                result.setResultCode( ResultCodeEnum.INVALID_CREDENTIALS );
                ldapSession.getIoSession().write( bindRequest.getResultResponse() );
                return;
            }

            if ( principalEntry.getOriginalEntry().contains( SchemaConstants.OBJECT_CLASS_AT,
                SchemaConstants.REFERRAL_OC ) )
            {
                LOG.info( "Bind principalDn points to referral." );
                InternalLdapResult result = bindRequest.getResultResponse().getLdapResult();
                result.setErrorMessage( "Bind principalDn points to referral." );
View Full Code Here

        ServerEntry entry = new DefaultServerEntry( schemaManager );
        entry.setDn( new DN( dn ).normalize( schemaManager.getNormalizerMapping() ) );
        entry.put( SchemaConstants.ENTRY_CSN_AT, defaultCSNFactory.newInstance().toString() );
        entry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
       
        ClonedServerEntry clonedEntry = new ClonedServerEntry( entry );

        return clonedEntry;
    }
View Full Code Here

    {
        DN adminDn = new DN( "uid=admin,ou=system" ).normalize( schemaManager.getNormalizerMapping() );
        CoreSession session = new MockCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), new MockDirectoryService( 1 ) );
        AddOperationContext addCtx = new AddOperationContext( session );
       
        ClonedServerEntry entry1 = createEntry( "dc=test,ou=test,ou=system" );
        entry1.put( "ObjectClass", "top", "domain" );
        entry1.put( "dc", "test" );
        addCtx.setEntry( entry1 );
       
        partition.add( addCtx );

        ClonedServerEntry entry2 = createEntry( "dc=test,dc=test,ou=test,ou=system" );
        entry2.put( "ObjectClass", "top", "domain" );
        entry2.put( "dc", "test" );
        addCtx.setEntry( entry2 );
       
        partition.add( addCtx );
       
        assertTrue( new File( wkdir, "ou=test,ou=system" ).exists() );
View Full Code Here

    {
        DN adminDn = new DN( "uid=admin,ou=system" ).normalize( schemaManager.getNormalizerMapping() );
        CoreSession session = new MockCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), new MockDirectoryService( 1 ) );
        AddOperationContext addCtx = new AddOperationContext( session );
       
        ClonedServerEntry entry1 = createEntry( "dc=test,ou=test,ou=system" );
        entry1.put( "ObjectClass", "top", "domain" );
        entry1.put( "dc", "test" );
        addCtx.setEntry( entry1 );
       
        partition.add( addCtx );

        ClonedServerEntry entry2 = createEntry( "dc=test,dc=test,ou=test,ou=system" );
        entry2.put( "ObjectClass", "top", "domain" );
        entry2.put( "dc", "test" );
        addCtx.setEntry( entry2 );
       
        partition.add( addCtx );
       
        ClonedServerEntry entry3 = createEntry( "dc=test,dc=test,ou=test,ou=system" );
        entry3.put( "ObjectClass", "top", "domain" );
        entry3.put( "dc", "test" );
        addCtx.setEntry( entry3 );
       
        try
        {
            partition.add( addCtx );
View Full Code Here

    {
        DN adminDn = new DN( "uid=admin,ou=system" ).normalize( schemaManager.getNormalizerMapping() );
        CoreSession session = new MockCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), new MockDirectoryService( 1 ) );
        AddOperationContext addCtx = new AddOperationContext( session );
       
        ClonedServerEntry entry1 = createEntry( "dc=test,ou=test,ou=system" );
        entry1.put( "ObjectClass", "top", "domain" );
        entry1.put( "dc", "test" );
        addCtx.setEntry( entry1 );
       
        partition.add( addCtx );

        ClonedServerEntry entry2 = createEntry( "dc=test1,dc=test,ou=test,ou=system" );
        entry2.put( "ObjectClass", "top", "domain" );
        entry2.put( "dc", "test1" );
        addCtx.setEntry( entry2 );
       
        partition.add( addCtx );
       
        ClonedServerEntry entry3 = createEntry( "dc=test2,dc=test,ou=test,ou=system" );
        entry3.put( "ObjectClass", "top", "domain" );
        entry3.put( "dc", "test2" );
        addCtx.setEntry( entry3 );
       
        partition.add( addCtx );
       
        DeleteOperationContext delCtx = new DeleteOperationContext( session );
View Full Code Here

    {
        DN adminDn = new DN( "uid=admin,ou=system" ).normalize( schemaManager.getNormalizerMapping() );
        CoreSession session = new MockCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), new MockDirectoryService( 1 ) );
        AddOperationContext addCtx = new AddOperationContext( session );
       
        ClonedServerEntry entry1 = createEntry( "dc=test,ou=test,ou=system" );
        entry1.put( "ObjectClass", "top", "domain" );
        entry1.put( "dc", "test" );
        addCtx.setEntry( entry1 );
       
        partition.add( addCtx );

        ClonedServerEntry entry2 = createEntry( "dc=test1,dc=test,ou=test,ou=system" );
        entry2.put( "ObjectClass", "top", "domain" );
        entry2.put( "dc", "test1" );
        addCtx.setEntry( entry2 );
       
        partition.add( addCtx );
       
        ClonedServerEntry entry3 = createEntry( "dc=test2,dc=test,ou=test,ou=system" );
        entry3.put( "ObjectClass", "top", "domain" );
        entry3.put( "dc", "test2" );
        addCtx.setEntry( entry3 );
       
        partition.add( addCtx );
       
        SearchOperationContext searchCtx = new SearchOperationContext( session );

        DN dn = new DN( "dc=test,ou=test,ou=system" );
        dn.normalize( schemaManager.getNormalizerMapping() );
        searchCtx.setDn( dn );
        ExprNode filter = FilterParser.parse( "(ObjectClass=domain)" );
        searchCtx.setFilter( filter );
        searchCtx.setScope( SearchScope.SUBTREE );
       
        EntryFilteringCursor cursor = partition.search( searchCtx );
       
        assertNotNull( cursor );
       
        Set<String> expectedDns = new HashSet<String>();
        expectedDns.add( entry1.getDn().getNormName() );
        expectedDns.add( entry2.getDn().getNormName() );
        expectedDns.add( entry3.getDn().getNormName() );
       
        cursor.beforeFirst();
        int nbRes = 0;
       
        while ( cursor.next() )
View Full Code Here

    @Test
    public void testLdifMoveEntry() throws Exception
    {
        CoreSession session = injectEntries();

        ClonedServerEntry childEntry1 = partition.lookup( partition.getEntryId( new DN( "dc=child1,ou=test,ou=system" ).normalize( schemaManager.getNormalizerMapping() ).getNormName() ) );
        ClonedServerEntry childEntry2 = partition.lookup( partition.getEntryId( new DN( "dc=child2,ou=test,ou=system" ).normalize( schemaManager.getNormalizerMapping() ).getNormName() ) );
       
        MoveOperationContext moveOpCtx = new MoveOperationContext( session, childEntry1.getDn(), childEntry2.getDn() );
        partition.move( moveOpCtx );

        assertFalse( new File( wkdir, "ou=test,ou=system/dc=child1" ).exists() );
        assertFalse( new File( wkdir, "ou=test,ou=system/dc=child1.ldif" ).exists() );
        assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2" ).exists() );
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.entry.ClonedServerEntry$EmptyEntry

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.