final PathAddress subsystem = PathAddress.EMPTY_ADDRESS.append("subsystem", "web");
final PathAddress defaultHost = subsystem.append(PathElement.pathElement("virtual-server", "default-host"));
List<ModelNode> xmlOps = builder.parseXmlResource("subsystem.xml");
FailedOperationTransformationConfig config = new FailedOperationTransformationConfig()
.addFailedAttribute(subsystem, new IntExpressionConfig("default-session-timeout"))
// valve
.addFailedAttribute(subsystem.append(VALVE_PATH), REJECTED_RESOURCE)
// configuration=container
.addFailedAttribute(subsystem.append(PathElement.pathElement("configuration", "container")),
new FailedOperationTransformationConfig.RejectExpressionsConfig("welcome-file"))
// configuration=static=resources
.addFailedAttribute(subsystem.append(PathElement.pathElement("configuration", "static-resources")),
new FailedOperationTransformationConfig.RejectExpressionsConfig("listings", "sendfile", "file-encoding",
"read-only", "webdav", "secret", "max-depth", "disabled"))
// configuration=jsp-configuration
.addFailedAttribute(subsystem.append(PathElement.pathElement("configuration", "jsp-configuration")),
createChainedConfig(
new String[]{
"development", "disabled", "keep-generated",
"trim-spaces", "tag-pooling", "mapped-file", "check-interval", "modification-test-interval",
"recompile-on-fail", "smap", "dump-smap", "generate-strings-as-char-arrays",
"error-on-use-bean-invalid-class-attribute", "scratch-dir", "source-vm", "target-vm",
"java-encoding", "x-powered-by", "display-source-fragment"},
new String[0]))
// connector=http
.addFailedAttribute(subsystem.append(PathElement.pathElement("connector", "http")),
new FailedOperationTransformationConfig.RejectExpressionsConfig("socket-binding", "enabled", "enable-lookups",
"proxy-name", "proxy-port", "max-post-size", "max-save-post-size", "redirect-port",
"max-connections", "executor"))
// Connector https
.addFailedAttribute(subsystem.append(PathElement.pathElement("connector", "https"), PathElement.pathElement("configuration", "ssl")),
new ChainedConfig(Arrays.asList(new AttributesPathAddressConfig<?>[]{
new FailedOperationTransformationConfig.RejectExpressionsConfig("certificate-key-file", "ca-certificate-file", "key-alias",
"password", "cipher-suite", "protocol", "verify-client", "verify-depth", "certificate-file", "ca-revocation-url",
"ca-certificate-password", "keystore-type", "truststore-type", "session-cache-size", "session-timeout", "ssl-protocol"),
new FailedOperationTransformationConfig.NewAttributesConfig("ssl-protocol")
}),
"certificate-key-file", "ca-certificate-file", "key-alias",
"password", "cipher-suite", "protocol", "verify-client", "verify-depth", "certificate-file", "ca-revocation-url",
"ca-certificate-password", "keystore-type", "truststore-type", "session-cache-size", "session-timeout", "ssl-protocol"));
if (modelVersion.getMicro() == 0) {
// Connector http-vs
config.addFailedAttribute(subsystem.append(PathElement.pathElement("connector", "http-vs")),
new FailedOperationTransformationConfig.NewAttributesConfig("virtual-server"));
}
// virtual-server=default-host
config.addFailedAttribute(defaultHost.append(PathElement.pathElement("rewrite", "myrewrite")),
new FailedOperationTransformationConfig.RejectExpressionsConfig("flags", "pattern", "substitution"))
.addFailedAttribute(defaultHost.append(PathElement.pathElement("rewrite", "with-conditions")),
new FailedOperationTransformationConfig.RejectExpressionsConfig("flags", "pattern", "substitution"))
.addFailedAttribute(defaultHost.append(PathElement.pathElement("rewrite", "with-conditions"), PathElement.pathElement("condition", "https")),
new FailedOperationTransformationConfig.RejectExpressionsConfig("flags", "pattern", "test"))