<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2012 SURFnet bv, The Netherlands Licensed under the Apache 
  License, Version 2.0 (the "License"); you may not use this file except in 
  compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
  Unless required by applicable law or agreed to in writing, software distributed 
  under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 
  OR CONDITIONS OF ANY KIND, either express or implied. See the License for 
  the specific language governing permissions and limitations under the License. -->

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:cache="http://www.springframework.org/schema/cache"
  xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">


  <context:component-scan base-package="nl.surfnet.coin.selfservice" />
  <cache:annotation-driven key-generator="methodNameAwareCacheKeyGenerator" />

  <!-- Our "own" database for tracking connect/disconnect requests -->
  <bean id="selfserviceDataSource" class="com.jolbox.bonecp.BoneCPDataSource"
    destroy-method="close">
    <property name="driverClass" value="${coin-selfservice.jdbc.driver}" />
    <property name="jdbcUrl" value="${coin-selfservice.jdbc.url}" />
    <property name="username" value="${coin-selfservice.jdbc.user}" />
    <property name="password" value="${coin-selfservice.jdbc.password}" />
    <property name="idleConnectionTestPeriodInSeconds"
      value="${coin-selfservice.database.idleConnectionTestPeriod}" />
    <property name="idleMaxAgeInSeconds" value="${coin-selfservice.database.maxIdleTime}" />
    <property name="maxConnectionsPerPartition" value="20" />
    <property name="minConnectionsPerPartition" value="2" />
    <property name="partitionCount" value="3" />
    <property name="acquireIncrement" value="2" />
    <property name="statementsCacheSize" value="100" />
    <property name="releaseHelperThreads" value="3" />
    <property name="acquireRetryAttempts" value="15" />
  </bean>

  <!-- The api database for oauth keys -->
  <bean id="apiDataSource" class="com.jolbox.bonecp.BoneCPDataSource"
    destroy-method="close">
    <property name="driverClass" value="${coin-api.jdbc.driver}" />
    <property name="jdbcUrl" value="${coin-api.jdbc.url}" />
    <property name="username" value="${coin-api.jdbc.user}" />
    <property name="password" value="${<PASSWORD>}" />
    <property name="idleConnectionTestPeriodInSeconds"
      value="${coin-selfservice.database.idleConnectionTestPeriod}" />
    <property name="idleMaxAgeInSeconds" value="${coin-selfservice.database.maxIdleTime}" />
    <property name="maxConnectionsPerPartition" value="20" />
    <property name="minConnectionsPerPartition" value="2" />
    <property name="partitionCount" value="3" />
    <property name="acquireIncrement" value="2" />
    <property name="statementsCacheSize" value="100" />
    <property name="releaseHelperThreads" value="3" />
    <property name="acquireRetryAttempts" value="15" />
  </bean>

  <!-- API and selfservice share the same datasource -->
  <bean id="apiJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <constructor-arg ref="apiDataSource" />
  </bean>

  <!-- We go to EB for statistics and consent checks -->
  <bean id="ebDataSource" class="com.jolbox.bonecp.BoneCPDataSource"
    destroy-method="close">
    <property name="driverClass" value="${coin-eb-db-driver}" />
    <property name="jdbcUrl" value="${coin-eb-db-url}" />
    <property name="username" value="${coin-eb-db-username}" />
    <property name="password" value="${coin-eb-db-password}" />
    <property name="idleConnectionTestPeriodInSeconds"
      value="${coin-selfservice.database.idleConnectionTestPeriod}" />
    <property name="idleMaxAgeInSeconds" value="${coin-selfservice.database.maxIdleTime}" />
    <property name="maxConnectionsPerPartition" value="20" />
    <property name="minConnectionsPerPartition" value="2" />
    <property name="partitionCount" value="3" />
    <property name="acquireIncrement" value="2" />
    <property name="statementsCacheSize" value="100" />
    <property name="releaseHelperThreads" value="3" />
    <property name="acquireRetryAttempts" value="15" />
  </bean>

  <bean id="ebJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <constructor-arg ref="ebDataSource" />
  </bean>

  <!-- shindigDataStore is to fetch OAuth keys for SPs that use os.surfconext.nl -->
  <bean id="shindigDataSource" class="com.jolbox.bonecp.BoneCPDataSource"
    destroy-method="close">
    <property name="driverClass" value="${coin-shindig-db-driver}" />
    <property name="jdbcUrl" value="${coin-shindig-db-url}" />
    <property name="username" value="${coin-shindig-db-username}" />
    <property name="password" value="${coin-shindig-db-password}" />
    <property name="idleConnectionTestPeriodInSeconds"
      value="${coin-selfservice.database.idleConnectionTestPeriod}" />
    <property name="idleMaxAgeInSeconds" value="${coin-selfservice.database.maxIdleTime}" />
    <property name="maxConnectionsPerPartition" value="20" />
    <property name="minConnectionsPerPartition" value="2" />
    <property name="partitionCount" value="3" />
    <property name="acquireIncrement" value="2" />
    <property name="statementsCacheSize" value="100" />
    <property name="releaseHelperThreads" value="3" />
    <property name="acquireRetryAttempts" value="15" />
  </bean>

  <bean id="shindigJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <constructor-arg ref="shindigDataSource" />
  </bean>

  <bean id="log4jInitialization"
    class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetClass" value="org.springframework.util.Log4jConfigurer" />
    <property name="targetMethod" value="initLogging" />
    <property name="arguments">
      <list>
        <value>classpath:log4j.xml</value>
        <value>5000</value>
      </list>
    </property>
  </bean>

  <bean id="localeResolver"
    class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
    <!-- Set the default Locale to English -->
    <property name="defaultLocale" value="en_EN" />
  </bean>

  <bean class="com.googlecode.flyway.core.Flyway" init-method="migrate">
    <property name="baseDir" value="${coin-selfservice.db.migrations.folder}" />
    <property name="dataSource" ref="selfserviceDataSource" />
    <property name="disableInitCheck" value="true" /><!-- skip because Hibernate creates its own table -->
  </bean>
