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

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


            Dn userDn = new Dn( getService().getSchemaManager(), "uid=akarasulu,ou=users,ou=system" );
            LdapPrincipal principal = new LdapPrincipal( getService().getSchemaManager(), userDn, AuthenticationLevel.SIMPLE );
            CoreSession akarasuluSession = getService().getSession( principal );

            ExprNode filter = FilterParser.parse( getService().getSchemaManager(), "(objectClass=*)" );
            Cursor<Entry> cursor = akarasuluSession.search( new Dn( "ou=users,ou=system" ), SearchScope.OBJECT, filter , AliasDerefMode.DEREF_ALWAYS );
           
            while ( cursor.next() )
            {
                fail();
            }
View Full Code Here


        CoreSession coreSession = getService().getAdminSession();
        Dn dn = new Dn( "ou=nobody,ou=apache,ou=roles,o=Mnn,c=WW,ou=system" );
       
        try
        {
            coreSession.search( dn, "(ObjectClass=*)", false );
            fail();
        }
        catch ( LdapReferralException re )
        {
            int nbRefs = 0;
View Full Code Here

        CoreSession coreSession = getService().getAdminSession();
        Dn dn = new Dn( "ou=nobody,ou=apache,ou=roles,o=Mnn,c=WW,ou=system" );
       
        try
        {
            coreSession.search( dn, "(ObjectClass=*)", true );
            fail();
        }
        catch ( LdapPartialResultException lpre )
        {
            assertTrue( true );
View Full Code Here

        CoreSession coreSession = getService().getAdminSession();
        Dn dn = new Dn( "ou=roles,o=Mnn,c=WW,ou=system" );
       
        try
        {
            coreSession.search( dn, "(ObjectClass=*)", false );
            fail();
        }
        catch ( LdapReferralException re )
        {
            int nbRefs = 0;
View Full Code Here

    public void testSearchExistingReferralCoreAPIWithManageDsaIT() throws Exception
    {
        CoreSession coreSession = getService().getAdminSession();
        Dn dn = new Dn( "ou=roles,o=Mnn,c=WW,ou=system" );
       
        Cursor<Entry> cursor = coreSession.search( dn, "(ObjectClass=*)", true );
       
        assertNotNull( cursor );
       
        cursor.beforeFirst();
        int nbRes = 0;
View Full Code Here

        String adminDn = session.getEffectivePrincipal().getName();

        ExprNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );

        Cursor<Entry> cursor = session.search( partition.getSuffixDn(), SearchScope.SUBTREE, filter,
            AliasDerefMode.NEVER_DEREF_ALIASES, MANDATORY_ENTRY_ATOP_AT );
        cursor.beforeFirst();

        List<Modification> mods = new ArrayList<Modification>();
View Full Code Here

        String adminDn = session.getEffectivePrincipal().getName();

        ExprNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );

        EntryFilteringCursor cursor = session.search( partition.getSuffixDn(), SearchScope.SUBTREE, filter,
            AliasDerefMode.NEVER_DEREF_ALIASES, new HashSet<AttributeTypeOptions>( MANDATORY_ENTRY_ATOP_MAP.values() ) );
        cursor.beforeFirst();

        List<Modification> mods = new ArrayList<Modification>();
View Full Code Here

        String adminDn = session.getEffectivePrincipal().getName();

        ExprNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );

        EntryFilteringCursor cursor = session.search( partition.getSuffixDn(), SearchScope.SUBTREE, filter,
            AliasDerefMode.NEVER_DEREF_ALIASES, MANDATORY_ENTRY_ATOP_AT );
        cursor.beforeFirst();

        List<Modification> mods = new ArrayList<Modification>();
View Full Code Here

        String adminDn = session.getEffectivePrincipal().getName();

        ExprNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );

        EntryFilteringCursor cursor = session.search( partition.getSuffixDn(), SearchScope.SUBTREE, filter,
            AliasDerefMode.NEVER_DEREF_ALIASES, MANDATORY_ENTRY_ATOP_AT );
        cursor.beforeFirst();

        List<Modification> mods = new ArrayList<Modification>();
View Full Code Here

        String adminDn = session.getEffectivePrincipal().getName();

        ExprNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );

        EntryFilteringCursor cursor = session.search( partition.getSuffixDn(), SearchScope.SUBTREE, filter,
            AliasDerefMode.NEVER_DEREF_ALIASES, new HashSet<AttributeTypeOptions>( MANDATORY_ENTRY_ATOP_MAP.values() ) );
        cursor.beforeFirst();

        List<Modification> mods = new ArrayList<Modification>();
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.