<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="spring-boot-to-azure-database" xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
    <metadata>
        <description>
            For any database, identify the connection string.
        </description>
        <dependencies>
            <addon id="org.jboss.windup.rules,windup-rules-xml,3.0.0.Final"/>
        </dependencies>
        <sourceTechnology id="springboot"/>
        <targetTechnology id="azure-appservice"/>
        <tag>database</tag>
    </metadata>
    <rules>
        <rule id="spring-boot-to-azure-database-jdbc-01000">
            <when>
                <filecontent filename="application{*}.{extensions}" pattern="jdbc:"/>
            </when>
            <perform>
                <hint category-id="information" effort="0" title="JDBC connection found in configuration file">
                    <message><![CDATA[
                        The application uses a JDBC connection string.

                        Checkout the different types of databases that are fully managed on Azure.
                        ]]></message>
                    <link href="https://docs.microsoft.com/azure/developer/java/migration/migrate-spring-boot-to-app-service#databases" title="JDBC connection string found in configuration file"/>
                    <link href="https://azure.microsoft.com/product-categories/databases/" title="Types of Databases on Azure"/>
                    <link href="https://docs.microsoft.com/azure/developer/java/spring-framework/configure-spring-data-jdbc-with-azure-mysql" title="Use Spring Data JDBC with Azure Database for MySQL"/>
                    <link href="https://docs.microsoft.com/azure/developer/java/spring-framework/configure-spring-data-jdbc-with-azure-postgresql" title="Use Spring Data JDBC with Azure Database for PostgreSQL"/>
                    <link href="https://docs.microsoft.com/azure/developer/java/spring-framework/configure-spring-data-jdbc-with-azure-sql-server" title="Use Spring Data JDBC with Azure SQL Database"/>
                    <tag>jdbc</tag>
                </hint>
            </perform>
            <where param="extensions">
                <matches pattern="(properties|yaml|yml)"/>
            </where>
        </rule>
        <rule id="spring-boot-to-azure-database-mongodb-02000">
            <when>
                <filecontent filename="application{*}.{extensions}" pattern="mongodb:"/>
            </when>
            <perform>
                <hint category-id="information" effort="0" title="MongoDB connection found in configuration file">
                    <message><![CDATA[
                        The application uses a MongoDB connection string.

                        Checkout the different types of databases that are fully managed on Azure.
                        ]]></message>
                    <link href="https://docs.microsoft.com/azure/developer/java/migration/migrate-spring-boot-to-app-service#databases" title="MongoDB connection string found in configuration file"/>
                    <link href="https://azure.microsoft.com/product-categories/databases/" title="Types of Databases on Azure"/>
                    <link href="https://docs.microsoft.com/azure/developer/java/spring-framework/configure-spring-data-mongodb-with-cosmos-db" title="How to use Spring Data MongoDB API with Azure Cosmos DB"/>
                    <link href="https://search.maven.org/artifact/com.azure.spring/spring-cloud-azure-starter-data-cosmos" title="Spring Cloud Azure Starter Data Cosmos DB"/>
                    <tag>mongodb</tag>
                </hint>
            </perform>
            <where param="extensions">
                <matches pattern="(properties|yaml|yml)"/>
            </where>
        </rule>
    </rules>
</ruleset>
