<commit_before>package org.apache.eve.jndi;


import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;

import org.apache.ldap.common.NotImplementedException;
import org.apache.ldap.common.schema.Syntax;
import org.apache.eve.schema.bootstrap.BootstrapSyntaxRegistry;
import org.apache.eve.schema.bootstrap.BootstrapOidRegistry;
import org.apache.eve.schema.bootstrap.BootstrapOidRegistry;
import org.apache.eve.schema.bootstrap.BootstrapSyntaxRegistry;

import org.apache.eve.schema.config.CoreSyntaxFactory;


/**
 * An LDAPd server-side provider implementation of a InitialContextFactory.
 * Can be utilized via JNDI API in the standard fashion:
 * <code>
 * Hashtable env = new Hashtable();
 * env.put( Context.PROVIDER_URL, "ou=system" );
 * env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.eve.jndi.EveContextFactory" );
 * InitialContext initialContext = new InitialContext( env );
 * </code>
 * @see javax.naming.spi.InitialContextFactory
 */
public class EveContextFactory implements InitialContextFactory
{
    /** The singleton EveJndiProvider instance */
    private EveJndiProvider provider = null;
    /** the initial context environment that fired up the backend subsystem */
    private Hashtable initialEnv;


    /**
     * Default constructor that sets the provider of this EveContextFactory.
     */
    public EveContextFactory()
    {
        EveJndiProvider.setProviderOn( this );
    }
    
    
    /**
     * Enables this EveContextFactory with a handle to the EveJndiProvider
     * singleton.
     * 
     * @param a_provider the system's singleton EveBackendSubsystem service.
     */
    void setProvider( EveJndiProvider a_provider )
    {
        provider = a_provider;
    }
    
    
    /**
     * @see javax.naming.spi.InitialContextFactory#getInitialContext(
     * java.util.Hashtable)
     */
    public Context getInitialContext( Hashtable env ) throws NamingException
    {
        // fire up the backend subsystem if we need to
        if ( null == provider )
        {
            this.initialEnv = env;
            throw new NotImplementedException();
        }
        
        return provider.getLdapContext( env );
    }


    private EveJndiProvider create( Hashtable env )
    {
        EveJndiProvider provider = null;
        Syntax[] syntaxes;
        BootstrapOidRegistry oidRegistry;
        CoreSyntaxFactory coreSyntaxes;
        BootstrapSyntaxRegistry syntaxRegistry;

        throw new NotImplementedException( "bootstrap code not yet written" );

        // return provider;
    }
}<commit_msg>some old junk removed until we implement this<commit_after>package org.apache.eve.jndi;


import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;

import org.apache.ldap.common.NotImplementedException;
import org.apache.ldap.common.schema.Syntax;
import org.apache.eve.schema.bootstrap.BootstrapSyntaxRegistry;
import org.apache.eve.schema.bootstrap.BootstrapOidRegistry;

import org.apache.eve.schema.bootstrap. CoreSyntaxFactory;


/**
 * An LDAPd server-side provider implementation of a InitialContextFactory.
 * Can be utilized via JNDI API in the standard fashion:
 * <code>
 * Hashtable env = new Hashtable();
 * env.put( Context.PROVIDER_URL, "ou=system" );
 * env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.eve.jndi.EveContextFactory" );
 * InitialContext initialContext = new InitialContext( env );
 * </code>
 * @see javax.naming.spi.InitialContextFactory
 */
public class EveContextFactory implements InitialContextFactory
{
    /** The singleton EveJndiProvider instance */
    private EveJndiProvider provider = null;
    /** the initial context environment that fired up the backend subsystem */
    private Hashtable initialEnv;


    /**
     * Default constructor that sets the provider of this EveContextFactory.
     */
    public EveContextFactory()
    {
        EveJndiProvider.setProviderOn( this );
    }
    
    
    /**
     * Enables this EveContextFactory with a handle to the EveJndiProvider
     * singleton.
     * 
     * @param a_provider the system's singleton EveBackendSubsystem service.
     */
    void setProvider( EveJndiProvider a_provider )
    {
        provider = a_provider;
    }
    
    
    /**
     * @see javax.naming.spi.InitialContextFactory#getInitialContext(
     * java.util.Hashtable)
     */
    public Context getInitialContext( Hashtable env ) throws NamingException
    {
        // fire up the backend subsystem if we need to
        if ( null == provider )
        {
            this.initialEnv = env;
            throw new NotImplementedException();
        }
        
        return provider.getLdapContext( env );
    }


    private EveJndiProvider create( Hashtable env )
    {
        throw new NotImplementedException( "bootstrap code not yet written" );
    }
}
{'fraction_non_alphanumeric': 0.08509354254677128, 'fraction_numerical': 0.0, 'mean_word_length': 3.115894039735099, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6201959', 'n_tokens_mistral': 1407, 'n_tokens_neox': 1385, 'n_words': 349}