Package org.apache.directory.server.core

Examples of org.apache.directory.server.core.CoreSession.lookup()


        assertNotNull( renamed );

        // Also check that the new entry does not exist
        try
        {
            renamed = session.lookup( dnGroups );
            fail();
        }
        catch ( LdapNoSuchObjectException lnsoe )
        {
            assertTrue( true );
View Full Code Here


        session.rename( dnRoles, newRdn, false, true );

        // It should not be there anymore
        try
        {
            renamed = session.lookup( dnRoles );
            fail();
        }
        catch ( LdapNoSuchObjectException lnsoe )
        {
            assertTrue( true );
View Full Code Here

        {
            assertTrue( true );
        }

        // But the new one should be there
        renamed = session.lookup( dnGroups );
        assertNotNull( renamed );
    }


    /**
 
View Full Code Here

            ksFile.delete();
        }
       
        ksFile = File.createTempFile( "testStore", "ks" );
        CoreSession session = getLdapServer().getDirectoryService().getAdminSession();
        Entry entry = session.lookup( new Dn( "uid=admin,ou=system" ), CERT_IDS );
        byte[] userCertificate = entry.get( CERT_IDS[0] ).getBytes();
        assertNotNull( userCertificate );

        ByteArrayInputStream in = new ByteArrayInputStream( userCertificate );
        CertificateFactory factory = CertificateFactory.getInstance( "X.509" );
View Full Code Here

            ksFile.delete();
        }
       
        ksFile = File.createTempFile( "testStore", "ks" );
        CoreSession session = getLdapServer().getDirectoryService().getAdminSession();
        Entry entry = session.lookup( new Dn( "uid=admin,ou=system" ), CERT_IDS );
        byte[] userCertificate = entry.get( CERT_IDS[0] ).getBytes();
        assertNotNull( userCertificate );

        ByteArrayInputStream in = new ByteArrayInputStream( userCertificate );
        CertificateFactory factory = CertificateFactory.getInstance( "X.509" );
View Full Code Here

    private Entry getTlsEntry() throws Exception
    {
        Dn adminDn = directoryService.getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
        LdapPrincipal principal = new LdapPrincipal( directoryService.getSchemaManager(), adminDn, AuthenticationLevel.SIMPLE );
        CoreSession session = directoryService.getSession( principal );
        return session.lookup( adminDn );
    }
   
   
    /* (non-Javadoc)
     * @see java.security.KeyStoreSpi#engineAliases()
View Full Code Here

    {
        // We have to use the admin session here, otherwise we may have
        // trouble reading the entry due to insufficient access rights
        CoreSession adminSession = opContext.getSession().getDirectoryService().getAdminSession();

        Entry foundEntry = adminSession.lookup( opContext.getDn(), SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES );

        if ( foundEntry != null )
        {
            return foundEntry;
        }
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.