Package org.apache.directory.server.core

Examples of org.apache.directory.server.core.CoreSession


        // Stores the request controls into the operation context
        LdapProtocolUtils.setRequestControls( opContext, bindRequest );
       
        try
        {
            CoreSession adminSession = ldapSession.getLdapServer().getDirectoryService().getAdminSession();

            // And call the OperationManager bind operation.
            adminSession.getDirectoryService().getOperationManager().bind( opContext );
           
            // As a result, store the created session in the Core Session
            ldapSession.setCoreSession( opContext.getSession() );
           
            // Return the successful response
View Full Code Here


        {
            handle( ldapSession, message );
        }
        else
        {
            CoreSession coreSession = null;
           
            /*
             * All requests except bind automatically presume the authentication
             * is anonymous if the session has not been authenticated.  Hence a
             * default bind is presumed as the anonymous identity.
View Full Code Here

                    .getSaslProperty( SaslConstants.SASL_AUTHENT_USER );
                if ( ldapPrincipal != null )
                {
                    DirectoryService ds = ldapSession.getLdapServer().getDirectoryService();
                    String saslMechanism = bindRequest.getSaslMechanism();
                    CoreSession userSession = ds.getSession( ldapPrincipal.getClonedName(), ldapPrincipal
                        .getUserPassword(), saslMechanism, null );

                    // Set the user session into the ldap session
                    ldapSession.setCoreSession( userSession );
                }
View Full Code Here

     */
    @Test
    public void testLdifAddEntries() throws Exception
    {
        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" );
View Full Code Here

     */
    @Test
    public void testLdifAddExistingEntry() throws Exception
    {
        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" );
View Full Code Here

     */
    @Test
    public void testLdifDeleteExistingEntry() throws Exception
    {
        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" );
View Full Code Here

     */
    @Test
    public void testLdifSearchExistingEntry() throws Exception
    {
        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" );
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() );
View Full Code Here

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

        DN childDn1 = new DN( "dc=child1,ou=test,ou=system" );
        childDn1.normalize( schemaManager.getNormalizerMapping() );
       
        RDN newRdn = new RDN( SchemaConstants.DC_AT + "=" + "renamedChild1" );
View Full Code Here

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

        DN childDn1 = new DN( "dc=child1,ou=test,ou=system" );
        childDn1.normalize( schemaManager.getNormalizerMapping() );
       
        RDN newRdn = new RDN( SchemaConstants.DC_AT + "=" + "renamedChild1" );
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.CoreSession

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.