diff --git a/migrations/eap7.4/eap6.4/src/main/java/org/jboss/migration/eap6/to/eap8/tasks/EAP6_4ToEAP7_4UpdateJGroupsSubsystem.java b/migrations/eap7.4/eap6.4/src/main/java/org/jboss/migration/eap6/to/eap8/tasks/EAP6_4ToEAP7_4UpdateJGroupsSubsystem.java index 8d818af93..66ae01150 100644 --- a/migrations/eap7.4/eap6.4/src/main/java/org/jboss/migration/eap6/to/eap8/tasks/EAP6_4ToEAP7_4UpdateJGroupsSubsystem.java +++ b/migrations/eap7.4/eap6.4/src/main/java/org/jboss/migration/eap6/to/eap8/tasks/EAP6_4ToEAP7_4UpdateJGroupsSubsystem.java @@ -17,6 +17,7 @@ package org.jboss.migration.eap6.to.eap8.tasks; import org.jboss.migration.core.jboss.JBossSubsystemNames; +import org.jboss.migration.eap.task.subsystem.jgroups.FixPortRange; import org.jboss.migration.wfly10.config.task.management.subsystem.UpdateSubsystemResources; import org.jboss.migration.wfly10.config.task.subsystem.jgroups.UpdateProtocols; @@ -33,6 +34,8 @@ public EAP6_4ToEAP7_4UpdateJGroupsSubsystem() { .replace("UNICAST2", "UNICAST3") .remove("RSVP") .replace("FRAG2", "FRAG3") - )); + ), + new FixPortRange<>() + ); } } diff --git a/migrations/eap8.0/eap7.0/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_0ToEAP8_0ServerMigrationProvider.java b/migrations/eap8.0/eap7.0/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_0ToEAP8_0ServerMigrationProvider.java index a50644836..122437ab0 100644 --- a/migrations/eap8.0/eap7.0/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_0ToEAP8_0ServerMigrationProvider.java +++ b/migrations/eap8.0/eap7.0/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_0ToEAP8_0ServerMigrationProvider.java @@ -63,7 +63,6 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(legacySecurityConfigurationMigration.getRemoveLegacySecurityRealms()) .subtask(new EAP7_0ToEAP8_0UpdateInfinispanSubsystem<>()) .subtask(new EAP7_0ToEAP8_0UpdateUndertowSubsystem<>()) - .subtask(new EAP7_0ToEAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getEnsureBasicElytronSubsystem()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityRealmsToElytron()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityDomainsToElytron()) @@ -89,7 +88,6 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(new EAP8_0AddHostExcludes<>()) .subtask(new EAP7_0ToEAP8_0UpdateInfinispanSubsystem<>()) .subtask(new EAP7_0ToEAP8_0UpdateUndertowSubsystem<>()) - .subtask(new EAP7_0ToEAP8_0UpdateJGroupsSubsystem<>()) .subtask(new AddCoreManagementSubsystem<>()) .subtask(new AddDiscoverySubsystem<>()) .subtask(new AddEESecuritySubsystem<>()) diff --git a/migrations/eap8.0/eap7.0/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_0ToEAP8_0UpdateJGroupsSubsystem.java b/migrations/eap8.0/eap7.0/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_0ToEAP8_0UpdateJGroupsSubsystem.java deleted file mode 100644 index 09335cb58..000000000 --- a/migrations/eap8.0/eap7.0/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_0ToEAP8_0UpdateJGroupsSubsystem.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. - * - * 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. - */ - -package org.jboss.migration.eap7.to.eap8; - -import org.jboss.migration.core.jboss.JBossSubsystemNames; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2AddFDSockProtocolOperation; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2AddPingMPingProtocolOperation; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2MoveTcpPingTimeoutOperation; -import org.jboss.migration.wfly10.config.task.management.subsystem.UpdateSubsystemResources; -import org.jboss.migration.wfly10.config.task.subsystem.jgroups.UpdateProtocols; - -/** - * @author emmartins - */ -public class EAP7_0ToEAP8_0UpdateJGroupsSubsystem extends UpdateSubsystemResources { - public EAP7_0ToEAP8_0UpdateJGroupsSubsystem() { - super(JBossSubsystemNames.JGROUPS, - new UpdateProtocols<>(new UpdateProtocols.Operations() - .remove("PING") - .remove("MPING") - .remove("MERGE3") - .remove("FD_SOCK") - .remove("FD_ALL") - .remove("FD") - .remove("VERIFY_SUSPECT") - .remove("pbcast.NAKACK2") - .remove("UNICAST3") - .remove("pbcast.STABLE") - .remove("pbcast.GMS") - .remove("UFC") - .remove("MFC") - .remove("FRAG2") - .add("RED") - .custom(new EAP7_2AddPingMPingProtocolOperation()) - .add("MERGE3") - .custom(new EAP7_2AddFDSockProtocolOperation("FD_SOCK2")) - .add("FD_ALL3") - .add("VERIFY_SUSPECT2") - .add("pbcast.NAKACK2") - .add("UNICAST3") - .add("pbcast.STABLE") - .add("pbcast.GMS") - .add("UFC") - .add("MFC") - .add("FRAG4") - .custom(new EAP7_2MoveTcpPingTimeoutOperation()) - )); - } -} diff --git a/migrations/eap8.0/eap7.1/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_1ToEAP8_0ServerMigrationProvider.java b/migrations/eap8.0/eap7.1/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_1ToEAP8_0ServerMigrationProvider.java index a5728878d..25a7ee1a7 100644 --- a/migrations/eap8.0/eap7.1/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_1ToEAP8_0ServerMigrationProvider.java +++ b/migrations/eap8.0/eap7.1/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_1ToEAP8_0ServerMigrationProvider.java @@ -63,7 +63,6 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(new EAP7_1ToEAP8_0UpdateInfinispanSubsystem<>()) .subtask(new EAP7_1ToEAP8_0UpdateUndertowSubsystem<>()) .subtask(new AddJGroupsFDSocketBindings<>()) - .subtask(new EAP7_1ToEAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getEnsureBasicElytronSubsystem()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityRealmsToElytron()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityDomainsToElytron()) @@ -87,7 +86,6 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(new EAP7_1ToEAP8_0UpdateInfinispanSubsystem<>()) .subtask(new EAP7_1ToEAP8_0UpdateUndertowSubsystem<>()) .subtask(new AddJGroupsFDSocketBindings<>()) - .subtask(new EAP7_1ToEAP8_0UpdateJGroupsSubsystem<>()) .subtask(new AddDiscoverySubsystem<>()) .subtask(new AddEESecuritySubsystem<>()) .subtask(new EAP8_0AddHostExcludes<>()) diff --git a/migrations/eap8.0/eap7.1/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_1ToEAP8_0UpdateJGroupsSubsystem.java b/migrations/eap8.0/eap7.1/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_1ToEAP8_0UpdateJGroupsSubsystem.java deleted file mode 100644 index aa37ddb2a..000000000 --- a/migrations/eap8.0/eap7.1/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_1ToEAP8_0UpdateJGroupsSubsystem.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. - * - * 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. - */ - -package org.jboss.migration.eap7.to.eap8; - -import org.jboss.migration.core.jboss.JBossSubsystemNames; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2MoveTcpPingTimeoutOperation; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2AddFDSockProtocolOperation; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2AddPingMPingProtocolOperation; -import org.jboss.migration.wfly10.config.task.management.subsystem.UpdateSubsystemResources; -import org.jboss.migration.wfly10.config.task.subsystem.jgroups.UpdateProtocols; - -/** - * @author emmartins - */ -public class EAP7_1ToEAP8_0UpdateJGroupsSubsystem extends UpdateSubsystemResources { - public EAP7_1ToEAP8_0UpdateJGroupsSubsystem() { - super(JBossSubsystemNames.JGROUPS, - new UpdateProtocols<>(new UpdateProtocols.Operations() - .remove("PING") - .remove("MPING") - .remove("MERGE3") - .remove("FD_SOCK") - .remove("FD_ALL") - .remove("VERIFY_SUSPECT") - .remove("pbcast.NAKACK2") - .remove("UNICAST3") - .remove("pbcast.STABLE") - .remove("pbcast.GMS") - .remove("UFC") - .remove("MFC") - .remove("FRAG2") - .add("RED") - .custom(new EAP7_2AddPingMPingProtocolOperation()) - .add("MERGE3") - .custom(new EAP7_2AddFDSockProtocolOperation("FD_SOCK2")) - .add("FD_ALL3") - .add("VERIFY_SUSPECT2") - .add("pbcast.NAKACK2") - .add("UNICAST3") - .add("pbcast.STABLE") - .add("pbcast.GMS") - .add("UFC") - .add("MFC") - .add("FRAG4") - .custom(new EAP7_2MoveTcpPingTimeoutOperation()) - )); - } -} diff --git a/migrations/eap8.0/eap7.2/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_2ToEAP8_0ServerMigrationProvider.java b/migrations/eap8.0/eap7.2/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_2ToEAP8_0ServerMigrationProvider.java index cd06a66bb..e88dcebf8 100644 --- a/migrations/eap8.0/eap7.2/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_2ToEAP8_0ServerMigrationProvider.java +++ b/migrations/eap8.0/eap7.2/src/main/java/org/jboss/migration/eap7/to/eap8/EAP7_2ToEAP8_0ServerMigrationProvider.java @@ -19,7 +19,6 @@ import org.jboss.migration.eap.EAPServer7_2; import org.jboss.migration.eap.EAPServerMigrationProvider8_0; import org.jboss.migration.eap.task.hostexclude.EAP8_0AddHostExcludes; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2ToEAP8_0UpdateJGroupsSubsystem; import org.jboss.migration.eap.task.subsystem.metrics.EAP8_0AddMetricsSubsystem; import org.jboss.migration.wfly.task.paths.WildFly26_0MigrateReferencedPaths; import org.jboss.migration.wfly.task.security.LegacySecurityConfigurationMigration; @@ -61,7 +60,6 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(new WildFly22_0UpdateInfinispanSubsystem<>()) .subtask(new WildFly26_0MigrateVault<>()) .subtask(new AddJGroupsFDSocketBindings<>()) - .subtask(new EAP7_2ToEAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getEnsureBasicElytronSubsystem()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityRealmsToElytron()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityDomainsToElytron()) @@ -80,7 +78,6 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(new MigrateReferencedModules<>()) .subtask(new WildFly26_0MigrateReferencedPaths<>()) .subtask(new AddJGroupsFDSocketBindings<>()) - .subtask(new EAP7_2ToEAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getRemoveLegacySecurityRealms()) .subtask(new WildFly22_0UpdateInfinispanSubsystem<>()) .subtask(new EAP8_0AddHostExcludes<>()) diff --git a/migrations/eap8.0/eap7.3/src/main/java/org/jboss/migration/eap7/to/eap7/EAP7_3ToEAP8_0ServerMigrationProvider.java b/migrations/eap8.0/eap7.3/src/main/java/org/jboss/migration/eap7/to/eap7/EAP7_3ToEAP8_0ServerMigrationProvider.java index 4b61fc538..a1184c4bc 100644 --- a/migrations/eap8.0/eap7.3/src/main/java/org/jboss/migration/eap7/to/eap7/EAP7_3ToEAP8_0ServerMigrationProvider.java +++ b/migrations/eap8.0/eap7.3/src/main/java/org/jboss/migration/eap7/to/eap7/EAP7_3ToEAP8_0ServerMigrationProvider.java @@ -19,7 +19,6 @@ import org.jboss.migration.eap.EAPServer7_3; import org.jboss.migration.eap.EAPServerMigrationProvider8_0; import org.jboss.migration.eap.task.hostexclude.EAP8_0AddHostExcludes; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2ToEAP8_0UpdateJGroupsSubsystem; import org.jboss.migration.eap.task.subsystem.metrics.EAP8_0AddMetricsSubsystem; import org.jboss.migration.wfly.task.paths.WildFly26_0MigrateReferencedPaths; import org.jboss.migration.wfly.task.security.LegacySecurityConfigurationMigration; @@ -58,7 +57,6 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(legacySecurityConfigurationMigration.getRemoveLegacySecurityRealms()) .subtask(new WildFly22_0UpdateInfinispanSubsystem<>()) .subtask(new WildFly26_0MigrateVault<>()) - .subtask(new EAP7_2ToEAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getEnsureBasicElytronSubsystem()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityRealmsToElytron()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityDomainsToElytron()) @@ -79,7 +77,6 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(legacySecurityConfigurationMigration.getRemoveLegacySecurityRealms()) .subtask(new WildFly22_0UpdateInfinispanSubsystem<>()) .subtask(new EAP8_0AddHostExcludes<>()) - .subtask(new EAP7_2ToEAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getEnsureBasicElytronSubsystem()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityRealmsToElytron()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityDomainsToElytron()) diff --git a/migrations/eap8.0/eap7.4/src/main/java/org/jboss/migration/eap7/to/eap7/EAP7_4ToEAP8_0ServerMigrationProvider.java b/migrations/eap8.0/eap7.4/src/main/java/org/jboss/migration/eap7/to/eap7/EAP7_4ToEAP8_0ServerMigrationProvider.java index 773091fe0..671c7ff2c 100644 --- a/migrations/eap8.0/eap7.4/src/main/java/org/jboss/migration/eap7/to/eap7/EAP7_4ToEAP8_0ServerMigrationProvider.java +++ b/migrations/eap8.0/eap7.4/src/main/java/org/jboss/migration/eap7/to/eap7/EAP7_4ToEAP8_0ServerMigrationProvider.java @@ -19,7 +19,7 @@ import org.jboss.migration.eap.EAPServer7_4; import org.jboss.migration.eap.EAPServerMigrationProvider8_0; import org.jboss.migration.eap.task.hostexclude.EAP8_0AddHostExcludes; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2ToEAP8_0UpdateJGroupsSubsystem; +import org.jboss.migration.eap.task.subsystem.jgroups.EAP8_0UpdateJGroupsSubsystem; import org.jboss.migration.wfly.task.paths.WildFly26_0MigrateReferencedPaths; import org.jboss.migration.wfly.task.security.LegacySecurityConfigurationMigration; import org.jboss.migration.wfly.task.subsystem.keycloak.MigrateKeycloakSubsystem; @@ -53,7 +53,7 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(new WildFly26_0MigrateReferencedPaths<>()) .subtask(legacySecurityConfigurationMigration.getRemoveLegacySecurityRealms()) .subtask(new WildFly26_0MigrateVault<>()) - .subtask(new EAP7_2ToEAP8_0UpdateJGroupsSubsystem<>()) + .subtask(new EAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getEnsureBasicElytronSubsystem()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityRealmsToElytron()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityDomainsToElytron()) @@ -71,7 +71,7 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(new WildFly26_0MigrateReferencedPaths<>()) .subtask(legacySecurityConfigurationMigration.getRemoveLegacySecurityRealms()) .subtask(new EAP8_0AddHostExcludes<>()) - .subtask(new EAP7_2ToEAP8_0UpdateJGroupsSubsystem<>()) + .subtask(new EAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getEnsureBasicElytronSubsystem()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityRealmsToElytron()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityDomainsToElytron()) diff --git a/migrations/eap8.0/eap7.4/src/main/java/org/jboss/migration/eap7/to/eap7/EAPXP7_4ToEAPXP8_0ServerMigrationProvider.java b/migrations/eap8.0/eap7.4/src/main/java/org/jboss/migration/eap7/to/eap7/EAPXP7_4ToEAPXP8_0ServerMigrationProvider.java index 0c528feb7..cf3a376c5 100644 --- a/migrations/eap8.0/eap7.4/src/main/java/org/jboss/migration/eap7/to/eap7/EAPXP7_4ToEAPXP8_0ServerMigrationProvider.java +++ b/migrations/eap8.0/eap7.4/src/main/java/org/jboss/migration/eap7/to/eap7/EAPXP7_4ToEAPXP8_0ServerMigrationProvider.java @@ -19,7 +19,7 @@ import org.jboss.migration.eap.EAPXPServer7_4; import org.jboss.migration.eap.EAPXPServerMigrationProvider8_0; import org.jboss.migration.eap.task.hostexclude.EAPXP8_0AddHostExcludes; -import org.jboss.migration.eap.task.subsystem.jgroups.EAP7_2ToEAP8_0UpdateJGroupsSubsystem; +import org.jboss.migration.eap.task.subsystem.jgroups.EAP8_0UpdateJGroupsSubsystem; import org.jboss.migration.eap.task.subsystem.metrics.MigrateMicroprofileMetricsSmallryeSubsystem; import org.jboss.migration.eap.task.subsystem.opentracing.MigrateMicroprofileOpentracingSmallryeSubsystem; import org.jboss.migration.wfly.task.paths.WildFly26_0MigrateReferencedPaths; @@ -56,7 +56,7 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(new WildFly26_0MigrateReferencedPaths<>()) .subtask(legacySecurityConfigurationMigration.getRemoveLegacySecurityRealms()) .subtask(new WildFly26_0MigrateVault<>()) - .subtask(new EAP7_2ToEAP8_0UpdateJGroupsSubsystem<>()) + .subtask(new EAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getEnsureBasicElytronSubsystem()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityRealmsToElytron()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityDomainsToElytron()) @@ -76,7 +76,7 @@ public WildFlyServerMigration10 getServerMigration() { .subtask(new WildFly26_0MigrateReferencedPaths<>()) .subtask(legacySecurityConfigurationMigration.getRemoveLegacySecurityRealms()) .subtask(new EAPXP8_0AddHostExcludes<>()) - .subtask(new EAP7_2ToEAP8_0UpdateJGroupsSubsystem<>()) + .subtask(new EAP8_0UpdateJGroupsSubsystem<>()) .subtask(legacySecurityConfigurationMigration.getEnsureBasicElytronSubsystem()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityRealmsToElytron()) .subtask(legacySecurityConfigurationMigration.getMigrateLegacySecurityDomainsToElytron()) diff --git a/servers/eap7.2/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP7_2AddFDSockProtocolOperation.java b/servers/eap7.2/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP7_2AddFDSockProtocolOperation.java deleted file mode 100644 index 67b3786e1..000000000 --- a/servers/eap7.2/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP7_2AddFDSockProtocolOperation.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2023 Red Hat, Inc. - * - * 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. - */ -package org.jboss.migration.eap.task.subsystem.jgroups; - -import org.jboss.dmr.ModelNode; -import org.jboss.migration.core.task.TaskContext; -import org.jboss.migration.wfly10.config.task.subsystem.jgroups.UpdateProtocols; - -/** - * Jgroups add protocol's Operation to add FD_SOCK/FD_SOCK2 and relevant socket-binding based on the stack name. - * @author istudens - */ -public class EAP7_2AddFDSockProtocolOperation implements UpdateProtocols.Operation { - - private static final String UDP_STACK = "udp"; - private static final String TCP_STACK = "tcp"; - private static final String SOCKET_BINDING = "socket-binding"; - private static final String JGROUPS_UDP_FD = "jgroups-udp-fd"; - private static final String JGROUPS_TCP_FD = "jgroups-tcp-fd"; - - private String newProtocol; - - public EAP7_2AddFDSockProtocolOperation(String newProtocol) { - this.newProtocol = newProtocol; - } - - @Override - public void execute(UpdateProtocols.ProtocolStack protocolStack, TaskContext context) { - final ModelNode mPingValue = new ModelNode(); - if (UDP_STACK.equals(protocolStack.getName())) { - mPingValue.get(SOCKET_BINDING).set(JGROUPS_UDP_FD); - } else if (TCP_STACK.equals(protocolStack.getName())) { - mPingValue.get(SOCKET_BINDING).set(JGROUPS_TCP_FD); - } - protocolStack.add(newProtocol, mPingValue); - } -} diff --git a/servers/eap7.2/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP7_2AddPingMPingProtocolOperation.java b/servers/eap7.2/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP7_2AddPingMPingProtocolOperation.java deleted file mode 100644 index 1c0350e2e..000000000 --- a/servers/eap7.2/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP7_2AddPingMPingProtocolOperation.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2023 Red Hat, Inc. - * - * 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. - */ -package org.jboss.migration.eap.task.subsystem.jgroups; - -import org.jboss.dmr.ModelNode; -import org.jboss.migration.core.task.TaskContext; -import org.jboss.migration.wfly10.config.task.subsystem.jgroups.UpdateProtocols; - -/** - * Jgroups add protocol's Operation to add PING/MPING and relevant socket-binding based on the stack name. - * @author istudens - */ -public class EAP7_2AddPingMPingProtocolOperation implements UpdateProtocols.Operation { - - private static final String UDP_PROTOCOL = "PING"; - private static final String TCP_PROTOCOL = "MPING"; - private static final String UDP_STACK = "udp"; - private static final String TCP_STACK = "tcp"; - private static final String SOCKET_BINDING = "socket-binding"; - private static final String JGROUPS_MPING = "jgroups-mping"; - - @Override - public void execute(UpdateProtocols.ProtocolStack protocolStack, TaskContext context) { - switch (protocolStack.getName()) { - case UDP_STACK: - protocolStack.add(UDP_PROTOCOL); - break; - case TCP_STACK: - ModelNode mPingValue = new ModelNode(); - mPingValue.get(SOCKET_BINDING).set(JGROUPS_MPING); - protocolStack.add(TCP_PROTOCOL, mPingValue); - break; - default: - // this should never happen, do nothing - } - } -} diff --git a/servers/eap7.2/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP7_2ToEAP8_0UpdateJGroupsSubsystem.java b/servers/eap7.2/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP7_2ToEAP8_0UpdateJGroupsSubsystem.java deleted file mode 100644 index 902bdb125..000000000 --- a/servers/eap7.2/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP7_2ToEAP8_0UpdateJGroupsSubsystem.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2023 Red Hat, Inc. - * - * 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. - */ - -package org.jboss.migration.eap.task.subsystem.jgroups; - -import org.jboss.migration.core.jboss.JBossSubsystemNames; -import org.jboss.migration.wfly10.config.task.management.subsystem.UpdateSubsystemResources; -import org.jboss.migration.wfly10.config.task.subsystem.jgroups.UpdateProtocols; - -/** - * @author istudens - */ -public class EAP7_2ToEAP8_0UpdateJGroupsSubsystem extends UpdateSubsystemResources { - public EAP7_2ToEAP8_0UpdateJGroupsSubsystem() { - super(JBossSubsystemNames.JGROUPS, - new UpdateProtocols<>(new UpdateProtocols.Operations() - .remove("PING") - .remove("MPING") - .remove("MERGE3") - .remove("FD_SOCK") - .remove("FD_ALL") - .remove("VERIFY_SUSPECT") - .remove("pbcast.NAKACK2") - .remove("UNICAST3") - .remove("pbcast.STABLE") - .remove("pbcast.GMS") - .remove("UFC") - .remove("MFC") - .remove("FRAG3") - .add("RED") - .custom(new EAP7_2AddPingMPingProtocolOperation()) - .add("MERGE3") - .custom(new EAP7_2AddFDSockProtocolOperation("FD_SOCK2")) - .add("FD_ALL3") - .add("VERIFY_SUSPECT2") - .add("pbcast.NAKACK2") - .add("UNICAST3") - .add("pbcast.STABLE") - .add("pbcast.GMS") - .add("UFC") - .add("MFC") - .add("FRAG4") - )); - } -} diff --git a/servers/eap7.4/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/FixPortRange.java b/servers/eap7.4/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/FixPortRange.java new file mode 100644 index 000000000..1bce937c7 --- /dev/null +++ b/servers/eap7.4/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/FixPortRange.java @@ -0,0 +1,108 @@ +/* + * Copyright 2023 Red Hat, Inc. + * + * 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. + */ +package org.jboss.migration.eap.task.subsystem.jgroups; + +import org.jboss.as.controller.PathAddress; +import org.jboss.as.controller.client.helpers.Operations; +import org.jboss.as.controller.operations.common.Util; +import org.jboss.dmr.ModelNode; +import org.jboss.migration.core.env.TaskEnvironment; +import org.jboss.migration.core.task.ServerMigrationTaskResult; +import org.jboss.migration.core.task.TaskContext; +import org.jboss.migration.wfly10.config.management.ManageableServerConfiguration; +import org.jboss.migration.wfly10.config.management.SubsystemResource; +import org.jboss.migration.wfly10.config.task.management.subsystem.UpdateSubsystemResourceSubtaskBuilder; + +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PROPERTIES; + +/** + * A task which fixes jgroup subsystem configuration's wrt port_range properties. + * @author emmartins + */ +public class FixPortRange extends UpdateSubsystemResourceSubtaskBuilder { + + private static final String FD_SOCK = "FD_SOCK"; + private static final String PORT_RANGE = "port_range"; + private static final String PROTOCOL = "protocol"; + private static final String STACK = "stack"; + private static final String tcp = "tcp"; + private static final String TCP = "TCP"; + private static final String TRANSPORT = "transport"; + private static final String udp = "udp"; + private static final String UDP = "UDP"; + + public FixPortRange() { + subtaskName("fix-port_range"); + } + + @Override + protected ServerMigrationTaskResult updateConfiguration(ModelNode config, S source, SubsystemResource subsystemResource, TaskContext context, TaskEnvironment taskEnvironment) { + final PathAddress subsystemPathAddress = subsystemResource.getResourcePathAddress(); + final ManageableServerConfiguration serverConfiguration = subsystemResource.getServerConfiguration(); + final Operations.CompositeOperationBuilder compositeOperationBuilder = Operations.CompositeOperationBuilder.create(); + boolean update = false; + if (updateStack(udp, UDP, config, subsystemPathAddress, compositeOperationBuilder, context)) { + update = true; + } + if (updateStack(tcp, TCP, config, subsystemPathAddress, compositeOperationBuilder, context)) { + update = true; + } + if (update) { + serverConfiguration.executeManagementOperation(compositeOperationBuilder.build().getOperation()); + return ServerMigrationTaskResult.SUCCESS; + } else { + return ServerMigrationTaskResult.SKIPPED; + } + } + + private boolean updateStack(String stack, String transport, ModelNode config, PathAddress subsystemPathAddress, Operations.CompositeOperationBuilder compositeOperationBuilder, TaskContext context) { + final ModelNode stackNode = config.get(STACK,stack); + if (!stackNode.isDefined()) { + context.getLogger().debugf("JGroups stack %s is not defined, skipping config update.", stack); + return false; + } + final ModelNode transportNode = stackNode.get(TRANSPORT,transport); + if (!transportNode.isDefined()) { + context.getLogger().debugf("JGroups transport %s is not defined, skipping config update.", transport); + return false; + } + final ModelNode portRangeTransportNode = transportNode.get(PROPERTIES, PORT_RANGE); + if (!portRangeTransportNode.isDefined()) { + context.getLogger().debugf("JGroups transport %s property %s is not defined, skipping config update.", transport, PORT_RANGE); + return false; + } + final ModelNode protocolNode = stackNode.get(PROTOCOL, FD_SOCK); + if (!protocolNode.isDefined()) { + context.getLogger().debugf("JGroups protocol %s is not defined, skipping config update.", FD_SOCK); + return false; + } + ModelNode protocolNodeProperties = protocolNode.get(PROPERTIES); + if (!protocolNodeProperties.isDefined()) { + protocolNodeProperties = new ModelNode(); + } + if (protocolNodeProperties.get(PORT_RANGE).isDefined()) { + context.getLogger().debugf("JGroups protocol %s property %s is defined, skipping config update.", FD_SOCK, PORT_RANGE); + return false; + } + + // we found the faulty config use case, let's copy the transport's port_range property to the protocol + protocolNodeProperties.get(PORT_RANGE).set(portRangeTransportNode.asString()); + final ModelNode addOp = Util.getWriteAttributeOperation(subsystemPathAddress.append(STACK, stack).append(PROTOCOL, FD_SOCK), PROPERTIES, protocolNodeProperties); + compositeOperationBuilder.addStep(addOp); + context.getLogger().debugf("JGroups protocol %s property %s configuration updated.", FD_SOCK, PORT_RANGE); + return true; + } +} \ No newline at end of file diff --git a/servers/eap8.0/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP8_0UpdateJGroupsSubsystem.java b/servers/eap8.0/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP8_0UpdateJGroupsSubsystem.java new file mode 100644 index 000000000..74b0b2d9a --- /dev/null +++ b/servers/eap8.0/src/main/java/org/jboss/migration/eap/task/subsystem/jgroups/EAP8_0UpdateJGroupsSubsystem.java @@ -0,0 +1,30 @@ +/* + * Copyright 2023 Red Hat, Inc. + * + * 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. + */ + +package org.jboss.migration.eap.task.subsystem.jgroups; + +import org.jboss.migration.core.jboss.JBossSubsystemNames; +import org.jboss.migration.wfly10.config.task.management.subsystem.UpdateSubsystemResources; + +/** + * @author emartins + */ +public class EAP8_0UpdateJGroupsSubsystem extends UpdateSubsystemResources { + + public EAP8_0UpdateJGroupsSubsystem() { + super(JBossSubsystemNames.JGROUPS, new FixPortRange<>()); + } +}