<commit_before>package gov.nih.nci.cabig.caaers.tools;

import gov.nih.nci.cabig.ctms.tools.DataSourceSelfDiscoveringPropertiesFactoryBean;

/**
 * This class searches through the following directories, looking for a file named
 * ${databaseConfigurationName}.properties:
 * <ul>
 *   <li><kbd>${catalina.home}/conf/caaers</kbd></li>
 *   <li><kbd>${user.home}/.caaers</kbd></li>
 *   <li><kbd>/etc/caaers</kbd></li>
 * </ul>
 *
 * It loads this file and returns it when {@link #getObject} is called.
 *
 * @author <NAME>
 */
public class CaaersDataSourcePropertiesFactoryBean extends DataSourceSelfDiscoveringPropertiesFactoryBean {
    public static final String QUARTZ_DELEGATE_PROPERTY_NAME= "jdbc.quartz.delegateClassName";
    public static final String SCHEMA_PROPERTY_NAME = "datasource.schema";

    public CaaersDataSourcePropertiesFactoryBean() {
        setApplicationDirectoryName("caaers");
    }

    /**
     * Sets reasonable defaults for caAERS-specific properties
     */
    @Override
    protected void computeProperties() {
        String quartzDelegateClass = selectQuartzDelegateClass();
        if(quartzDelegateClass != null) properties.setProperty(QUARTZ_DELEGATE_PROPERTY_NAME, quartzDelegateClass);
        String schema = selectSchema();
        if(schema != null) properties.setProperty(SCHEMA_PROPERTY_NAME, schema);
        //properties.setProperty(RULES_REPO_PROPERTY_NAME, selectRepository());
    }

    /**
     * To determin the quartz delegate class to use
     * @return
     */
    private String selectQuartzDelegateClass(){
    	////hibernate for time being will use default (http://jira.opensymphony.com/browse/QUARTZ-560)<commit_msg>Default authentication mode is made as "local"<commit_after>package gov.nih.nci.cabig.caaers.tools;

import gov.nih.nci.cabig.ctms.tools.DataSourceSelfDiscoveringPropertiesFactoryBean;

/**
 * This class searches through the following directories, looking for a file named
 * ${databaseConfigurationName}.properties:
 * <ul>
 *   <li><kbd>${catalina.home}/conf/caaers</kbd></li>
 *   <li><kbd>${user.home}/.caaers</kbd></li>
 *   <li><kbd>/etc/caaers</kbd></li>
 * </ul>
 *
 * It loads this file and returns it when {@link #getObject} is called.
 *
 * @author <NAME>
 */
public class CaaersDataSourcePropertiesFactoryBean extends DataSourceSelfDiscoveringPropertiesFactoryBean {
    public static final String QUARTZ_DELEGATE_PROPERTY_NAME= "jdbc.quartz.delegateClassName";
    public static final String SCHEMA_PROPERTY_NAME = "datasource.schema";
    public static final String AUTH_MODE_PROPERTY_NAME = "authenticationMode";

    public CaaersDataSourcePropertiesFactoryBean() {
        setApplicationDirectoryName("caaers");
    }

    /**
     * Sets reasonable defaults for caAERS-specific properties
     */
    @Override
    protected void computeProperties() {
        String quartzDelegateClass = selectQuartzDelegateClass();
        if(quartzDelegateClass != null) properties.setProperty(QUARTZ_DELEGATE_PROPERTY_NAME, quartzDelegateClass);
        String schema = selectSchema();
        if(schema != null) properties.setProperty(SCHEMA_PROPERTY_NAME, schema);
        if(properties.getProperty(AUTH_MODE_PROPERTY_NAME) == null) properties.setProperty(AUTH_MODE_PROPERTY_NAME, "local");
    }

    /**
     * To determin the quartz delegate class to use
     * @return
     */
    private String selectQuartzDelegateClass(){
    	////hibernate for time being will use default (http://jira.opensymphony.com/browse/QUARTZ-560)
{'fraction_non_alphanumeric': 0.11013090495162209, 'fraction_numerical': 0.001707455890722823, 'mean_word_length': 4.230654761904762, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '5837369', 'n_tokens_mistral': 1057, 'n_tokens_neox': 1026, 'n_words': 217}