<?xml version="1.0" encoding="UTF-8"?>
<ruleset id="websphere-mqe-eap7" xmlns="http://windup.jboss.org/schema/jboss-ruleset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">

    <metadata>
        <description>
            Provides analysis of WebSphere MQ proprietary classes and configuration that may require individual attention when migrating to
            JBoss EAP 7+.
        </description>
        <dependencies>
            <addon id="org.jboss.windup.rules,windup-rules-javaee,2.7.0.Final" />
            <addon id="org.jboss.windup.rules,windup-rules-java,2.7.0.Final" />
        </dependencies>
        <sourceTechnology id="websphere" />
        <targetTechnology id="eap" versionRange="[7,8)" />
        <targetTechnology id="java-ee" versionRange="[7,)" />
        <tag>jms</tag>
        <tag>messaging</tag>
        <tag>websphere</tag>
    </metadata>

    <rules>
        <rule id="websphere-mqe-eap7-00000">
            <when>
                <javaclass references="{package}.{type}" />
            </when>
            <perform>
                <classification issue-display-mode="all" title="IBM MQe client API" effort="3" category-id="mandatory">
                    <description>WebSphere MQe client API is used to communicate with the MQ server from client-side applications.
                        For JBoss EAP 7, this needs to be replaced with standard Java EE 6 JMS API, or with ActiveMQ Artemis client API.
                    </description>
                    <link title="Java EE 7 JMS Tutorial" href="https://docs.oracle.com/javaee/7/tutorial/jms-concepts003.htm#BNCEH" />
                    <link title="WebSphere MQe JavaDoc" href="http://www-01.ibm.com/support/knowledgecenter/SSVHEW_6.2.0/com.ibm.mqe.javadoc/java/overview-summary.html" />
                    <tag>jms</tag>
                    <tag>websphere</tag>
                </classification>
            </perform>
            <where param="package">
                <matches pattern="com.ibm(\..*)?\.(mqe).*" />
            </where>
            <where param="type">
                <matches pattern="[^.]+" />
            </where>
        </rule>

        <rule id="websphere-mqe-eap7-01000">
            <when>
                <javaclass references="com.ibm.mqe.adapters.MQe{type}Adapter">
                    <location>INHERITANCE</location>
                </javaclass>
            </when>
            <perform>
                <hint title="IBM MQe com.ibm.mqe.adapters.MQe{type}Adapter" category-id="mandatory" effort="3">
                    <message>
                        IBM MQe {type} adapter provides plug-in communications adapters or data storage adapters for queue managers. These can
                        be deployed to JBoss EAP.
                    </message>
                    <link title="JBoss EAP 7 Configuring Messaging: Deploy a WebSphere MQ Resource Adapter"
                          href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/configuring_messaging/#deploy_the_websphere_mq_resource_adapter" />
                    <link title="MQe Adapter Javadoc"
                        href="http://www-01.ibm.com/support/knowledgecenter/SSVHEW_6.2.0/com.ibm.mqe.javadoc/java/com/ibm/mqe/adapters/package-summary.html" />
                    <tag>jms</tag>
                    <tag>messaging</tag>
                    <tag>websphere</tag>
                </hint>
            </perform>
        </rule>

        <rule id="websphere-mqe-eap7-02000">
            <when>
                <javaclass references="com.ibm.mqe.administration.MQe{type}AdminMsg">
                    <location>INHERITANCE</location>
                </javaclass>
            </when>
            <perform>
                <hint title="IBM MQe com.ibm.mqe.administration.MQe{type}AdminMsg" category-id="mandatory" effort="3">
                    <message>IBM MQe {type} administration API provides classes used to administer and monitor a WebSphere MQ Everyplace queue manager. In
                        JBoss EAP 7, the JMS destinations can be configured with the JBoss Admin CLI.
                    </message>
                    <link title="JBoss EAP 7 - Configuring Messaging Destinations"
                          href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/configuring_messaging/#configure_destinations_artemis" />
                    <link title="IBM MQe Admin API Javadoc"
                        href="http://www-01.ibm.com/support/knowledgecenter/SSVHEW_6.2.0/com.ibm.mqe.javadoc/java/com/ibm/mqe/administration/package-summary.html" />
                    <tag>jms</tag>
                    <tag>messaging</tag>
                    <tag>websphere</tag>
                </hint>
            </perform>
        </rule>

        <rule id="websphere-mqe-eap7-03000">
            <when>
                <javaclass references="com.ibm.mqe.jms.MQeJMSAuthenticator" />
            </when>
            <perform>
                <hint title="IBM MQe com.ibm.mqe.jms.MQeJMSAuthenticator" category-id="mandatory" effort="5">
                    <message>
                        `MQeJMSAuthenticator` is a WebSphere proprietary JMS authentication API.
                        To migrate to JBoss EAP 7, replace with Java EE 6 JAAS for JMS authentication.
                    </message>
                    <link title="JBoss EAP 7 Configuring Messaging: Configuring Security"
                          href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html-single/configuring_messaging/#configuring_messaging_security" />
                    <tag>jms</tag>
                    <tag>messaging</tag>
                    <tag>websphere</tag>
                </hint>
            </perform>
        </rule>

        <rule id="websphere-mqe-eap7-04000">
            <when>
                <javaclass references="com.ibm.mqe.jms.MQeJMSMsgFieldNames" />
            </when>
            <perform>
                <hint title="IBM MQe com.ibm.mqe.jms.MQeJMSMsgFieldNames" effort="1" category-id="optional">
                    <message>
                        IBM MQe constants are used to name fields when a JMS message is mapped to an `MQeMsgObject`. These are provided to
                        enable WebSphere MQ Everyplace applications to interpret messages sent by JMS or to construct messages that a JMS application
                        will understand.

                        These settings can be discarded when migrating to JBoss EAP 7 with ActiveMQ Artemis.
                    </message>
                    <tag>jms</tag>
                    <tag>messaging</tag>
                    <tag>websphere</tag>
                </hint>
            </perform>
        </rule>
    </rules>
</ruleset>
