#    Copyright 2013 Red Hat, Inc. and/or its affiliates.
#
#    This file is part of jcliff.
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

name=undertow
getContents=/subsystem=undertow:read-resource(recursive=true)
client.preprocess.strip=/undertow

prefix.undefine=undefine:/
undefine.rule.1=/subsystem=undertow${cmdpath(${path(..)})}:undefine-attribute(name=${name(.)})
undefine.refresh=true

match.rootLevelProps=modify:/*
rootLevelProps.rule=/subsystem=undertow:write-attribute(name=${name(.)},value=${value(.)})

match.addBufferCache=add:/buffer-cache/*
addBufferCache.rule=/subsystem=undertow/buffer-cache=${name(.)}:add
addBufferCache.refresh=true
addBufferCache.precedence=10

match.removeBufferCache=remove:/buffer-cache/*
removeBufferCache.rule=/subsystem=undertow/buffer-cache=${name(.)}:remove
removeBufferCache.refresh=true
removeBufferCache.precedence=10

match.modBufferCache=modify:/buffer-cache/*/*
modBufferCache.rule=/subsystem=undertow/buffer-cache=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})

match.filterConfig_ExpressionFilter_add=add:/configuration/filter/expression-filter/*
filterConfig_ExpressionFilter_add.rule=/subsystem=undertow/configuration=filter/expression-filter=${name(.)}:add(expression=${value(expression)}
filterConfig_ExpressionFilter_add.refresh=true
filterConfig_ExpressionFilter_add.precedence=100

match.filterConfig_ExpressionFilter_remove=remove:/configuration/filter/expression-filter/*
filterConfig_ExpressionFilter_remove.rule=/subsystem=undertow/configuration=filter/expression-filter=${name(.)}:remove
filterConfig_ExpressionFilter_remove.refresh=true
filterConfig_ExpressionFilter_remove.precedence=100

match.filterConfig_ExpressionFilter_modify=modify:/configuration/filter/expression-filter/*/*
filterConfig_ExpressionFilter_modify.rule=/subsystem=undertow/configuration=filter/expression-filter=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})

