From a900cbe215d9e7827b968a5f636b927b7fc9d314 Mon Sep 17 00:00:00 2001 From: Yeray Borges Date: Wed, 17 Sep 2025 17:34:28 +0100 Subject: [PATCH 1/2] [WFCORE-7360] Add a urn:jboss:domain:21.0 / wildfly-config_21_0.xsd schemas Jira issue: https://issues.redhat.com/browse/WFCORE-7360 Signed-off-by: Yeray Borges --- .../controller/parsing/ManagementSchemas.java | 3 +- .../as/core/model/test/access/constraints.xml | 2 +- .../as/core/model/test/access/domain-all.xml | 2 +- .../domain-transform-no-rbac-provider.xml | 2 +- .../access/domain-transform-rbac-provider.xml | 2 +- .../jboss/as/core/model/test/access/host.xml | 2 +- .../as/core/model/test/access/standalone.xml | 2 +- .../as/core/model/test/auditlog/host.xml | 2 +- .../auditlog/host_credential_reference.xml | 2 +- .../core/model/test/auditlog/standalone.xml | 2 +- .../jboss/as/core/model/test/boot/host.xml | 2 +- .../as/core/model/test/boot/standalone.xml | 2 +- .../test/deployment/domain-deployments.xml | 2 +- .../domain-exploded-deployments.xml | 2 +- .../core/model/test/deployment/standalone.xml | 2 +- .../test/deployment/standalone_duplicate.xml | 2 +- .../domain-no-servergroup-overlay.xml | 2 +- .../model/test/deploymentoverlay/domain.xml | 2 +- .../test/deploymentoverlay/standalone.xml | 2 +- .../host-http-remoting-domain-manager-ac.xml | 2 +- .../host-http-remoting-domain-manager.xml | 2 +- .../test/host/host-remote-domain-manager.xml | 2 +- .../test/host/host-with-default-interface.xml | 2 +- .../model/test/host/host-with-expressions.xml | 2 +- .../jboss/as/core/model/test/host/host.xml | 2 +- .../test/hostexclude/domain-host-excludes.xml | 2 +- .../model/test/interfaces/domain-empty.xml | 2 +- .../as/core/model/test/interfaces/domain.xml | 2 +- .../as/core/model/test/interfaces/host.xml | 2 +- .../core/model/test/interfaces/standalone.xml | 2 +- .../as/core/model/test/jvm/domain-empty.xml | 2 +- .../as/core/model/test/jvm/domain-full.xml | 2 +- .../test/jvm/domain-with-expressions.xml | 2 +- .../as/core/model/test/jvm/host-global.xml | 2 +- .../core/model/test/jvm/host-server-empty.xml | 2 +- .../core/model/test/jvm/host-server-full.xml | 2 +- .../core/model/test/mgmt_interfaces/host.xml | 2 +- .../host_empty_allowed_origins.xml | 2 +- .../model/test/mgmt_interfaces/standalone.xml | 2 +- .../standalone_empty_allowed_origins.xml | 2 +- .../as/core/model/test/paths/domain-empty.xml | 2 +- .../model/test/paths/domain-expressions.xml | 2 +- .../jboss/as/core/model/test/paths/domain.xml | 2 +- .../jboss/as/core/model/test/paths/host.xml | 2 +- .../as/core/model/test/paths/standalone.xml | 2 +- .../model/test/profile/domain-transform.xml | 2 +- .../as/core/model/test/profile/domain.xml | 2 +- .../servergroup-with-deployments.xml | 2 +- ...rvergroup-with-duplicate-runtime-names.xml | 2 +- .../servergroup-with-expressions.xml | 2 +- .../model/test/servergroup/servergroup.xml | 2 +- .../as/core/model/test/shipped/domain.xml | 2 +- .../jboss/as/core/model/test/shipped/host.xml | 2 +- .../as/core/model/test/shipped/standalone.xml | 2 +- .../socketbindinggroups/domain-transform.xml | 2 +- .../model/test/socketbindinggroups/domain.xml | 2 +- .../model/test/socketbindinggroups/host.xml | 2 +- .../test/socketbindinggroups/standalone.xml | 2 +- ...roup-systemproperties-with-expressions.xml | 2 +- .../domain-servergroup-systemproperties.xml | 2 +- ...main-systemproperties-with-expressions.xml | 2 +- .../domain-systemproperties.xml | 2 +- .../host-server-systemproperties.xml | 2 +- .../systemproperty/host-systemproperties.xml | 2 +- .../standalone-systemproperties.xml | 2 +- .../as/host/controller/parsing/HostXml.java | 7 +- .../host/controller/parsing/HostXml_20.java | 355 -- .../host/controller/parsing/HostXml_21.java | 1787 ++++++++ .../as/server/parsing/StandaloneXml.java | 7 +- .../as/server/parsing/StandaloneXml_20.java | 216 - .../as/server/parsing/StandaloneXml_21.java | 1009 +++++ .../resources/schema/wildfly-config_21_0.xsd | 3909 +++++++++++++++++ .../src/test/resources/base-server-config.xml | 2 +- .../domain-configs/domain-auto-ignore.xml | 2 +- .../domain-configs/domain-config-changes.xml | 2 +- .../domain-default-interface.xml | 2 +- .../domain-configs/domain-jvm-properties.xml | 2 +- .../domain-configs/domain-minimal.xml | 2 +- .../resources/domain-configs/domain-rbac.xml | 2 +- .../domain-configs/domain-respawn-http.xml | 2 +- .../domain-configs/domain-respawn.xml | 2 +- .../domain-configs/domain-standard.xml | 2 +- .../domain-configs/domain-synchronization.xml | 2 +- .../domain-configs/domain.cached-remote.xml | 2 +- .../host-configs/admin-only-discovery.xml | 2 +- .../host-configs/admin-only-no-discovery.xml | 2 +- .../host-configs/host-auto-ignore-primary.xml | 2 +- .../host-auto-ignore-secondary.xml | 2 +- .../host-configs/host-default-interface.xml | 2 +- .../resources/host-configs/host-failover1.xml | 2 +- .../resources/host-configs/host-failover2.xml | 2 +- .../resources/host-configs/host-failover3.xml | 2 +- .../resources/host-configs/host-minimal.xml | 2 +- .../host-configs/host-nonexistent-group.xml | 2 +- .../host-configs/host-primary-auto-start.xml | 2 +- .../host-configs/host-primary-cacheddc.xml | 2 +- .../host-primary-config-changes.xml | 2 +- .../host-primary-elytron-no-legacy-realms.xml | 2 +- .../host-configs/host-primary-elytron.xml | 2 +- .../host-primary-jvm-properties.xml | 2 +- .../host-primary-rbac-properties.xml | 2 +- .../host-configs/host-primary-rbac.xml | 2 +- .../host-primary-ssl-1way-elytron.xml | 2 +- .../host-primary-ssl-2way-elytron.xml | 2 +- .../resources/host-configs/host-primary.xml | 2 +- .../host-secondary-auto-start.xml | 2 +- .../host-configs/host-secondary-cacheddc.xml | 2 +- .../host-secondary-config-changes.xml | 2 +- .../host-secondary-discovery-options.xml | 2 +- ...ost-secondary-elytron-no-legacy-realms.xml | 2 +- .../host-configs/host-secondary-elytron.xml | 2 +- .../host-configs/host-secondary-failure.xml | 2 +- .../host-secondary-main-three-without-jvm.xml | 2 +- .../host-secondary-rbac-properties.xml | 2 +- .../host-configs/host-secondary-rbac.xml | 2 +- .../host-secondary-ssl-1way-elytron.xml | 2 +- .../host-secondary-ssl-2way-elytron.xml | 2 +- .../resources/host-configs/host-secondary.xml | 2 +- .../host-configs/host-synchronization-hc1.xml | 2 +- .../host-configs/host-synchronization-hc2.xml | 2 +- .../host-synchronization-primary.xml | 2 +- .../host-configs/respawn-primary-http.xml | 2 +- .../host-configs/respawn-primary.xml | 2 +- 123 files changed, 6832 insertions(+), 691 deletions(-) create mode 100644 host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml_21.java create mode 100644 server/src/main/java/org/jboss/as/server/parsing/StandaloneXml_21.java create mode 100644 server/src/main/resources/schema/wildfly-config_21_0.xsd diff --git a/controller/src/main/java/org/jboss/as/controller/parsing/ManagementSchemas.java b/controller/src/main/java/org/jboss/as/controller/parsing/ManagementSchemas.java index bdfb9147751..30744a96320 100644 --- a/controller/src/main/java/org/jboss/as/controller/parsing/ManagementSchemas.java +++ b/controller/src/main/java/org/jboss/as/controller/parsing/ManagementSchemas.java @@ -20,7 +20,7 @@ public abstract class ManagementSchemas { // TODO Maybe this could be calculated from static method, sometimes tests want to use "latest". - public static final String CURRENT = "urn:jboss:domain:20.0"; + public static final String CURRENT = "urn:jboss:domain:21.0"; private enum Version implements Feature { @@ -57,6 +57,7 @@ private enum Version implements Feature { VERSION_19(19), VERSION_20(20), VERSION_20_COMMUNITY(20, Stability.COMMUNITY), + VERSION_21(21), ; private final int majorVersion; diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/constraints.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/constraints.xml index 5cbf28149ac..5d536c56225 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/constraints.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/constraints.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-all.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-all.xml index 6d4bec4b859..3e5457a2e5a 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-all.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-all.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-transform-no-rbac-provider.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-transform-no-rbac-provider.xml index c9455cc06aa..49f1d603f29 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-transform-no-rbac-provider.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-transform-no-rbac-provider.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-transform-rbac-provider.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-transform-rbac-provider.xml index 3eef963e349..977e1a5d18f 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-transform-rbac-provider.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/domain-transform-rbac-provider.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/host.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/host.xml index 921c3f6bb7e..c65cd353b29 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/host.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/host.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/standalone.xml index 8547451c0e5..bb28db9f19f 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/access/standalone.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/host.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/host.xml index 165bf199a33..330e57e6e99 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/host.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/host.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/host_credential_reference.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/host_credential_reference.xml index ca2f497a503..92b9d30e3a7 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/host_credential_reference.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/host_credential_reference.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/standalone.xml index 9875e9ea5e9..2c195144a73 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/auditlog/standalone.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/boot/host.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/boot/host.xml index 80a7bd02392..f311a5c6c51 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/boot/host.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/boot/host.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/boot/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/boot/standalone.xml index b2e013641cc..d19f7500a39 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/boot/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/boot/standalone.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/domain-deployments.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/domain-deployments.xml index 482c6fca553..b583fd85ef8 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/domain-deployments.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/domain-deployments.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/domain-exploded-deployments.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/domain-exploded-deployments.xml index 1bf4a599c92..230d6488296 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/domain-exploded-deployments.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/domain-exploded-deployments.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/standalone.xml index f74b43dda4c..a65029d838c 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/standalone.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/standalone_duplicate.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/standalone_duplicate.xml index f89a257a40c..17944455885 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/standalone_duplicate.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deployment/standalone_duplicate.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/domain-no-servergroup-overlay.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/domain-no-servergroup-overlay.xml index 41b77a99b10..a4fe47e4a67 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/domain-no-servergroup-overlay.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/domain-no-servergroup-overlay.xml @@ -9,7 +9,7 @@ This is the shipped configuration with the extensions and profiles removed --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/domain.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/domain.xml index 41a75e88ada..90972b1f5dd 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/domain.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/domain.xml @@ -9,7 +9,7 @@ This is the shipped configuration with the extensions and profiles removed --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/standalone.xml index ce0d5688fef..cf76d108caf 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/deploymentoverlay/standalone.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-http-remoting-domain-manager-ac.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-http-remoting-domain-manager-ac.xml index 31c75ff8d06..50327ff034b 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-http-remoting-domain-manager-ac.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-http-remoting-domain-manager-ac.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-http-remoting-domain-manager.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-http-remoting-domain-manager.xml index 9d496cb5a26..34e2956ecd3 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-http-remoting-domain-manager.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-http-remoting-domain-manager.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-remote-domain-manager.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-remote-domain-manager.xml index eff9e245a86..fddc10df5b9 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-remote-domain-manager.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-remote-domain-manager.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-with-default-interface.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-with-default-interface.xml index 80f97bf6882..25ad9fb3ba0 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-with-default-interface.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-with-default-interface.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-with-expressions.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-with-expressions.xml index 3a8f2b15f2d..08488273e1d 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-with-expressions.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host-with-expressions.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host.xml index cdfad001b0c..2281e5943d4 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/host/host.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/hostexclude/domain-host-excludes.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/hostexclude/domain-host-excludes.xml index 02c25a58078..d2ec43064a5 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/hostexclude/domain-host-excludes.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/hostexclude/domain-host-excludes.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/domain-empty.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/domain-empty.xml index 1090d17dbbf..34317c60d75 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/domain-empty.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/domain-empty.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/domain.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/domain.xml index 7ecf6330079..7cdb41bb8a4 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/domain.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/domain.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/host.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/host.xml index ecc19ff05b6..616ee659726 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/host.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/host.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/standalone.xml index 60499334cef..e6bda0852e7 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/interfaces/standalone.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-empty.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-empty.xml index c57c4284f53..243f6c792f5 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-empty.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-empty.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-full.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-full.xml index 55a1b159b47..c8a9766caae 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-full.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-full.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-with-expressions.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-with-expressions.xml index b47a65175f9..3938450517e 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-with-expressions.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/domain-with-expressions.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-global.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-global.xml index db0704e00d9..f90fdb9cf58 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-global.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-global.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-server-empty.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-server-empty.xml index c69646bcf96..88102963c29 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-server-empty.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-server-empty.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-server-full.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-server-full.xml index f33ef1e56d8..389984a82c8 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-server-full.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/jvm/host-server-full.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host.xml index 5ec5c77f71a..dd87a0fa07e 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_empty_allowed_origins.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_empty_allowed_origins.xml index 9d243ce026d..8d3846f5eac 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_empty_allowed_origins.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_empty_allowed_origins.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone.xml index b8e40b807bd..d824969c530 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_empty_allowed_origins.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_empty_allowed_origins.xml index 61cea5335db..72bd408dfac 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_empty_allowed_origins.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_empty_allowed_origins.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain-empty.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain-empty.xml index 760e27baf4d..2dd03477b42 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain-empty.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain-empty.xml @@ -4,6 +4,6 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain-expressions.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain-expressions.xml index 6fce9e6cbb5..633f3fa357b 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain-expressions.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain-expressions.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain.xml index db6a362bc87..ea09a462462 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/domain.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/host.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/host.xml index eee92e1a514..870e74904b3 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/host.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/host.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/standalone.xml index 69c4e097db0..af1173766d0 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/paths/standalone.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/profile/domain-transform.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/profile/domain-transform.xml index 8cca658483f..79c4a2cf009 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/profile/domain-transform.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/profile/domain-transform.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/profile/domain.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/profile/domain.xml index c0898cfb793..5a0241f5241 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/profile/domain.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/profile/domain.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-deployments.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-deployments.xml index 3d07db617f4..9f6e4f7cbf7 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-deployments.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-deployments.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-duplicate-runtime-names.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-duplicate-runtime-names.xml index 6ff4917b018..c9cb711355e 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-duplicate-runtime-names.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-duplicate-runtime-names.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-expressions.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-expressions.xml index 07a5a1e3927..9f8eb02f505 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-expressions.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup-with-expressions.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup.xml index 7e5c6845014..c5e13d6bc86 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/servergroup/servergroup.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/domain.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/domain.xml index bff16586e13..2031eca722e 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/domain.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/domain.xml @@ -9,7 +9,7 @@ This is the shipped configuration with the extensions and profiles removed --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/host.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/host.xml index 754583fed85..b4aae8a1f0a 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/host.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/host.xml @@ -5,7 +5,7 @@ --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/standalone.xml index 14449573d22..8b8336485e7 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/shipped/standalone.xml @@ -5,7 +5,7 @@ --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/domain-transform.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/domain-transform.xml index 42f72066472..2ed820fcebc 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/domain-transform.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/domain-transform.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/domain.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/domain.xml index 7572822016c..3d7e2e58201 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/domain.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/domain.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/host.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/host.xml index 33a8bb5ae80..1c619132187 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/host.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/host.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/standalone.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/standalone.xml index 6b83c0d8c27..c52cd85dd89 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/standalone.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/socketbindinggroups/standalone.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-servergroup-systemproperties-with-expressions.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-servergroup-systemproperties-with-expressions.xml index 0cc98adb4f1..f97b3c250d5 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-servergroup-systemproperties-with-expressions.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-servergroup-systemproperties-with-expressions.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-servergroup-systemproperties.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-servergroup-systemproperties.xml index 4cbf23912fd..8adfd34a2a7 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-servergroup-systemproperties.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-servergroup-systemproperties.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-systemproperties-with-expressions.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-systemproperties-with-expressions.xml index 360010558e4..5aa64790b4e 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-systemproperties-with-expressions.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-systemproperties-with-expressions.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-systemproperties.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-systemproperties.xml index 01e1d5541df..4089ce669e9 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-systemproperties.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/domain-systemproperties.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/host-server-systemproperties.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/host-server-systemproperties.xml index 2c47151276b..15c3956fbc6 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/host-server-systemproperties.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/host-server-systemproperties.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/host-systemproperties.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/host-systemproperties.xml index 1f308029e2a..4a044f64a25 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/host-systemproperties.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/host-systemproperties.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/standalone-systemproperties.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/standalone-systemproperties.xml index 546951297b8..6e4b99989a3 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/standalone-systemproperties.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/systemproperty/standalone-systemproperties.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml.java b/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml.java index 8f5c7692d14..a1078ca94f7 100644 --- a/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml.java +++ b/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml.java @@ -88,8 +88,11 @@ public void readElement(final XMLExtendedStreamReader reader, final VersionedNam case 19: new HostXml_18(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, version, namespaceUri).readElement(reader, operationList); break; - default: + case 20: new HostXml_20(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, namespace).readElement(reader, operationList); + break; + default: + new HostXml_21(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, namespace).readElement(reader, operationList); } } @@ -97,7 +100,7 @@ public void readElement(final XMLExtendedStreamReader reader, final VersionedNam public void writeContent(final XMLExtendedStreamWriter writer, final VersionedNamespace namespace, final ModelMarshallingContext context) throws XMLStreamException { - new HostXml_20(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, namespace).writeContent(writer, context); + new HostXml_21(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, namespace).writeContent(writer, context); } } diff --git a/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml_20.java b/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml_20.java index e14c8ca16a1..b9c7bce6de5 100644 --- a/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml_20.java +++ b/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml_20.java @@ -12,36 +12,25 @@ import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DISCOVERY_OPTION; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DISCOVERY_OPTIONS; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DOMAIN_CONTROLLER; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.EXTENSION; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HOST; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HTTP_INTERFACE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HTTP_UPGRADE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.IGNORED_RESOURCES; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.IGNORED_RESOURCE_TYPE; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.INTERFACE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.IS_DOMAIN_CONTROLLER; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.JVM; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.LOCAL; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.LOOPBACK; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MANAGEMENT; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MANAGEMENT_INTERFACE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAMES; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NATIVE_INTERFACE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ORGANIZATION; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PATH; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PROPERTIES; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOTE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVER_CONFIG; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING_DEFAULT_INTERFACE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING_GROUP; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING_PORT_OFFSET; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SSL; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STATIC_DISCOVERY; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SYSTEM_PROPERTY; import static org.jboss.as.controller.parsing.ParseUtils.isNoNamespaceAttribute; import static org.jboss.as.controller.parsing.ParseUtils.isXmlNamespaceAttribute; import static org.jboss.as.controller.parsing.ParseUtils.missingOneOf; @@ -72,7 +61,6 @@ import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.as.controller.extension.ExtensionRegistry; import org.jboss.as.controller.logging.ControllerLogger; -import org.jboss.as.controller.management.BaseHttpInterfaceResourceDefinition; import org.jboss.as.controller.operations.common.Util; import org.jboss.as.controller.parsing.Attribute; import org.jboss.as.controller.parsing.Element; @@ -80,8 +68,6 @@ import org.jboss.as.controller.parsing.ManagementXmlSchema; import org.jboss.as.controller.parsing.ParseUtils; import org.jboss.as.controller.parsing.ProfileParsingCompletionHandler; -import org.jboss.as.controller.parsing.WriteUtils; -import org.jboss.as.controller.persistence.ModelMarshallingContext; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.as.domain.management.parsing.AuditLogXml; import org.jboss.as.domain.management.parsing.ManagementXml; @@ -94,7 +80,6 @@ import org.jboss.as.host.controller.model.host.HostResourceDefinition; import org.jboss.as.host.controller.operations.DomainControllerWriteAttributeHandler; import org.jboss.as.host.controller.operations.HostAddHandler; -import org.jboss.as.host.controller.operations.RemoteDomainControllerAddHandler; import org.jboss.as.host.controller.resources.HttpManagementResourceDefinition; import org.jboss.as.host.controller.resources.NativeManagementResourceDefinition; import org.jboss.as.host.controller.resources.ServerConfigResourceDefinition; @@ -109,7 +94,6 @@ import org.jboss.dmr.Property; import org.jboss.staxmapper.IntVersion; import org.jboss.staxmapper.XMLExtendedStreamReader; -import org.jboss.staxmapper.XMLExtendedStreamWriter; /** * Parser and marshaller for host controller configuration xml documents (e.g. host.xml) that use the urn:jboss:domain:18.0 schema. @@ -157,100 +141,6 @@ public void readElement(final XMLExtendedStreamReader reader, final List groups = modelNode.get(SOCKET_BINDING_GROUP).keys(); - if (groups.size() > 1) { - throw ControllerLogger.ROOT_LOGGER.multipleModelNodes(SOCKET_BINDING_GROUP); - } - for (String group : groups) { - writeSocketBindingGroup(writer, modelNode.get(SOCKET_BINDING_GROUP, group), group); - } - } - - - writer.writeEndElement(); - writer.writeEndDocument(); - } - private void readHostElement(final XMLExtendedStreamReader reader, final ModelNode address, final List list) throws XMLStreamException { String hostName = null; @@ -1514,173 +1404,6 @@ private void parseSocketBindingGroup(final XMLExtendedStreamReader reader, final } } - private void writeDomainController(final XMLExtendedStreamWriter writer, final ModelNode modelNode, ModelNode ignoredResources, - ModelNode discoveryOptions) throws XMLStreamException { - writer.writeStartElement(Element.DOMAIN_CONTROLLER.getLocalName()); - if (modelNode.hasDefined(LOCAL)) { - if (discoveryOptions != null) { - writer.writeStartElement(Element.LOCAL.getLocalName()); - writeDiscoveryOptions(writer, discoveryOptions); - writer.writeEndElement(); - } else { - writer.writeEmptyElement(Element.LOCAL.getLocalName()); - } - } else if (modelNode.hasDefined(REMOTE)) { - writer.writeStartElement(Element.REMOTE.getLocalName()); - final ModelNode remote = modelNode.get(REMOTE); - RemoteDomainControllerAddHandler.PROTOCOL.marshallAsAttribute(remote, writer); - RemoteDomainControllerAddHandler.HOST.marshallAsAttribute(remote, writer); - RemoteDomainControllerAddHandler.PORT.marshallAsAttribute(remote, writer); - RemoteDomainControllerAddHandler.AUTHENTICATION_CONTEXT.marshallAsAttribute(remote, writer); - RemoteDomainControllerAddHandler.USERNAME.marshallAsAttribute(remote, writer); - RemoteDomainControllerAddHandler.IGNORE_UNUSED_CONFIG.marshallAsAttribute(remote, writer); - RemoteDomainControllerAddHandler.ADMIN_ONLY_POLICY.marshallAsAttribute(remote, writer); - - if (ignoredResources != null) { - writeIgnoredResources(writer, ignoredResources); - } - if (discoveryOptions != null) { - writeDiscoveryOptions(writer, discoveryOptions); - } - writer.writeEndElement(); - } - writer.writeEndElement(); - } - - private void writeIgnoredResources(XMLExtendedStreamWriter writer, ModelNode ignoredTypes) throws XMLStreamException { - for (String ignoredName : ignoredTypes.keys()) { - - ModelNode ignored = ignoredTypes.get(ignoredName); - - ModelNode names = ignored.hasDefined(NAMES) ? ignored.get(NAMES) : null; - boolean hasNames = names != null && names.asInt() > 0; - if (hasNames) { - writer.writeStartElement(Element.IGNORED_RESOURCE.getLocalName()); - } else { - writer.writeEmptyElement(Element.IGNORED_RESOURCE.getLocalName()); - } - - writer.writeAttribute(Attribute.TYPE.getLocalName(), ignoredName); - IgnoredDomainTypeResourceDefinition.WILDCARD.marshallAsAttribute(ignored, writer); - - if (hasNames) { - for (ModelNode name : names.asList()) { - writer.writeEmptyElement(Element.INSTANCE.getLocalName()); - writer.writeAttribute(Attribute.NAME.getLocalName(), name.asString()); - } - writer.writeEndElement(); - } - } - } - - private void writeDiscoveryOptions(XMLExtendedStreamWriter writer, ModelNode discoveryOptions) throws XMLStreamException { - writer.writeStartElement(Element.DISCOVERY_OPTIONS.getLocalName()); - for (Property property : discoveryOptions.asPropertyList()) { - final String type = property.getName().equals(STATIC_DISCOVERY) ? STATIC_DISCOVERY : DISCOVERY_OPTION; - final Element element = Element.forName(type); - final String optionName = property.getValue().get(ModelDescriptionConstants.NAME).asString(); - - switch (element) { - case STATIC_DISCOVERY: { - final ModelNode staticDiscoveryOption = property.getValue(); - writer.writeStartElement(element.getLocalName()); - WriteUtils.writeAttribute(writer, Attribute.NAME, optionName); - StaticDiscoveryResourceDefinition.PROTOCOL.marshallAsAttribute(staticDiscoveryOption, writer); - StaticDiscoveryResourceDefinition.HOST.marshallAsAttribute(staticDiscoveryOption, writer); - StaticDiscoveryResourceDefinition.PORT.marshallAsAttribute(staticDiscoveryOption, writer); - writer.writeEndElement(); - break; - } - case DISCOVERY_OPTION: { - final ModelNode discoveryOption = property.getValue(); - writer.writeStartElement(element.getLocalName()); - WriteUtils.writeAttribute(writer, Attribute.NAME, optionName); - DiscoveryOptionResourceDefinition.CODE.marshallAsAttribute(discoveryOption, writer); - DiscoveryOptionResourceDefinition.MODULE.marshallAsAttribute(discoveryOption, writer); - if (discoveryOption.hasDefined(PROPERTIES)) { - writeDiscoveryOptionProperties(writer, discoveryOption.get(PROPERTIES)); - } - writer.writeEndElement(); - break; - } - default: - throw new RuntimeException(ControllerLogger.ROOT_LOGGER.unknownChildType(element.getLocalName())); - } - } - writer.writeEndElement(); - } - - private void writeDiscoveryOptionProperties(XMLExtendedStreamWriter writer, ModelNode discoveryOptionProperties) throws XMLStreamException { - for (String property : discoveryOptionProperties.keys()) { - writer.writeStartElement(Element.PROPERTY.getLocalName()); - WriteUtils.writeAttribute(writer, Attribute.NAME, property); - WriteUtils.writeAttribute(writer, Attribute.VALUE, discoveryOptionProperties.get(property).asString()); - writer.writeEndElement(); - } - } - - private void writeServers(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException { - - for (String serverName : modelNode.keys()) { - final ModelNode server = modelNode.get(serverName); - - writer.writeStartElement(Element.SERVER.getLocalName()); - - WriteUtils.writeAttribute(writer, Attribute.NAME, serverName); - ServerConfigResourceDefinition.GROUP.marshallAsAttribute(server, writer); - ServerConfigResourceDefinition.AUTO_START.marshallAsAttribute(server, writer); - ServerConfigResourceDefinition.UPDATE_AUTO_START_WITH_SERVER_STATUS.marshallAsAttribute(server, writer); - if (server.hasDefined(PATH)) { - writePaths(writer, server.get(PATH), false); - } - if (server.hasDefined(SYSTEM_PROPERTY)) { - writeProperties(writer, server.get(SYSTEM_PROPERTY), Element.SYSTEM_PROPERTIES, false); - } - if (server.hasDefined(INTERFACE)) { - writeInterfaces(writer, server.get(INTERFACE)); - } - if (server.hasDefined(JVM)) { - for (final Property jvm : server.get(JVM).asPropertyList()) { - JvmXml.writeJVMElement(writer, jvm.getName(), jvm.getValue()); - break; // TODO just write the first !? - } - } - if (server.hasDefined(SOCKET_BINDING_GROUP) || server.hasDefined(SOCKET_BINDING_PORT_OFFSET) || server.hasDefined(SOCKET_BINDING_DEFAULT_INTERFACE)) { - writer.writeStartElement(Element.SOCKET_BINDINGS.getLocalName()); - ServerConfigResourceDefinition.SOCKET_BINDING_GROUP.marshallAsAttribute(server, writer); - ServerConfigResourceDefinition.SOCKET_BINDING_PORT_OFFSET.marshallAsAttribute(server, writer); - ServerConfigResourceDefinition.SOCKET_BINDING_DEFAULT_INTERFACE.marshallAsAttribute(server, writer); - writer.writeEndElement(); - } - if (server.hasDefined(SSL, LOOPBACK)) { - ModelNode ssl = server.get(SSL, LOOPBACK); - writer.writeStartElement(Element.SSL.getLocalName()); - SslLoopbackResourceDefinition.SSL_PROTOCOCOL.marshallAsAttribute(ssl, writer); - SslLoopbackResourceDefinition.TRUST_MANAGER_ALGORITHM.marshallAsAttribute(ssl, writer); - SslLoopbackResourceDefinition.TRUSTSTORE_TYPE.marshallAsAttribute(ssl, writer); - SslLoopbackResourceDefinition.TRUSTSTORE_PATH.marshallAsAttribute(ssl, writer); - SslLoopbackResourceDefinition.TRUSTSTORE_PASSWORD.marshallAsAttribute(ssl, writer); - writer.writeEndElement(); - } - - writer.writeEndElement(); - } - } - - private void writeHostProfile(final XMLExtendedStreamWriter writer, final ModelMarshallingContext context) - throws XMLStreamException { - - final ModelNode profileNode = context.getModelNode(); - // In case there are no subsystems defined - if (!profileNode.hasDefined(SUBSYSTEM)) { - return; - } - - writer.writeStartElement(Element.PROFILE.getLocalName()); - writeSubsystems(profileNode, writer, context); - writer.writeEndElement(); - } - /* * ManagamentXmlDelegate Methods */ @@ -1725,82 +1448,4 @@ public boolean parseAuditLog(XMLExtendedStreamReader reader, ModelNode address, return true; } - - @Override - public boolean writeNativeManagementProtocol(XMLExtendedStreamWriter writer, ModelNode protocol) throws XMLStreamException { - - writer.writeStartElement(Element.NATIVE_INTERFACE.getLocalName()); - NativeManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol, writer); - NativeManagementResourceDefinition.SSL_CONTEXT.marshallAsAttribute(protocol, writer); - NativeManagementResourceDefinition.SASL_PROTOCOL.marshallAsAttribute(protocol, writer); - NativeManagementResourceDefinition.SERVER_NAME.marshallAsAttribute(protocol, writer); - - writer.writeEmptyElement(Element.SOCKET.getLocalName()); - NativeManagementResourceDefinition.INTERFACE.marshallAsAttribute(protocol, writer); - NativeManagementResourceDefinition.NATIVE_PORT.marshallAsAttribute(protocol, writer); - - writer.writeEndElement(); - - return true; - } - - @Override - public boolean writeHttpManagementProtocol(XMLExtendedStreamWriter writer, ModelNode protocol) throws XMLStreamException { - - writer.writeStartElement(Element.HTTP_INTERFACE.getLocalName()); - HttpManagementResourceDefinition.HTTP_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.SSL_CONTEXT.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.CONSOLE_ENABLED.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.ALLOWED_ORIGINS.getMarshaller().marshallAsAttribute( - HttpManagementResourceDefinition.ALLOWED_ORIGINS, protocol, true, writer); - HttpManagementResourceDefinition.SASL_PROTOCOL.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.SERVER_NAME.marshallAsAttribute(protocol, writer); - if (stability.enables(Stability.COMMUNITY)) { - HttpManagementResourceDefinition.BACKLOG.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.NO_REQUEST_TIMEOUT.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.CONNECTION_HIGH_WATER.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.CONNECTION_LOW_WATER.marshallAsAttribute(protocol, writer); - } - - if (HttpManagementResourceDefinition.HTTP_UPGRADE.isMarshallable(protocol)) { - writer.writeEmptyElement(Element.HTTP_UPGRADE.getLocalName()); - HttpManagementResourceDefinition.ENABLED.marshallAsAttribute(protocol.require(HTTP_UPGRADE), writer); - HttpManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol.require(HTTP_UPGRADE), writer); - } - - writer.writeEmptyElement(Element.SOCKET.getLocalName()); - HttpManagementResourceDefinition.INTERFACE.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.HTTP_PORT.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.HTTPS_PORT.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.SECURE_INTERFACE.marshallAsAttribute(protocol, writer); - - if (HttpManagementResourceDefinition.CONSTANT_HEADERS.isMarshallable(protocol)) { - writer.writeStartElement(Element.CONSTANT_HEADERS.getLocalName()); - - for (ModelNode headerMapping : protocol.require(ModelDescriptionConstants.CONSTANT_HEADERS).asList()) { - writer.writeStartElement(Element.HEADER_MAPPING.getLocalName()); - BaseHttpInterfaceResourceDefinition.PATH.marshallAsAttribute(headerMapping, writer); - for (ModelNode header : headerMapping.require(ModelDescriptionConstants.HEADERS).asList()) { - writer.writeEmptyElement(Element.HEADER.getLocalName()); - BaseHttpInterfaceResourceDefinition.HEADER_NAME.marshallAsAttribute(header, writer); - BaseHttpInterfaceResourceDefinition.HEADER_VALUE.marshallAsAttribute(header, writer); - } - writer.writeEndElement(); - } - - writer.writeEndElement(); - } - - writer.writeEndElement(); - - return true; - } - - @Override - public boolean writeAuditLog(XMLExtendedStreamWriter writer, ModelNode auditLog) throws XMLStreamException { - auditLogDelegate.writeAuditLog(writer, auditLog); - - return true; - } - } diff --git a/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml_21.java b/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml_21.java new file mode 100644 index 00000000000..9a1bc888391 --- /dev/null +++ b/host-controller/src/main/java/org/jboss/as/host/controller/parsing/HostXml_21.java @@ -0,0 +1,1787 @@ +/* + * Copyright The WildFly Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.jboss.as.host.controller.parsing; + +import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CORE_SERVICE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DIRECTORY_GROUPING; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DISCOVERY_OPTION; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DISCOVERY_OPTIONS; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DOMAIN_CONTROLLER; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.EXTENSION; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HOST; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HTTP_INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HTTP_UPGRADE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.IGNORED_RESOURCES; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.IGNORED_RESOURCE_TYPE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.IS_DOMAIN_CONTROLLER; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.JVM; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.LOCAL; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.LOOPBACK; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MANAGEMENT; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MANAGEMENT_INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAMES; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NATIVE_INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ORGANIZATION; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PATH; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PROPERTIES; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOTE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SERVER_CONFIG; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING_DEFAULT_INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING_GROUP; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING_PORT_OFFSET; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SSL; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.STATIC_DISCOVERY; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SYSTEM_PROPERTY; +import static org.jboss.as.controller.parsing.ParseUtils.isNoNamespaceAttribute; +import static org.jboss.as.controller.parsing.ParseUtils.isXmlNamespaceAttribute; +import static org.jboss.as.controller.parsing.ParseUtils.missingOneOf; +import static org.jboss.as.controller.parsing.ParseUtils.missingRequired; +import static org.jboss.as.controller.parsing.ParseUtils.missingRequiredElement; +import static org.jboss.as.controller.parsing.ParseUtils.nextElement; +import static org.jboss.as.controller.parsing.ParseUtils.requireNamespace; +import static org.jboss.as.controller.parsing.ParseUtils.requireNoAttributes; +import static org.jboss.as.controller.parsing.ParseUtils.requireNoContent; +import static org.jboss.as.controller.parsing.ParseUtils.requireNoNamespaceAttribute; +import static org.jboss.as.controller.parsing.ParseUtils.requireSingleAttribute; +import static org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute; +import static org.jboss.as.controller.parsing.ParseUtils.unexpectedElement; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.xml.stream.XMLStreamException; + +import org.jboss.as.controller.RunningMode; +import org.jboss.as.controller.descriptions.ModelDescriptionConstants; +import org.jboss.as.controller.extension.ExtensionRegistry; +import org.jboss.as.controller.logging.ControllerLogger; +import org.jboss.as.controller.management.BaseHttpInterfaceResourceDefinition; +import org.jboss.as.controller.operations.common.Util; +import org.jboss.as.controller.parsing.Attribute; +import org.jboss.as.controller.parsing.Element; +import org.jboss.as.controller.parsing.ExtensionXml; +import org.jboss.as.controller.parsing.ManagementXmlSchema; +import org.jboss.as.controller.parsing.ParseUtils; +import org.jboss.as.controller.parsing.ProfileParsingCompletionHandler; +import org.jboss.as.controller.parsing.WriteUtils; +import org.jboss.as.controller.persistence.ModelMarshallingContext; +import org.jboss.as.controller.xml.VersionedNamespace; +import org.jboss.as.domain.management.parsing.AuditLogXml; +import org.jboss.as.domain.management.parsing.ManagementXml; +import org.jboss.as.domain.management.parsing.ManagementXmlDelegate; +import org.jboss.as.host.controller.discovery.DiscoveryOptionResourceDefinition; +import org.jboss.as.host.controller.discovery.StaticDiscoveryResourceDefinition; +import org.jboss.as.host.controller.ignored.IgnoredDomainTypeResourceDefinition; +import org.jboss.as.host.controller.logging.HostControllerLogger; +import org.jboss.as.host.controller.model.host.AdminOnlyDomainConfigPolicy; +import org.jboss.as.host.controller.model.host.HostResourceDefinition; +import org.jboss.as.host.controller.operations.DomainControllerWriteAttributeHandler; +import org.jboss.as.host.controller.operations.HostAddHandler; +import org.jboss.as.host.controller.operations.RemoteDomainControllerAddHandler; +import org.jboss.as.host.controller.resources.HttpManagementResourceDefinition; +import org.jboss.as.host.controller.resources.NativeManagementResourceDefinition; +import org.jboss.as.host.controller.resources.ServerConfigResourceDefinition; +import org.jboss.as.host.controller.resources.SslLoopbackResourceDefinition; +import org.jboss.as.process.CommandLineConstants; +import org.jboss.as.server.parsing.CommonXml; +import org.jboss.as.server.parsing.SocketBindingsXml; +import org.jboss.as.server.services.net.SocketBindingGroupResourceDefinition; +import org.jboss.as.version.Stability; +import org.jboss.dmr.ModelNode; +import org.jboss.dmr.ModelType; +import org.jboss.dmr.Property; +import org.jboss.staxmapper.IntVersion; +import org.jboss.staxmapper.XMLExtendedStreamReader; +import org.jboss.staxmapper.XMLExtendedStreamWriter; + +/** + * Parser and marshaller for host controller configuration xml documents (e.g. host.xml) that use the urn:jboss:domain:21.0 schema. + * + * @author Brian Stansberry + * @author Darran Lofthouse + * @author James R. Perkins + */ +final class HostXml_21 extends CommonXml implements ManagementXmlDelegate { + + private final AuditLogXml auditLogDelegate; + + private final String defaultHostControllerName; + private final RunningMode runningMode; + private final boolean isCachedDc; + private final ExtensionRegistry extensionRegistry; + private final ExtensionXml extensionXml; + private final IntVersion version; + private final String namespace; + private final Stability stability; + + HostXml_21(String defaultHostControllerName, RunningMode runningMode, boolean isCachedDC, + final ExtensionRegistry extensionRegistry, final ExtensionXml extensionXml, + final VersionedNamespace namespace) { + super(new SocketBindingsXml.HostSocketBindingsXml()); + this.namespace = namespace.getUri(); + this.version = namespace.getVersion(); + this.auditLogDelegate = AuditLogXml.newInstance(version, true); + this.defaultHostControllerName = defaultHostControllerName; + this.runningMode = runningMode; + this.isCachedDc = isCachedDC; + this.extensionRegistry = extensionRegistry; + this.stability = namespace.getStability(); + this.extensionXml = extensionXml; + } + + @Override + public void readElement(final XMLExtendedStreamReader reader, final List operationList) + throws XMLStreamException { + final ModelNode address = new ModelNode().setEmptyList(); + if (Element.forName(reader.getLocalName()) != Element.HOST) { + throw unexpectedElement(reader); + } + + readHostElement(reader, address, operationList); + } + + void writeContent(final XMLExtendedStreamWriter writer, final ModelMarshallingContext context) + throws XMLStreamException { + + final ModelNode modelNode = context.getModelNode(); + + writer.writeStartDocument(); + writer.writeStartElement(Element.HOST.getLocalName()); + + writer.writeDefaultNamespace(namespace); + writeNamespaces(writer, modelNode); + writeSchemaLocation(writer, modelNode); + + if (modelNode.hasDefined(NAME)) { + HostResourceDefinition.NAME.marshallAsAttribute(modelNode, writer); + } + if (modelNode.hasDefined(ORGANIZATION)) { + HostResourceDefinition.ORGANIZATION_IDENTIFIER.marshallAsAttribute(modelNode, writer); + } + + if (modelNode.hasDefined(EXTENSION)) { + extensionXml.writeExtensions(writer, modelNode.get(EXTENSION)); + } + + if (modelNode.hasDefined(SYSTEM_PROPERTY)) { + writeProperties(writer, modelNode.get(SYSTEM_PROPERTY), Element.SYSTEM_PROPERTIES, false); + } + + if (modelNode.hasDefined(PATH)) { + writePaths(writer, modelNode.get(PATH), false); + } + + boolean hasCoreServices = modelNode.hasDefined(CORE_SERVICE); + + if (hasCoreServices) { + ManagementXml managementXml = ManagementXml.newInstance(version, namespace, this, false); + managementXml.writeManagement(writer, modelNode.get(CORE_SERVICE, MANAGEMENT), true); + } + + if (modelNode.hasDefined(DOMAIN_CONTROLLER)) { + ModelNode ignoredResources = null; + ModelNode discoveryOptions = null; + if (hasCoreServices && modelNode.get(CORE_SERVICE).hasDefined(IGNORED_RESOURCES) + && modelNode.get(CORE_SERVICE, IGNORED_RESOURCES).hasDefined(IGNORED_RESOURCE_TYPE)) { + ignoredResources = modelNode.get(CORE_SERVICE, IGNORED_RESOURCES, IGNORED_RESOURCE_TYPE); + } + if (hasCoreServices && modelNode.get(CORE_SERVICE).hasDefined(DISCOVERY_OPTIONS) + && modelNode.get(CORE_SERVICE, DISCOVERY_OPTIONS).hasDefined(ModelDescriptionConstants.OPTIONS)) { + // List of discovery option types and names, in the order they were provided + discoveryOptions = modelNode.get(CORE_SERVICE, DISCOVERY_OPTIONS, ModelDescriptionConstants.OPTIONS); + } + writeDomainController(writer, modelNode.get(DOMAIN_CONTROLLER), ignoredResources, discoveryOptions); + } + + if (modelNode.hasDefined(INTERFACE)) { + writeInterfaces(writer, modelNode.get(INTERFACE)); + } + if (modelNode.hasDefined(JVM)) { + writer.writeStartElement(Element.JVMS.getLocalName()); + ModelNode jvms = modelNode.get(JVM); + for (final String jvm : jvms.keys()) { + JvmXml.writeJVMElement(writer, jvm, jvms.get(jvm)); + } + writer.writeEndElement(); + } + + if (modelNode.hasDefined(SERVER_CONFIG)) { + writer.writeStartElement(Element.SERVERS.getLocalName()); + // Write the directory grouping + HostResourceDefinition.DIRECTORY_GROUPING.marshallAsAttribute(modelNode, writer); + writeServers(writer, modelNode.get(SERVER_CONFIG)); + writer.writeEndElement(); + } else if (modelNode.hasDefined(DIRECTORY_GROUPING)) { + // In case there are no servers defined, write an empty element, preserving the directory grouping + writer.writeEmptyElement(Element.SERVERS.getLocalName()); + HostResourceDefinition.DIRECTORY_GROUPING.marshallAsAttribute(modelNode, writer); + } + + writeHostProfile(writer, context); + + if (modelNode.hasDefined(SOCKET_BINDING_GROUP)) { + Set groups = modelNode.get(SOCKET_BINDING_GROUP).keys(); + if (groups.size() > 1) { + throw ControllerLogger.ROOT_LOGGER.multipleModelNodes(SOCKET_BINDING_GROUP); + } + for (String group : groups) { + writeSocketBindingGroup(writer, modelNode.get(SOCKET_BINDING_GROUP, group), group); + } + } + + + writer.writeEndElement(); + writer.writeEndDocument(); + } + + private void readHostElement(final XMLExtendedStreamReader reader, final ModelNode address, final List list) + throws XMLStreamException { + String hostName = null; + String organization = null; + // Deffer adding the namespaces and schema locations until after the host has been created. + List namespaceOperations = new LinkedList(); + parseNamespaces(reader, address, namespaceOperations); + + // attributes + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + if (isNoNamespaceAttribute(reader, i)) { + final String value = reader.getAttributeValue(i); + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case NAME: { + hostName = value; + break; + } + case ORGANIZATION : { + organization = value; + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } else if (isXmlNamespaceAttribute(reader, i)) { + switch (Attribute.forName(reader.getAttributeLocalName(i))) { + case SCHEMA_LOCATION: { + parseSchemaLocations(reader, address, namespaceOperations, i); + break; + } + case NO_NAMESPACE_SCHEMA_LOCATION: { + // todo, jeez + break; + } + default: { + throw unexpectedAttribute(reader, i); + } + } + } else { + throw unexpectedAttribute(reader, i); + } + } + + // The following also updates the address parameter so this address can be used for future operations + // in the context of this host. + final ModelNode hostAddOp = addLocalHost(address, list, hostName); + setOrganization(address, list, organization); + // The namespace operations were created before the host name was known, the address can now be updated + // to the local host specific address. + for (ModelNode operation : namespaceOperations) { + operation.get(OP_ADDR).set(address); + list.add(operation); + } + + // Content + // Handle elements: sequence + + Element element = nextElement(reader, namespace); + if (element == Element.EXTENSIONS) { + extensionXml.parseExtensions(reader, address, namespace, list); + element = nextElement(reader, namespace); + } + if (element == Element.SYSTEM_PROPERTIES) { + parseSystemProperties(reader, address, namespace, list, false); + element = nextElement(reader, namespace); + } + if (element == Element.PATHS) { + parsePaths(reader, address, namespace, list, true); + element = nextElement(reader, namespace); + } + if (element == Element.MANAGEMENT) { + ManagementXml managementXml = ManagementXml.newInstance(version, namespace, this, false); + managementXml.parseManagement(reader, address, list, true); + element = nextElement(reader, namespace); + } else { + throw missingRequiredElement(reader, EnumSet.of(Element.MANAGEMENT)); + } + if (element == Element.DOMAIN_CONTROLLER) { + parseDomainController(reader, address, list, hostAddOp); + element = nextElement(reader, namespace); + } + final Set interfaceNames = new HashSet(); + if (element == Element.INTERFACES) { + parseInterfaces(reader, interfaceNames, address, version, namespace, list, true); + element = nextElement(reader, namespace); + } + if (element == Element.JVMS) { + parseJvms(reader, address, list); + element = nextElement(reader, namespace); + } + if (element == Element.SERVERS) { + parseServers(reader, address, list); + element = nextElement(reader, namespace); + } + if (element == Element.PROFILE) { + parseHostProfile(reader, address, list); + element = nextElement(reader, namespace); + } + // Single socket binding group + if (element == Element.SOCKET_BINDING_GROUP) { + parseSocketBindingGroup(reader, interfaceNames, address, list); + element = nextElement(reader, namespace); + } + + if (element != null) { + throw unexpectedElement(reader); + } + + } + + private void parseHttpManagementInterfaceAttributes(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case HTTP_AUTHENTICATION_FACTORY: { + HttpManagementResourceDefinition.HTTP_AUTHENTICATION_FACTORY.parseAndSetParameter(value, addOp, reader); + break; + } + case SASL_PROTOCOL: { + HttpManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader); + break; + } + case SERVER_NAME: { + HttpManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader); + break; + } + case SSL_CONTEXT: { + HttpManagementResourceDefinition.SSL_CONTEXT.parseAndSetParameter(value, addOp, reader); + break; + } + case CONSOLE_ENABLED: { + HttpManagementResourceDefinition.CONSOLE_ENABLED.parseAndSetParameter(value, addOp, reader); + break; + } + case HTTP_UPGRADE_ENABLED: { + ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE); + HttpManagementResourceDefinition.ENABLED.parseAndSetParameter(value, httpUpgrade, reader); + break; + } + case ALLOWED_ORIGINS: { + HttpManagementResourceDefinition.ALLOWED_ORIGINS.getParser().parseAndSetParameter(HttpManagementResourceDefinition.ALLOWED_ORIGINS, value, addOp, reader); + break; + } + case BACKLOG: { + HttpManagementResourceDefinition.BACKLOG.parseAndSetParameter(value, addOp, reader); + break; + } + case NO_REQUEST_TIMEOUT: { + HttpManagementResourceDefinition.NO_REQUEST_TIMEOUT.parseAndSetParameter(value, addOp, reader); + break; + } + case CONNECTION_HIGH_WATER: { + HttpManagementResourceDefinition.CONNECTION_HIGH_WATER.parseAndSetParameter(value, addOp, reader); + break; + } + case CONNECTION_LOW_WATER: { + HttpManagementResourceDefinition.CONNECTION_LOW_WATER.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + } + + private void parseNativeManagementInterfaceAttributes(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case SASL_AUTHENTICATION_FACTORY: { + NativeManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.parseAndSetParameter(value, addOp, reader); + break; + } + case SASL_PROTOCOL: { + NativeManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader); + break; + } + case SERVER_NAME: { + NativeManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader); + break; + } + case SSL_CONTEXT: { + NativeManagementResourceDefinition.SSL_CONTEXT.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + } + + private void parseNativeManagementInterface(XMLExtendedStreamReader reader, ModelNode address, List list) throws XMLStreamException { + + final ModelNode operationAddress = address.clone(); + operationAddress.add(MANAGEMENT_INTERFACE, NATIVE_INTERFACE); + final ModelNode addOp = Util.getEmptyOperation(ADD, operationAddress); + + // Handle attributes + parseNativeManagementInterfaceAttributes(reader, addOp); + + // Handle elements + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case SOCKET: + parseNativeManagementSocket(reader, addOp); + break; + default: + throw unexpectedElement(reader); + } + } + + list.add(addOp); + } + + private void parseHttpManagementInterface(XMLExtendedStreamReader reader, ModelNode address, List list) throws XMLStreamException { + + final ModelNode operationAddress = address.clone(); + operationAddress.add(MANAGEMENT_INTERFACE, HTTP_INTERFACE); + final ModelNode addOp = Util.getEmptyOperation(ADD, operationAddress); + + int socketCount = 0; + int httpUpgradeCount = 0; + + // Handle attributes + parseHttpManagementInterfaceAttributes(reader, addOp); + + // Handle elements + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case SOCKET: + if (++socketCount > 1) { + throw unexpectedElement(reader); + } + parseHttpManagementSocket(reader, addOp); + break; + case HTTP_UPGRADE: + if (++httpUpgradeCount > 1) { + throw unexpectedElement(reader); + } + parseHttpUpgrade(reader, addOp); + break; + case CONSTANT_HEADERS: + parseConstantHeaders(reader, addOp); + break; + default: + throw unexpectedElement(reader); + } + } + + list.add(addOp); + } + + private void parseConstantHeaders(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + // Attributes + requireNoAttributes(reader); + + ModelNode constantHeaders= new ModelNode(); + // Content + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + if (Element.forName(reader.getLocalName()) != Element.HEADER_MAPPING) { + throw unexpectedElement(reader); + } + + ModelNode headerMapping = new ModelNode(); + requireSingleAttribute(reader, Attribute.PATH.getLocalName()); + // After double checking the name of the only attribute we can retrieve it. + HttpManagementResourceDefinition.PATH.parseAndSetParameter(reader.getAttributeValue(0), headerMapping, reader); + ModelNode headers = new ModelNode(); + boolean headerFound = false; + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + if (Element.forName(reader.getLocalName()) != Element.HEADER) { + throw unexpectedElement(reader); + } + headerFound = true; + + ModelNode header= new ModelNode(); + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case NAME: { + HttpManagementResourceDefinition.HEADER_NAME.parseAndSetParameter(value, header, reader); + break; + } + case VALUE: { + HttpManagementResourceDefinition.HEADER_VALUE.parseAndSetParameter(value, header, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + headers.add(header); + + requireNoContent(reader); + } + if (headerFound == false) { + throw missingRequiredElement(reader, Collections.singleton(Element.HEADER.getLocalName())); + } + + headerMapping.get(ModelDescriptionConstants.HEADERS).set(headers); + constantHeaders.add(headerMapping); + } + + addOp.get(ModelDescriptionConstants.CONSTANT_HEADERS).set(constantHeaders); + } + + private void parseNativeManagementSocket(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + // Handle attributes + boolean hasInterface = false; + + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case INTERFACE: { + NativeManagementResourceDefinition.INTERFACE.parseAndSetParameter(value, addOp, reader); + hasInterface = true; + break; + } + case PORT: { + NativeManagementResourceDefinition.NATIVE_PORT.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + requireNoContent(reader); + + if (!hasInterface) { + throw missingRequired(reader, Collections.singleton(Attribute.INTERFACE.getLocalName())); + } + } + + private void parseHttpManagementSocket(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + // Handle attributes + boolean hasInterface = false; + + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case INTERFACE: { + HttpManagementResourceDefinition.INTERFACE.parseAndSetParameter(value, addOp, reader); + hasInterface = true; + break; + } + case PORT: { + HttpManagementResourceDefinition.HTTP_PORT.parseAndSetParameter(value, addOp, reader); + break; + } + case SECURE_PORT: { + HttpManagementResourceDefinition.HTTPS_PORT.parseAndSetParameter(value, addOp, reader); + break; + } + case SECURE_INTERFACE: { + HttpManagementResourceDefinition.SECURE_INTERFACE.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + requireNoContent(reader); + + if (!hasInterface) { + throw missingRequired(reader, Collections.singleton(Attribute.INTERFACE.getLocalName())); + } + } + + private void parseHttpUpgrade(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + // Handle attributes + + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case ENABLED: { + ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE); + HttpManagementResourceDefinition.ENABLED.parseAndSetParameter(value, httpUpgrade, reader); + break; + } + case SASL_AUTHENTICATION_FACTORY: { + ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE); + HttpManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.parseAndSetParameter(value, httpUpgrade, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + requireNoContent(reader); + } + + private void setOrganization(final ModelNode address, final List operationList, final String value) { + if (value != null && !value.isEmpty()) { + final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); + operationList.add(update); + } + } + /** + * Add the operation to add the local host definition. + */ + private ModelNode addLocalHost(final ModelNode address, final List operationList, final String hostName) { + + String resolvedHost = hostName != null ? hostName : defaultHostControllerName; + + // All further operations should modify the newly added host so the address passed in is updated. + address.add(HOST, resolvedHost); + + // Add a step to setup the ManagementResourceRegistrations for the root host resource + final ModelNode hostAddOp = new ModelNode(); + hostAddOp.get(OP).set(HostAddHandler.OPERATION_NAME); // /host=foo:add() + hostAddOp.get(OP_ADDR).set(address); + + operationList.add(hostAddOp); + + // Add a step to store the HC name + ModelNode nameValue = hostName == null ? new ModelNode() : new ModelNode(hostName); + final ModelNode writeName = Util.getWriteAttributeOperation(address, NAME, nameValue); + operationList.add(writeName); + + return hostAddOp; + } + + private void parseDomainController(final XMLExtendedStreamReader reader, final ModelNode address, final List list, final ModelNode hostAddOp) + throws XMLStreamException { + + requireNoAttributes(reader); + + boolean hasLocal = false; + boolean hasRemote = false; + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case LOCAL: { + if (hasLocal) { + throw ControllerLogger.ROOT_LOGGER.childAlreadyDeclared(element.getLocalName(), Element.DOMAIN_CONTROLLER.getLocalName(), reader.getLocation()); + } else if (hasRemote) { + throw ControllerLogger.ROOT_LOGGER.childAlreadyDeclared(Element.REMOTE.getLocalName(), Element.DOMAIN_CONTROLLER.getLocalName(), reader.getLocation()); + } + hostAddOp.get(IS_DOMAIN_CONTROLLER).set(true); + parseLocalDomainController(reader, address, list); + hasLocal = true; + break; + } + case REMOTE: { + if (hasRemote) { + throw ControllerLogger.ROOT_LOGGER.childAlreadyDeclared(element.getLocalName(), Element.DOMAIN_CONTROLLER.getLocalName(), reader.getLocation()); + } else if (hasLocal) { + throw ControllerLogger.ROOT_LOGGER.childAlreadyDeclared(Element.LOCAL.getLocalName(), Element.DOMAIN_CONTROLLER.getLocalName(), reader.getLocation()); + } + hostAddOp.get(IS_DOMAIN_CONTROLLER).set(false); + parseRemoteDomainController(reader, address, list); + + hasRemote = true; + break; + } + default: + throw unexpectedElement(reader); + } + } + if (!hasLocal && !hasRemote) { + throw ControllerLogger.ROOT_LOGGER.domainControllerMustBeDeclared(Element.REMOTE.getLocalName(), Element.LOCAL.getLocalName(), reader.getLocation()); + } + } + + private void parseLocalDomainController(final XMLExtendedStreamReader reader, final ModelNode address, final List list) throws XMLStreamException { + requireNoAttributes(reader); + boolean hasDiscoveryOptions = false; + Set staticDiscoveryOptionNames = new HashSet(); + Set discoveryOptionNames = new HashSet(); + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case DISCOVERY_OPTIONS: { + if (hasDiscoveryOptions) { + throw ControllerLogger.ROOT_LOGGER.alreadyDefined(element.getLocalName(), reader.getLocation()); + } + parseDiscoveryOptions(reader, address, list, staticDiscoveryOptionNames, discoveryOptionNames); + hasDiscoveryOptions = true; + break; + } + default: + throw unexpectedElement(reader); + } + } + } + + private void parseRemoteDomainController(final XMLExtendedStreamReader reader, final ModelNode address, final List list) throws XMLStreamException { + boolean requireDiscoveryOptions = false; + boolean hasDiscoveryOptions = false; + + requireDiscoveryOptions = parseRemoteDomainControllerAttributes(reader, address, list); + + + Set types = new HashSet(); + Set staticDiscoveryOptionNames = new HashSet(); + Set discoveryOptionNames = new HashSet(); + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case IGNORED_RESOURCE: { + parseIgnoredResource(reader, address, list, types); + break; + } + case DISCOVERY_OPTIONS: { // Different from parseRemoteDomainController1_1 + if (hasDiscoveryOptions) { + throw ControllerLogger.ROOT_LOGGER.alreadyDefined(element.getLocalName(), reader.getLocation()); + } + parseDiscoveryOptions(reader, address, list, staticDiscoveryOptionNames, discoveryOptionNames); + hasDiscoveryOptions = true; + break; + } + default: + throw unexpectedElement(reader); + } + } + + if (requireDiscoveryOptions && !hasDiscoveryOptions) { + throw ControllerLogger.ROOT_LOGGER.discoveryOptionsMustBeDeclared(CommandLineConstants.ADMIN_ONLY, + Attribute.ADMIN_ONLY_POLICY.getLocalName(), AdminOnlyDomainConfigPolicy.FETCH_FROM_DOMAIN_CONTROLLER.toString(), + Element.DISCOVERY_OPTIONS.getLocalName(), Attribute.HOST.getLocalName(), Attribute.PORT.getLocalName(), + reader.getLocation()); + } + } + + private boolean parseRemoteDomainControllerAttributes(final XMLExtendedStreamReader reader, final ModelNode address, + final List list) throws XMLStreamException { + + final ModelNode remoteDc = new ModelNode(); + final ModelNode updateDc = remoteDc.get(REMOTE).setEmptyObject() ; + // Handle attributes + AdminOnlyDomainConfigPolicy adminOnlyPolicy = AdminOnlyDomainConfigPolicy.DEFAULT; + boolean requireDiscoveryOptions = false; + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case HOST: { + DomainControllerWriteAttributeHandler.HOST.parseAndSetParameter(value, updateDc, reader); + break; + } + case PORT: { + DomainControllerWriteAttributeHandler.PORT.parseAndSetParameter(value, updateDc, reader); + break; + } + case PROTOCOL: { + DomainControllerWriteAttributeHandler.PROTOCOL.parseAndSetParameter(value, updateDc, reader); + break; + } + case AUTHENTICATION_CONTEXT: { + DomainControllerWriteAttributeHandler.AUTHENTICATION_CONTEXT.parseAndSetParameter(value, updateDc, reader); + break; + } + case USERNAME: { + DomainControllerWriteAttributeHandler.USERNAME.parseAndSetParameter(value, updateDc, reader); + break; + } + case IGNORE_UNUSED_CONFIG: { + DomainControllerWriteAttributeHandler.IGNORE_UNUSED_CONFIG.parseAndSetParameter(value, updateDc, reader); + break; + } + case ADMIN_ONLY_POLICY: { + DomainControllerWriteAttributeHandler.ADMIN_ONLY_POLICY.parseAndSetParameter(value, updateDc, reader); + ModelNode nodeValue = updateDc.get(DomainControllerWriteAttributeHandler.ADMIN_ONLY_POLICY.getName()); + if (nodeValue.getType() != ModelType.EXPRESSION) { + adminOnlyPolicy = AdminOnlyDomainConfigPolicy.getPolicy(nodeValue.asString()); + } + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + if (!updateDc.hasDefined(DomainControllerWriteAttributeHandler.HOST.getName())) { + requireDiscoveryOptions = isRequireDiscoveryOptions(adminOnlyPolicy); + } + if (!updateDc.hasDefined(DomainControllerWriteAttributeHandler.PORT.getName())) { + requireDiscoveryOptions = requireDiscoveryOptions || isRequireDiscoveryOptions(adminOnlyPolicy); + } + + final ModelNode update = Util.getWriteAttributeOperation(address, DOMAIN_CONTROLLER, remoteDc); + list.add(update); + return requireDiscoveryOptions; + } + + private boolean isRequireDiscoveryOptions(AdminOnlyDomainConfigPolicy adminOnlyPolicy) { + return !isCachedDc && + (runningMode != RunningMode.ADMIN_ONLY || adminOnlyPolicy == AdminOnlyDomainConfigPolicy.FETCH_FROM_DOMAIN_CONTROLLER); + } + + private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List list, final Set foundTypes) throws XMLStreamException { + + ModelNode op = new ModelNode(); + op.get(OP).set(ADD); + + String type = null; + + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } + final String value = reader.getAttributeValue(i); + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case TYPE: { + if (!foundTypes.add(value)) { + throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); + } + type = value; + break; + } + case WILDCARD: { + IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + + if (type == null) { + throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); + } + + ModelNode addr = op.get(OP_ADDR).set(address); + addr.add(CORE_SERVICE, IGNORED_RESOURCES); + addr.add(IGNORED_RESOURCE_TYPE, type); + + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case INSTANCE: { + String name = ParseUtils.readStringAttributeElement(reader, NAME); + IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); + break; + } + default: + throw unexpectedElement(reader); + } + } + + list.add(op); + } + + private void parseDiscoveryOptions(final XMLExtendedStreamReader reader, final ModelNode address, final List list, final Set staticDiscoveryOptionNames, + final Set discoveryOptionNames) throws XMLStreamException { + requireNoAttributes(reader); + + // Handle elements + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case DISCOVERY_OPTION: + parseDiscoveryOption(reader, address, list, discoveryOptionNames); + break; + case STATIC_DISCOVERY: + parseStaticDiscoveryOption(reader, address, list, staticDiscoveryOptionNames); + break; + default: + throw unexpectedElement(reader); + } + } + } + + private void parseStaticDiscoveryOption(final XMLExtendedStreamReader reader, final ModelNode address, final List list, final Set staticDiscoveryOptionNames) throws XMLStreamException { + + // OP_ADDR will be set after parsing the NAME attribute + final ModelNode staticDiscoveryOptionAddress = address.clone(); + staticDiscoveryOptionAddress.add(CORE_SERVICE, DISCOVERY_OPTIONS); + final ModelNode addOp = Util.getEmptyOperation(ADD, new ModelNode()); + list.add(addOp); + + // Handle attributes + final Set required = EnumSet.of(Attribute.NAME, Attribute.HOST, Attribute.PORT); + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + requireNoNamespaceAttribute(reader, i); + final String value = reader.getAttributeValue(i); + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + required.remove(attribute); + switch (attribute) { + case NAME: { + if (!staticDiscoveryOptionNames.add(value)) { + throw ParseUtils.duplicateNamedElement(reader, value); + } + addOp.get(OP_ADDR).set(staticDiscoveryOptionAddress).add(STATIC_DISCOVERY, value); + break; + } + case HOST: { + StaticDiscoveryResourceDefinition.HOST.parseAndSetParameter(value, addOp, reader); + break; + } + case PROTOCOL: { + StaticDiscoveryResourceDefinition.PROTOCOL.parseAndSetParameter(value, addOp, reader); + break; + } + case PORT: { + StaticDiscoveryResourceDefinition.PORT.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + + if (!required.isEmpty()) { + throw missingRequired(reader, required); + } + + requireNoContent(reader); + } + + private void parseDiscoveryOption(final XMLExtendedStreamReader reader, final ModelNode address, final List list, final Set discoveryOptionNames) throws XMLStreamException { + + // Handle attributes + final ModelNode addOp = parseDiscoveryOptionAttributes(reader, address, list, discoveryOptionNames); + + // Handle elements + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case PROPERTY: { + parseDiscoveryOptionProperty(reader, addOp.get(PROPERTIES)); + break; + } + default: + throw unexpectedElement(reader); + } + } + } + + private ModelNode parseDiscoveryOptionAttributes(final XMLExtendedStreamReader reader, final ModelNode address, + final List list, final Set discoveryOptionNames) throws XMLStreamException { + + // OP_ADDR will be set after parsing the NAME attribute + final ModelNode discoveryOptionAddress = address.clone(); + discoveryOptionAddress.add(CORE_SERVICE, DISCOVERY_OPTIONS); + final ModelNode addOp = Util.getEmptyOperation(ADD, new ModelNode()); + list.add(addOp); + + final Set required = EnumSet.of(Attribute.NAME, Attribute.CODE); + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + requireNoNamespaceAttribute(reader, i); + final String value = reader.getAttributeValue(i); + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + required.remove(attribute); + switch (attribute) { + case NAME: { + if (!discoveryOptionNames.add(value)) { + throw ParseUtils.duplicateNamedElement(reader, value); + } + addOp.get(OP_ADDR).set(discoveryOptionAddress).add(DISCOVERY_OPTION, value); + break; + } + case CODE: { + DiscoveryOptionResourceDefinition.CODE.parseAndSetParameter(value, addOp, reader); + break; + } + case MODULE: { + DiscoveryOptionResourceDefinition.MODULE.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + + if (!required.isEmpty()) { + throw missingRequired(reader, required); + } + + return addOp; + } + + private void parseDiscoveryOptionProperty(XMLExtendedStreamReader reader, ModelNode discoveryOptionProperties) throws XMLStreamException { + String propertyName = null; + String propertyValue = null; + EnumSet required = EnumSet.of(Attribute.NAME, Attribute.VALUE); + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + requireNoNamespaceAttribute(reader, i); + final String value = reader.getAttributeValue(i); + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + required.remove(attribute); + switch (attribute) { + case NAME: { + propertyName = value; + break; + } + case VALUE: { + propertyValue = value; + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + + if (!required.isEmpty()) { + throw missingRequired(reader, required); + } + + discoveryOptionProperties.add(propertyName, propertyValue); + requireNoContent(reader); + } + + private void parseJvms(final XMLExtendedStreamReader reader, final ModelNode address, final List list) + throws XMLStreamException { + + requireNoAttributes(reader); + + final Set names = new HashSet(); + // Handle elements + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case JVM: + JvmXml.parseJvm(reader, address, version, namespace, list, names, false); + break; + default: + throw unexpectedElement(reader); + } + } + } + + private void parseServersAttributes(final XMLExtendedStreamReader reader, final ModelNode parentAddress, final List list) throws XMLStreamException { + // Handle attributes + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case DIRECTORY_GROUPING: { + final ModelNode address = parentAddress.clone(); + list.add(Util.getWriteAttributeOperation(address, DIRECTORY_GROUPING, + parseAttributeValue(HostResourceDefinition.DIRECTORY_GROUPING, value,reader))); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + } + + private void parseServers(final XMLExtendedStreamReader reader, final ModelNode address, final List list) throws XMLStreamException { + parseServersAttributes(reader, address, list); + // Handle elements + final Set names = new HashSet(); + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case SERVER: + parseServer(reader, address, list, names); + break; + default: + throw unexpectedElement(reader); + } + } + } + + private void parseServer(final XMLExtendedStreamReader reader, final ModelNode parentAddress, final List list, + final Set serverNames) throws XMLStreamException { + + // Handle attributes + final ModelNode addUpdate = parseServerAttributes(reader, parentAddress, serverNames); + final ModelNode address = addUpdate.require(OP_ADDR); + list.add(addUpdate); + + // Handle elements + parseServerContent(reader, addUpdate, address, list); + } + + private void parseServerContent(final XMLExtendedStreamReader reader, final ModelNode serverAddOperation, + final ModelNode serverAddress, final List list) throws XMLStreamException { + boolean sawJvm = false; + boolean sawSystemProperties = false; + boolean sawSocketBinding = false; + boolean sawSSL = false; + final Set interfaceNames = new HashSet(); + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case INTERFACES: { // THIS IS DIFFERENT FROM 1.0 + parseInterfaces(reader, interfaceNames, serverAddress, version, namespace, list, true); + break; + } + case JVM: { + if (sawJvm) { + throw ControllerLogger.ROOT_LOGGER.alreadyDefined(element.getLocalName(), reader.getLocation()); + } + + JvmXml.parseJvm(reader, serverAddress, version, namespace, list, new HashSet(), true); + sawJvm = true; + break; + } + case PATHS: { + parsePaths(reader, serverAddress, namespace, list, true); + break; + } + case SOCKET_BINDINGS: { + if (sawSocketBinding) { + throw ControllerLogger.ROOT_LOGGER.alreadyDefined(element.getLocalName(), reader.getLocation()); + } + parseServerSocketBindings(reader, serverAddOperation); + sawSocketBinding = true; + break; + } + case SSL: { + if (sawSSL) { + throw ControllerLogger.ROOT_LOGGER.alreadyDefined(element.getLocalName(), reader.getLocation()); + } + parseServerSsl(serverAddress, reader, list); + sawSSL = true; + break; + } + case SYSTEM_PROPERTIES: { + if (sawSystemProperties) { + throw ControllerLogger.ROOT_LOGGER.alreadyDefined(element.getLocalName(), reader.getLocation()); + } + parseSystemProperties(reader, serverAddress, namespace, list, false); + sawSystemProperties = true; + break; + } + default: + throw unexpectedElement(reader); + } + } + + } + + private ModelNode parseServerAttributes(final XMLExtendedStreamReader reader, final ModelNode parentAddress, + final Set serverNames) throws XMLStreamException { + + final ModelNode addUpdate = new ModelNode(); + addUpdate.get(OP).set(ADD); + + final Set required = EnumSet.of(Attribute.NAME, Attribute.GROUP); + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + required.remove(attribute); + switch (attribute) { + case NAME: { + if (!serverNames.add(value)) { + throw ControllerLogger.ROOT_LOGGER.duplicateDeclaration("server", value, reader.getLocation()); + } + final ModelNode address = parentAddress.clone().add(SERVER_CONFIG, value); + addUpdate.get(OP_ADDR).set(address); + break; + } + case GROUP: { + ServerConfigResourceDefinition.GROUP.parseAndSetParameter(value, addUpdate, reader); + break; + } + case AUTO_START: { + ServerConfigResourceDefinition.AUTO_START.parseAndSetParameter(value, addUpdate, reader); + break; + } + case UPDATE_AUTO_START_WITH_SERVER_STATUS: { + ServerConfigResourceDefinition.UPDATE_AUTO_START_WITH_SERVER_STATUS.parseAndSetParameter(value, addUpdate, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + if (!required.isEmpty()) { + throw missingRequired(reader, required); + } + + return addUpdate; + } + + private void parseServerSocketBindings(final XMLExtendedStreamReader reader, final ModelNode serverAddOperation) throws XMLStreamException { + // Handle attributes + + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw ParseUtils.unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case SOCKET_BINDING_GROUP: { + ServerConfigResourceDefinition.SOCKET_BINDING_GROUP.parseAndSetParameter(value, serverAddOperation, reader); + break; + } + case DEFAULT_INTERFACE: { + ServerConfigResourceDefinition.SOCKET_BINDING_DEFAULT_INTERFACE.parseAndSetParameter(value, serverAddOperation, reader); + break; + } + case PORT_OFFSET: { + ServerConfigResourceDefinition.SOCKET_BINDING_PORT_OFFSET.parseAndSetParameter(value, serverAddOperation, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + // Handle elements + requireNoContent(reader); + + } + + private void parseServerSsl(final ModelNode parentAddress, final XMLExtendedStreamReader reader, final List operations) throws XMLStreamException { + + ModelNode addOp = new ModelNode(); + addOp.get(OP).set(ADD); + final ModelNode address = parentAddress.clone(); + address.add(SSL, LOOPBACK); + addOp.get(OP_ADDR).set(address); + operations.add(addOp); + + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw ParseUtils.unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case SSL_PROTOCOL: { + SslLoopbackResourceDefinition.SSL_PROTOCOCOL.parseAndSetParameter(value, addOp, reader); + break; + } + case TRUST_MANAGER_ALGORITHM: { + SslLoopbackResourceDefinition.TRUST_MANAGER_ALGORITHM.parseAndSetParameter(value, addOp, reader); + break; + } + case TRUSTSTORE_TYPE: { + SslLoopbackResourceDefinition.TRUSTSTORE_TYPE.parseAndSetParameter(value, addOp, reader); + break; + } + case TRUSTSTORE_PATH: { + SslLoopbackResourceDefinition.TRUSTSTORE_PATH.parseAndSetParameter(value, addOp, reader); + break; + } + case TRUSTSTORE_PASSWORD: { + SslLoopbackResourceDefinition.TRUSTSTORE_PASSWORD.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + requireNoContent(reader); + + } + private void parseHostProfile(XMLExtendedStreamReader reader, ModelNode address, List list) throws XMLStreamException { + // Attributes + requireNoAttributes(reader); + + // Content + final Map> profileOps = new LinkedHashMap>(); + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + if (Element.forName(reader.getLocalName()) != Element.SUBSYSTEM) { + throw unexpectedElement(reader); + } + String namespace = reader.getNamespaceURI(); + if (profileOps.containsKey(namespace)) { + throw ControllerLogger.ROOT_LOGGER.duplicateDeclaration("subsystem", reader.getLocation()); + } + // parse subsystem + final List subsystems = new ArrayList(); + reader.handleAny(subsystems); + + profileOps.put(namespace, subsystems); + } + + // Let extensions modify the profile + Set completionHandlers = extensionRegistry.getProfileParsingCompletionHandlers(); + for (ProfileParsingCompletionHandler completionHandler : completionHandlers) { + completionHandler.handleProfileParsingCompletion(profileOps, list); + } + + for (List subsystems : profileOps.values()) { + for (final ModelNode update : subsystems) { + // Process relative subsystem path address + final ModelNode subsystemAddress = address.clone(); + for (final Property path : update.get(OP_ADDR).asPropertyList()) { + subsystemAddress.add(path.getName(), path.getValue().asString()); + } + update.get(OP_ADDR).set(subsystemAddress); + list.add(update); + } + } + } + + private void parseSocketBindingGroup(final XMLExtendedStreamReader reader, final Set interfaces, + final ModelNode address, final List updates) throws XMLStreamException { + + // unique names for both socket-binding and outbound-socket-binding(s) + final Set uniqueBindingNames = new HashSet(); + + ModelNode op = Util.getEmptyOperation(ADD, null); + // Handle attributes + String socketBindingGroupName = null; + + final EnumSet required = EnumSet.of(Attribute.NAME, Attribute.DEFAULT_INTERFACE); + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case NAME: { + socketBindingGroupName = value; + required.remove(attribute); + break; + } + case DEFAULT_INTERFACE: { + SocketBindingGroupResourceDefinition.DEFAULT_INTERFACE.parseAndSetParameter(value, op, reader); + required.remove(attribute); + if (op.get(SocketBindingGroupResourceDefinition.DEFAULT_INTERFACE.getName()).getType() != ModelType.EXPRESSION + && !interfaces.contains(value)) { + throw ControllerLogger.ROOT_LOGGER.unknownInterface(value, Attribute.DEFAULT_INTERFACE.getLocalName(), Element.INTERFACES.getLocalName(), reader.getLocation()); + } + break; + } + case PORT_OFFSET: { + SocketBindingGroupResourceDefinition.PORT_OFFSET.parseAndSetParameter(value, op, reader); + break; + } + default: + throw ParseUtils.unexpectedAttribute(reader, i); + } + } + + if (!required.isEmpty()) { + throw missingRequired(reader, required); + } + + + ModelNode groupAddress = address.clone().add(SOCKET_BINDING_GROUP, socketBindingGroupName); + op.get(OP_ADDR).set(groupAddress); + + updates.add(op); + + // Handle elements + while (reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case SOCKET_BINDING: { + final String bindingName = parseSocketBinding(reader, interfaces, groupAddress, updates); + if (!uniqueBindingNames.add(bindingName)) { + throw ControllerLogger.ROOT_LOGGER.alreadyDeclared(Element.SOCKET_BINDING.getLocalName(), Element.OUTBOUND_SOCKET_BINDING.getLocalName(), bindingName, Element.SOCKET_BINDING_GROUP.getLocalName(), socketBindingGroupName, reader.getLocation()); + } + break; + } + case OUTBOUND_SOCKET_BINDING: { + final String bindingName = parseOutboundSocketBinding(reader, interfaces, groupAddress, updates); + if (!uniqueBindingNames.add(bindingName)) { + throw ControllerLogger.ROOT_LOGGER.alreadyDeclared(Element.SOCKET_BINDING.getLocalName(), Element.OUTBOUND_SOCKET_BINDING.getLocalName(), bindingName, Element.SOCKET_BINDING_GROUP.getLocalName(), socketBindingGroupName, reader.getLocation()); + } + break; + } + default: + throw unexpectedElement(reader); + } + } + } + + private void writeDomainController(final XMLExtendedStreamWriter writer, final ModelNode modelNode, ModelNode ignoredResources, + ModelNode discoveryOptions) throws XMLStreamException { + writer.writeStartElement(Element.DOMAIN_CONTROLLER.getLocalName()); + if (modelNode.hasDefined(LOCAL)) { + if (discoveryOptions != null) { + writer.writeStartElement(Element.LOCAL.getLocalName()); + writeDiscoveryOptions(writer, discoveryOptions); + writer.writeEndElement(); + } else { + writer.writeEmptyElement(Element.LOCAL.getLocalName()); + } + } else if (modelNode.hasDefined(REMOTE)) { + writer.writeStartElement(Element.REMOTE.getLocalName()); + final ModelNode remote = modelNode.get(REMOTE); + RemoteDomainControllerAddHandler.PROTOCOL.marshallAsAttribute(remote, writer); + RemoteDomainControllerAddHandler.HOST.marshallAsAttribute(remote, writer); + RemoteDomainControllerAddHandler.PORT.marshallAsAttribute(remote, writer); + RemoteDomainControllerAddHandler.AUTHENTICATION_CONTEXT.marshallAsAttribute(remote, writer); + RemoteDomainControllerAddHandler.USERNAME.marshallAsAttribute(remote, writer); + RemoteDomainControllerAddHandler.IGNORE_UNUSED_CONFIG.marshallAsAttribute(remote, writer); + RemoteDomainControllerAddHandler.ADMIN_ONLY_POLICY.marshallAsAttribute(remote, writer); + + if (ignoredResources != null) { + writeIgnoredResources(writer, ignoredResources); + } + if (discoveryOptions != null) { + writeDiscoveryOptions(writer, discoveryOptions); + } + writer.writeEndElement(); + } + writer.writeEndElement(); + } + + private void writeIgnoredResources(XMLExtendedStreamWriter writer, ModelNode ignoredTypes) throws XMLStreamException { + for (String ignoredName : ignoredTypes.keys()) { + + ModelNode ignored = ignoredTypes.get(ignoredName); + + ModelNode names = ignored.hasDefined(NAMES) ? ignored.get(NAMES) : null; + boolean hasNames = names != null && names.asInt() > 0; + if (hasNames) { + writer.writeStartElement(Element.IGNORED_RESOURCE.getLocalName()); + } else { + writer.writeEmptyElement(Element.IGNORED_RESOURCE.getLocalName()); + } + + writer.writeAttribute(Attribute.TYPE.getLocalName(), ignoredName); + IgnoredDomainTypeResourceDefinition.WILDCARD.marshallAsAttribute(ignored, writer); + + if (hasNames) { + for (ModelNode name : names.asList()) { + writer.writeEmptyElement(Element.INSTANCE.getLocalName()); + writer.writeAttribute(Attribute.NAME.getLocalName(), name.asString()); + } + writer.writeEndElement(); + } + } + } + + private void writeDiscoveryOptions(XMLExtendedStreamWriter writer, ModelNode discoveryOptions) throws XMLStreamException { + writer.writeStartElement(Element.DISCOVERY_OPTIONS.getLocalName()); + for (Property property : discoveryOptions.asPropertyList()) { + final String type = property.getName().equals(STATIC_DISCOVERY) ? STATIC_DISCOVERY : DISCOVERY_OPTION; + final Element element = Element.forName(type); + final String optionName = property.getValue().get(ModelDescriptionConstants.NAME).asString(); + + switch (element) { + case STATIC_DISCOVERY: { + final ModelNode staticDiscoveryOption = property.getValue(); + writer.writeStartElement(element.getLocalName()); + WriteUtils.writeAttribute(writer, Attribute.NAME, optionName); + StaticDiscoveryResourceDefinition.PROTOCOL.marshallAsAttribute(staticDiscoveryOption, writer); + StaticDiscoveryResourceDefinition.HOST.marshallAsAttribute(staticDiscoveryOption, writer); + StaticDiscoveryResourceDefinition.PORT.marshallAsAttribute(staticDiscoveryOption, writer); + writer.writeEndElement(); + break; + } + case DISCOVERY_OPTION: { + final ModelNode discoveryOption = property.getValue(); + writer.writeStartElement(element.getLocalName()); + WriteUtils.writeAttribute(writer, Attribute.NAME, optionName); + DiscoveryOptionResourceDefinition.CODE.marshallAsAttribute(discoveryOption, writer); + DiscoveryOptionResourceDefinition.MODULE.marshallAsAttribute(discoveryOption, writer); + if (discoveryOption.hasDefined(PROPERTIES)) { + writeDiscoveryOptionProperties(writer, discoveryOption.get(PROPERTIES)); + } + writer.writeEndElement(); + break; + } + default: + throw new RuntimeException(ControllerLogger.ROOT_LOGGER.unknownChildType(element.getLocalName())); + } + } + writer.writeEndElement(); + } + + private void writeDiscoveryOptionProperties(XMLExtendedStreamWriter writer, ModelNode discoveryOptionProperties) throws XMLStreamException { + for (String property : discoveryOptionProperties.keys()) { + writer.writeStartElement(Element.PROPERTY.getLocalName()); + WriteUtils.writeAttribute(writer, Attribute.NAME, property); + WriteUtils.writeAttribute(writer, Attribute.VALUE, discoveryOptionProperties.get(property).asString()); + writer.writeEndElement(); + } + } + + private void writeServers(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException { + + for (String serverName : modelNode.keys()) { + final ModelNode server = modelNode.get(serverName); + + writer.writeStartElement(Element.SERVER.getLocalName()); + + WriteUtils.writeAttribute(writer, Attribute.NAME, serverName); + ServerConfigResourceDefinition.GROUP.marshallAsAttribute(server, writer); + ServerConfigResourceDefinition.AUTO_START.marshallAsAttribute(server, writer); + ServerConfigResourceDefinition.UPDATE_AUTO_START_WITH_SERVER_STATUS.marshallAsAttribute(server, writer); + if (server.hasDefined(PATH)) { + writePaths(writer, server.get(PATH), false); + } + if (server.hasDefined(SYSTEM_PROPERTY)) { + writeProperties(writer, server.get(SYSTEM_PROPERTY), Element.SYSTEM_PROPERTIES, false); + } + if (server.hasDefined(INTERFACE)) { + writeInterfaces(writer, server.get(INTERFACE)); + } + if (server.hasDefined(JVM)) { + for (final Property jvm : server.get(JVM).asPropertyList()) { + JvmXml.writeJVMElement(writer, jvm.getName(), jvm.getValue()); + break; // TODO just write the first !? + } + } + if (server.hasDefined(SOCKET_BINDING_GROUP) || server.hasDefined(SOCKET_BINDING_PORT_OFFSET) || server.hasDefined(SOCKET_BINDING_DEFAULT_INTERFACE)) { + writer.writeStartElement(Element.SOCKET_BINDINGS.getLocalName()); + ServerConfigResourceDefinition.SOCKET_BINDING_GROUP.marshallAsAttribute(server, writer); + ServerConfigResourceDefinition.SOCKET_BINDING_PORT_OFFSET.marshallAsAttribute(server, writer); + ServerConfigResourceDefinition.SOCKET_BINDING_DEFAULT_INTERFACE.marshallAsAttribute(server, writer); + writer.writeEndElement(); + } + if (server.hasDefined(SSL, LOOPBACK)) { + ModelNode ssl = server.get(SSL, LOOPBACK); + writer.writeStartElement(Element.SSL.getLocalName()); + SslLoopbackResourceDefinition.SSL_PROTOCOCOL.marshallAsAttribute(ssl, writer); + SslLoopbackResourceDefinition.TRUST_MANAGER_ALGORITHM.marshallAsAttribute(ssl, writer); + SslLoopbackResourceDefinition.TRUSTSTORE_TYPE.marshallAsAttribute(ssl, writer); + SslLoopbackResourceDefinition.TRUSTSTORE_PATH.marshallAsAttribute(ssl, writer); + SslLoopbackResourceDefinition.TRUSTSTORE_PASSWORD.marshallAsAttribute(ssl, writer); + writer.writeEndElement(); + } + + writer.writeEndElement(); + } + } + + private void writeHostProfile(final XMLExtendedStreamWriter writer, final ModelMarshallingContext context) + throws XMLStreamException { + + final ModelNode profileNode = context.getModelNode(); + // In case there are no subsystems defined + if (!profileNode.hasDefined(SUBSYSTEM)) { + return; + } + + writer.writeStartElement(Element.PROFILE.getLocalName()); + writeSubsystems(profileNode, writer, context); + writer.writeEndElement(); + } + + /* + * ManagamentXmlDelegate Methods + */ + + @Override + public boolean parseManagementInterfaces(XMLExtendedStreamReader reader, ModelNode address, List operationsList) + throws XMLStreamException { + + requireNoAttributes(reader); + boolean interfaceDefined = false; + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case NATIVE_INTERFACE: { + interfaceDefined = true; + parseNativeManagementInterface(reader, address, operationsList); + break; + } + case HTTP_INTERFACE: { + interfaceDefined = true; + parseHttpManagementInterface(reader, address, operationsList); + break; + } + default: { + throw unexpectedElement(reader); + } + } + } + + if (!interfaceDefined) { + throw missingOneOf(reader, EnumSet.of(Element.NATIVE_INTERFACE, Element.HTTP_INTERFACE)); + } + + return true; + } + + @Override + public boolean parseAuditLog(XMLExtendedStreamReader reader, ModelNode address, List list) + throws XMLStreamException { + auditLogDelegate.parseAuditLog(reader, address, namespace, list); + + return true; + } + + @Override + public boolean writeNativeManagementProtocol(XMLExtendedStreamWriter writer, ModelNode protocol) throws XMLStreamException { + + writer.writeStartElement(Element.NATIVE_INTERFACE.getLocalName()); + NativeManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol, writer); + NativeManagementResourceDefinition.SSL_CONTEXT.marshallAsAttribute(protocol, writer); + NativeManagementResourceDefinition.SASL_PROTOCOL.marshallAsAttribute(protocol, writer); + NativeManagementResourceDefinition.SERVER_NAME.marshallAsAttribute(protocol, writer); + + writer.writeEmptyElement(Element.SOCKET.getLocalName()); + NativeManagementResourceDefinition.INTERFACE.marshallAsAttribute(protocol, writer); + NativeManagementResourceDefinition.NATIVE_PORT.marshallAsAttribute(protocol, writer); + + writer.writeEndElement(); + + return true; + } + + @Override + public boolean writeHttpManagementProtocol(XMLExtendedStreamWriter writer, ModelNode protocol) throws XMLStreamException { + + writer.writeStartElement(Element.HTTP_INTERFACE.getLocalName()); + HttpManagementResourceDefinition.HTTP_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.SSL_CONTEXT.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.CONSOLE_ENABLED.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.ALLOWED_ORIGINS.getMarshaller().marshallAsAttribute( + HttpManagementResourceDefinition.ALLOWED_ORIGINS, protocol, true, writer + ); + HttpManagementResourceDefinition.SASL_PROTOCOL.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.SERVER_NAME.marshallAsAttribute(protocol, writer); + + HttpManagementResourceDefinition.BACKLOG.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.NO_REQUEST_TIMEOUT.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.CONNECTION_HIGH_WATER.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.CONNECTION_LOW_WATER.marshallAsAttribute(protocol, writer); + + + if (HttpManagementResourceDefinition.HTTP_UPGRADE.isMarshallable(protocol)) { + writer.writeEmptyElement(Element.HTTP_UPGRADE.getLocalName()); + HttpManagementResourceDefinition.ENABLED.marshallAsAttribute(protocol.require(HTTP_UPGRADE), writer); + HttpManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol.require(HTTP_UPGRADE), writer); + } + + writer.writeEmptyElement(Element.SOCKET.getLocalName()); + HttpManagementResourceDefinition.INTERFACE.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.HTTP_PORT.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.HTTPS_PORT.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.SECURE_INTERFACE.marshallAsAttribute(protocol, writer); + + if (HttpManagementResourceDefinition.CONSTANT_HEADERS.isMarshallable(protocol)) { + writer.writeStartElement(Element.CONSTANT_HEADERS.getLocalName()); + + for (ModelNode headerMapping : protocol.require(ModelDescriptionConstants.CONSTANT_HEADERS).asList()) { + writer.writeStartElement(Element.HEADER_MAPPING.getLocalName()); + BaseHttpInterfaceResourceDefinition.PATH.marshallAsAttribute(headerMapping, writer); + for (ModelNode header : headerMapping.require(ModelDescriptionConstants.HEADERS).asList()) { + writer.writeEmptyElement(Element.HEADER.getLocalName()); + BaseHttpInterfaceResourceDefinition.HEADER_NAME.marshallAsAttribute(header, writer); + BaseHttpInterfaceResourceDefinition.HEADER_VALUE.marshallAsAttribute(header, writer); + } + writer.writeEndElement(); + } + + writer.writeEndElement(); + } + + writer.writeEndElement(); + + return true; + } + + @Override + public boolean writeAuditLog(XMLExtendedStreamWriter writer, ModelNode auditLog) throws XMLStreamException { + auditLogDelegate.writeAuditLog(writer, auditLog); + + return true; + } + +} diff --git a/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml.java b/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml.java index 162ef07f8a1..48db388142c 100644 --- a/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml.java +++ b/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml.java @@ -114,8 +114,11 @@ public void readElement(final XMLExtendedStreamReader reader, final VersionedNam case 19: new StandaloneXml_18(extensionHandler, version, namespaceUri, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; - default: + case 20: new StandaloneXml_20(extensionHandler, namespace, deferredExtensionContext, parsingOptions).readElement(reader, operationList); + break; + default: + new StandaloneXml_21(extensionHandler, namespace, deferredExtensionContext, parsingOptions).readElement(reader, operationList); } } @@ -123,7 +126,7 @@ public void readElement(final XMLExtendedStreamReader reader, final VersionedNam public void writeContent(final XMLExtendedStreamWriter writer, final VersionedNamespace namespace, final ModelMarshallingContext context) throws XMLStreamException { - new StandaloneXml_20(extensionHandler, namespace, deferredExtensionContext, parsingOptions).writeContent(writer, context); + new StandaloneXml_21(extensionHandler, namespace, deferredExtensionContext, parsingOptions).writeContent(writer, context); } class DefaultExtensionHandler implements ExtensionHandler { diff --git a/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml_20.java b/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml_20.java index 21d6c78600a..834c3958e33 100644 --- a/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml_20.java +++ b/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml_20.java @@ -9,30 +9,17 @@ import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ACCESS; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.AUTHORIZATION; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CONNECTION_HIGH_WATER; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CONNECTION_LOW_WATER; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CONTENT; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CORE_SERVICE; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DEPLOYMENT; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DEPLOYMENT_OVERLAY; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.EXTENSION; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HTTP_INTERFACE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HTTP_UPGRADE; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.INTERFACE; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MANAGEMENT; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MANAGEMENT_INTERFACE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NATIVE_INTERFACE; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NATIVE_REMOTING_INTERFACE; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NO_REQUEST_TIMEOUT; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ORGANIZATION; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PATH; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING; import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING_GROUP; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SYSTEM_PROPERTY; import static org.jboss.as.controller.parsing.ParseUtils.isNoNamespaceAttribute; import static org.jboss.as.controller.parsing.ParseUtils.isXmlNamespaceAttribute; import static org.jboss.as.controller.parsing.ParseUtils.missingRequired; @@ -44,7 +31,6 @@ import static org.jboss.as.controller.parsing.ParseUtils.requireSingleAttribute; import static org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute; import static org.jboss.as.controller.parsing.ParseUtils.unexpectedElement; -import static org.jboss.as.server.controller.resources.ServerRootResourceDefinition.ORGANIZATION_IDENTIFIER; import java.util.ArrayList; import java.util.Collections; @@ -60,7 +46,6 @@ import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.as.controller.logging.ControllerLogger; -import org.jboss.as.controller.management.BaseHttpInterfaceResourceDefinition; import org.jboss.as.controller.operations.common.Util; import org.jboss.as.controller.parsing.Attribute; import org.jboss.as.controller.parsing.DeferredExtensionContext; @@ -68,15 +53,12 @@ import org.jboss.as.controller.parsing.ManagementXmlSchema; import org.jboss.as.controller.parsing.ParseUtils; import org.jboss.as.controller.parsing.ProfileParsingCompletionHandler; -import org.jboss.as.controller.parsing.WriteUtils; -import org.jboss.as.controller.persistence.ModelMarshallingContext; import org.jboss.as.controller.xml.VersionedNamespace; import org.jboss.as.domain.management.access.AccessAuthorizationResourceDefinition; import org.jboss.as.domain.management.parsing.AccessControlXml; import org.jboss.as.domain.management.parsing.AuditLogXml; import org.jboss.as.domain.management.parsing.ManagementXml; import org.jboss.as.domain.management.parsing.ManagementXmlDelegate; -import org.jboss.as.server.controller.resources.DeploymentAttributes; import org.jboss.as.server.controller.resources.ServerRootResourceDefinition; import org.jboss.as.server.logging.ServerLogger; import org.jboss.as.server.mgmt.HttpManagementResourceDefinition; @@ -88,7 +70,6 @@ import org.jboss.dmr.Property; import org.jboss.staxmapper.IntVersion; import org.jboss.staxmapper.XMLExtendedStreamReader; -import org.jboss.staxmapper.XMLExtendedStreamWriter; /** * Parser and marshaller for standalone server configuration xml documents (e.g. standalone.xml) that use the urn:jboss:domain:19.0 schema. @@ -724,116 +705,6 @@ private void setServerName(final ModelNode address, final List operat } } - void writeContent(final XMLExtendedStreamWriter writer, final ModelMarshallingContext context) - throws XMLStreamException { - - ModelNode modelNode = context.getModelNode(); - writer.writeStartDocument(); - writer.writeStartElement(Element.SERVER.getLocalName()); - - if (modelNode.hasDefined(NAME)) { - ServerRootResourceDefinition.NAME.marshallAsAttribute(modelNode, false, writer); - } - - if (modelNode.hasDefined(ORGANIZATION_IDENTIFIER.getName())) { - ServerRootResourceDefinition.ORGANIZATION_IDENTIFIER.marshallAsAttribute(modelNode, false, writer); - } - - writer.writeDefaultNamespace(namespace); - writeNamespaces(writer, modelNode); - writeSchemaLocation(writer, modelNode); - - if (modelNode.hasDefined(EXTENSION)) { - extensionHandler.writeExtensions(writer, modelNode.get(EXTENSION)); - } - - if (modelNode.hasDefined(SYSTEM_PROPERTY)) { - writeProperties(writer, modelNode.get(SYSTEM_PROPERTY), Element.SYSTEM_PROPERTIES, true); - } - - if (modelNode.hasDefined(PATH)) { - writePaths(writer, modelNode.get(PATH), false); - } - - if (modelNode.hasDefined(CORE_SERVICE)) { - ManagementXml managementXml = ManagementXml.newInstance(version, namespace, this, false); - managementXml.writeManagement(writer, modelNode.get(CORE_SERVICE, MANAGEMENT), true); - } - - writeServerProfile(writer, context); - - if (modelNode.hasDefined(INTERFACE)) { - writeInterfaces(writer, modelNode.get(INTERFACE)); - } - - if (modelNode.hasDefined(SOCKET_BINDING_GROUP)) { - Set groups = modelNode.get(SOCKET_BINDING_GROUP).keys(); - if (groups.size() > 1) { - throw ControllerLogger.ROOT_LOGGER.multipleModelNodes(SOCKET_BINDING_GROUP); - } - for (String group : groups) { - writeSocketBindingGroup(writer, modelNode.get(SOCKET_BINDING_GROUP, group), group); - } - } - - if (modelNode.hasDefined(DEPLOYMENT)) { - writeServerDeployments(writer, modelNode.get(DEPLOYMENT)); - WriteUtils.writeNewLine(writer); - } - - if (modelNode.hasDefined(DEPLOYMENT_OVERLAY)) { - writeDeploymentOverlays(writer, modelNode.get(DEPLOYMENT_OVERLAY)); - WriteUtils.writeNewLine(writer); - } - writer.writeEndElement(); - writer.writeEndDocument(); - } - - private void writeServerDeployments(final XMLExtendedStreamWriter writer, final ModelNode modelNode) - throws XMLStreamException { - - boolean deploymentWritten = false; - for (String deploymentName : modelNode.keys()) { - - final ModelNode deployment = modelNode.get(deploymentName); - if (!deployment.isDefined()) { - continue; - } - - if (!deploymentWritten) { - writer.writeStartElement(Element.DEPLOYMENTS.getLocalName()); - deploymentWritten = true; - } - - writer.writeStartElement(Element.DEPLOYMENT.getLocalName()); - WriteUtils.writeAttribute(writer, Attribute.NAME, deploymentName); - DeploymentAttributes.RUNTIME_NAME.marshallAsAttribute(deployment, writer); - DeploymentAttributes.ENABLED.marshallAsAttribute(deployment, writer); - final List contentItems = deployment.require(CONTENT).asList(); - for (ModelNode contentItem : contentItems) { - writeContentItem(writer, contentItem); - } - writer.writeEndElement(); - } - if (deploymentWritten) { - writer.writeEndElement(); - } - } - - private void writeServerProfile(final XMLExtendedStreamWriter writer, final ModelMarshallingContext context) - throws XMLStreamException { - - final ModelNode profileNode = context.getModelNode(); - // In case there are no subsystems defined - if (!profileNode.hasDefined(SUBSYSTEM)) { - return; - } - - writer.writeStartElement(Element.PROFILE.getLocalName()); - writeSubsystems(profileNode, writer, context); - writer.writeEndElement(); - } - /* * ManagamentXmlDelegate Methods */ @@ -944,91 +815,4 @@ public boolean parseAuditLog(XMLExtendedStreamReader reader, ModelNode address, return true; } - - @Override - public boolean writeNativeManagementProtocol(XMLExtendedStreamWriter writer, ModelNode protocol) throws XMLStreamException { - - writer.writeStartElement(Element.NATIVE_INTERFACE.getLocalName()); - NativeManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol, writer); - NativeManagementResourceDefinition.SSL_CONTEXT.marshallAsAttribute(protocol, writer); - NativeManagementResourceDefinition.SASL_PROTOCOL.marshallAsAttribute(protocol, writer); - NativeManagementResourceDefinition.SERVER_NAME.marshallAsAttribute(protocol, writer); - - if (NativeManagementResourceDefinition.SOCKET_BINDING.isMarshallable(protocol)) { - writer.writeEmptyElement(Element.SOCKET_BINDING.getLocalName()); - NativeManagementResourceDefinition.SOCKET_BINDING.marshallAsAttribute(protocol, writer); - } - - writer.writeEndElement(); - - return true; - } - - @Override - public boolean writeHttpManagementProtocol(XMLExtendedStreamWriter writer, ModelNode protocol) throws XMLStreamException { - - writer.writeStartElement(Element.HTTP_INTERFACE.getLocalName()); - HttpManagementResourceDefinition.HTTP_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.SSL_CONTEXT.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.SASL_PROTOCOL.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.SERVER_NAME.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.CONSOLE_ENABLED.marshallAsAttribute(protocol, writer); - if (stability.enables(Stability.COMMUNITY)) { - HttpManagementResourceDefinition.BACKLOG.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.NO_REQUEST_TIMEOUT.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.CONNECTION_HIGH_WATER.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.CONNECTION_LOW_WATER.marshallAsAttribute(protocol, writer); - } - - HttpManagementResourceDefinition.ALLOWED_ORIGINS.getMarshaller().marshallAsAttribute( - HttpManagementResourceDefinition.ALLOWED_ORIGINS, protocol, true, writer); - - if (HttpManagementResourceDefinition.HTTP_UPGRADE.isMarshallable(protocol)) { - writer.writeEmptyElement(Element.HTTP_UPGRADE.getLocalName()); - HttpManagementResourceDefinition.ENABLED.marshallAsAttribute(protocol.require(HTTP_UPGRADE), writer); - HttpManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol.require(HTTP_UPGRADE), writer); - } - - if (HttpManagementResourceDefinition.SOCKET_BINDING.isMarshallable(protocol) - || HttpManagementResourceDefinition.SECURE_SOCKET_BINDING.isMarshallable(protocol)) { - writer.writeEmptyElement(Element.SOCKET_BINDING.getLocalName()); - HttpManagementResourceDefinition.SOCKET_BINDING.marshallAsAttribute(protocol, writer); - HttpManagementResourceDefinition.SECURE_SOCKET_BINDING.marshallAsAttribute(protocol, writer); - } - - if (HttpManagementResourceDefinition.CONSTANT_HEADERS.isMarshallable(protocol)) { - writer.writeStartElement(Element.CONSTANT_HEADERS.getLocalName()); - - for (ModelNode headerMapping : protocol.require(ModelDescriptionConstants.CONSTANT_HEADERS).asList()) { - writer.writeStartElement(Element.HEADER_MAPPING.getLocalName()); - BaseHttpInterfaceResourceDefinition.PATH.marshallAsAttribute(headerMapping, writer); - for (ModelNode header : headerMapping.require(ModelDescriptionConstants.HEADERS).asList()) { - writer.writeEmptyElement(Element.HEADER.getLocalName()); - BaseHttpInterfaceResourceDefinition.HEADER_NAME.marshallAsAttribute(header, writer); - BaseHttpInterfaceResourceDefinition.HEADER_VALUE.marshallAsAttribute(header, writer); - } - writer.writeEndElement(); - } - - writer.writeEndElement(); - } - - writer.writeEndElement(); - - return true; - } - - @Override - public boolean writeAccessControl(XMLExtendedStreamWriter writer, ModelNode accessAuthorization) throws XMLStreamException { - accessControlXml.writeAccessControl(writer, accessAuthorization); - - return true; - } - - @Override - public boolean writeAuditLog(XMLExtendedStreamWriter writer, ModelNode auditLog) throws XMLStreamException { - auditLogDelegate.writeAuditLog(writer, auditLog); - - return true; - } } diff --git a/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml_21.java b/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml_21.java new file mode 100644 index 00000000000..953d304a1f0 --- /dev/null +++ b/server/src/main/java/org/jboss/as/server/parsing/StandaloneXml_21.java @@ -0,0 +1,1009 @@ +/* + * Copyright The WildFly Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.jboss.as.server.parsing; + +import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ACCESS; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.AUTHORIZATION; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CONTENT; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CORE_SERVICE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DEPLOYMENT; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DEPLOYMENT_OVERLAY; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.EXTENSION; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HTTP_INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HTTP_UPGRADE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MANAGEMENT; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.MANAGEMENT_INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAME; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NATIVE_INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NATIVE_REMOTING_INTERFACE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ORGANIZATION; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PATH; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SOCKET_BINDING_GROUP; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SYSTEM_PROPERTY; +import static org.jboss.as.controller.parsing.ParseUtils.isNoNamespaceAttribute; +import static org.jboss.as.controller.parsing.ParseUtils.isXmlNamespaceAttribute; +import static org.jboss.as.controller.parsing.ParseUtils.missingRequired; +import static org.jboss.as.controller.parsing.ParseUtils.missingRequiredElement; +import static org.jboss.as.controller.parsing.ParseUtils.nextElement; +import static org.jboss.as.controller.parsing.ParseUtils.requireNamespace; +import static org.jboss.as.controller.parsing.ParseUtils.requireNoAttributes; +import static org.jboss.as.controller.parsing.ParseUtils.requireNoContent; +import static org.jboss.as.controller.parsing.ParseUtils.requireSingleAttribute; +import static org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute; +import static org.jboss.as.controller.parsing.ParseUtils.unexpectedElement; +import static org.jboss.as.server.controller.resources.ServerRootResourceDefinition.ORGANIZATION_IDENTIFIER; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; + +import org.jboss.as.controller.descriptions.ModelDescriptionConstants; +import org.jboss.as.controller.logging.ControllerLogger; +import org.jboss.as.controller.management.BaseHttpInterfaceResourceDefinition; +import org.jboss.as.controller.operations.common.Util; +import org.jboss.as.controller.parsing.Attribute; +import org.jboss.as.controller.parsing.DeferredExtensionContext; +import org.jboss.as.controller.parsing.Element; +import org.jboss.as.controller.parsing.ManagementXmlSchema; +import org.jboss.as.controller.parsing.ParseUtils; +import org.jboss.as.controller.parsing.ProfileParsingCompletionHandler; +import org.jboss.as.controller.parsing.WriteUtils; +import org.jboss.as.controller.persistence.ModelMarshallingContext; +import org.jboss.as.controller.xml.VersionedNamespace; +import org.jboss.as.domain.management.access.AccessAuthorizationResourceDefinition; +import org.jboss.as.domain.management.parsing.AccessControlXml; +import org.jboss.as.domain.management.parsing.AuditLogXml; +import org.jboss.as.domain.management.parsing.ManagementXml; +import org.jboss.as.domain.management.parsing.ManagementXmlDelegate; +import org.jboss.as.server.controller.resources.DeploymentAttributes; +import org.jboss.as.server.controller.resources.ServerRootResourceDefinition; +import org.jboss.as.server.logging.ServerLogger; +import org.jboss.as.server.mgmt.HttpManagementResourceDefinition; +import org.jboss.as.server.mgmt.NativeManagementResourceDefinition; +import org.jboss.as.server.services.net.SocketBindingGroupResourceDefinition; +import org.jboss.as.version.Stability; +import org.jboss.dmr.ModelNode; +import org.jboss.dmr.ModelType; +import org.jboss.dmr.Property; +import org.jboss.staxmapper.IntVersion; +import org.jboss.staxmapper.XMLExtendedStreamReader; +import org.jboss.staxmapper.XMLExtendedStreamWriter; + +/** + * Parser and marshaller for standalone server configuration xml documents (e.g. standalone.xml) that use the urn:jboss:domain:21.0 schema. + * + * @author Brian Stansberry + * @author David M. Lloyd + * @author Darran Lofthouse + */ +final class StandaloneXml_21 extends CommonXml implements ManagementXmlDelegate { + + private final AccessControlXml accessControlXml; + private final StandaloneXml.ParsingOption[] parsingOptions; + private final IntVersion version; + private final String namespace; + private final Stability stability; + private AuditLogXml auditLogDelegate; + private ExtensionHandler extensionHandler; + private final DeferredExtensionContext deferredExtensionContext; + + StandaloneXml_21(ExtensionHandler extensionHandler, final VersionedNamespace namespace, DeferredExtensionContext deferredExtensionContext, StandaloneXml.ParsingOption... options) { + super(new SocketBindingsXml.ServerSocketBindingsXml()); + this.extensionHandler = extensionHandler; + this.version = namespace.getVersion(); + this.namespace = namespace.getUri(); + this.stability = namespace.getStability(); + this.accessControlXml = AccessControlXml.newInstance(this.namespace); + this.auditLogDelegate = AuditLogXml.newInstance(version, false); + this.deferredExtensionContext = deferredExtensionContext; + this.parsingOptions = options; + } + + @Override + public void readElement(final XMLExtendedStreamReader reader, final List operationList) + throws XMLStreamException { + + long start = System.currentTimeMillis(); + final ModelNode address = new ModelNode().setEmptyList(); + + if (Element.forName(reader.getLocalName()) != Element.SERVER) { + throw unexpectedElement(reader); + } + + readServerElement(reader, address, operationList); + + if (ServerLogger.ROOT_LOGGER.isDebugEnabled()) { + long elapsed = System.currentTimeMillis() - start; + ServerLogger.ROOT_LOGGER.debugf("Parsed standalone configuration in [%d] ms", elapsed); + } + } + + /** + * Read the element. + * + * @param reader the xml stream reader + * @param address address of the parent resource of any resources this method will add + * @param list the list of boot operations to which any new operations should be added + * @throws XMLStreamException if a parsing error occurs + */ + private void readServerElement(final XMLExtendedStreamReader reader, final ModelNode address, final List list) + throws XMLStreamException { + + parseNamespaces(reader, address, list); + + ModelNode serverName = null; + + // attributes + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + if (isNoNamespaceAttribute(reader, i)) { + final String value = reader.getAttributeValue(i); + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case NAME: { + serverName = parseAttributeValue(ServerRootResourceDefinition.NAME, value, reader); + break; + } + case ORGANIZATION: { + setOrganization(address, list, parseAttributeValue(ServerRootResourceDefinition.ORGANIZATION_IDENTIFIER, value, reader)); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } else if (isXmlNamespaceAttribute(reader, i)) { + switch (Attribute.forName(reader.getAttributeLocalName(i))) { + case SCHEMA_LOCATION: { + parseSchemaLocations(reader, address, list, i); + break; + } + case NO_NAMESPACE_SCHEMA_LOCATION: { + // todo, jeez + break; + } + default: { + throw unexpectedAttribute(reader, i); + } + } + } else { + throw unexpectedAttribute(reader, i); + } + } + + setServerName(address, list, serverName); + + // elements - sequence + + Element element = nextElement(reader, namespace); + if (element == Element.EXTENSIONS) { + extensionHandler.parseExtensions(reader, address, namespace, list); + element = nextElement(reader, namespace); + } + // System properties + if (element == Element.SYSTEM_PROPERTIES) { + parseSystemProperties(reader, address, namespace, list, true); + element = nextElement(reader, namespace); + } + if (element == Element.PATHS) { + parsePaths(reader, address, namespace, list, true); + element = nextElement(reader, namespace); + } + + if (element == Element.MANAGEMENT) { + ManagementXml managementXml = ManagementXml.newInstance(version, namespace, this, false); + managementXml.parseManagement(reader, address, list, false); + element = nextElement(reader, namespace); + } + //load all extensions and initialize the parsers + deferredExtensionContext.load(); + // Single profile + if (element == Element.PROFILE) { + parseServerProfile(reader, address, list); + element = nextElement(reader, namespace); + } + + // Interfaces + final Set interfaceNames = new HashSet(); + if (element == Element.INTERFACES) { + parseInterfaces(reader, interfaceNames, address, version, namespace, list, true); + element = nextElement(reader, namespace); + } + // Single socket binding group + if (element == Element.SOCKET_BINDING_GROUP) { + parseSocketBindingGroup(reader, interfaceNames, address, list); + element = nextElement(reader, namespace); + } + if (element == Element.DEPLOYMENTS) { + parseDeployments(reader, address, namespace, list, EnumSet.of(Attribute.NAME, Attribute.RUNTIME_NAME, Attribute.ENABLED), + EnumSet.of(Element.CONTENT, Element.FS_ARCHIVE, Element.FS_EXPLODED), true); + element = nextElement(reader, namespace); + } + + if (element == Element.DEPLOYMENT_OVERLAYS) { + parseDeploymentOverlays(reader, namespace, new ModelNode(), list, true, true); + element = nextElement(reader, namespace); + } + if (element != null) { + throw unexpectedElement(reader); + } + } + + private void parseHttpManagementInterfaceAttributes(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case HTTP_AUTHENTICATION_FACTORY: { + HttpManagementResourceDefinition.HTTP_AUTHENTICATION_FACTORY.parseAndSetParameter(value, addOp, reader); + break; + } + case SASL_PROTOCOL: { + HttpManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader); + break; + } + case SERVER_NAME: { + HttpManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader); + break; + } + case SSL_CONTEXT: { + HttpManagementResourceDefinition.SSL_CONTEXT.parseAndSetParameter(value, addOp, reader); + break; + } + case CONSOLE_ENABLED: { + HttpManagementResourceDefinition.CONSOLE_ENABLED.parseAndSetParameter(value, addOp, reader); + break; + } + case ALLOWED_ORIGINS: { + HttpManagementResourceDefinition.ALLOWED_ORIGINS.getParser().parseAndSetParameter(HttpManagementResourceDefinition.ALLOWED_ORIGINS, value, addOp, reader); + break; + } + case BACKLOG: { + HttpManagementResourceDefinition.BACKLOG.parseAndSetParameter(value, addOp, reader); + break; + } + case NO_REQUEST_TIMEOUT: { + HttpManagementResourceDefinition.NO_REQUEST_TIMEOUT.parseAndSetParameter(value, addOp, reader); + break; + } + case CONNECTION_HIGH_WATER: { + HttpManagementResourceDefinition.CONNECTION_HIGH_WATER.parseAndSetParameter(value, addOp, reader); + break; + } + case CONNECTION_LOW_WATER: { + HttpManagementResourceDefinition.CONNECTION_LOW_WATER.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + } + + private void parseNativeManagementInterfaceAttributes(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case SASL_AUTHENTICATION_FACTORY: { + NativeManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.parseAndSetParameter(value, addOp, reader); + break; + } + case SASL_PROTOCOL: { + NativeManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader); + break; + } + case SERVER_NAME: { + NativeManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader); + break; + } + case SSL_CONTEXT: { + NativeManagementResourceDefinition.SSL_CONTEXT.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + } + + private void parseNativeManagementInterface(XMLExtendedStreamReader reader, ModelNode address, List list) throws XMLStreamException { + final ModelNode operationAddress = address.clone(); + operationAddress.add(MANAGEMENT_INTERFACE, NATIVE_INTERFACE); + final ModelNode addOp = Util.getEmptyOperation(ADD, operationAddress); + + // Handle attributes + parseNativeManagementInterfaceAttributes(reader, addOp); + + // Handle elements + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case SOCKET: + throw ControllerLogger.ROOT_LOGGER.unsupportedElement(reader.getName(),reader.getLocation(), SOCKET_BINDING); + case SOCKET_BINDING: + parseNativeManagementSocketBinding(reader, addOp); + break; + default: + throw unexpectedElement(reader); + } + } + + list.add(addOp); + } + + private void parseHttpManagementInterface(XMLExtendedStreamReader reader, ModelNode address, List list) throws XMLStreamException { + final ModelNode operationAddress = address.clone(); + operationAddress.add(MANAGEMENT_INTERFACE, HTTP_INTERFACE); + final ModelNode addOp = Util.getEmptyOperation(ADD, operationAddress); + + // Handle attributes + parseHttpManagementInterfaceAttributes(reader, addOp); + + // Handle elements + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case SOCKET: + throw ControllerLogger.ROOT_LOGGER.unsupportedElement(reader.getName(),reader.getLocation(), SOCKET_BINDING); + case SOCKET_BINDING: + parseHttpManagementSocketBinding(reader, addOp); + break; + case HTTP_UPGRADE: + parseHttpUpgrade(reader, addOp); + break; + case CONSTANT_HEADERS: + parseConstantHeaders(reader, addOp); + break; + default: + throw unexpectedElement(reader); + } + } + + list.add(addOp); + } + + private void parseConstantHeaders(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + // Attributes + requireNoAttributes(reader); + + ModelNode constantHeaders= new ModelNode(); + // Content + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + if (Element.forName(reader.getLocalName()) != Element.HEADER_MAPPING) { + throw unexpectedElement(reader); + } + + ModelNode headerMapping = new ModelNode(); + requireSingleAttribute(reader, Attribute.PATH.getLocalName()); + // After double checking the name of the only attribute we can retrieve it. + HttpManagementResourceDefinition.PATH.parseAndSetParameter(reader.getAttributeValue(0), headerMapping, reader); + ModelNode headers = new ModelNode(); + boolean headerFound = false; + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + if (Element.forName(reader.getLocalName()) != Element.HEADER) { + throw unexpectedElement(reader); + } + headerFound = true; + + ModelNode header= new ModelNode(); + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case NAME: { + HttpManagementResourceDefinition.HEADER_NAME.parseAndSetParameter(value, header, reader); + break; + } + case VALUE: { + HttpManagementResourceDefinition.HEADER_VALUE.parseAndSetParameter(value, header, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + headers.add(header); + + requireNoContent(reader); + } + if (headerFound == false) { + throw missingRequiredElement(reader, Collections.singleton(Element.HEADER.getLocalName())); + } + + headerMapping.get(ModelDescriptionConstants.HEADERS).set(headers); + constantHeaders.add(headerMapping); + } + + addOp.get(ModelDescriptionConstants.CONSTANT_HEADERS).set(constantHeaders); + } + + private void parseHttpManagementSocketBinding(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + + // Handle attributes + + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case HTTP: { + HttpManagementResourceDefinition.SOCKET_BINDING.parseAndSetParameter(value, addOp, reader); + break; + } + case HTTPS: { + HttpManagementResourceDefinition.SECURE_SOCKET_BINDING.parseAndSetParameter(value, addOp, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + requireNoContent(reader); + } + + private void parseHttpUpgrade(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + // Handle attributes + + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case ENABLED: { + ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE); + HttpManagementResourceDefinition.ENABLED.parseAndSetParameter(value, httpUpgrade, reader); + break; + } + case SASL_AUTHENTICATION_FACTORY: { + ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE); + HttpManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.parseAndSetParameter(value, httpUpgrade, reader); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + requireNoContent(reader); + } + + private void parseNativeManagementSocketBinding(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException { + + // Handle attributes + boolean hasRef = false; + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } else { + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case NATIVE: { + NativeManagementResourceDefinition.SOCKET_BINDING.parseAndSetParameter(value, addOp, reader); + hasRef = true; + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + } + + if (!hasRef) { + throw missingRequired(reader, Collections.singleton(Attribute.REF.getLocalName())); + } + + requireNoContent(reader); + } + + private void parseNativeRemotingManagementInterface(final XMLExtendedStreamReader reader, final ModelNode address, + final List list) throws XMLStreamException { + + requireNoAttributes(reader); + //requireNoContent(reader); + + final ModelNode connector = new ModelNode(); + connector.get(OP).set(ADD); + ModelNode operationAddress = address.clone(); + operationAddress.add(MANAGEMENT_INTERFACE, NATIVE_REMOTING_INTERFACE); + connector.get(OP_ADDR).set(operationAddress); + list.add(connector); + + reader.discardRemainder(); + } + + private void parseSocketBindingGroup(final XMLExtendedStreamReader reader, final Set interfaces, + final ModelNode address, final List updates) throws XMLStreamException { + + // unique names for both socket-binding and outbound-socket-binding(s) + final Set uniqueBindingNames = new HashSet(); + + ModelNode op = Util.getEmptyOperation(ADD, null); + // Handle attributes + String socketBindingGroupName = null; + + final EnumSet required = EnumSet.of(Attribute.NAME, Attribute.DEFAULT_INTERFACE); + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw unexpectedAttribute(reader, i); + } + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + switch (attribute) { + case NAME: { + socketBindingGroupName = value; + required.remove(attribute); + break; + } + case DEFAULT_INTERFACE: { + SocketBindingGroupResourceDefinition.DEFAULT_INTERFACE.parseAndSetParameter(value, op, reader); + required.remove(attribute); + if (op.get(SocketBindingGroupResourceDefinition.DEFAULT_INTERFACE.getName()).getType() != ModelType.EXPRESSION + && !interfaces.contains(value)) { + throw ControllerLogger.ROOT_LOGGER.unknownInterface(value, Attribute.DEFAULT_INTERFACE.getLocalName(), Element.INTERFACES.getLocalName(), reader.getLocation()); + } + break; + } + case PORT_OFFSET: { + SocketBindingGroupResourceDefinition.PORT_OFFSET.parseAndSetParameter(value, op, reader); + break; + } + default: + throw ParseUtils.unexpectedAttribute(reader, i); + } + } + + if (!required.isEmpty()) { + throw missingRequired(reader, required); + } + + + ModelNode groupAddress = address.clone().add(SOCKET_BINDING_GROUP, socketBindingGroupName); + op.get(OP_ADDR).set(groupAddress); + + updates.add(op); + + // Handle elements + while (reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case SOCKET_BINDING: { + final String bindingName = parseSocketBinding(reader, interfaces, groupAddress, updates); + if (!uniqueBindingNames.add(bindingName)) { + throw ControllerLogger.ROOT_LOGGER.alreadyDeclared(Element.SOCKET_BINDING.getLocalName(), Element.OUTBOUND_SOCKET_BINDING.getLocalName(), bindingName, Element.SOCKET_BINDING_GROUP.getLocalName(), socketBindingGroupName, reader.getLocation()); + } + break; + } + case OUTBOUND_SOCKET_BINDING: { + final String bindingName = parseOutboundSocketBinding(reader, interfaces, groupAddress, updates); + if (!uniqueBindingNames.add(bindingName)) { + throw ControllerLogger.ROOT_LOGGER.alreadyDeclared(Element.SOCKET_BINDING.getLocalName(), Element.OUTBOUND_SOCKET_BINDING.getLocalName(), bindingName, Element.SOCKET_BINDING_GROUP.getLocalName(), socketBindingGroupName, reader.getLocation()); + } + break; + } + default: + throw unexpectedElement(reader); + } + } + } + + private void parseServerProfile(final XMLExtendedStreamReader reader, final ModelNode address, final List list) + throws XMLStreamException { + // Attributes + requireNoAttributes(reader); + + // Content + final Map> profileOps = new LinkedHashMap>(); + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + if (Element.forName(reader.getLocalName()) != Element.SUBSYSTEM) { + throw unexpectedElement(reader); + } + String namespace = reader.getNamespaceURI(); + if (profileOps.containsKey(namespace)) { + throw ControllerLogger.ROOT_LOGGER.duplicateDeclaration("subsystem", reader.getLocation()); + } + // parse subsystem + final List subsystems = new ArrayList(); + try { + reader.handleAny(subsystems); + } catch (XMLStreamException e) { + if(StandaloneXml.ParsingOption.IGNORE_SUBSYSTEM_FAILURES.isSet(this.parsingOptions)) { + QName element = new QName(reader.getNamespaceURI(), reader.getLocalName()); + ControllerLogger.ROOT_LOGGER.failedToParseElementLenient(e, element.toString()); + reader.discardRemainder(); + } + else { + throw e; + } + } + + profileOps.put(namespace, subsystems); + } + + // Let extensions modify the profile + Set completionHandlers = extensionHandler.getProfileParsingCompletionHandlers(); + for (ProfileParsingCompletionHandler completionHandler : completionHandlers) { + completionHandler.handleProfileParsingCompletion(profileOps, list); + } + + for (List subsystems : profileOps.values()) { + for (final ModelNode update : subsystems) { + // Process relative subsystem path address + final ModelNode subsystemAddress = address.clone(); + for (final Property path : update.get(OP_ADDR).asPropertyList()) { + subsystemAddress.add(path.getName(), path.getValue().asString()); + } + update.get(OP_ADDR).set(subsystemAddress); + list.add(update); + } + } + } + + private void setOrganization(final ModelNode address, final List operationList, final ModelNode value) { + if (value != null && value.isDefined() && value.asString().length() > 0) { + final ModelNode update = Util.getWriteAttributeOperation(address, ORGANIZATION, value); + operationList.add(update); + } + } + private void setServerName(final ModelNode address, final List operationList, final ModelNode value) { + if (value != null && value.isDefined() && value.asString().length() > 0) { + final ModelNode update = Util.getWriteAttributeOperation(address, NAME, value); + operationList.add(update); + } + } + + void writeContent(final XMLExtendedStreamWriter writer, final ModelMarshallingContext context) + throws XMLStreamException { + + ModelNode modelNode = context.getModelNode(); + writer.writeStartDocument(); + writer.writeStartElement(Element.SERVER.getLocalName()); + + if (modelNode.hasDefined(NAME)) { + ServerRootResourceDefinition.NAME.marshallAsAttribute(modelNode, false, writer); + } + + if (modelNode.hasDefined(ORGANIZATION_IDENTIFIER.getName())) { + ServerRootResourceDefinition.ORGANIZATION_IDENTIFIER.marshallAsAttribute(modelNode, false, writer); + } + + writer.writeDefaultNamespace(namespace); + writeNamespaces(writer, modelNode); + writeSchemaLocation(writer, modelNode); + + if (modelNode.hasDefined(EXTENSION)) { + extensionHandler.writeExtensions(writer, modelNode.get(EXTENSION)); + } + + if (modelNode.hasDefined(SYSTEM_PROPERTY)) { + writeProperties(writer, modelNode.get(SYSTEM_PROPERTY), Element.SYSTEM_PROPERTIES, true); + } + + if (modelNode.hasDefined(PATH)) { + writePaths(writer, modelNode.get(PATH), false); + } + + if (modelNode.hasDefined(CORE_SERVICE)) { + ManagementXml managementXml = ManagementXml.newInstance(version, namespace, this, false); + managementXml.writeManagement(writer, modelNode.get(CORE_SERVICE, MANAGEMENT), true); + } + + writeServerProfile(writer, context); + + if (modelNode.hasDefined(INTERFACE)) { + writeInterfaces(writer, modelNode.get(INTERFACE)); + } + + if (modelNode.hasDefined(SOCKET_BINDING_GROUP)) { + Set groups = modelNode.get(SOCKET_BINDING_GROUP).keys(); + if (groups.size() > 1) { + throw ControllerLogger.ROOT_LOGGER.multipleModelNodes(SOCKET_BINDING_GROUP); + } + for (String group : groups) { + writeSocketBindingGroup(writer, modelNode.get(SOCKET_BINDING_GROUP, group), group); + } + } + + if (modelNode.hasDefined(DEPLOYMENT)) { + writeServerDeployments(writer, modelNode.get(DEPLOYMENT)); + WriteUtils.writeNewLine(writer); + } + + if (modelNode.hasDefined(DEPLOYMENT_OVERLAY)) { + writeDeploymentOverlays(writer, modelNode.get(DEPLOYMENT_OVERLAY)); + WriteUtils.writeNewLine(writer); + } + writer.writeEndElement(); + writer.writeEndDocument(); + } + + private void writeServerDeployments(final XMLExtendedStreamWriter writer, final ModelNode modelNode) + throws XMLStreamException { + + boolean deploymentWritten = false; + for (String deploymentName : modelNode.keys()) { + + final ModelNode deployment = modelNode.get(deploymentName); + if (!deployment.isDefined()) { + continue; + } + + if (!deploymentWritten) { + writer.writeStartElement(Element.DEPLOYMENTS.getLocalName()); + deploymentWritten = true; + } + + writer.writeStartElement(Element.DEPLOYMENT.getLocalName()); + WriteUtils.writeAttribute(writer, Attribute.NAME, deploymentName); + DeploymentAttributes.RUNTIME_NAME.marshallAsAttribute(deployment, writer); + DeploymentAttributes.ENABLED.marshallAsAttribute(deployment, writer); + final List contentItems = deployment.require(CONTENT).asList(); + for (ModelNode contentItem : contentItems) { + writeContentItem(writer, contentItem); + } + writer.writeEndElement(); + } + if (deploymentWritten) { + writer.writeEndElement(); + } + } + + private void writeServerProfile(final XMLExtendedStreamWriter writer, final ModelMarshallingContext context) + throws XMLStreamException { + + final ModelNode profileNode = context.getModelNode(); + // In case there are no subsystems defined + if (!profileNode.hasDefined(SUBSYSTEM)) { + return; + } + + writer.writeStartElement(Element.PROFILE.getLocalName()); + writeSubsystems(profileNode, writer, context); + writer.writeEndElement(); + } + + /* + * ManagamentXmlDelegate Methods + */ + + @Override + public boolean parseManagementInterfaces(final XMLExtendedStreamReader reader, final ModelNode address, + final List list) throws XMLStreamException { + requireNoAttributes(reader); + + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case NATIVE_INTERFACE: { + parseNativeManagementInterface(reader, address, list); + break; + } + case HTTP_INTERFACE: { + parseHttpManagementInterface(reader, address, list); + break; + } + case NATIVE_REMOTING_INTERFACE: { + parseNativeRemotingManagementInterface(reader, address, list); + break; + } + default: { + throw unexpectedElement(reader); + } + } + } + + return true; + } + + @Override + public boolean parseAccessControl(XMLExtendedStreamReader reader, ModelNode address, List operationsList) + throws XMLStreamException { + + ModelNode accAuthzAddr = address.clone().add(ACCESS, AUTHORIZATION); + + final int count = reader.getAttributeCount(); + for (int i = 0; i < count; i++) { + + final String value = reader.getAttributeValue(i); + if (!isNoNamespaceAttribute(reader, i)) { + throw ParseUtils.unexpectedAttribute(reader, i); + } + + final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); + if (null == attribute) { + throw unexpectedAttribute(reader, i); + } + switch (attribute) { + case PROVIDER: + { + ModelNode provider = AccessAuthorizationResourceDefinition.PROVIDER.getParser().parse(AccessAuthorizationResourceDefinition.PROVIDER, value, reader); + ModelNode op = Util.getWriteAttributeOperation(accAuthzAddr, + AccessAuthorizationResourceDefinition.PROVIDER.getName(), provider); + operationsList.add(op); + break; + } + case USE_IDENTITY_ROLES: + { + ModelNode useIdentityRoles = AccessAuthorizationResourceDefinition.USE_IDENTITY_ROLES.getParser().parse(AccessAuthorizationResourceDefinition.USE_IDENTITY_ROLES, value, reader); + ModelNode op = Util.getWriteAttributeOperation(accAuthzAddr, + AccessAuthorizationResourceDefinition.USE_IDENTITY_ROLES.getName(), useIdentityRoles); + operationsList.add(op); + break; + } + case PERMISSION_COMBINATION_POLICY: + { + ModelNode provider = AccessAuthorizationResourceDefinition.PERMISSION_COMBINATION_POLICY.getParser().parse(AccessAuthorizationResourceDefinition.PERMISSION_COMBINATION_POLICY, value, reader); + ModelNode op = Util.getWriteAttributeOperation(accAuthzAddr, + AccessAuthorizationResourceDefinition.PERMISSION_COMBINATION_POLICY.getName(), provider); + operationsList.add(op); + break; + } + default: + throw unexpectedAttribute(reader, i); + } + } + + while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + requireNamespace(reader, namespace); + final Element element = Element.forName(reader.getLocalName()); + switch (element) { + case ROLE_MAPPING: { + accessControlXml.parseAccessControlRoleMapping(reader, accAuthzAddr, operationsList); + break; + } + case CONSTRAINTS: { + accessControlXml.parseAccessControlConstraints(reader, accAuthzAddr, operationsList); + break; + } + default: { + throw unexpectedElement(reader); + } + } + } + + return true; + } + + @Override + public boolean parseAuditLog(XMLExtendedStreamReader reader, ModelNode address, List list) + throws XMLStreamException { + auditLogDelegate.parseAuditLog(reader, address, namespace, list); + + return true; + } + + @Override + public boolean writeNativeManagementProtocol(XMLExtendedStreamWriter writer, ModelNode protocol) throws XMLStreamException { + + writer.writeStartElement(Element.NATIVE_INTERFACE.getLocalName()); + NativeManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol, writer); + NativeManagementResourceDefinition.SSL_CONTEXT.marshallAsAttribute(protocol, writer); + NativeManagementResourceDefinition.SASL_PROTOCOL.marshallAsAttribute(protocol, writer); + NativeManagementResourceDefinition.SERVER_NAME.marshallAsAttribute(protocol, writer); + + if (NativeManagementResourceDefinition.SOCKET_BINDING.isMarshallable(protocol)) { + writer.writeEmptyElement(Element.SOCKET_BINDING.getLocalName()); + NativeManagementResourceDefinition.SOCKET_BINDING.marshallAsAttribute(protocol, writer); + } + + writer.writeEndElement(); + + return true; + } + + @Override + public boolean writeHttpManagementProtocol(XMLExtendedStreamWriter writer, ModelNode protocol) throws XMLStreamException { + + writer.writeStartElement(Element.HTTP_INTERFACE.getLocalName()); + HttpManagementResourceDefinition.HTTP_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.SSL_CONTEXT.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.SASL_PROTOCOL.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.SERVER_NAME.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.CONSOLE_ENABLED.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.BACKLOG.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.NO_REQUEST_TIMEOUT.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.CONNECTION_HIGH_WATER.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.CONNECTION_LOW_WATER.marshallAsAttribute(protocol, writer); + + HttpManagementResourceDefinition.ALLOWED_ORIGINS.getMarshaller().marshallAsAttribute( + HttpManagementResourceDefinition.ALLOWED_ORIGINS, protocol, true, writer); + + if (HttpManagementResourceDefinition.HTTP_UPGRADE.isMarshallable(protocol)) { + writer.writeEmptyElement(Element.HTTP_UPGRADE.getLocalName()); + HttpManagementResourceDefinition.ENABLED.marshallAsAttribute(protocol.require(HTTP_UPGRADE), writer); + HttpManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.marshallAsAttribute(protocol.require(HTTP_UPGRADE), writer); + } + + if (HttpManagementResourceDefinition.SOCKET_BINDING.isMarshallable(protocol) + || HttpManagementResourceDefinition.SECURE_SOCKET_BINDING.isMarshallable(protocol)) { + writer.writeEmptyElement(Element.SOCKET_BINDING.getLocalName()); + HttpManagementResourceDefinition.SOCKET_BINDING.marshallAsAttribute(protocol, writer); + HttpManagementResourceDefinition.SECURE_SOCKET_BINDING.marshallAsAttribute(protocol, writer); + } + + if (HttpManagementResourceDefinition.CONSTANT_HEADERS.isMarshallable(protocol)) { + writer.writeStartElement(Element.CONSTANT_HEADERS.getLocalName()); + + for (ModelNode headerMapping : protocol.require(ModelDescriptionConstants.CONSTANT_HEADERS).asList()) { + writer.writeStartElement(Element.HEADER_MAPPING.getLocalName()); + BaseHttpInterfaceResourceDefinition.PATH.marshallAsAttribute(headerMapping, writer); + for (ModelNode header : headerMapping.require(ModelDescriptionConstants.HEADERS).asList()) { + writer.writeEmptyElement(Element.HEADER.getLocalName()); + BaseHttpInterfaceResourceDefinition.HEADER_NAME.marshallAsAttribute(header, writer); + BaseHttpInterfaceResourceDefinition.HEADER_VALUE.marshallAsAttribute(header, writer); + } + writer.writeEndElement(); + } + + writer.writeEndElement(); + } + + writer.writeEndElement(); + + return true; + } + + @Override + public boolean writeAccessControl(XMLExtendedStreamWriter writer, ModelNode accessAuthorization) throws XMLStreamException { + accessControlXml.writeAccessControl(writer, accessAuthorization); + + return true; + } + + @Override + public boolean writeAuditLog(XMLExtendedStreamWriter writer, ModelNode auditLog) throws XMLStreamException { + auditLogDelegate.writeAuditLog(writer, auditLog); + + return true; + } +} diff --git a/server/src/main/resources/schema/wildfly-config_21_0.xsd b/server/src/main/resources/schema/wildfly-config_21_0.xsd new file mode 100644 index 00000000000..06641e6afa9 --- /dev/null +++ b/server/src/main/resources/schema/wildfly-config_21_0.xsd @@ -0,0 +1,3909 @@ + + + + + + + + + + + + Root element for the main document specifying the core configuration + for the servers in a domain. There should be one such main + document per domain, available to the host controller that + is configured to act as the domain controller. + + + + + + + + + + + + + + + + + + + + + The name to use for the domain controller. Useful for administrators who need to work with multiple domains. + + + + + + + The name of the organization running this domain. + + + + + + + + + + Root element for a document configuring a host controller and + the group of servers under the control of that host controller. + The standard usage would be for a domain to have one such host controller + on each physical (or virtual) host machine. Emphasis in this + document is on enumerating the servers, configuring items that + are specific to the host environment (e.g. IP addresses), and + on any server-specific configuration settings. + + + + + + + + + + + + + + + + + + + The name to use for this host's host controller. Must be unique across the domain. + If not set, defaults to the runtime value "HOSTNAME" or "COMPUTERNAME" environment variables, + or, if neither environment variable is present, to the value of InetAddress.getLocalHost().getHostName(). + + If the special value "jboss.domain.uuid" is used, a java.util.UUID will be created + and used, based on the value of InetAddress.getLocalHost(). + + + + + + + The name of the organization running this host. + + + + + + + + + + Root element for a document specifying the configuration + of a single "standalone" server that does not operate + as part of a domain. + + Note that this element is distinct from the 'serverType' + specified in this schema. The latter type forms part of the + configuration of a server that operates as part of a domain. + + + + + + + + + + + + + + + + + + The name to use for this server. + If not set, defaults to the runtime value "HOSTNAME" or "COMPUTERNAME" environment variables, + or, if neither environment variable is present, to the value of InetAddress.getLocalHost().getHostName(). + + If the special value "jboss.domain.uuid" is used, a java.util.UUID will be created + and used, based on the value of InetAddress.getLocalHost(). + + + + + + + The name of the organization running this server. + + + + + + + + + + Domain-wide default configuration settings for the management of standalone servers and a Host Controller. + + + + + + + Configuration for the history of configuration changes. + + + + + + + Number of configuration changes that are available in history. + + + + + + + + + + + + + The centralized configuration for the management of a Host Controller. + + + + + + + + + + + + + + + + + + + + + + + + + The centralized configuration for the management of standalone server. + + + + + + + + + + + + + + + + + + + + + + + + + The centralized configuration for domain-wide management. + + + + + + + + + + A list of URLs. + + + + + + + A list of String. + + + + + + + + Configuration of the secret/password-based identity of this server. + + + + + + + Credential to be used by as protection parameter for the Credential Store. + + + + + + + + The secret / password - Base64 Encoded + + + + + + + + + The keystore configuration for the server. + + + + + + + Credential reference to be used by as protection parameter for the Keystore. + + + + + + + + The password to open the keystore. + + + + + + + + + This is a more complex keystore definition which also allows for an alias + and key password to be specified. + + + + + + + + + Credential reference to be used by as protection parameter when loading keys from the keystore. + + + + + + + + The alias of the entry to use from the keystore, if specified all remaining + entries in the keystore will be ignored. + + Note: The use of aliases is only available for JKS based stores, for other store types this will be ignored. + + + + + + + The password to use when loading keys from the keystore. + + + + + + + If this is set and the key store does not exist then a new keystore will be created and a + self-signed certificate will be generated. The host name for the self-signed certificate + will be the value of this attribute. + + This is not intended for production use. + + + + + + + + + + + An extension of keyStoreType used for audit logging configuration. + + + + + + + + The path of the keystore, this is required if the provider is JKS otherwise it will be ignored. + + + + + + + The name of another previously named path, or of one of the + standard paths provided by the system. If 'relative-to' is + provided, the value of the 'path' attribute is treated as + relative to the path specified by this + attribute. + + + + + + + + + + + An audit specific extension of the extended key store type. + + + + + + + + The path of the keystore, this is required if the provider is JKS otherwise it will be ignored. + + + + + + + The name of another previously named path, or of one of the + standard paths provided by the system. If 'relative-to' is + provided, the value of the 'path' attribute is treated as + relative to the path specified by this + attribute. + + + + + + + + + + + Declaration of management operation audit logging formatters. + + + + + + + + + + + Shared configuration for audit log formatters.. + + + + + + The name of the formatter. Must be unique across all types of formatter + (there is only the JSON formatter at present but more are planned for the + future) + + + + + + + Whether or not to include the date in the formatted log record + + + + + + + The date format to use as understood by {@link java.text.SimpleDateFormat}. + Will be ignored if include-date="false". + + + + + + + The separator between the date and the rest of the formatted log message. + Will be ignored if include-date="false". + + + + + + + + + Configuration of a JSON formatter for the audit log. + + + + + + + + If true will format the JSON on one line. There may still be + values containing new lines, so if having the whole record on + one line is important, set escape-new-line or escape-control-characters to true. + + + + + + + If true will escape all new lines with the ascii code in octal, + e.g. #012. + + + + + + + If true will escape all control characters (ascii entries with a decimal + value less than 32) with the ascii code in octal, e.g.'\n\ becomes '#012'. + If this is true, it will override escape-new-line="false" + + + + + + + + + + + Declaration of management operation audit logging handlers. + + + + + + + + + + + + Configuration of a in memory handler for the audit log. + + + + + + The name of the handler. The name must be unique across all types of handler. + + + + + + + The number of logging entries stored in memory. + + + + + + + + + + + + Common configuration of a handler for the audit log. + + + + + + The name of the handler. The name must be unique across all types of handler. + + + + + + + The name of the formatter to use for the handler. + + + + + + + The number of logging failures before this handler is disabled. + + + + + + + + + Configuration of a simple file handler for the audit log. This writes to a local file. + + + + + + + + The path of the audit log. + + + + + + + The name of another previously named path, or of one of the + standard paths provided by the system. If 'relative-to' is + provided, the value of the 'path' attribute is treated as + relative to the path specified by this attribute. + + + + + + + + + + + Configuration of a simple file handler for the audit log. This writes to a local file. + + + + + + + + Whether or not should an old log file be rotated during a handler initialization. + + + + + + + + + + + Configuration of a size rotating file handler for the audit log. This writes to a local file, + rotating the log after the size of the file grows beyond a certain point and keeping + a fixed number of backups.. + + + + + + + + The size at which to rotate the log file. + + + + + + + The maximum number of backups to keep. + + + + + + + + + + + Configuration of a periodic rotating file handler for the audit log. This writes to a local file, + rotating the log after a time period derived from the given suffix string, + which should be in a format understood by java.text.SimpleDateFormat. + + + + + + + + The suffix string in a format which can be understood by java.text.SimpleDateFormat. + The period of the rotation is automatically calculated based on the suffix. + + + + + + + + + + A positive number optionally followed by one of [bBkKmMgGtT] + + + + + + + + + + Configuration of a syslog file handler for the audit log on a server. This writes to syslog server. + + + + + + + + The configuration of the protocol to use communication with the syslog server. See your + syslog provider's documentation for configuration options. + + + + + + + + + + + + + The format to use for the syslog messages. See your syslog provider's documentation for what is supported. + + + + + + + Format the syslog data according to the RFC-5424 standard + + + + + Format the syslog data according to the RFC-3164 standard + + + + + + + + + The maximum length in bytes a log message, including the header, is allowed to be. If undefined, it will default to 1024 bytes if the syslog-format is RFC3164, or 2048 bytes if the syslog-format is RFC5424. + + + + + + + Whether or not a message, including the header, should truncate the message if the length in bytes is greater than the maximum length. If set to false messages will be split and sent with the same header values. + + + + + + + The facility to use for syslog logging as defined in section 6.2.1 of RFC-5424, and section 4.1.1 of RFC-3164. + The numerical values in the enumeration entries, is the numerical value as defined in the RFC. + + + + + + + 0 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 15 + + + + + 16 + + + + + 17 + + + + + 18 + + + + + 19 + + + + + 20 + + + + + 21 + + + + + 22 + + + + + 23 + + + + + + + + + The application name to add to the syslog records as defined in section 6.2.5 of RFC-5424. If not specified it will default to the name of the product. + + + + + + + + + + + + The host of the syslog server. + + + + + + + The port of the syslog server. + + + + + + + + Configure udp as the protocol for communicating with the syslog server + + + + + + + + + Configure tcp as the protocol for communicating with the syslog server + + + + + + + The message transfer setting as described in section 3.4 of RFC-6587. See your syslog provider's + documentation for what is supported + + + + + + + + Use the octet counting format for message transfer as described in section 3.4.1 of RFC-6587. + + + + + + + Use the non-transparent-framing format for message transfer as described in section 3.4.1 of RFC-6587. + + + + + + + + + + If a connection drop is detected, the number of seconds to wait before reconnecting. A negative number means + don't reconnect automatically. + + + + + + + + + + Configure tls as the protocol for communicating with the syslog server + + + + + + + + Configuration of a keystore to use to create a trust manager to verify the server + certificate for encrypted communications. If the server certificate is signed off by a + signing authority, tls can be used without a truststore. + + + + + + + Configuration of a keystore containing a client certificate and a private key, e.g. in + PKCS12 format. This turns on authenticating the clients against the syslog server. + + + + + + + + + + + + Declaration of management operation audit logging configuration coming from the model controller core. + + + + + + + + + Whether operations should be logged on boot. + + + + + + + Whether operations that do not modify the configuration or any runtime services should be logged. + + + + + + + Whether audit logging is enabled. + + + + + + + + + References to audit-log-handlers defined in the audit-log-handlers section + + + + + + + + + + + A reference to an audit-log-handler defined in the audit-log-appenders section + + + + + + + + + + + + + + + + + Reference to the SSLContext to use for this management interface. + + + + + + + Where Remoting is accepting incomming connections part of the authentication process + advertises the name of the protocol in use, by default this is 'remote' but this attribute + can be set if an alternative is required. + + + + + + + Where Remoting is accepting incomming connection the initial exchange and the authentication + process both advertise the name of the server, by default this is derived from the address Remoting + is listening on but this attribute can be set to override the name. + + + + + + + + + + + + + HTTP Upgrade configuration on the management interface. + + + + + + + Is HTTP Upgrade to 'remote' enabled. + + + + + + + The SASL authentication policy to secure connections upgraded from HTTP. + + + + + + + + + + + The HTTP authentication factory to use to secure normal HTTP requests. + + + + + + + The maximum number of pending connections on the socket. + + + + + + + The maximum time in milliseconds a connection can be idle without a HTTP request before it is closed. + + + + + + + The maximum number of connections that can be open at any one time. + + Once reached no further connections will be accepted until the count reduces to the connection-low-water level. + + + + + + + The number of connections that the open count must reduce to before the connection-high-water level is reset. + + + + + + + + + + + Definition to HTTP headers to be added to responses based on the path of the request. + + + + + + + + + + + + The name of the header to set. + + Must be a valid HTTP Header name. + + + + + + + The value to set the header to. + + + + + + + + + + The path prefix this header mapping applies to. + + + + + + + + + + + + + + + The SASL server authentication policy to secure connections upgraded from HTTP. + + + + + + + + + + + Configuration of a host's exposed native management interface. + + + + + + + + + + + + + + + Configuration of the socket used by host or standalone server's exposed management interface. + + + + + + Network interface on which the host's socket for + management communication should be opened. + + + + + + + + + Configuration of the socket used by host or standalone server's exposed HTTP management interface. + + + + + + + + Port on which the host's socket for native + management communication should be opened. + + + + + + + + + + + Configuration of a host's exposed HTTP management interface. + + + + + + + + + + + + + + + + Configuration of the socket used by host or standalone server's exposed HTTP management interface. + + + + + + + + Port on which the host's socket for + management communication should be opened. + + If not specified the port will not be opened. + + + + + + + Port on which the host's socket for HTTPS + management communication should be opened. + + If not specified the port will not be opened. + + If specified an ssl-context will be + required to obtain the SSL configuration. + + + + + + + + + + + Configuration of the socket used by host's exposed HTTP management interface. + + + + + + + + Network interface on which the host's socket for + HTTPS management communication should be opened + if a different interface should be used from that + specified by the 'interface' attribute. + + If not specified the interface specified by the 'interface' + attribute will be used. + + Has no effect if the 'secure-port' attribute is not set. + + If specified with a different value from the 'interface' + attribute, redirect of HTTPS requests received on the HTTP + socket to the HTTPS address will not be supported. + + If specified an ssl-context will be + required to obtain the SSL configuration. + + + + + + + + + + + + + + + + + + + Configuration of the socket used by host or standalone server's exposed HTTP management interface. + + + + + + + Configuration of the socket to use for the native management interface is a choice + between a direct configuration of the address and port, or a reference to a socket-binding + configuration in the server's socket-binding-group element. The latter is the recommended + approach as it makes it easier to avoid port conflicts by taking advantage of the + socket-binding-group's port-offset configuration. Direct configuration of the address and + ports is deprecated and is only provided to preserve backward compatibility. + + + + + + + Deprecated. Use 'socket-binding' + + + + + + + + + + + + + Reference to the configuration of the socket to be used by a standalone server's exposed native management interface. + + + + + + Name of a socket-binding configuration declared in the server's socket-binding-group. + + + + + + + + + Configuration of a standalone server's exposed HTTP/HTTPS management interface. + + + + + + + Configuration of the socket to use for the HTTP/HTTPS management interface is a choice + between a direct configuration of the address and ports, or a reference to socket-binding + configurations in the server's socket-binding-group element. The latter is the recommended + approach as it makes it easier to avoid port conflicts by taking advantage of the + socket-binding-group's port-offset configuration. Direct configuration of the address and + ports is deprecated and is only provided to preserve backward compatibility. + + + + + + + Deprecated. Use 'socket-binding' + + + + + + + + + + A space separated list of Origins that will be trusted to send request to the management + API once the user is authenticated. This is used following the Cross-Origin Resource Sharing + recommendation (http://www.w3.org/TR/access-control/). + + + + + + + + + + + Reference to the configurations of the sockets to be used by a standalone server's exposed HTTP and HTTPS management interface. + + + + + + Name of a socket-binding configuration declared in the server's socket-binding-group to use for a HTTP socket. + + + + + + + Name of a socket-binding configuration declared in the server's socket-binding-group to use for a HTTPS socket. + + Note: When specified the interface must also be configured to reference an ssl-context. + + + + + + + + + Makes the native management interface available via the connectors set up in the remoting subsystem, + using the remoting subsystem's endpoint. This should only be used for a server not for a HC/DC. + + + + + + + + + + + + + + + + + + + + + + + + + + The remote domain controller's protocol. If not set, a discovery option must be provided, + or the --cached-dc startup option must be used, or the --admin-only startup option must be used + with the 'admin-only-policy' attribute set to a value other than 'fetch-from-domain-controller'. + + + + + + + The remote domain controller's host name. If not set, a discovery option must be provided, + or the --cached-dc startup option must be used, or the --admin-only startup option must be used + with the 'admin-only-policy' attribute set to a value other than 'fetch-from-domain-controller'. + + + + + + + The remote domain controller's port. If not set, a discovery option must be provided, + or the --cached-dc startup option must be used, or the --admin-only startup option must be used + with the 'admin-only-policy' attribute set to a value other than 'fetch-from-domain-controller'. + + + + + + + Reference to the authentication-context to use when establishing the remote connection. + + + + + + + + When set to true, this instructs the Domain Controller to not forward configuration and + operations for profiles, socket binding groups and server groups which do not affect our servers. + Setting to false will ensure that all of this configuration information is copied. Note that using + the '--backup' startup option on the command line will set this to false if the value is unspecified + in host.xml. If the value is specified in host.xml, then using '--backup' will not override the + specified value (for example: setting ignore-unused-configuration="true" and using --backup will + not override the value of ignore-unused-configuration, which will remain true). If --backup is not + used, this value will be true at runtime. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provides names of direct child resources of the domain root resource requests for which the + Host Controller should ignore. Only relevant on a secondary Host Controller. Configuring such + "ignored resources" may help allow a Host Controller from an earlier release to function as a + secondary Host Controller to a primary Host Controller running a later release, by letting the secondary + ignore portions of the configuration its version of the software cannot understand. This strategy can + only be successful if the servers managed by the secondary Host Controller do not reference any of the + ignored configuration. + + Supports the following attributes: + + type -- the type of resource (e.g. 'profile' or 'socket-binding-group') certain instances of which + should be ignored. The value corresponds to the 'key' portion of the first element in the + resource's address (e.g. 'profile' in the address /profile=ha/subsystem=web) + + wildcard -- if 'true', all resources of the given type should be ignored. + + Child elements list the names of specific instances of the given type of resource + that should be ignored. Each element in the list corresponds to the 'value' portion of + the first element in the resource's address (e.g. 'ha' in the address /profile=ha/subsystem=web.) + + + + + + + + + + + + + + The name of a specific instances of a particular type of resource that should be ignored. + The 'name' attribute corresponds to the 'value' portion of the first element in the resource's address + (e.g. 'ha' in the address /profile=ha/subsystem=web.) + + + + + + + + + + + + + + + + + + + + The name for this domain controller discovery option. + + + + + + + The fully qualified class name for the DiscoveryOption implementation. + + + + + + + The module from which the DiscoveryOption implementation should be loaded. If not provided, + the DiscoveryOption implementation must be available from the Host Controller's own module. + + + + + + + + + + The name for this domain controller discovery option. + + + + + + + The remote domain controller's protocol. + + + + + + + The remote domain controller's host name. + + + + + + + The remote domain controller's port. + + + + + + + + + + + + + + + + Indicates each server's writable directories should be grouped under the server's name + in the domain/servers directory. This is the default option. + + + + + + + Indicates each server's writable directories should be grouped based on their "type" + (i.e. "data", "log", "tmp") with directories of a given type for all servers appearing + in the domain level directory for that type, e.g. domain/data/servers/server-name. + + + + + + + + + + + + + + + + + + + + + + + Configuration of the SSLContext used for the connection from the application server back to it's host controller. + + + + + + + + + + + Iif the server last status (STARTED or STOPPED) is to be used to define the value of auto-start. + + + + + + + + + + The protocol to initialise the SSLContext, if 'Default' is specified the JVM wide default SSLContext will be used instead. + + + + + + + The algorithm to use when initialising the TrustManagerFactory. + + If not specified the JVM default is used instead. + + + + + + + The type of the trust store. + + If not specified the JVM default is used instead. + + + + + + + The fully qualified path to the truststore. + + If not specified the no file will be used to initialise the truststore. + + + + + + + The password to open the truststore. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains a list of extension modules. + + + + + + + + + + A module that extends the standard capabilities of a domain + or a standalone server. + + + + + The name of the module + + + + + + + + + + + + + + + + + + + + + + + + The name of the server group + + + + + + + The name of the profile this server is running. + + + + + + + Set to true to have servers in the group start gracefully, queuing or cleanly rejecting incoming + requests until the server is fully started. If set to false, the server will pass the request to the + appropriate subsystem for processing, irrespective of whether or not that system is ready. + + + + + + + Set to true to have servers belonging to the server group connect back to the host controller using the + endpoint from their remoting subsystem. The subsystem must be preset for this to + work. + + + + + + + + Contains a list of deployments that have been mapped to a server-group. + + + + + + + + + A deployment that has been mapped to a server group. + + + + + + + Whether the deployment deploy automatically when the server starts up. + + + + + + + + + + + Unique identifier of the deployment. Must be unique across all deployments. + + + + + + Name by which the deployment will be known within a running server.of the deployment. + Does not need to be unique across all deployments in the domain, although it must be unique within + an individual server. For example, two different deployments running on different servers in + the domain could both have a 'runtime-name' of 'example.war', with one having a 'name' + of 'example.war_v1' and another with an 'name' of 'example.war_v2'. + + + + + + + + Contains a list of deployments that have been mapped to a server. + + + + + + + + + A deployment that has been mapped to a server. + + + + + + + + + + + + + + + Whether the deployment deploy automatically when the server starts up. + + + + + + + + + + + The checksum of the content + + + + + + + Archived content found on the filesystem + + + + + + + + + + + + + + + + Exploded content found on the filesystem + + + + + + + + + Contains a list of domain-level deployments + + + + + + + + + Deployment represents anything that can be deployed (e.g. an application such as EJB-JAR, + WAR, EAR, + any kind of standard archive such as RAR or JBoss-specific deployment), + which can be enabled or disabled on a domain level. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The domain controller/server bootstrap configuration + + + + + + + + The URI for bootstrapping a domain server + + + + + + Contains a list of profiles available for use in the domain + + + + + + + + + Contains a list of subsystems + + + + + A profile declaration may include configuration + elements from other namespaces for the subsystems that make up the profile. + + + + + + + Name of the profile + + + + + + A profile may include another profile. Overriding of included profiles is not supported. + + + + + + + + Contains a list of subsystems + + + + + + A profile declaration may include configuration + elements from other namespaces for the subsystems that make up the profile. + + + + + + + + + + Contains a list of subsystems that will be run on the host + + + + + + A profile declaration may include configuration + elements from other namespaces for the subsystems that make up the profile. + + + + + + + + + + + Contains a list of socket binding groups + + + + + + + + + Contains a list of socket configurations + + + + + + + + + + Name of an interface that should be used as the interface for + any sockets that do not explicitly declare one. + + + + + + + A profile may include another profile. Overriding of included profiles is not supported. + + + + + + + + Contains a list of socket configurations + + + + + + + + + + Name of an interface that should be used as the interface for + any sockets that do not explicitly declare one. + + + + + + + Increment to apply to the base port values defined in the + socket group to derive the values to use on this + server. + + + + + + + + Contains a list of socket configurations + + + + + + + + + + Name of an interface that should be used as the interface for + any sockets that do not explicitly declare one. + + + + + + + Increment to apply to the base port values defined in the + socket group to derive the values to use on this + server. + + + + + + + + Configuration information for a socket. + + + + + + Specifies zero or more client mappings for this socket binding. + A client connecting to this socket should use the destination address + specified in the mapping that matches its desired outbound interface. + This allows for advanced network topologies that use either network + address translation, or have bindings on multiple network interfaces + to function. + + Each mapping should be evaluated in declared order, with the first successful + match used to determine the destination. + + + + + + + + + Name of the interface to which the socket should be bound, or, for multicast + sockets, the interface on which it should listen. This should + be one of the declared interfaces. + + + + + + + Number of the port to which the socket should be bound. + + + + + + + Whether the port value should remain fixed even if numerically offsets + are applied to the other sockets in the socket group.. + + + + + + + Multicast address on which the socket should receive multicast + traffic. If unspecified, the socket will not be configured + to receive multicast. + + + + + + + Port on which the socket should receive multicast + traffic. Must be configured if 'multicast-address' is configured. + + + + + + + + + Type definition for a client mapping on a socket binding. A client + mapping specifies how external clients should connect to this + socket's port, provided that the client's outbound interface + match the specified source network value. + + + + + + Source network the client connection binds on. This value is in + the form of ip/netmask. A client should match this value against + the desired client host network interface, and if matched the + client should connect to the corresponding destination values. + + If omitted this mapping should match any interface. + + + + + + + The destination address that a client should connect to if the + source-network matches. This value can either be a hostname or + an IP address. + + + + + + + The destination port that a client should connect to if the + source-network matches. + + If omitted this mapping will reuse the effective socket binding + port. + + + + + + + + Configuration information for an outbound socket. + + + + + + + + + + The name of the outbound socket binding + + + + + + + The name of the interface that should be used for setting up the source address of the + outbound socket. This should be one of the declared interfaces. + + + + + + + + The port number that will be used for setting the source address of the outbound socket. If the + source-interface attribute has been specified and the source-port attribute equals 0 or is absent, + then the system uses an ephemeral port while binding the socket to a source address. + + + + + + + Whether the source-port value should remain fixed even if the socket binding group specifies + a port offset + + + + + + + + + + The remote server address to which the outbound socket has to be connect. + The address can be either an IP address of the host server of the hostname of the server + + + + + + + The remote port to which the outbound socket has to connect. + + + + + + + + + + + + + + + + + + + + The reference to a socket binding that has to be used as the destination for the outbound + socket binding. This socket binding name should belong to the same socket binding group + to which this local destination client socket belongs. + + + + + + + + + + The socket group to use for the server group or server. + + + + + + + Increment to apply to the base port values defined in the + referenced socket group to derive the values to use on this + server. + + + + + + + + + + + + + + + + + A list of named network interfaces. The interfaces may or may + not be fully specified (i.e. include criteria on how to determine + their IP address.) + + + + + + + + + + + + A named network interface, but without any criteria + for determining the IP address to associate with that interface. + Acts as a placeholder in the model (e.g. at the domain level) + until a fully specified interface definition is applied at a + lower level (e.g. at the server level, where available addresses + are known.) + + + + + + + + + + A list of fully specified named network interfaces. + + + + + + + + + + + A named network interface, along with required criteria + for determining the IP address to associate with that interface. + + + + + + + + + + A set of criteria that can be used at runtime to determine + what IP address to use for an interface. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Either an IP address in IPv6 or IPv4 dotted decimal notation, + or a hostname that can be resolved to an IP address. + + + + + + + + + + The name of a network interface (e.g. eth0, eth1, lo). + + + + + + + + + + A regular expression against which the names of the network + interfaces available on the machine can be matched to find + an acceptable interface. + + + + + + + + + + A network IP address and the number of bits in the + address' network prefix, written in "slash notation"; + e.g. "192.168.0.0/16". + + + + + + + + + + + + + + + + + + + + + + + + + + + Empty element indicating that part of the selection criteria + for an interface should be whether or not it is a loopback + interface. + + + + + + + + A loopback address that may not actually be configured on the machine's loopback interface. + Differs from inet-addressType in that the given value will be used even if no NIC can + be found that has the IP address associated with it. + + + + + + An IP address in IPv6 or IPv4 dotted decimal notation. + + + + + + + + + Empty element indicating that part of the selection criteria + for an interface should be whether or not it supports + multicast. + + + + + + + + Empty element indicating that part of the selection criteria + for an interface should be whether or not it is a point-to-point + interface. + + + + + + + + Empty element indicating that part of the selection criteria + for an interface should be whether or not it is currently up. + + + + + + + + Empty element indicating that part of the selection criteria + for an interface should be whether or not it is a virtual + interface. + + + + + + + + Empty element indicating that part of the selection criteria + for an interface should be whether or not it has a publicly + routable address. + + + + + + + + Empty element indicating that part of the selection criteria + for an interface should be whether or not an address associated + with it is site-local. + + + + + + + + Empty element indicating that part of the selection criteria + for an interface should be whether or not an address associated + with it is link-local. + + + + + + + + Empty element indicating that sockets using this interface + should be bound to a wildcard address. The IPv6 wildcard + address (::) will be used unless the java.net.preferIpV4Stack + system property is set to true, in which case the IPv4 + wildcard address (0.0.0.0) will be used. If a socket is + bound to an IPv6 anylocal address on a dual-stack machine, + it can accept both IPv6 and IPv4 traffic; if it is bound to + an IPv4 (IPv4-mapped) anylocal address, it can only accept + IPv4 traffic. + + + + + + + Configuration information for a socket. + + + + + + Name of the interface to which the socket should be bound, or, for multicast + sockets, the interface on which it should listen. This should + be one of the declared interfaces. + + + + + + + Number of the port to which the socket should be bound. + + + + + + + Whether the port value should remain fixed even if numerically offsets + are applied to the other sockets in the socket group.. + + + + + + + Multicast address on which the socket should receive multicast + traffic. If unspecified, the socket will not be configured + to receive multicast. + + + + + + + Port on which the socket should receive multicast + traffic. If unspecified, the socket will not be configured + to receive multicast. + + + + + + + + + + A list of named filesystem paths. The paths may or may + not be fully specified (i.e. include the actual paths.) + + + + + + + + + + + A named filesystem path, but without a requirement to specify + the actual path. If no actual path is specified, acts as a + as a placeholder in the model (e.g. at the domain level) + until a fully specified path definition is applied at a + lower level (e.g. at the host level, where available addresses + are known.) + + + + + + + + The name of the path. Cannot be one of the standard fixed paths + provided by the system: + + jboss.home.dir - the root directory of the JBoss AS distribution + user.home - user's home directory + user.dir - user's current working directory + java.home - java installation directory + jboss.server.base.dir - root directory for an individual server + instance + + Note that the system provides other standard paths that can be + overridden by declaring them in the configuration file. See + the 'relative-to' attribute documentation for a complete + list of standard paths. + + + + + + + + + + + + The actual filesystem path. Treated as an absolute path, unless the + 'relative-to' attribute is specified, in which case the value + is treated as relative to that path. + + If treated as an absolute path, the actual runtime pathname specified + by the value of this attribute will be determined as follows: + + If this value is already absolute, then the value is directly + used. Otherwise the runtime pathname is resolved in a + system-dependent way. On UNIX systems, a relative pathname is + made absolute by resolving it against the current user directory. + On Microsoft Windows systems, a relative pathname is made absolute + by resolving it against the current directory of the drive named by the + pathname, if any; if not, it is resolved against the current user + directory. + + + + + + + + + + + + The name of another previously named path, or of one of the + standard paths provided by the system. If 'relative-to' is + provided, the value of the 'path' attribute is treated as + relative to the path specified by this attribute. The standard + paths provided by the system include: + + jboss.home.dir - the root directory of the JBoss AS distribution + user.home - user's home directory + user.dir - user's current working directory + java.home - java installation directory + jboss.server.base.dir - root directory for an individual server + instance + jboss.server.config.dir - directory in which server configuration + files are stored. + jboss.server.data.dir - directory the server will use for persistent + data file storage + jboss.server.log.dir - directory the server will use for + log file storage + jboss.server.temp.dir - directory the server will use for + temporary file storage + jboss.domain.servers.dir - directory under which a host controller + will create the working area for + individual server instances + + + + + + + + + A list of named filesystem paths. + + + + + + + + + + + A named filesystem path. + + + + + + The name of the path. Cannot be one of the standard fixed paths + provided by the system: + + jboss.home.dir - the root directory of the JBoss AS distribution + user.home - user's home directory + user.dir - user's current working directory + java.home - java installation directory + jboss.server.base.dir - root directory for an individual server + instance + + Note that the system provides other standard paths that can be + overridden by declaring them in the configuration file. See + the 'relative-to' attribute documentation for a complete + list of standard paths. + + + + + + + The actual filesystem path. Treated as an absolute path, unless the + 'relative-to' attribute is specified, in which case the value + is treated as relative to that path. + + If treated as an absolute path, the actual runtime pathname specified + by the value of this attribute will be determined as follows: + + If this value is already absolute, then the value is directly + used. Otherwise the runtime pathname is resolved in a + system-dependent way. On UNIX systems, a relative pathname is + made absolute by resolving it against the current user directory. + On Microsoft Windows systems, a relative pathname is made absolute + by resolving it against the current directory of the drive named by the + pathname, if any; if not, it is resolved against the current user + directory. + + Note relative path declarations have to use '/' as file separator. + + + + + + + + + + + + The name of another previously named path, or of one of the + standard paths provided by the system. If 'relative-to' is + provided, the value of the 'path' attribute is treated as + relative to the path specified by this attribute. The standard + paths provided by the system include: + + jboss.home.dir - the root directory of the JBoss AS distribution + user.home - user's home directory + user.dir - user's current working directory + java.home - java installation directory + jboss.server.base.dir - root directory for an individual server + instance + jboss.server.config.dir - directory in which server configuration + files are stored. + jboss.server.data.dir - directory the server will use for persistent + data file storage + jboss.server.log.dir - directory the server will use for + log file storage + jboss.server.temp.dir - directory the server will use for + temporary file storage + jboss.domain.servers.dir - directory under which a host controller + will create the working area for + individual server instances + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Allows the full set of JVM options to be set via the jvm schema elements + + + + + Sets a subset of the JVM options via the jvm schema elements + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initial JVM heap size + + + + + Maximum JVM heap size + + + + + + + + + + + + + + JVM option value + + + + + + + + JVM agent lib value + + + + + + + + JVM agent path value + + + + + + + + JVM javaagent value + + + + + + + + + + + + + + JBoss Modules option value + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Definition of the security domain to use to obtain the current identity from. + + + + + + Reference to the security domain to use to obtain the current identity. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Configuration of if a classification's read is sensitive + + + + + + + Configuration of if a classification's write is sensitive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Configuration of if a classification's addressability is sensitive + + + + + + + The name of the constraint, must be unique for each name + + + + + + + 'core' or the name of the subsystem defining the constraint + + + + + + + + + + + + + + + + + + + + + + + + + + + + The name of the constraint, must be unique for each name + + + + + + + 'core' or the name of the subsystem defining the constraint + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . (for example, EAP6.2 or EAP7.3) + * WildFly. (for example WildFly10.0 or WildFly10.1) + + The corresponding kernel management API version is defined in the enum + org.jboss.as.domain.controller.resources.HostExcludeResourceDefinition.KnownRelease. + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testsuite/domain/src/test/resources/base-server-config.xml b/testsuite/domain/src/test/resources/base-server-config.xml index 92e5c488d0f..75f8c9f1b20 100644 --- a/testsuite/domain/src/test/resources/base-server-config.xml +++ b/testsuite/domain/src/test/resources/base-server-config.xml @@ -1,6 +1,6 @@ - + diff --git a/testsuite/domain/src/test/resources/domain-configs/domain-auto-ignore.xml b/testsuite/domain/src/test/resources/domain-configs/domain-auto-ignore.xml index aa13a50cc88..38a691591d8 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain-auto-ignore.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain-auto-ignore.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + - + diff --git a/testsuite/domain/src/test/resources/domain-configs/domain-default-interface.xml b/testsuite/domain/src/test/resources/domain-configs/domain-default-interface.xml index 9870a3e568f..e3dcfec0c5a 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain-default-interface.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain-default-interface.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/domain-configs/domain-jvm-properties.xml b/testsuite/domain/src/test/resources/domain-configs/domain-jvm-properties.xml index 4e5e288c106..42d03a4510f 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain-jvm-properties.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain-jvm-properties.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/domain-configs/domain-minimal.xml b/testsuite/domain/src/test/resources/domain-configs/domain-minimal.xml index b373feb8885..44149891c3c 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain-minimal.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain-minimal.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/domain-configs/domain-rbac.xml b/testsuite/domain/src/test/resources/domain-configs/domain-rbac.xml index ddaec58a578..b9cf5fe1da2 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain-rbac.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain-rbac.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/domain-configs/domain-respawn-http.xml b/testsuite/domain/src/test/resources/domain-configs/domain-respawn-http.xml index 3cb014d6a98..74aa2d7fcc5 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain-respawn-http.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain-respawn-http.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/domain-configs/domain-respawn.xml b/testsuite/domain/src/test/resources/domain-configs/domain-respawn.xml index 3cb014d6a98..74aa2d7fcc5 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain-respawn.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain-respawn.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/domain-configs/domain-standard.xml b/testsuite/domain/src/test/resources/domain-configs/domain-standard.xml index a125e5ea97d..2ef3b9fe64f 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain-standard.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain-standard.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/domain-configs/domain-synchronization.xml b/testsuite/domain/src/test/resources/domain-configs/domain-synchronization.xml index da39a18bdc1..da77aff9658 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain-synchronization.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain-synchronization.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/domain-configs/domain.cached-remote.xml b/testsuite/domain/src/test/resources/domain-configs/domain.cached-remote.xml index 918696d721b..f88672c9f8a 100644 --- a/testsuite/domain/src/test/resources/domain-configs/domain.cached-remote.xml +++ b/testsuite/domain/src/test/resources/domain-configs/domain.cached-remote.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/admin-only-discovery.xml b/testsuite/domain/src/test/resources/host-configs/admin-only-discovery.xml index 019c4222866..5cd32a05423 100644 --- a/testsuite/domain/src/test/resources/host-configs/admin-only-discovery.xml +++ b/testsuite/domain/src/test/resources/host-configs/admin-only-discovery.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/admin-only-no-discovery.xml b/testsuite/domain/src/test/resources/host-configs/admin-only-no-discovery.xml index edbc603e980..f68bc92a2ac 100644 --- a/testsuite/domain/src/test/resources/host-configs/admin-only-no-discovery.xml +++ b/testsuite/domain/src/test/resources/host-configs/admin-only-no-discovery.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-auto-ignore-primary.xml b/testsuite/domain/src/test/resources/host-configs/host-auto-ignore-primary.xml index a53ee23bd2b..7bb88b599db 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-auto-ignore-primary.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-auto-ignore-primary.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-auto-ignore-secondary.xml b/testsuite/domain/src/test/resources/host-configs/host-auto-ignore-secondary.xml index c170b7dd793..2427ce380fd 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-auto-ignore-secondary.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-auto-ignore-secondary.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-default-interface.xml b/testsuite/domain/src/test/resources/host-configs/host-default-interface.xml index 3c149ac4c1f..26afa14f787 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-default-interface.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-default-interface.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-failover1.xml b/testsuite/domain/src/test/resources/host-configs/host-failover1.xml index 036d805e0da..c4f4eb93a0e 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-failover1.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-failover1.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-failover2.xml b/testsuite/domain/src/test/resources/host-configs/host-failover2.xml index 17d171d9da6..3667133ca77 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-failover2.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-failover2.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-failover3.xml b/testsuite/domain/src/test/resources/host-configs/host-failover3.xml index 8cc6bcabf5c..3a0aa092ae9 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-failover3.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-failover3.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-minimal.xml b/testsuite/domain/src/test/resources/host-configs/host-minimal.xml index cfbe0e86351..323323a7fa4 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-minimal.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-minimal.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-nonexistent-group.xml b/testsuite/domain/src/test/resources/host-configs/host-nonexistent-group.xml index b6b5be3255b..d665bdd34d4 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-nonexistent-group.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-nonexistent-group.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-auto-start.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-auto-start.xml index d56bcd2fd79..ea03a5cde29 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-auto-start.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-auto-start.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-cacheddc.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-cacheddc.xml index 40ef176ea92..e280a4d9192 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-cacheddc.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-cacheddc.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-config-changes.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-config-changes.xml index 288b8f56255..f0e3955e1c4 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-config-changes.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-config-changes.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-elytron-no-legacy-realms.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-elytron-no-legacy-realms.xml index fb847d86757..f67b3efc97f 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-elytron-no-legacy-realms.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-elytron-no-legacy-realms.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-elytron.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-elytron.xml index 3fc90d76cbc..9c5d11a5da4 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-elytron.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-elytron.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-jvm-properties.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-jvm-properties.xml index a8c17dc6591..c3c5efe46d4 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-jvm-properties.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-jvm-properties.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-rbac-properties.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-rbac-properties.xml index 6443918c8a3..85f2e506367 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-rbac-properties.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-rbac-properties.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-rbac.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-rbac.xml index 636e6d0c32f..ce784c32dc5 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-rbac.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-rbac.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-ssl-1way-elytron.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-ssl-1way-elytron.xml index d81bba42572..46083ffc5c6 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-ssl-1way-elytron.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-ssl-1way-elytron.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary-ssl-2way-elytron.xml b/testsuite/domain/src/test/resources/host-configs/host-primary-ssl-2way-elytron.xml index 6602e03faf9..b1916f50347 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary-ssl-2way-elytron.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary-ssl-2way-elytron.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/host-configs/host-primary.xml b/testsuite/domain/src/test/resources/host-configs/host-primary.xml index ca7fc58af4a..d7fd7c4696e 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-primary.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-primary.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-auto-start.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-auto-start.xml index ce81cfcba8f..a5db9c45e93 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-auto-start.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-auto-start.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-cacheddc.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-cacheddc.xml index 867089f0a6b..8eac5283324 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-cacheddc.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-cacheddc.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-config-changes.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-config-changes.xml index af3cb83acd3..66a410c497a 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-config-changes.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-config-changes.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-discovery-options.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-discovery-options.xml index 0ee2261c508..9bac242b68b 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-discovery-options.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-discovery-options.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-elytron-no-legacy-realms.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-elytron-no-legacy-realms.xml index 87d3a0c285f..248d2992f8f 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-elytron-no-legacy-realms.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-elytron-no-legacy-realms.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-elytron.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-elytron.xml index f558fa694e0..af4364838ee 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-elytron.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-elytron.xml @@ -5,7 +5,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-failure.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-failure.xml index 225109c2f89..cbaa45d202e 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-failure.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-failure.xml @@ -2,7 +2,7 @@ ~ Copyright The WildFly Authors ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-main-three-without-jvm.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-main-three-without-jvm.xml index 1450a08f3a1..e1f1f06246a 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-main-three-without-jvm.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-main-three-without-jvm.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-rbac-properties.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-rbac-properties.xml index 386df8a72d9..3626eba482b 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-rbac-properties.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-rbac-properties.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-rbac.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-rbac.xml index 934ff373190..c6f645af820 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-rbac.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-rbac.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-ssl-1way-elytron.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-ssl-1way-elytron.xml index 243b8e0a556..4f1d0c5565d 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-ssl-1way-elytron.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-ssl-1way-elytron.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary-ssl-2way-elytron.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary-ssl-2way-elytron.xml index ffff39bc8b4..745d717121c 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary-ssl-2way-elytron.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary-ssl-2way-elytron.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/host-configs/host-secondary.xml b/testsuite/domain/src/test/resources/host-configs/host-secondary.xml index 2fb7e1da186..a2595f2eaaa 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-secondary.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-secondary.xml @@ -4,7 +4,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + diff --git a/testsuite/domain/src/test/resources/host-configs/host-synchronization-hc1.xml b/testsuite/domain/src/test/resources/host-configs/host-synchronization-hc1.xml index ae11809a778..cd2c3dcd3bc 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-synchronization-hc1.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-synchronization-hc1.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-synchronization-hc2.xml b/testsuite/domain/src/test/resources/host-configs/host-synchronization-hc2.xml index dc9a62bbd02..73ba8d9ac55 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-synchronization-hc2.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-synchronization-hc2.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/host-synchronization-primary.xml b/testsuite/domain/src/test/resources/host-configs/host-synchronization-primary.xml index 9449875417c..19a5c4af26b 100644 --- a/testsuite/domain/src/test/resources/host-configs/host-synchronization-primary.xml +++ b/testsuite/domain/src/test/resources/host-configs/host-synchronization-primary.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/respawn-primary-http.xml b/testsuite/domain/src/test/resources/host-configs/respawn-primary-http.xml index 074a3f978da..dbf553c072d 100644 --- a/testsuite/domain/src/test/resources/host-configs/respawn-primary-http.xml +++ b/testsuite/domain/src/test/resources/host-configs/respawn-primary-http.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - diff --git a/testsuite/domain/src/test/resources/host-configs/respawn-primary.xml b/testsuite/domain/src/test/resources/host-configs/respawn-primary.xml index fb04bff0779..fe73e90fab3 100644 --- a/testsuite/domain/src/test/resources/host-configs/respawn-primary.xml +++ b/testsuite/domain/src/test/resources/host-configs/respawn-primary.xml @@ -3,7 +3,7 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - From 686f4b5b3123ef064f19edb3001ad17c5dc2bb16 Mon Sep 17 00:00:00 2001 From: Yeray Borges Date: Fri, 19 Sep 2025 17:10:27 +0100 Subject: [PATCH 2/2] [WFCORE-7317] Promote management interface attributes for backlog, no-read-timeout, connection-high-water, connection-low-water from community to default stability level Jira issue: https://issues.redhat.com/browse/WFCORE-7317 Signed-off-by: Yeray Borges --- .../management/BaseHttpInterfaceAddStepHandler.java | 5 +++++ .../management/BaseHttpInterfaceResourceDefinition.java | 5 ----- .../test/mgmt_interfaces/HostMgmtInterfacesTestCase.java | 6 +++--- .../mgmt_interfaces/StandaloneMgmtInterfacesTestCase.java | 7 ++++--- ...raints_community.xml => host_resource_constraints.xml} | 4 ++-- ..._community.xml => standalone_resource_constraints.xml} | 4 ++-- .../mgmt/ManagementInterfaceResourcesTestCase.java | 8 -------- 7 files changed, 16 insertions(+), 23 deletions(-) rename core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/{host_resource_constraints_community.xml => host_resource_constraints.xml} (81%) rename core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/{standalone_resource_constraints_community.xml => standalone_resource_constraints.xml} (87%) diff --git a/controller/src/main/java/org/jboss/as/controller/management/BaseHttpInterfaceAddStepHandler.java b/controller/src/main/java/org/jboss/as/controller/management/BaseHttpInterfaceAddStepHandler.java index 2666367af54..3098f09e6df 100644 --- a/controller/src/main/java/org/jboss/as/controller/management/BaseHttpInterfaceAddStepHandler.java +++ b/controller/src/main/java/org/jboss/as/controller/management/BaseHttpInterfaceAddStepHandler.java @@ -33,9 +33,14 @@ public abstract class BaseHttpInterfaceAddStepHandler extends ManagementInterfaceAddStepHandler { private static final String PROPERTY_BASE = "org.wildfly.management."; + // Do not use the system properties, use the management API to configure them in the model + @Deprecated(since = "30.0.0", forRemoval = true) private static final String BACKLOG_PROPERTY = PROPERTY_BASE + "backlog"; + @Deprecated(since = "30.0.0", forRemoval = true) private static final String CONNECTION_HIGH_WATER_PROPERTY = PROPERTY_BASE + "connection-high-water"; + @Deprecated(since = "30.0.0", forRemoval = true) private static final String CONNECTION_LOW_WATER_PROPERTY = PROPERTY_BASE + "connection-low-water"; + @Deprecated(since = "30.0.0", forRemoval = true) private static final String NO_REQUEST_TIMEOUT_PROPERTY = PROPERTY_BASE + "no-request-timeout"; protected static final String HTTP_AUTHENTICATION_FACTORY_CAPABILITY = "org.wildfly.security.http-authentication-factory"; diff --git a/controller/src/main/java/org/jboss/as/controller/management/BaseHttpInterfaceResourceDefinition.java b/controller/src/main/java/org/jboss/as/controller/management/BaseHttpInterfaceResourceDefinition.java index 071aa4af15e..b5c2aebacf5 100644 --- a/controller/src/main/java/org/jboss/as/controller/management/BaseHttpInterfaceResourceDefinition.java +++ b/controller/src/main/java/org/jboss/as/controller/management/BaseHttpInterfaceResourceDefinition.java @@ -45,7 +45,6 @@ import org.jboss.as.controller.parsing.Attribute; import org.jboss.as.controller.registry.AttributeAccess; import org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.jboss.as.version.Stability; import org.jboss.dmr.ModelNode; import org.jboss.dmr.ModelType; @@ -187,7 +186,6 @@ public void validateParameter(String parameterName, ModelNode value) throws Oper .setAllowExpression(true) .setDefaultValue(new ModelNode(50)) .setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES) - .setStability(Stability.COMMUNITY) .build(); public static final SimpleAttributeDefinition NO_REQUEST_TIMEOUT = new SimpleAttributeDefinitionBuilder(ModelDescriptionConstants.NO_REQUEST_TIMEOUT, ModelType.INT, true) @@ -195,21 +193,18 @@ public void validateParameter(String parameterName, ModelNode value) throws Oper .setMeasurementUnit(MeasurementUnit.MILLISECONDS) .setDefaultValue(new ModelNode(60000)) .setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES) - .setStability(Stability.COMMUNITY) .build(); public static final SimpleAttributeDefinition CONNECTION_HIGH_WATER = new SimpleAttributeDefinitionBuilder(ModelDescriptionConstants.CONNECTION_HIGH_WATER, ModelType.INT, true) .setAllowExpression(true) .setDefaultValue(new ModelNode(100)) .setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES) - .setStability(Stability.COMMUNITY) .build(); public static final SimpleAttributeDefinition CONNECTION_LOW_WATER = new SimpleAttributeDefinitionBuilder(ModelDescriptionConstants.CONNECTION_LOW_WATER, ModelType.INT, true) .setAllowExpression(true) .setDefaultValue(new ModelNode(75)) .setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES) - .setStability(Stability.COMMUNITY) .build(); protected static final AttributeDefinition[] COMMON_ATTRIBUTES = new AttributeDefinition[] { HTTP_AUTHENTICATION_FACTORY, SSL_CONTEXT, CONSOLE_ENABLED, HTTP_UPGRADE_ENABLED, diff --git a/core-model-test/tests/src/test/java/org/jboss/as/core/model/test/mgmt_interfaces/HostMgmtInterfacesTestCase.java b/core-model-test/tests/src/test/java/org/jboss/as/core/model/test/mgmt_interfaces/HostMgmtInterfacesTestCase.java index 2674603f5db..6956af14290 100644 --- a/core-model-test/tests/src/test/java/org/jboss/as/core/model/test/mgmt_interfaces/HostMgmtInterfacesTestCase.java +++ b/core-model-test/tests/src/test/java/org/jboss/as/core/model/test/mgmt_interfaces/HostMgmtInterfacesTestCase.java @@ -31,9 +31,9 @@ public void testEmptyAllowedOriginsConfiguration() throws Exception { } @Test - public void testResourceConstraints_Community() throws Exception { - // Test for https://issues.redhat.com/browse/WFCORE-6830 - testConfiguration("host_resource_constraints_community.xml", Stability.COMMUNITY); + public void testResourceConstraints() throws Exception { + // Test for https://issues.redhat.com/browse/WFCORE-7317 + testConfiguration("host_resource_constraints.xml"); } private void testConfiguration(String fileName) throws Exception { diff --git a/core-model-test/tests/src/test/java/org/jboss/as/core/model/test/mgmt_interfaces/StandaloneMgmtInterfacesTestCase.java b/core-model-test/tests/src/test/java/org/jboss/as/core/model/test/mgmt_interfaces/StandaloneMgmtInterfacesTestCase.java index 1c605af3e3b..2c20d387dea 100644 --- a/core-model-test/tests/src/test/java/org/jboss/as/core/model/test/mgmt_interfaces/StandaloneMgmtInterfacesTestCase.java +++ b/core-model-test/tests/src/test/java/org/jboss/as/core/model/test/mgmt_interfaces/StandaloneMgmtInterfacesTestCase.java @@ -31,11 +31,12 @@ public void testEmptyAllowedOriginsConfiguration() throws Exception { } @Test - public void testResourceConstraints_Community() throws Exception { - // Test for https://issues.redhat.com/browse/WFCORE-6830 - testConfiguration("standalone_resource_constraints_community.xml", Stability.COMMUNITY); + public void testResourceConstraints() throws Exception { + // Test for https://issues.redhat.com/browse/WFCORE-7317 + testConfiguration("standalone_resource_constraints.xml"); } + public void testConfiguration(String fileName) throws Exception { testConfiguration(fileName, Stability.DEFAULT); } diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_resource_constraints_community.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_resource_constraints.xml similarity index 81% rename from core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_resource_constraints_community.xml rename to core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_resource_constraints.xml index d12ddd76af8..7069aada467 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_resource_constraints_community.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/host_resource_constraints.xml @@ -5,12 +5,12 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + + backlog="44" connection-high-water="111" connection-low-water="77" no-request-timeout="66666"> diff --git a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_resource_constraints_community.xml b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_resource_constraints.xml similarity index 87% rename from core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_resource_constraints_community.xml rename to core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_resource_constraints.xml index 1cd27e53d21..041f9e1a2ce 100644 --- a/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_resource_constraints_community.xml +++ b/core-model-test/tests/src/test/resources/org/jboss/as/core/model/test/mgmt_interfaces/standalone_resource_constraints.xml @@ -5,11 +5,11 @@ ~ SPDX-License-Identifier: Apache-2.0 --> - + + backlog="44" connection-high-water="111" connection-low-water="77" no-request-timeout="66666"> diff --git a/testsuite/manualmode/src/test/java/org/wildfly/core/test/standalone/mgmt/ManagementInterfaceResourcesTestCase.java b/testsuite/manualmode/src/test/java/org/wildfly/core/test/standalone/mgmt/ManagementInterfaceResourcesTestCase.java index 6f9e00f6b14..6cb4f798dc4 100644 --- a/testsuite/manualmode/src/test/java/org/wildfly/core/test/standalone/mgmt/ManagementInterfaceResourcesTestCase.java +++ b/testsuite/manualmode/src/test/java/org/wildfly/core/test/standalone/mgmt/ManagementInterfaceResourcesTestCase.java @@ -53,7 +53,6 @@ public class ManagementInterfaceResourcesTestCase { /* * Command Templates */ - private static final String HTTP_INTERFACE_READ_ATTRIBUTE = "/core-service=management/management-interface=http-interface:read-attribute(name=%s)"; private static final String HTTP_INTERFACE_WRITE_ATTRIBUTE = "/core-service=management/management-interface=http-interface:write-attribute(name=%s, value=%d)"; private static final String HTTP_INTERFACE_UNDEFINE_ATTRIBUTE = "/core-service=management/management-interface=http-interface:undefine-attribute(name=%s)"; private static final String SYSTEM_PROPERTY_ADD = "/system-property=%s:add(value=%d)"; @@ -159,13 +158,6 @@ private void runTest(boolean useSystemProperties, int noRequestTimeout, Exceptio cli.sendLine(String.format(SYSTEM_PROPERTY_ADD, CONNECTION_LOW_WATER_PROPERTY, 3)); cli.sendLine(String.format(SYSTEM_PROPERTY_ADD, NO_REQUEST_TIMEOUT_PROPERTY, noRequestTimeout)); } else { - cli.sendLine(String.format(HTTP_INTERFACE_READ_ATTRIBUTE, BACKLOG_ATTRIBUTE), true); - String response = cli.readOutput(); - if (response.contains("WFLYCTL0201")) { - LOG.info("Attribute \"backlog\" not found - assuming the attributes are not available at the server's stability level" ); - controller.stop(); - return; - } cli.sendLine(String.format(HTTP_INTERFACE_WRITE_ATTRIBUTE, BACKLOG_ATTRIBUTE, 2)); cli.sendLine(String.format(HTTP_INTERFACE_WRITE_ATTRIBUTE, CONNECTION_HIGH_WATER_ATTRIBUTE, 6)); cli.sendLine(String.format(HTTP_INTERFACE_WRITE_ATTRIBUTE, CONNECTION_LOW_WATER_ATTRIBUTE, 3));