<commit_msg>locale: use the localeresolver from coin-selfservice-servlet.xml (a cookie-one instead of a session-one)<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2012 SURFnet bv, The Netherlands Licensed under the Apache 
  License, Version 2.0 (the "License"); you may not use this file except in 
  compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
  Unless required by applicable law or agreed to in writing, software distributed 
  under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 
  OR CONDITIONS OF ANY KIND, either express or implied. See the License for 
  the specific language governing permissions and limitations under the License. -->

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:cache="http://www.springframework.org/schema/cache"
  xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">


  <context:component-scan base-package="nl.surfnet.coin.selfservice" />
  <cache:annotation-driven key-generator="methodNameAwareCacheKeyGenerator" />

  <!-- Our "own" database for tracking connect/disconnect requests -->
  <bean id="selfserviceDataSource" class="com.jolbox.bonecp.BoneCPDataSource"
    destroy-method="close">
    <property name="driverClass" value="${coin-selfservice.jdbc.driver}" />
    <property name="jdbcUrl" value="${coin-selfservice.jdbc.url}" />
    <property name="username" value="${coin-selfservice.jdbc.user}" />
    <property name="password" value="${coin-selfservice.jdbc.password}" />
    <property name="idleConnectionTestPeriodInSeconds"
      value="${coin-selfservice.database.idleConnectionTestPeriod}" />
    <property name="idleMaxAgeInSeconds" value="${coin-selfservice.database.maxIdleTime}" />
    <property name="maxConnectionsPerPartition" value="20" />
    <property name="minConnectionsPerPartition" value="2" />
    <property name="partitionCount" value="3" />
    <property name="acquireIncrement" value="2" />
    <property name="statementsCacheSize" value="100" />
    <property name="releaseHelperThreads" value="3" />
    <property name="acquireRetryAttempts" value="15" />
  </bean>

  <!-- The api database for oauth keys -->
  <bean id="apiDataSource" class="com.jolbox.bonecp.BoneCPDataSource"
    destroy-method="close">
    <property name="driverClass" value="${coin-api.jdbc.driver}" />
    <property name="jdbcUrl" value="${coin-api.jdbc.url}" />
    <property name="username" value="${coin-api.jdbc.user}" />
    <property name="password" value="${coin-api.jdbc.password}" />
    <property name="idleConnectionTestPeriodInSeconds"
      value="${coin-selfservice.database.idleConnectionTestPeriod}" />
    <property name="idleMaxAgeInSeconds" value="${coin-selfservice.database.maxIdleTime}" />
    <property name="maxConnectionsPerPartition" value="20" />
    <property name="minConnectionsPerPartition" value="2" />
    <property name="partitionCount" value="3" />
    <property name="acquireIncrement" value="2" />
    <property name="statementsCacheSize" value="100" />
    <property name="releaseHelperThreads" value="3" />
    <property name="acquireRetryAttempts" value="15" />
  </bean>

  <!-- API and selfservice share the same datasource -->
  <bean id="apiJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <constructor-arg ref="apiDataSource" />
  </bean>

  <!-- We go to EB for statistics and consent checks -->
  <bean id="ebDataSource" class="com.jolbox.bonecp.BoneCPDataSource"
    destroy-method="close">
    <property name="driverClass" value="${coin-eb-db-driver}" />
    <property name="jdbcUrl" value="${coin-eb-db-url}" />
    <property name="username" value="${coin-eb-db-username}" />
    <property name="password" value="${coin-eb-db-password}" />
    <property name="idleConnectionTestPeriodInSeconds"
      value="${coin-selfservice.database.idleConnectionTestPeriod}" />
    <property name="idleMaxAgeInSeconds" value="${coin-selfservice.database.maxIdleTime}" />
    <property name="maxConnectionsPerPartition" value="20" />
    <property name="minConnectionsPerPartition" value="2" />
    <property name="partitionCount" value="3" />
    <property name="acquireIncrement" value="2" />
    <property name="statementsCacheSize" value="100" />
    <property name="releaseHelperThreads" value="3" />
    <property name="acquireRetryAttempts" value="15" />
  </bean>

  <bean id="ebJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <constructor-arg ref="ebDataSource" />
  </bean>

  <!-- shindigDataStore is to fetch OAuth keys for SPs that use os.surfconext.nl -->
  <bean id="shindigDataSource" class="com.jolbox.bonecp.BoneCPDataSource"
    destroy-method="close">
    <property name="driverClass" value="${coin-shindig-db-driver}" />
    <property name="jdbcUrl" value="${coin-shindig-db-url}" />
    <property name="username" value="${coin-shindig-db-username}" />
    <property name="password" value="${<PASSWORD>}" />
    <property name="idleConnectionTestPeriodInSeconds"
      value="${coin-selfservice.database.idleConnectionTestPeriod}" />
    <property name="idleMaxAgeInSeconds" value="${coin-selfservice.database.maxIdleTime}" />
    <property name="maxConnectionsPerPartition" value="20" />
    <property name="minConnectionsPerPartition" value="2" />
    <property name="partitionCount" value="3" />
    <property name="acquireIncrement" value="2" />
    <property name="statementsCacheSize" value="100" />
    <property name="releaseHelperThreads" value="3" />
    <property name="acquireRetryAttempts" value="15" />
  </bean>

  <bean id="shindigJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <constructor-arg ref="shindigDataSource" />
  </bean>

  <bean id="log4jInitialization"
    class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetClass" value="org.springframework.util.Log4jConfigurer" />
    <property name="targetMethod" value="initLogging" />
    <property name="arguments">
      <list>
        <value>classpath:log4j.xml</value>
        <value>5000</value>
      </list>
    </property>
  </bean>

  <bean class="com.googlecode.flyway.core.Flyway" init-method="migrate">
    <property name="baseDir" value="${coin-selfservice.db.migrations.folder}" />
    <property name="dataSource" ref="selfserviceDataSource" />
    <property name="disableInitCheck" value="true" /><!-- skip because Hibernate creates its own table -->
  </bean>

{'fraction_non_alphanumeric': 0.15769957321765898, 'fraction_numerical': 0.009795004547680683, 'mean_word_length': 4.6565096952908585, 'pattern_counts': {'":': 0, '<': 203, '<?xml version=': 2, '>': 203, 'https://': 0, 'lorem ipsum': 0, 'www.': 28, 'xml': 15}, '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': '3316476', 'n_tokens_mistral': 4284, 'n_tokens_neox': 4151, 'n_words': 778}