# Copyright 2017 WSO2 Inc. (http://wso2.org)
#
# 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.

# Data Sources Configurations for different databases.
wso2.datasources:
  # datasources
  dataSources:
    # Datasource configuration for H2 Database
    - name: WSO2_METRICS_DB
      description: The default datasource used for WSO2 Carbon Metrics
       # JNDI mapping of a data source
      jndiConfig:
        name: jdbc/WSO2MetricsDB
        # data source definition
      definition:
        # data source type
        type: RDBMS
        # data source configuration
        configuration:
          jdbcUrl: 'jdbc:h2:./database/metrics'
          username: wso2carbon
          password: wso2carbon
          driverClassName: org.h2.Driver
          maxPoolSize: 50
          idleTimeout: 60000
          connectionTestQuery: SELECT 1
          validationTimeout: 30000
          isAutoCommit: false

    # Datasource configuration for MySQL Database
    - name: WSO2_METRICS_DB
      description: The MySQL datasource used for WSO2 Carbon Metrics
      # JNDI mapping of a data source
      jndiConfig:
        name: jdbc/WSO2MetricsDB
      # data source definition
      definition:
        # data source type
        type: RDBMS
        # data source configuration
        configuration:
          jdbcUrl: 'jdbc:mysql://localhost/wso2_metrics'
          username: root
          password: root
          driverClassName: com.mysql.jdbc.Driver
          maxPoolSize: 50
          idleTimeout: 60000
          connectionTestQuery: SELECT 1
          validationTimeout: 30000
          isAutoCommit: false

    # Datasource configuration for Oracle Database
    - name: WSO2_METRICS_DB
      description: The Oracle datasource used for WSO2 Carbon Metrics
      jndiConfig:
        name: jdbc/WSO2MetricsDB
      # data source definition
      definition:
        # data source type
        type: RDBMS
        # data source configuration
        configuration:
          jdbcUrl: 'jdbc:oracle:thin:@localhost:1521/wso2_metrics'
          username: scott
          password: tiger
          driverClassName: oracle.jdbc.OracleDriver
          maxPoolSize: 50
          idleTimeout: 60000
          connectionTestQuery: SELECT 1 FROM DUAL
          validationTimeout: 30000
          isAutoCommit: false
          dataSourceProperties:
            - name: SetFloatAndDoubleUseBinary
              value: 'true'
