<!--
  ~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. licenses this file to you 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.
  -->

<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
    <providers>
        <provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
    </providers>

    <datasources>
        <datasource>
            <name>WSO2_CARBON_DB</name>
            <description>The datasource used for registry and user manager</description>
            <jndiConfig>
                <name>jdbc/WSO2CarbonDB</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE</url>
                    <username>wso2carbon</username>
                    <password>wso2carbon</password>
                    <driverClassName>org.h2.Driver</driverClassName>
                    <maxActive>50</maxActive>
                    <maxWait>60000</maxWait>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                </configuration>
            </definition>
        </datasource>

<!--        todo remove-->
<!--        <datasource>-->
<!--            <name>WSO2APPM_DB</name>-->
<!--            <description>The datasource used for App Manager database</description>-->
<!--            <jndiConfig>-->
<!--                <name>jdbc/WSO2APPM_DB</name>-->
<!--            </jndiConfig>-->
<!--            <definition type="RDBMS">-->
<!--                <configuration>-->
<!--                    <url>jdbc:h2:repository/database/WSO2APPM_DB;DB_CLOSE_ON_EXIT=FALSE</url>-->
<!--                    <username>wso2carbon</username>-->
<!--                    <password>wso2carbon</password>-->
<!--                    <driverClassName>org.h2.Driver</driverClassName>-->
<!--                    <maxActive>50</maxActive>-->
<!--                    <maxWait>60000</maxWait>-->
<!--                    <testOnBorrow>true</testOnBorrow>-->
<!--                    <validationQuery>SELECT 1</validationQuery>-->
<!--                    <validationInterval>30000</validationInterval>-->
<!--                </configuration>-->
<!--            </definition>-->
<!--        </datasource>-->

        <datasource>
            <name>WSO2AM_DB</name>
            <description>The datasource used for API Manager database</description>
            <jndiConfig>
                <name>jdbc/WSO2AM_DB</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:h2:repository/database/WSO2AM_DB;DB_CLOSE_ON_EXIT=FALSE</url>
                    <username>wso2carbon</username>
                    <password>wso2carbon</password>
                    <driverClassName>org.h2.Driver</driverClassName>
                    <maxActive>50</maxActive>
                    <maxWait>60000</maxWait>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                </configuration>
            </definition>
        </datasource>

        <datasource>
            <name>WSO2_MB_STORE_DB</name>
            <description>The datasource used for message broker database</description>
            <jndiConfig>
                <name>WSO2MBStoreDB</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:h2:repository/database/WSO2MB_DB;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000</url>
                    <username>wso2carbon</username>
                    <password>wso2carbon</password>
                    <driverClassName>org.h2.Driver</driverClassName>
                    <maxActive>50</maxActive>
                    <maxWait>60000</maxWait>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                    <defaultAutoCommit>false</defaultAutoCommit>
                </configuration>
            </definition>
        </datasource>
        <datasource>
            <name>JAGH2</name>
            <description>The datasource used for by the Jaggery Storage Manager</description>
            <jndiConfig>
                <name>jdbc/ES_Storage</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:h2:repository/database/ES_STORAGE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=60000</url>
                    <username>wso2carbon</username>
                    <password>wso2carbon</password>
                    <driverClassName>org.h2.Driver</driverClassName>
                    <maxActive>50</maxActive>
                    <maxWait>60000</maxWait>
                </configuration>
            </definition>
        </datasource>
<!--        todo remove-->
<!--        <datasource>-->
<!--            <name>WSO2_SOCIAL_DB</name>-->
<!--            <description>The datasource used for Store social database</description>-->
<!--            <jndiConfig>-->
<!--                <name>jdbc/WSO2_SOCIAL_DB</name>-->
<!--            </jndiConfig>-->
<!--            <definition type="RDBMS">-->
<!--                <configuration>-->
<!--                    <url>jdbc:h2:repository/database/WSO2_SOCIAL_DB;DB_CLOSE_ON_EXIT=FALSE</url>-->
<!--                    <username>wso2carbon</username>-->
<!--                    <password>wso2carbon</password>-->
<!--                    <driverClassName>org.h2.Driver</driverClassName>-->
<!--                    <maxActive>50</maxActive>-->
<!--                    <maxWait>60000</maxWait>-->
<!--                    <testOnBorrow>true</testOnBorrow>-->
<!--                    <validationQuery>SELECT 1</validationQuery>-->
<!--                    <validationInterval>30000</validationInterval>-->
<!--                </configuration>-->
<!--            </definition>-->
<!--        </datasource>-->
    </datasources>
</datasources-configuration>
