Author: rsearls
Date: 2014-07-29 14:00:00 -0400 (Tue, 29 Jul 2014)
New Revision: 18824
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Attributes.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Constants.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Element.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSServerConfigAttributeHandler.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemReader.java
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/test/java/org/jboss/as/webservices/config/ServerConfigImplTestCase.java
Log:
[JBWS-3750] integration of WebServicePathRewriteRule
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java 2014-07-29
17:58:28 UTC (rev 18823)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/config/ServerConfigImpl.java 2014-07-29
18:00:00 UTC (rev 18824)
@@ -52,6 +52,7 @@
private final DMRSynchCheckHandler webServicePortUCH = new DMRSynchCheckHandler();
private final DMRSynchCheckHandler webServiceSecurePortUCH = new
DMRSynchCheckHandler();
private final DMRSynchCheckHandler modifySOAPAddressUCH = new
DMRSynchCheckHandler();
+ private final DMRSynchCheckHandler webServicePathRewriteRuleUCH = new
DMRSynchCheckHandler();
private ServerConfigImpl() {
// forbidden inheritance
@@ -65,6 +66,7 @@
webServicePortUCH.reset();
webServiceSecurePortUCH.reset();
modifySOAPAddressUCH.reset();
+ webServicePathRewriteRuleUCH.reset();
}
public void incrementWSDeploymentCount() {
@@ -89,6 +91,15 @@
setWebServiceHost(host, webServiceHostUCH);
}
+ public void setWebServicePathRewriteRule(String path, boolean forceUpdate) {
+ setWebServicePathRewriteRule(path, forceUpdate ? null :
webServicePathRewriteRuleUCH);
+ }
+
+ @Override
+ public void setWebServicePathRewriteRule(String path) {
+ setWebServicePathRewriteRule(path, webServicePathRewriteRuleUCH);
+ }
+
public void setWebServicePort(int port, boolean forceUpdate) {
setWebServicePort(port, forceUpdate ? null : webServicePortUCH);
}
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Attributes.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Attributes.java 2014-07-29
17:58:28 UTC (rev 18823)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Attributes.java 2014-07-29
18:00:00 UTC (rev 18824)
@@ -61,8 +61,14 @@
.setDefaultValue(new ModelNode(true))
.setAllowExpression(true)
.build();
- SimpleAttributeDefinition[] SUBSYSTEM_ATTRIBUTES = {MODIFY_WSDL_ADDRESS, WSDL_HOST,
WSDL_PORT, WSDL_SECURE_PORT};
+ SimpleAttributeDefinition WSDL_PATH_REWRITE_RULE = new
SimpleAttributeDefinitionBuilder(Constants.WSDL_PATH_REWRITE_RULE, ModelType.STRING)
+ .setAllowNull(true)
+ .setAllowExpression(false)
+ .build();
+
+ SimpleAttributeDefinition[] SUBSYSTEM_ATTRIBUTES = {MODIFY_WSDL_ADDRESS, WSDL_HOST,
WSDL_PORT, WSDL_SECURE_PORT, WSDL_PATH_REWRITE_RULE};
+
SimpleAttributeDefinition VALUE = new
SimpleAttributeDefinitionBuilder(Constants.VALUE, ModelType.STRING)
.setAllowNull(true)
.setAllowExpression(true)
@@ -77,5 +83,4 @@
.setAllowExpression(true)
.build();
-
}
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Constants.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Constants.java 2014-07-29
17:58:28 UTC (rev 18823)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Constants.java 2014-07-29
18:00:00 UTC (rev 18824)
@@ -55,4 +55,5 @@
String HANDLER_NAME="handler-name";
String HANDLER_CLASS="handler-class";
String VALUE = "value";
+ String WSDL_PATH_REWRITE_RULE = "wsdl-path-rewrite-rule";
}
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Element.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Element.java 2014-07-29
17:58:28 UTC (rev 18823)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/Element.java 2014-07-29
18:00:00 UTC (rev 18824)
@@ -39,6 +39,7 @@
WSDL_HOST(Constants.WSDL_HOST),
WSDL_PORT(Constants.WSDL_PORT),
WSDL_SECURE_PORT(Constants.WSDL_SECURE_PORT),
+ WSDL_PATH_REWRITE_RULE(Constants.WSDL_PATH_REWRITE_RULE),
CLIENT_CONFIG(Constants.CLIENT_CONFIG),
ENDPOINT_CONFIG(Constants.ENDPOINT_CONFIG),
CONFIG_NAME(Constants.CONFIG_NAME),
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSServerConfigAttributeHandler.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSServerConfigAttributeHandler.java 2014-07-29
17:58:28 UTC (rev 18823)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSServerConfigAttributeHandler.java 2014-07-29
18:00:00 UTC (rev 18824)
@@ -25,6 +25,7 @@
import static org.jboss.as.webservices.dmr.Constants.WSDL_HOST;
import static org.jboss.as.webservices.dmr.Constants.WSDL_PORT;
import static org.jboss.as.webservices.dmr.Constants.WSDL_SECURE_PORT;
+import static org.jboss.as.webservices.dmr.Constants.WSDL_PATH_REWRITE_RULE;
import java.net.UnknownHostException;
@@ -107,6 +108,9 @@
} else if (WSDL_SECURE_PORT.equals(attributeName)) {
final int securePort = value != null ? Integer.parseInt(value) : -1;
config.setWebServiceSecurePort(securePort, isRevert);
+ } else if (WSDL_PATH_REWRITE_RULE.equals(attributeName)) {
+ final String path = value != null ? value : null;
+ config.setWebServicePathRewriteRule(path, isRevert);
} else {
throw new IllegalArgumentException(attributeName);
}
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java 2014-07-29
17:58:28 UTC (rev 18823)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemAdd.java 2014-07-29
18:00:00 UTC (rev 18824)
@@ -26,6 +26,7 @@
import static org.jboss.as.webservices.dmr.Constants.WSDL_HOST;
import static org.jboss.as.webservices.dmr.Constants.WSDL_PORT;
import static org.jboss.as.webservices.dmr.Constants.WSDL_SECURE_PORT;
+import static org.jboss.as.webservices.dmr.Constants.WSDL_PATH_REWRITE_RULE;
import java.net.UnknownHostException;
import java.util.ArrayList;
@@ -112,6 +113,9 @@
if (configuration.hasDefined(WSDL_SECURE_PORT)) {
config.setWebServiceSecurePort(Attributes.WSDL_SECURE_PORT.resolveModelAttribute(context,
configuration).asInt());
}
+ if (configuration.hasDefined(WSDL_PATH_REWRITE_RULE)) {
+
config.setWebServicePathRewriteRule(Attributes.WSDL_PATH_REWRITE_RULE.resolveModelAttribute(context,
configuration).asString());
+ }
return config;
}
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemReader.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemReader.java 2014-07-29
17:58:28 UTC (rev 18823)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/main/java/org/jboss/as/webservices/dmr/WSSubsystemReader.java 2014-07-29
18:00:00 UTC (rev 18824)
@@ -140,6 +140,11 @@
Attributes.WSDL_SECURE_PORT.parseAndSetParameter(value,
subsystem, reader);
break;
}
+ case WSDL_PATH_REWRITE_RULE: {
+ final String value = parseElementNoAttributes(reader);
+ Attributes.WSDL_PATH_REWRITE_RULE.parseAndSetParameter(value,
subsystem, reader);
+ break;
+ }
case ENDPOINT_CONFIG: {
readConfig(reader, address, endpointConfigs, false);
break;
Modified:
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/test/java/org/jboss/as/webservices/config/ServerConfigImplTestCase.java
===================================================================
---
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/test/java/org/jboss/as/webservices/config/ServerConfigImplTestCase.java 2014-07-29
17:58:28 UTC (rev 18823)
+++
container/wildfly80/branches/jbossws-wildfly800/server-integration/src/test/java/org/jboss/as/webservices/config/ServerConfigImplTestCase.java 2014-07-29
18:00:00 UTC (rev 18824)
@@ -92,6 +92,12 @@
sc.setWebServiceSecurePort(5435);
}
});
+ internalTestSingleAttributeUpdate(new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setWebServicePathRewriteRule("MY/TEST/PATH");
+ }
+ });
}
@Test
@@ -120,10 +126,17 @@
sc.setWebServiceSecurePort(5435);
}
};
- internalTestMultipleAttributeUpdate(cbA, new Callback[]{cbB, cbC, cbD});
- internalTestMultipleAttributeUpdate(cbB, new Callback[]{cbA, cbC, cbD});
- internalTestMultipleAttributeUpdate(cbC, new Callback[]{cbA, cbB, cbD});
- internalTestMultipleAttributeUpdate(cbD, new Callback[]{cbA, cbB, cbC});
+ Callback cbE = new Callback() {
+ @Override
+ public void setAttribute(ServerConfig sc) throws Exception {
+ sc.setWebServicePathRewriteRule("MY/TEST/PATH");
+ }
+ };
+ internalTestMultipleAttributeUpdate(cbA, new Callback[]{cbB, cbC, cbD, cbE});
+ internalTestMultipleAttributeUpdate(cbB, new Callback[]{cbA, cbC, cbD, cbE});
+ internalTestMultipleAttributeUpdate(cbC, new Callback[]{cbA, cbB, cbD, cbE});
+ internalTestMultipleAttributeUpdate(cbD, new Callback[]{cbA, cbB, cbC, cbE});
+ internalTestMultipleAttributeUpdate(cbE, new Callback[]{cbA, cbB, cbC, cbD});
}
protected void internalTestSingleAttributeUpdate(Callback cb) throws Exception {