Package org.apache.directory.server.core

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


        session.delete( dn, true );

        // We should not find the entry
        try
        {
            session.lookup( dn, new String[]{} );
            fail();
        }
        catch ( LdapNoSuchObjectException lnsoe )
        {
            assertTrue( true );
View Full Code Here


            ksFile.delete();
        }
       
        ksFile = File.createTempFile( "testStore", "ks" );
        CoreSession session = ldapServer.getDirectoryService().getAdminSession();
        ClonedServerEntry 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

    {
        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
        adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
        LdapPrincipal principal = new LdapPrincipal( adminDn, AuthenticationLevel.SIMPLE );
        CoreSession session = directoryService.getSession( principal );
        return session.lookup( adminDn );
    }
   
   
    /* (non-Javadoc)
     * @see java.security.KeyStoreSpi#engineAliases()
View Full Code Here

            ksFile.delete();
        }
        ksFile = File.createTempFile( "testStore", "ks" );

        CoreSession session = ldapServer.getDirectoryService().getAdminSession();
        ClonedServerEntry entry = session.lookup( new LdapDN( "uid=admin,ou=system" ), new String[]
            { USER_CERTIFICATE_AT } );
        byte[] userCertificate = entry.get( USER_CERTIFICATE_AT ).getBytes();
        assertNotNull( userCertificate );

        ByteArrayInputStream in = new ByteArrayInputStream( userCertificate );
View Full Code Here

    private ServerEntry getTlsEntry() throws Exception
    {
        LdapDN adminDn = PartitionNexus.getAdminName();
        LdapPrincipal principal = new LdapPrincipal( adminDn, AuthenticationLevel.SIMPLE );
        CoreSession session = directoryService.getSession( principal );
        return session.lookup( adminDn );
    }
   
   
    /* (non-Javadoc)
     * @see java.security.KeyStoreSpi#engineAliases()
View Full Code Here

       
        session.delete( dn );
       
        try
        {
            session.lookup( dn, new String[]{} );
            fail();
        }
        catch ( NameNotFoundException nnfe )
        {
            assertTrue( true );
View Full Code Here

        LdapDN dn = new LdapDN( "ou=Roles,o=MNN,c=WW,ou=system" );
       
        // We should not find the entry
        try
        {
            session.lookup( dn, new String[]{} );
            fail();
        }
        catch ( NameNotFoundException nnfe )
        {
            assertTrue( true );
View Full Code Here

        session.delete( dn, true );

        // We should not find the entry
        try
        {
            session.lookup( dn, new String[]{} );
            fail();
        }
        catch ( NameNotFoundException nnfe )
        {
            assertTrue( true );
View Full Code Here

        LdapDN dnRoles = new LdapDN( "ou=Roles,o=MNN,c=WW,ou=system" );
        LdapDN dnGroups = new LdapDN( "ou=Groups,o=MNN,c=WW,ou=system" );
        Rdn newRdn = new Rdn( "ou=Groups" );

        // First check that the object exists
        ServerEntry renamed = session.lookup( dnRoles );
        assertNotNull( renamed );

        // Also check that the new entry does not exist
        try
        {
View Full Code Here

        assertNotNull( renamed );

        // Also check that the new entry does not exist
        try
        {
            renamed = session.lookup( dnGroups );
            fail();
        }
        catch ( NameNotFoundException nnfe )
        {
            assertTrue( true );
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.