match.filterConfig_BasicAuth_add=add:/configuration/filter/basic-auth/*
filterConfig_BasicAuth_add.rule=/subsystem=undertow/configuration=filter/basic-auth=${name(.)}:add(security-domain=${value(security-domain)}
filterConfig_BasicAuth_add.refresh=true
filterConfig_BasicAuth_add.precedence=100

match.filterConfig_BasicAuth_remove=remove:/configuration/filter/basic-auth/*
filterConfig_BasicAuth_remove.rule=/subsystem=undertow/configuration=filter/basic-auth=${name(.)}:remove
filterConfig_BasicAuth_remove.refresh=true
filterConfig_BasicAuth_remove.precedence=100

match.filterConfig_BasicAuth_modify=modify:/configuration/filter/basic-auth/*/*
filterConfig_BasicAuth_modify.rule=/subsystem=undertow/configuration=filter/basic-auth=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.filterConfig_ConnLimit_add=add:/configuration/filter/connection-limit/*
filterConfig_ConnLimit_add.rule=/subsystem=undertow/configuration=filter/connection-limit=${name(.)}:add
filterConfig_ConnLimit_add.refresh=true
filterConfig_ConnLimit_add.precedence=100

match.filterConfig_ConnLimit_remove=remove:/configuration/filter/connection-limit/*
filterConfig_ConnLimit_remove.rule=/subsystem=undertow/configuration=filter/connection-limit=${name(.)}:remove
filterConfig_ConnLimit_remove.refresh=true
filterConfig_ConnLimit_remove.precedence=100

match.filterConfig_ConnLimit_modify=modify:/configuration/filter/connection-limit/*/*
filterConfig_ConnLimit_modify.rule=/subsystem=undertow/configuration=filter/connection-limit=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.filterConfig_CustomFilter_add=add:/configuration/filter/custom-filter/*
filterConfig_CustomFilter_add.rule=/subsystem=undertow/configuration=filter/custom-filter=${name(.)}:add(class-name=${value(class-name)},module=${value(module)})
filterConfig_CustomFilter_add.refresh=true
filterConfig_CustomFilter_add.precedence=100

match.filterConfig_CustomFilter_remove=remove:/configuration/filter/custom-filter/*
filterConfig_CustomFilter_remove.rule=/subsystem=undertow/configuration=filter/custom-filter=${name(.)}:remove
filterConfig_CustomFilter_remove.refresh=true
filterConfig_CustomFilter_remove.precedence=100

match.filterConfig_CustomFilter_modify=modify:/configuration/filter/custom-filter/*/*
filterConfig_CustomFilter_modify.rule=/subsystem=undertow/configuration=filter/custom-filter=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.filterConfig_ErrorPage_add=add:/configuration/filter/error-page/*
filterConfig_ErrorPage_add.rule=/subsystem=undertow/configuration=filter/error-page=${name(.)}:add(code=${value(code)})
filterConfig_ErrorPage_add.refresh=true
filterConfig_ErrorPage_add.precedence=100

match.filterConfig_ErrorPage_remove=remove:/configuration/filter/error-page/*
filterConfig_ErrorPage_remove.rule=/subsystem=undertow/configuration=filter/error-page=${name(.)}:remove
filterConfig_ErrorPage_remove.refresh=true
filterConfig_ErrorPage_remove.precedence=100

match.filterConfig_ErrorPage_modify=modify:/configuration/filter/error-page/*/*
filterConfig_ErrorPage_modify.rule=/subsystem=undertow/configuration=filter/error-page=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.filterConfig_gzip_add=add:/configuration/filter/gzip/*
filterConfig_gzip_add.rule=/subsystem=undertow/configuration=filter/gzip=${name(.)}:add
filterConfig_gzip_add.refresh=true
filterConfig_gzip_add.precedence=100

match.filterConfig_gzip_remove=remove:/configuration/filter/gzip/*
filterConfig_gzip_remove.rule=/subsystem=undertow/configuration=filter/gzip=${name(.)}:remove
filterConfig_gzip_remove.refresh=true
filterConfig_gzip_remove.precedence=100



match.filterConfig_ResponseHeader_add=add:/configuration/filter/response-header/*
filterConfig_ResponseHeader_add.rule=/subsystem=undertow/configuration=filter/response-header=${name(.)}:add(header-name=${value(header-name)},header-value=${value(header-value)})
filterConfig_ResponseHeader_add.refresh=true
filterConfig_ResponseHeader_add.precedence=100

match.filterConfig_ResponseHeader_remove=remove:/configuration/filter/response-header/*
filterConfig_ResponseHeader_remove.rule=/subsystem=undertow/configuration=filter/response-header=${name(.)}:remove
filterConfig_ResponseHeader_remove.refresh=true
filterConfig_ResponseHeader_remove.precedence=100

match.filterConfig_ResponseHeader_modify=modify:/configuration/filter/response-header/*/*
filterConfig_ResponseHeader_modify.rule=/subsystem=undertow/configuration=filter/response-header=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.handlerConfig_file_add=add:/configuration/handler/file/*
handlerConfig_file_add.rule=/subsystem=undertow/configuration=handler/file=${name(.)}:add(path=${value(path)} ${if-defined (directory-listing),(,directory-listing=${value(directory-listing)})})
handlerConfig_file_add.refresh=true
handlerConfig_file_add.precedence=100

match.handlerConfig_file_remove=remove:/configuration/handler/file/*
handlerConfig_file_remove.rule=/subsystem=undertow/configuration=handler/file=${name(.)}:remove
handlerConfig_file_remove.refresh=true
handlerConfig_file_remove.precedence=100

match.handlerConfig_file_modify=modify:/configuration/handler/file/*/*
handlerConfig_file_modify.rule=/subsystem=undertow/configuration=handler/file=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.handlerConfig_reverse-proxy_add=add:/configuration/handler/reverse-proxy/*
handlerConfig_reverse-proxy_add.rule=/subsystem=undertow/configuration=handler/reverse-proxy=${name(.)}:add
handlerConfig_reverse-proxy_add.refresh=true
handlerConfig_reverse-proxy_add.precedence=100

match.handlerConfig_reverse-proxy_remove=remove:/configuration/handler/reverse-proxy/*
handlerConfig_reverse-proxy_remove.rule=/subsystem=undertow/configuration=handler/reverse-proxy=${name(.)}:remove
handlerConfig_reverse-proxy_remove.refresh=true
handlerConfig_reverse-proxy_remove.precedence=100

match.handlerConfig_reverse-proxy_modify=modify:/configuration/handler/reverse-proxy/*/*
handlerConfig_reverse-proxy_modify.rule=/subsystem=undertow/configuration=handler/reverse-proxy=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})



match.server_add=add:/server/*
server_add.rule=/subsystem=undertow/server=${name(.)}:add
server_add.refresh=true
server_add.precedence=200

match.server_remove=remove:/server/*
server_remove.rule=/subsystem=undertow/server=${name(.)}:remove
server_remove.refresh=true
server_remove.precedence=200

match.server_modify=modify:/server/*/*
server_modify.rule=/subsystem=undertow/server=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.server_host_add=add:/server/*/host/*
server_host_add.rule=/subsystem=undertow/server=${name(../..)}/host=${name(.)}:add
server_host_add.refresh=true
server_host_add.precedence=250

match.server_host_remove=remove:/server/*/host/*
server_host_remove.rule=/subsystem=undertow/server=${name(../..)}/host=${name(.)}:remove
server_host_remove.refresh=true
server_host_remove.precedence=250

match.server_host_filter-ref_add=add:/server/*/host/*/filter-ref/*
server_host_filter-ref_add.rule=/subsystem=undertow/server=${name(../../../..)}/host=${name(../..)}/filter-ref=${name(.)}:add
server_host_filter-ref_add.precedence=255
server_host_filter-ref_add.refresh=true

match.server_host_filter-ref_remove=remove:/server/*/host/*/filter-ref/*
server_host_filter-ref_remove.rule=/subsystem=undertow/server=${name(../../../..)}/host=${name(../..)}/filter-ref=${name(.)}:remove
server_host_filter-ref_remove.precedence=255
server_host_filter-ref_remove.refresh=true

match.server_host_filter-ref_modify=modify:/server/*/host/*/filter-ref/*/*
server_host_filter-ref_modify.rule=/subsystem=undertow/server=${name(../../../../..)}/host=${name(../../..)}/filter-ref=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.server_host_mod=modify:/server/*/host/*/*
server_host_mod.rule=/subsystem=undertow/server=${name(../../..)}/host=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})
server_host_mod.precedence=280


