Author: richard.opalka(a)jboss.com
Date: 2008-04-10 10:19:39 -0400 (Thu, 10 Apr 2008)
New Revision: 6339
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM10PolicyAssertionDeployer.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM11PolicyAssertionDeployer.java
Log:
[JBWS-2097] fix to consume minimized WS-RM policies + register new WS-Addressing policy
deployer
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2008-04-10
14:18:17 UTC (rev 6338)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2008-04-10
14:19:39 UTC (rev 6339)
@@ -60,6 +60,7 @@
me.domainDeployerMap.put("http://www.jboss.com/ws-security/schema/jb...;,
WSSecurityAssertionDeployer.class);
me.domainDeployerMap.put("http://docs.oasis-open.org/ws-rx/wsrmp/200...;,
RM11PolicyAssertionDeployer.class);
me.domainDeployerMap.put("http://schemas.xmlsoap.org/ws/2005/02/rm/p...;,
RM10PolicyAssertionDeployer.class);
+
me.domainDeployerMap.put("http://www.w3.org/2006/05/addressing/wsdl&...;,
NopAssertionDeployer.class);
}
//hide constructor
@@ -88,8 +89,8 @@
instance.domainDeployerMap.put("http://www.jboss.com/ws-security/sch...;,
NopAssertionDeployer.class);
instance.domainDeployerMap.put("http://docs.oasis-open.org/ws-rx/wsr...;,
NopAssertionDeployer.class);
instance.domainDeployerMap.put("http://schemas.xmlsoap.org/ws/2005/0...;,
NopAssertionDeployer.class);
+
instance.domainDeployerMap.put("http://www.w3.org/2006/05/addressing...;,
NopAssertionDeployer.class);
return instance;
-
}
@SuppressWarnings("unchecked")
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM10PolicyAssertionDeployer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM10PolicyAssertionDeployer.java 2008-04-10
14:18:17 UTC (rev 6338)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM10PolicyAssertionDeployer.java 2008-04-10
14:19:39 UTC (rev 6339)
@@ -78,7 +78,7 @@
portMD.setPortName(endpointMD.getPortName());
RMDeliveryAssuranceConfig deliveryMD = new RMDeliveryAssuranceConfig();
deliveryMD.setInOrder("false");
- deliveryMD.setQuality("AtMostOnce");
+ deliveryMD.setQuality("AtLeastOnce");
portMD.setDeliveryAssurance(deliveryMD);
// ensure port does not exists yet
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM11PolicyAssertionDeployer.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM11PolicyAssertionDeployer.java 2008-04-10
14:18:17 UTC (rev 6338)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/policy/RM11PolicyAssertionDeployer.java 2008-04-10
14:19:39 UTC (rev 6339)
@@ -92,8 +92,10 @@
// construct new port metadata
RMPortConfig portMD = new RMPortConfig();
portMD.setPortName(endpointMD.getPortName());
- List<PrimitiveAssertion> wsrmpAssertions = getWSRMPAssertions(assertion);
- portMD.setDeliveryAssurance(constructDeliveryAssurance(wsrmpAssertions));
+ RMDeliveryAssuranceConfig deliveryMD = new RMDeliveryAssuranceConfig();
+ deliveryMD.setInOrder("false");
+ deliveryMD.setQuality("AtLeastOnce");
+ portMD.setDeliveryAssurance(deliveryMD);
// ensure port does not exists yet
for (RMPortConfig pMD : rmMD.getPorts())
@@ -113,6 +115,15 @@
private static RMDeliveryAssuranceConfig
constructDeliveryAssurance(List<PrimitiveAssertion> assertions)
throws UnsupportedAssertion
{
+ if (assertions.size() == 0)
+ {
+ // use default one
+ RMDeliveryAssuranceConfig deliveryMD = new RMDeliveryAssuranceConfig();
+ deliveryMD.setInOrder("false");
+ deliveryMD.setQuality("AtLeastOnce");
+ return deliveryMD;
+ }
+
if (assertions.size() == 1)
{
QName assertionQN = assertions.get(0).getName();
@@ -164,17 +175,19 @@
private static List<PrimitiveAssertion> getWSRMPAssertions(PrimitiveAssertion
assertion)
{
- Policy policy = (Policy)assertion.getTerms().get(0);
- XorCompositeAssertion xor = (XorCompositeAssertion)policy.getTerms().get(0);
- AndCompositeAssertion and = (AndCompositeAssertion)xor.getTerms().get(0);
- List<?> primitiveAssertions = and.getTerms();
-
List<PrimitiveAssertion> retVal = new
LinkedList<PrimitiveAssertion>();
- for (int i = 0; i < primitiveAssertions.size(); i++)
+ if (assertion.getTerms().size() != 0)
{
- retVal.add((PrimitiveAssertion)primitiveAssertions.get(i));
+ Policy policy = (Policy)assertion.getTerms().get(0);
+ XorCompositeAssertion xor = (XorCompositeAssertion)policy.getTerms().get(0);
+ AndCompositeAssertion and = (AndCompositeAssertion)xor.getTerms().get(0);
+ List<?> primitiveAssertions = and.getTerms();
+
+ for (int i = 0; i < primitiveAssertions.size(); i++)
+ {
+ retVal.add((PrimitiveAssertion)primitiveAssertions.get(i));
+ }
}
-
return retVal;
}