match.http-listener_add=add:/server/*/http-listener/*
http-listener_add.rule=/subsystem=undertow/server=${name(../..)/http-listener=${name(.)}:add(socket-binding=${value(socket-binding)}
http-listener_add.refresh=true
http-listener_add.precedence=300

match.http-listener_remove=remove:/server/*/http-listener/*
http-listener_remove.rule=/subsystem=undertow/server=${name(../..)}/http-listener=${name(.)}:remove
http-listener_remove.refresh=true
http-listener_remove.precedence=300

match.http-listener_modify=modify:/server/*/http-listener/*/*
http-listener_modify.rule=/subsystem=undertow/server=${name(../../..)}/http-listener=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.https-listener_add=add:/server/*/https-listener/*
https-listener_add.rule=/subsystem=undertow/server=${name(../..)}/https-listener=${name(.)}:add(socket-binding=${value(socket-binding)},security-realm=${value(security-realm)})
https-listener_add.refresh=true
https-listener_add.precedence=300

match.https-listener_remove=remove:/server/*/https-listener/*
https-listener_remove.rule=/subsystem=undertow/server=${name(../..)}/https-listener=${name(.)}:remove
https-listener_remove.refresh=true
https-listener_remove.precedence=300

match.https-listener_modify=modify:/server/*/https-listener/*/*
https-listener_modify.rule=/subsystem=undertow/server=${name(../../..)}/https-listener=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.access-log_add=add:/server/*/host/*/setting/access-log
access-log_add.rule=/subsystem=undertow/server=${name(../../../..)}/host=${name(../..)}/setting=access-log:add()
access-log_add.refresh=true
access-log_add.precedence=300

match.access-log_remove=remove:/server/*/host/*/setting/access-log
access-log_remove.rule=/subsystem=undertow/server=${name(../../../..)}/host=${name(../..)}/setting=access-log:remove()
access-log_remove.refresh=true
access-log_remove.precedence=300

match.access-log_modify=modify:/server/*/host/*/setting/access-log/*
access-log_modify.rule=/subsystem=undertow/server=${name(../../../../..)}/host=${name(../../..)}/setting=access-log:write-attribute(name=${name(.)},value=${value(.)})


match.servlet-container_add=add:/servlet-container/*
servlet-container_add.rule=/subsystem=undertow/servlet-container=${name(.)}:add
servlet-container_add.refresh=true
servlet-container_add.precedence=500

match.servlet-container_remove=remove:/servlet-container/*
servlet-container_remove.rule=/subsystem=undertow/servlet-container=${name(.)}:remove
servlet-container_remove.refresh=true
servlet-container_remove.precedence=500

match.servlet-container_modify=modify:/servlet-container/*/*
servlet-container_modify.rule=/subsystem=undertow/servlet-container=${name(..)}:write-attribute(name=${name(.)},value=${value(.)})


match.servlet-container-jsp_add=add:/servlet-container/*/setting/jsp
servlet-container-jsp_add.rule=/subsystem=undertow/servlet-container=${name(../..)}/setting=jsp:add
servlet-container-jsp_add.refresh=true
servlet-container-jsp_add.precedence=500

match.servlet-container-jsp_remove=remove:/servlet-container/*/setting/jsp
servlet-container-jsp_remove.rule=/subsystem=undertow/servlet-container=${name(../..)}/setting=jsp:add
servlet-container-jsp_remove.refresh=true
servlet-container-jsp_remove.precedence=500

match.servlet-container-jsp_modify=modify:/servlet-container/*/setting/jsp/*
servlet-container-jsp_modify.rule=/subsystem=undertow/servlet-container=${name(../../..)}/setting=jsp:write-attribute(name=${name(.)},value=${value(.)})


match.servlet-container-websockets_add=add:/servlet-container/*/setting/websockets
servlet-container-websockets_add.rule=/subsystem=undertow/servlet-container=${name(../..)}/setting=websockets:add
servlet-container-websockets_add.refresh=true
servlet-container-websockets_add.precedence=500

match.servlet-container-websockets_remove=remove:/servlet-container/*/setting/websockets
servlet-container-websockets_remove.rule=/subsystem=undertow/servlet-container=${name(../..)}/setting=websockets:add
servlet-container-websockets_remove.refresh=true
servlet-container-websockets_remove.precedence=500

match.servlet-container-websockets_modify=modify:/servlet-container/*/setting/websockets/*
servlet-container-websockets_modify.rule=/subsystem=undertow/servlet-container=${name(../../..)}/setting=websockets:write-attribute(name=${name(.)},value=${value(.)})


