Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 49559 invoked from network); 17 Feb 2011 19:50:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2011 19:50:35 -0000 Received: (qmail 42742 invoked by uid 500); 17 Feb 2011 19:50:35 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 42690 invoked by uid 500); 17 Feb 2011 19:50:34 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 42683 invoked by uid 99); 17 Feb 2011 19:50:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Feb 2011 19:50:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Feb 2011 19:50:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BACEB2388A64; Thu, 17 Feb 2011 19:50:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1071761 [1/2] - in /cxf/trunk: api/src/main/java/org/apache/cxf/ws/policy/ api/src/main/java/org/apache/cxf/ws/policy/builder/primitive/ api/src/test/java/org/apache/cxf/ws/policy/ rt/transports/http/src/main/java/org/apache/cxf/transport/... Date: Thu, 17 Feb 2011 19:50:08 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110217195008.BACEB2388A64@eris.apache.org> Author: dkulp Date: Thu Feb 17 19:50:06 2011 New Revision: 1071761 URL: http://svn.apache.org/viewvc?rev=1071761&view=rev Log: Update to just use Neethi Assertion wherever possible instead of CXF specific PolicyAssertion subclass. Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AlternativeSelector.java cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfo.java cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EffectivePolicy.java cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistry.java cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builder/primitive/NestedPrimitiveAssertion.java cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/AssertionInfoMapTest.java cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelector.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MaximalAlternativeSelector.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MinimalAlternativeSelector.java cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelectorTest.java cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/MinimalMaximalAlternativeSelectorTest.java cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWss4JInOutTest.java Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AlternativeSelector.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AlternativeSelector.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AlternativeSelector.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AlternativeSelector.java Thu Feb 17 19:50:06 2011 @@ -21,6 +21,7 @@ package org.apache.cxf.ws.policy; import java.util.Collection; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; /** @@ -28,6 +29,6 @@ import org.apache.neethi.Policy; */ public interface AlternativeSelector { - Collection selectAlternative(Policy policy, PolicyEngine engine, Assertor assertor); + Collection selectAlternative(Policy policy, PolicyEngine engine, Assertor assertor); } Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfo.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfo.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfo.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfo.java Thu Feb 17 19:50:06 2011 @@ -19,6 +19,8 @@ package org.apache.cxf.ws.policy; +import org.apache.neethi.Assertion; + /** * @@ -26,10 +28,10 @@ package org.apache.cxf.ws.policy; public class AssertionInfo { private boolean asserted; - private final PolicyAssertion assertion; + private final Assertion assertion; private String errorMessage; - public AssertionInfo(PolicyAssertion a) { + public AssertionInfo(Assertion a) { assertion = a; } public boolean isAsserted() { @@ -46,7 +48,7 @@ public class AssertionInfo { return errorMessage; } - public PolicyAssertion getAssertion() { + public Assertion getAssertion() { return assertion; } public String toString() { Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java Thu Feb 17 19:50:06 2011 @@ -34,6 +34,7 @@ import javax.xml.namespace.QName; import org.apache.cxf.common.i18n.BundleUtils; import org.apache.cxf.common.i18n.Message; import org.apache.cxf.helpers.CastUtils; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; import org.apache.neethi.PolicyComponent; import org.apache.neethi.PolicyContainingAssertion; @@ -47,20 +48,20 @@ public class AssertionInfoMap extends Ha this(getAssertions(p)); } - public AssertionInfoMap(Collection assertions) { + public AssertionInfoMap(Collection assertions) { super(assertions.size() < 6 ? 6 : assertions.size()); - for (PolicyAssertion a : assertions) { + for (Assertion a : assertions) { putAssertionInfo(a); } } - private void putAssertionInfo(PolicyAssertion a) { + private void putAssertionInfo(Assertion a) { if (a instanceof PolicyContainingAssertion) { Policy p = ((PolicyContainingAssertion)a).getPolicy(); if (p != null) { - List pcs = new ArrayList(); + List pcs = new ArrayList(); getAssertions(p, pcs); - for (PolicyAssertion na : pcs) { + for (Assertion na : pcs) { putAssertionInfo(na); } } @@ -81,16 +82,29 @@ public class AssertionInfoMap extends Ha } - public boolean supportsAlternative(PolicyAssertion assertion, + public boolean supportsAlternative(PolicyComponent assertion, List errors) { boolean pass = true; - PolicyAssertion a = (PolicyAssertion)assertion; - if (!a.isAsserted(this) && !a.isOptional()) { - errors.add(a.getName()); - pass = false; + if (assertion instanceof PolicyAssertion) { + PolicyAssertion a = (PolicyAssertion)assertion; + if (!a.isAsserted(this) && !a.isOptional()) { + errors.add(a.getName()); + pass = false; + } + } else if (assertion instanceof Assertion) { + Assertion ass = (Assertion)assertion; + Collection ail = getAssertionInfo(ass.getName()); + for (AssertionInfo ai : ail) { + if (ai.isAsserted() && ai.getAssertion() == ass) { + return true; + } else if (!ass.isOptional()) { + errors.add(ass.getName()); + pass = false; + } + } } - if (a instanceof PolicyContainingAssertion) { - Policy p = ((PolicyContainingAssertion)a).getPolicy(); + if (assertion instanceof PolicyContainingAssertion) { + Policy p = ((PolicyContainingAssertion)assertion).getPolicy(); if (p != null) { Iterator it = p.getAlternatives(); while (it.hasNext()) { @@ -101,12 +115,12 @@ public class AssertionInfoMap extends Ha } } } - return pass || a.isOptional(); + return pass; } - public boolean supportsAlternative(Collection alternative, + public boolean supportsAlternative(Collection alternative, List errors) { boolean pass = true; - for (PolicyAssertion a : alternative) { + for (PolicyComponent a : alternative) { pass &= supportsAlternative(a, errors); } return pass; @@ -114,11 +128,10 @@ public class AssertionInfoMap extends Ha public void checkEffectivePolicy(Policy policy) { List errors = new ArrayList(); - Iterator alternatives = policy.getAlternatives(); - while (alternatives.hasNext()) { - List alternative = CastUtils.cast((List)alternatives.next(), - PolicyAssertion.class); - if (supportsAlternative(alternative, errors)) { + Iterator> alternatives = policy.getAlternatives(); + while (alternatives.hasNext()) { + List pc = alternatives.next(); + if (supportsAlternative(pc, errors)) { return; } } @@ -156,18 +169,17 @@ public class AssertionInfoMap extends Ha } } } - private static Collection getAssertions(PolicyOperator p) { - Collection assertions = new ArrayList(); + private static Collection getAssertions(PolicyOperator p) { + Collection assertions = new ArrayList(); getAssertions(p, assertions); return assertions; } - private static void getAssertions(PolicyOperator p, Collection assertions) { - List pcs = - CastUtils.cast(p.getPolicyComponents(), PolicyComponent.class); + private static void getAssertions(PolicyOperator p, Collection assertions) { + List pcs = p.getPolicyComponents(); for (PolicyComponent pc : pcs) { - if (pc instanceof PolicyAssertion) { - assertions.add((PolicyAssertion)pc); + if (pc instanceof Assertion) { + assertions.add((Assertion)pc); } else { getAssertions((PolicyOperator)pc, assertions); } Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EffectivePolicy.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EffectivePolicy.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EffectivePolicy.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EffectivePolicy.java Thu Feb 17 19:50:06 2011 @@ -24,6 +24,7 @@ import java.util.List; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.message.Message; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; /** @@ -33,7 +34,7 @@ public interface EffectivePolicy { Policy getPolicy(); - Collection getChosenAlternative(); + Collection getChosenAlternative(); List> getInterceptors(); } Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/EndpointPolicy.java Thu Feb 17 19:50:06 2011 @@ -24,6 +24,7 @@ import java.util.List; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.message.Message; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; /** @@ -37,11 +38,11 @@ public interface EndpointPolicy { Policy getPolicy(); EndpointPolicy updatePolicy(Policy p); - Collection getChosenAlternative(); + Collection getChosenAlternative(); - Collection getVocabulary(); + Collection getVocabulary(); - Collection getFaultVocabulary(); + Collection getFaultVocabulary(); List> getInterceptors(); Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java Thu Feb 17 19:50:06 2011 @@ -26,6 +26,7 @@ import org.apache.cxf.service.model.Bind import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.Destination; +import org.apache.neethi.PolicyComponent; import org.apache.neethi.PolicyRegistry; /** @@ -49,7 +50,7 @@ public interface PolicyEngine { // - boolean supportsAlternative(Collection alterative, Assertor assertor); + boolean supportsAlternative(Collection alterative, Assertor assertor); // available throughout the outbound path Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistry.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistry.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistry.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistry.java Thu Feb 17 19:50:06 2011 @@ -27,6 +27,7 @@ import javax.xml.namespace.QName; import org.apache.cxf.extension.Registry; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.message.Message; +import org.apache.neethi.Assertion; /** @@ -43,7 +44,7 @@ public interface PolicyInterceptorProvid */ void register(PolicyInterceptorProvider provider); - List> getInterceptors(Collection alterative, + List> getInterceptors(Collection alterative, boolean out, boolean fault); } Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builder/primitive/NestedPrimitiveAssertion.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builder/primitive/NestedPrimitiveAssertion.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builder/primitive/NestedPrimitiveAssertion.java (original) +++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/builder/primitive/NestedPrimitiveAssertion.java Thu Feb 17 19:50:06 2011 @@ -31,7 +31,6 @@ import org.w3c.dom.Node; import org.apache.cxf.common.i18n.BundleUtils; import org.apache.cxf.common.i18n.Message; -import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.ws.policy.AssertionInfo; import org.apache.cxf.ws.policy.AssertionInfoMap; import org.apache.cxf.ws.policy.PolicyAssertion; @@ -152,30 +151,29 @@ public class NestedPrimitiveAssertion if (p == null) { return true; } - List pcs = - CastUtils.cast(p.getPolicyComponents(), PolicyComponent.class); + List pcs = p.getPolicyComponents(); if (pcs.size() == 0) { return true; } - - if (pcs.get(0) instanceof PolicyAssertion) { - List assertions = - CastUtils.cast(pcs, PolicyAssertion.class); - for (PolicyAssertion pa : assertions) { - if (!pa.isAsserted(aim)) { + for (PolicyComponent pc : pcs) { + if (pc instanceof PolicyOperator) { + if (!isPolicyAsserted((PolicyOperator)pc, aim)) { return false; } - } - return true; - } else { - List assertions = - CastUtils.cast(pcs, PolicyOperator.class); - for (PolicyOperator po : assertions) { - if (isPolicyAsserted(po, aim)) { - return true; + } else if (pc instanceof PolicyAssertion) { + if (!((PolicyAssertion)pc).isAsserted(aim)) { + return false; + } + } else { + Assertion ass = (Assertion)pc; + Collection ail = aim.getAssertionInfo(ass.getName()); + for (AssertionInfo ai : ail) { + if (!ai.isAsserted() && ai.getAssertion() == ass) { + return false; + } } } - return false; } + return true; } } Modified: cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/AssertionInfoMapTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/AssertionInfoMapTest.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/AssertionInfoMapTest.java (original) +++ cxf/trunk/api/src/test/java/org/apache/cxf/ws/policy/AssertionInfoMapTest.java Thu Feb 17 19:50:06 2011 @@ -30,6 +30,7 @@ import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.ws.policy.builder.primitive.NestedPrimitiveAssertion; import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion; import org.apache.neethi.All; +import org.apache.neethi.Assertion; import org.apache.neethi.ExactlyOne; import org.apache.neethi.Policy; import org.easymock.classextension.EasyMock; @@ -88,11 +89,11 @@ public class AssertionInfoMapTest extend EasyMock.expect(c.isAsserted(aim)).andReturn(true).anyTimes(); - List alt1 = new ArrayList(); + List alt1 = new ArrayList(); alt1.add(a1); alt1.add(b); - List alt2 = new ArrayList(); + List alt2 = new ArrayList(); alt2.add(a2); alt2.add(c); Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java (original) +++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java Thu Feb 17 19:50:06 2011 @@ -36,10 +36,10 @@ import org.apache.cxf.transports.http.co import org.apache.cxf.transports.http.configuration.HTTPServerPolicy; import org.apache.cxf.ws.policy.AssertionInfo; import org.apache.cxf.ws.policy.AssertionInfoMap; -import org.apache.cxf.ws.policy.PolicyAssertion; import org.apache.cxf.ws.policy.PolicyEngine; import org.apache.cxf.ws.policy.PolicyException; import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion; +import org.apache.neethi.Assertion; /** * @@ -85,7 +85,7 @@ public final class PolicyUtils { if (null == ais) { return confPolicy; } - Collection alternative = new ArrayList(); + Collection alternative = new ArrayList(); for (AssertionInfo ai : ais) { alternative.add(ai.getAssertion()); } @@ -120,7 +120,7 @@ public final class PolicyUtils { if (null == ais) { return confPolicy; } - Collection alternative = new ArrayList(); + Collection alternative = new ArrayList(); for (AssertionInfo ai : ais) { alternative.add(ai.getAssertion()); } @@ -147,9 +147,9 @@ public final class PolicyUtils { * @throws PolicyException if no compatible HTTPClientPolicy can be determined */ public static HTTPClientPolicy getClient(PolicyEngine pe, EndpointInfo ei, Conduit c) { - Collection alternative = pe.getClientEndpointPolicy(ei, c).getChosenAlternative(); + Collection alternative = pe.getClientEndpointPolicy(ei, c).getChosenAlternative(); HTTPClientPolicy compatible = null; - for (PolicyAssertion a : alternative) { + for (Assertion a : alternative) { if (HTTPCLIENTPOLICY_ASSERTION_QNAME.equals(a.getName())) { HTTPClientPolicy p = JaxbAssertion.cast(a, HTTPClientPolicy.class).getData(); if (null == compatible) { @@ -177,9 +177,9 @@ public final class PolicyUtils { * @throws PolicyException if no compatible HTTPServerPolicy can be determined */ public static HTTPServerPolicy getServer(PolicyEngine pe, EndpointInfo ei, Destination d) { - Collection alternative = pe.getServerEndpointPolicy(ei, d).getChosenAlternative(); + Collection alternative = pe.getServerEndpointPolicy(ei, d).getChosenAlternative(); HTTPServerPolicy compatible = null; - for (PolicyAssertion a : alternative) { + for (Assertion a : alternative) { if (HTTPSERVERPOLICY_ASSERTION_QNAME.equals(a.getName())) { HTTPServerPolicy p = JaxbAssertion.cast(a, HTTPServerPolicy.class).getData(); if (null == compatible) { @@ -634,9 +634,9 @@ public final class PolicyUtils { return s1 == null || s2 == null || s1.equals(s2); } - private static HTTPClientPolicy getClient(Collection alternative) { + private static HTTPClientPolicy getClient(Collection alternative) { HTTPClientPolicy compatible = null; - for (PolicyAssertion a : alternative) { + for (Assertion a : alternative) { if (HTTPCLIENTPOLICY_ASSERTION_QNAME.equals(a.getName())) { HTTPClientPolicy p = JaxbAssertion.cast(a, HTTPClientPolicy.class).getData(); if (null == compatible) { @@ -656,9 +656,9 @@ public final class PolicyUtils { return compatible; } - private static HTTPServerPolicy getServer(Collection alternative) { + private static HTTPServerPolicy getServer(Collection alternative) { HTTPServerPolicy compatible = null; - for (PolicyAssertion a : alternative) { + for (Assertion a : alternative) { if (HTTPSERVERPOLICY_ASSERTION_QNAME.equals(a.getName())) { HTTPServerPolicy p = JaxbAssertion.cast(a, HTTPServerPolicy.class).getData(); if (null == compatible) { Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java Thu Feb 17 19:50:06 2011 @@ -34,6 +34,7 @@ import org.apache.cxf.message.MessageUti import org.apache.cxf.phase.Phase; import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.Conduit; +import org.apache.neethi.Assertion; /** * @@ -90,7 +91,7 @@ public class ClientPolicyInFaultIntercep // insert assertions of endpoint's fault vocabulary into message - Collection assertions = ep.getFaultVocabulary(); + Collection assertions = ep.getFaultVocabulary(); if (null != assertions && !assertions.isEmpty()) { msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions)); } Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java Thu Feb 17 19:50:06 2011 @@ -42,7 +42,9 @@ import org.apache.cxf.service.model.Bind import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.Destination; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; +import org.apache.neethi.PolicyComponent; import org.apache.neethi.PolicyContainingAssertion; /** @@ -54,7 +56,7 @@ public class EffectivePolicyImpl impleme private static final Logger LOG = LogUtils.getL7dLogger(EffectivePolicyImpl.class); protected Policy policy; - protected Collection chosenAlternative; + protected Collection chosenAlternative; protected List> interceptors; public Policy getPolicy() { @@ -65,7 +67,7 @@ public class EffectivePolicyImpl impleme return interceptors; } - public Collection getChosenAlternative() { + public Collection getChosenAlternative() { return chosenAlternative; } @@ -145,7 +147,7 @@ public class EffectivePolicyImpl impleme } void chooseAlternative(PolicyEngineImpl engine, Assertor assertor) { - Collection alternative = engine.getAlternativeSelector() + Collection alternative = engine.getAlternativeSelector() .selectAlternative(policy, engine, assertor); if (null == alternative) { PolicyUtils.logPolicy(LOG, Level.FINE, "No alternative supported.", getPolicy()); @@ -164,7 +166,7 @@ public class EffectivePolicyImpl impleme = engine.getBus().getExtension(PolicyInterceptorProviderRegistry.class); Set> out = new LinkedHashSet>(); - for (PolicyAssertion a : getChosenAlternative()) { + for (Assertion a : getChosenAlternative()) { initialiseInterceptors(reg, engine, out, a, useIn); } setInterceptors(new ArrayList>(out)); @@ -172,13 +174,16 @@ public class EffectivePolicyImpl impleme } - protected Collection getSupportedAlternatives(PolicyEngineImpl engine, + protected Collection getSupportedAlternatives(PolicyEngineImpl engine, Policy p) { - Collection alternatives = new ArrayList(); - for (Iterator it = p.getAlternatives(); it.hasNext();) { - List alternative = CastUtils.cast((List)it.next(), PolicyAssertion.class); + Collection alternatives = new ArrayList(); + + + for (Iterator> it = p.getAlternatives(); it.hasNext();) { + List alternative = it.next(); if (engine.supportsAlternative(alternative, null)) { - alternatives.addAll(alternative); + List asserts = CastUtils.cast(alternative); + alternatives.addAll(asserts); } } return alternatives; @@ -187,7 +192,7 @@ public class EffectivePolicyImpl impleme void initialiseInterceptors(PolicyInterceptorProviderRegistry reg, PolicyEngineImpl engine, Set> out, - PolicyAssertion a, + Assertion a, boolean usIn) { QName qn = a.getName(); PolicyInterceptorProvider pp = reg.get(qn); @@ -197,7 +202,7 @@ public class EffectivePolicyImpl impleme if (a instanceof PolicyContainingAssertion) { Policy p = ((PolicyContainingAssertion)a).getPolicy(); if (p != null) { - for (PolicyAssertion a2 : getSupportedAlternatives(engine, p)) { + for (Assertion a2 : getSupportedAlternatives(engine, p)) { initialiseInterceptors(reg, engine, out, a2, usIn); } } @@ -210,7 +215,7 @@ public class EffectivePolicyImpl impleme policy = ep; } - void setChosenAlternative(Collection c) { + void setChosenAlternative(Collection c) { chosenAlternative = c; } Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java Thu Feb 17 19:50:06 2011 @@ -38,8 +38,10 @@ import org.apache.cxf.service.model.Bind import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.Destination; +import org.apache.neethi.Assertion; import org.apache.neethi.ExactlyOne; import org.apache.neethi.Policy; +import org.apache.neethi.PolicyComponent; import org.apache.neethi.PolicyContainingAssertion; /** @@ -50,10 +52,10 @@ public class EndpointPolicyImpl implemen private static final ResourceBundle BUNDLE = BundleUtils.getBundle(EndpointPolicyImpl.class); private Policy policy; - private Collection chosenAlternative; + private Collection chosenAlternative; - private Collection vocabulary; - private Collection faultVocabulary; + private Collection vocabulary; + private Collection faultVocabulary; private List> interceptors; private List> faultInterceptors; @@ -105,18 +107,18 @@ public class EndpointPolicyImpl implemen return epi; } - public Collection getChosenAlternative() { + public Collection getChosenAlternative() { return chosenAlternative; } - public synchronized Collection getVocabulary() { + public synchronized Collection getVocabulary() { if (vocabulary == null) { initializeVocabulary(); } return vocabulary; } - public synchronized Collection getFaultVocabulary() { + public synchronized Collection getFaultVocabulary() { if (vocabulary == null) { initializeVocabulary(); } @@ -157,7 +159,7 @@ public class EndpointPolicyImpl implemen } void chooseAlternative() { - Collection alternative = null; + Collection alternative = null; if (requestor) { alternative = engine.getAlternativeSelector().selectAlternative(policy, engine, assertor); } else { @@ -170,26 +172,28 @@ public class EndpointPolicyImpl implemen } } - protected Collection getSupportedAlternatives() { - Collection alternatives = new ArrayList(); - for (Iterator it = policy.getAlternatives(); it.hasNext();) { - List alternative = CastUtils.cast((List)it.next(), PolicyAssertion.class); + protected Collection getSupportedAlternatives() { + Collection alternatives = new ArrayList(); + + for (Iterator> it = policy.getAlternatives(); it.hasNext();) { + List alternative = it.next(); if (engine.supportsAlternative(alternative, assertor)) { - alternatives.addAll(alternative); + List asserts = CastUtils.cast(alternative); + alternatives.addAll(asserts); } } return alternatives; } void initializeVocabulary() { - vocabulary = new ArrayList(); + vocabulary = new ArrayList(); if (requestor) { - faultVocabulary = new ArrayList(); + faultVocabulary = new ArrayList(); } // vocabulary of alternative chosen for endpoint if (getChosenAlternative() != null) { - for (PolicyAssertion a : getChosenAlternative()) { + for (Assertion a : getChosenAlternative()) { if (a.isOptional()) { continue; } @@ -210,7 +214,7 @@ public class EndpointPolicyImpl implemen } else { p = engine.getEffectiveServerRequestPolicy(ei, boi); } - Collection c = engine.getAssertions(p, false); + Collection c = engine.getAssertions(p, false); if (c != null) { vocabulary.addAll(c); if (null != faultVocabulary) { @@ -250,12 +254,13 @@ public class EndpointPolicyImpl implemen } } - Collection getSupportedAlternatives(Policy p) { - Collection alternatives = new ArrayList(); - for (Iterator it = p.getAlternatives(); it.hasNext();) { - List alternative = CastUtils.cast((List)it.next(), PolicyAssertion.class); + Collection getSupportedAlternatives(Policy p) { + Collection alternatives = new ArrayList(); + for (Iterator> it = p.getAlternatives(); it.hasNext();) { + List alternative = it.next(); if (engine.supportsAlternative(alternative, null)) { - alternatives.addAll(alternative); + List asserts = CastUtils.cast(alternative); + alternatives.addAll(asserts); } } return alternatives; @@ -263,7 +268,7 @@ public class EndpointPolicyImpl implemen void initializeInterceptors(PolicyInterceptorProviderRegistry reg, Set> out, - PolicyAssertion a, + Assertion a, boolean fault) { QName qn = a.getName(); PolicyInterceptorProvider pp = reg.get(qn); @@ -273,7 +278,7 @@ public class EndpointPolicyImpl implemen if (a instanceof PolicyContainingAssertion) { Policy p = ((PolicyContainingAssertion)a).getPolicy(); if (p != null) { - for (PolicyAssertion a2 : getSupportedAlternatives(p)) { + for (Assertion a2 : getSupportedAlternatives(p)) { initializeInterceptors(reg, out, a2, fault); } } @@ -290,7 +295,7 @@ public class EndpointPolicyImpl implemen Set> out = new LinkedHashSet>(); if (getChosenAlternative() != null) { - for (PolicyAssertion a : getChosenAlternative()) { + for (Assertion a : getChosenAlternative()) { initializeInterceptors(reg, out, a, false); } } @@ -298,7 +303,7 @@ public class EndpointPolicyImpl implemen if (requestor) { interceptors = new ArrayList>(out); out.clear(); - for (PolicyAssertion a : getChosenAlternative()) { + for (Assertion a : getChosenAlternative()) { initializeInterceptors(reg, out, a, true); } faultInterceptors = new ArrayList>(out); @@ -308,9 +313,9 @@ public class EndpointPolicyImpl implemen if (p == null || p.getPolicy() == null || p.getPolicy().isEmpty()) { continue; } - Collection c = engine.getAssertions(p, true); + Collection c = engine.getAssertions(p, true); if (c != null) { - for (PolicyAssertion a : c) { + for (Assertion a : c) { initializeInterceptors(reg, out, a, false); initializeInterceptors(reg, out, a, true); } @@ -328,15 +333,15 @@ public class EndpointPolicyImpl implemen policy = ep; } - void setChosenAlternative(Collection c) { + void setChosenAlternative(Collection c) { chosenAlternative = c; } - void setVocabulary(Collection v) { + void setVocabulary(Collection v) { vocabulary = v; } - void setFaultVocabulary(Collection v) { + void setFaultVocabulary(Collection v) { faultVocabulary = v; } Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java Thu Feb 17 19:50:06 2011 @@ -41,6 +41,7 @@ import org.apache.cxf.service.model.Serv import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.Destination; import org.apache.cxf.ws.policy.selector.MinimalAlternativeSelector; +import org.apache.neethi.Assertion; import org.apache.neethi.Constants; import org.apache.neethi.Policy; import org.apache.neethi.PolicyComponent; @@ -444,12 +445,12 @@ public class PolicyEngineImpl implements * @param includeOptional flag indicating if optional assertions should be included * @return the assertions */ - Collection getAssertions(PolicyComponent pc, boolean includeOptional) { + Collection getAssertions(PolicyComponent pc, boolean includeOptional) { - Collection assertions = new ArrayList(); + Collection assertions = new ArrayList(); if (Constants.TYPE_ASSERTION == pc.getType()) { - PolicyAssertion a = (PolicyAssertion)pc; + Assertion a = (Assertion)pc; if (includeOptional || !a.isOptional()) { assertions.add(a); } @@ -458,16 +459,15 @@ public class PolicyEngineImpl implements } return assertions; } - Collection getAssertions(EffectivePolicy pc, boolean includeOptional) { + Collection getAssertions(EffectivePolicy pc, boolean includeOptional) { if (pc == null || pc.getChosenAlternative() == null) { return null; } - Collection assertions = new ArrayList(); - for (PolicyAssertion assertion : pc.getChosenAlternative()) { + Collection assertions = new ArrayList(); + for (Assertion assertion : pc.getChosenAlternative()) { if (Constants.TYPE_ASSERTION == assertion.getType()) { - PolicyAssertion a = assertion; - if (includeOptional || !a.isOptional()) { - assertions.add(a); + if (includeOptional || !assertion.isOptional()) { + assertions.add(assertion); } } else { addAssertions(assertion, includeOptional, assertions); @@ -477,12 +477,12 @@ public class PolicyEngineImpl implements } void addAssertions(PolicyComponent pc, boolean includeOptional, - Collection assertions) { + Collection assertions) { if (Constants.TYPE_ASSERTION == pc.getType()) { - PolicyAssertion a = (PolicyAssertion)pc; + Assertion a = (Assertion)pc; if (includeOptional || !a.isOptional()) { - assertions.add((PolicyAssertion)pc); + assertions.add((Assertion)pc); } return; } @@ -508,9 +508,9 @@ public class PolicyEngineImpl implements * @return the vocabulary */ Set getVocabulary(PolicyComponent pc, boolean includeOptional) { - Collection assertions = getAssertions(pc, includeOptional); + Collection assertions = getAssertions(pc, includeOptional); Set vocabulary = new HashSet(); - for (PolicyAssertion a : assertions) { + for (Assertion a : assertions) { vocabulary.add(a.getName()); } return vocabulary; @@ -535,16 +535,21 @@ public class PolicyEngineImpl implements * @param Assertor the assertor * @return true iff the alternative can be supported */ - public boolean supportsAlternative(Collection alternative, + public boolean supportsAlternative(Collection alternative, Assertor assertor) { PolicyInterceptorProviderRegistry pipr = bus.getExtension(PolicyInterceptorProviderRegistry.class); - for (PolicyAssertion a : alternative) { - if (!(a.isOptional() - || (null != pipr.get(a.getName())) - || (null != assertor && assertor.canAssert(a.getName())))) { + for (PolicyComponent pc : alternative) { + if (pc instanceof Assertion) { + Assertion a = (Assertion)pc; + if (!(a.isOptional() + || (null != pipr.get(a.getName())) + || (null != assertor && assertor.canAssert(a.getName())))) { - LOG.fine("Alternative " + a.getName() + " is not supported"); + LOG.fine("Alternative " + a.getName() + " is not supported"); + return false; + } + } else { return false; } } Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInInterceptor.java Thu Feb 17 19:50:06 2011 @@ -36,6 +36,7 @@ import org.apache.cxf.service.model.Bind import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.Destination; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; /** @@ -82,7 +83,7 @@ public class PolicyInInterceptor extends msg.getInterceptorChain().add(i); LOG.log(Level.FINE, "Added interceptor of type {0}", i.getClass().getSimpleName()); } - Collection assertions = effectivePolicy.getChosenAlternative(); + Collection assertions = effectivePolicy.getChosenAlternative(); if (null != assertions && !assertions.isEmpty()) { msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions)); msg.getInterceptorChain().add(PolicyVerificationInInterceptor.INSTANCE); @@ -101,7 +102,7 @@ public class PolicyInInterceptor extends // insert assertions of endpoint's vocabulary into message - Collection assertions = ep.getVocabulary(); + Collection assertions = ep.getVocabulary(); if (null != assertions && !assertions.isEmpty()) { msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions)); msg.getInterceptorChain().add(PolicyVerificationInInterceptor.INSTANCE); @@ -142,7 +143,7 @@ public class PolicyInInterceptor extends // insert assertions of endpoint's vocabulary into message - Collection assertions = ep.getVocabulary(); + Collection assertions = ep.getVocabulary(); if (null != assertions && !assertions.isEmpty()) { msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions)); msg.getInterceptorChain().add(PolicyVerificationInInterceptor.INSTANCE); Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java Thu Feb 17 19:50:06 2011 @@ -35,6 +35,7 @@ import org.apache.cxf.extension.BusExten import org.apache.cxf.extension.RegistryImpl; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.message.Message; +import org.apache.neethi.Assertion; /** * @@ -94,11 +95,11 @@ public class PolicyInterceptorProviderRe } } } - public List> getInterceptors(Collection alternative, + public List> getInterceptors(Collection alternative, boolean out, boolean fault) { loadDynamic(); List> interceptors = new ArrayList>(); - for (PolicyAssertion a : alternative) { + for (Assertion a : alternative) { if (a.isOptional()) { continue; } Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java Thu Feb 17 19:50:06 2011 @@ -36,6 +36,7 @@ import org.apache.cxf.service.model.Bind import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.Destination; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; /** @@ -88,14 +89,14 @@ public class PolicyOutInterceptor extend // insert assertions of the chosen alternative into the message - Collection assertions = effectivePolicy.getChosenAlternative(); + Collection assertions = effectivePolicy.getChosenAlternative(); if (null != assertions && !assertions.isEmpty()) { if (LOG.isLoggable(Level.FINEST)) { StringBuilder buf = new StringBuilder(); buf.append("Chosen alternative: "); String nl = System.getProperty("line.separator"); buf.append(nl); - for (PolicyAssertion a : assertions) { + for (Assertion a : assertions) { PolicyUtils.printPolicyComponent(a, buf, 1); } LOG.finest(buf.toString()); @@ -119,14 +120,14 @@ public class PolicyOutInterceptor extend // insert assertions of the chosen alternative into the message - Collection assertions = effectivePolicy.getChosenAlternative(); + Collection assertions = effectivePolicy.getChosenAlternative(); if (null != assertions && !assertions.isEmpty()) { if (LOG.isLoggable(Level.FINEST)) { StringBuilder buf = new StringBuilder(); buf.append("Chosen alternative: "); String nl = System.getProperty("line.separator"); buf.append(nl); - for (PolicyAssertion a : assertions) { + for (Assertion a : assertions) { PolicyUtils.printPolicyComponent(a, buf, 1); } LOG.finest(buf.toString()); @@ -148,7 +149,7 @@ public class PolicyOutInterceptor extend // insert assertions of the chosen alternative into the message - Collection assertions = effectivePolicy.getChosenAlternative(); + Collection assertions = effectivePolicy.getChosenAlternative(); if (null != assertions && !assertions.isEmpty()) { msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions)); msg.getInterceptorChain().add(PolicyVerificationOutInterceptor.INSTANCE); Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java Thu Feb 17 19:50:06 2011 @@ -36,6 +36,7 @@ import org.apache.cxf.service.model.Bind import org.apache.cxf.service.model.BindingOperationInfo; import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.Destination; +import org.apache.neethi.Assertion; /** * @@ -97,7 +98,7 @@ public class ServerPolicyOutFaultInterce // insert assertions of the chosen alternative into the message - Collection assertions = effectivePolicy.getChosenAlternative(); + Collection assertions = effectivePolicy.getChosenAlternative(); if (null != assertions && !assertions.isEmpty()) { msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions)); } Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelector.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelector.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelector.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelector.java Thu Feb 17 19:50:06 2011 @@ -26,23 +26,23 @@ import java.util.List; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.ws.policy.AlternativeSelector; import org.apache.cxf.ws.policy.Assertor; -import org.apache.cxf.ws.policy.PolicyAssertion; import org.apache.cxf.ws.policy.PolicyEngine; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; +import org.apache.neethi.PolicyComponent; /** * */ public class FirstAlternativeSelector implements AlternativeSelector { - public Collection selectAlternative( + public Collection selectAlternative( Policy policy, PolicyEngine engine, Assertor assertor) { - Iterator alternatives = policy.getAlternatives(); + Iterator> alternatives = policy.getAlternatives(); while (alternatives.hasNext()) { - List alternative = - CastUtils.cast((List)alternatives.next(), PolicyAssertion.class); + List alternative = alternatives.next(); if (engine.supportsAlternative(alternative, assertor)) { - return alternative; + return CastUtils.cast(alternative); } } return null; Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MaximalAlternativeSelector.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MaximalAlternativeSelector.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MaximalAlternativeSelector.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MaximalAlternativeSelector.java Thu Feb 17 19:50:06 2011 @@ -26,25 +26,25 @@ import java.util.List; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.ws.policy.AlternativeSelector; import org.apache.cxf.ws.policy.Assertor; -import org.apache.cxf.ws.policy.PolicyAssertion; import org.apache.cxf.ws.policy.PolicyEngine; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; +import org.apache.neethi.PolicyComponent; /** * */ public class MaximalAlternativeSelector implements AlternativeSelector { - public Collection selectAlternative( + public Collection selectAlternative( Policy policy, PolicyEngine engine, Assertor assertor) { - Collection choice = null; - Iterator alternatives = policy.getAlternatives(); + Collection choice = null; + Iterator> alternatives = policy.getAlternatives(); while (alternatives.hasNext()) { - List alternative = - CastUtils.cast((List)alternatives.next(), PolicyAssertion.class); + List alternative = alternatives.next(); if (engine.supportsAlternative(alternative, assertor) && (null == choice || alternative.size() > choice.size())) { - choice = alternative; + choice = CastUtils.cast(alternative); } } return choice; Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MinimalAlternativeSelector.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MinimalAlternativeSelector.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MinimalAlternativeSelector.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MinimalAlternativeSelector.java Thu Feb 17 19:50:06 2011 @@ -26,25 +26,26 @@ import java.util.List; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.ws.policy.AlternativeSelector; import org.apache.cxf.ws.policy.Assertor; -import org.apache.cxf.ws.policy.PolicyAssertion; import org.apache.cxf.ws.policy.PolicyEngine; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; +import org.apache.neethi.PolicyComponent; /** * */ public class MinimalAlternativeSelector implements AlternativeSelector { - public Collection selectAlternative( + public Collection selectAlternative( Policy policy, PolicyEngine engine, Assertor assertor) { - Collection choice = null; - Iterator alternatives = policy.getAlternatives(); + Collection choice = null; + Iterator> alternatives = policy.getAlternatives(); while (alternatives.hasNext()) { - List alternative = - CastUtils.cast((List)alternatives.next(), PolicyAssertion.class); + List alternative = alternatives.next(); + if (engine.supportsAlternative(alternative, assertor) && (null == choice || alternative.size() < choice.size())) { - choice = alternative; + choice = CastUtils.cast(alternative); } } return choice; Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java (original) +++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java Thu Feb 17 19:50:06 2011 @@ -36,6 +36,7 @@ import org.apache.cxf.service.model.Bind import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.Destination; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; import org.easymock.classextension.EasyMock; import org.easymock.classextension.IMocksControl; @@ -73,8 +74,8 @@ public class EffectivePolicyImplTest ext assertNull(effectivePolicy.getInterceptors()); Policy p = control.createMock(Policy.class); - PolicyAssertion a = control.createMock(PolicyAssertion.class); - List la = Collections.singletonList(a); + Assertion a = control.createMock(Assertion.class); + List la = Collections.singletonList(a); List> li = createMockInterceptorList(); control.replay(); effectivePolicy.setPolicy(p); @@ -94,7 +95,7 @@ public class EffectivePolicyImplTest ext EndpointPolicyImpl endpointPolicy = control.createMock(EndpointPolicyImpl.class); Policy p = control.createMock(Policy.class); EasyMock.expect(endpointPolicy.getPolicy()).andReturn(p); - Collection chosenAlternative = new ArrayList(); + Collection chosenAlternative = new ArrayList(); EasyMock.expect(endpointPolicy.getChosenAlternative()).andReturn(chosenAlternative); PolicyEngineImpl pe = new PolicyEngineImpl(); effectivePolicy.initialiseInterceptors(pe, false); @@ -259,11 +260,11 @@ public class EffectivePolicyImplTest ext control.reset(); EasyMock.expect(engine.getAlternativeSelector()).andReturn(selector); - Collection alternative = new ArrayList(); + Collection alternative = new ArrayList(); EasyMock.expect(selector.selectAlternative(policy, engine, assertor)).andReturn(alternative); control.replay(); epi.chooseAlternative(engine, assertor); - Collection choice = epi.getChosenAlternative(); + Collection choice = epi.getChosenAlternative(); assertSame(choice, alternative); control.verify(); } @@ -272,7 +273,7 @@ public class EffectivePolicyImplTest ext @Test public void testInitialiseOutInterceptors() { EffectivePolicyImpl epi = new EffectivePolicyImpl(); - List alternative = new ArrayList(); + List alternative = new ArrayList(); epi.setChosenAlternative(alternative); PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class); Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java (original) +++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java Thu Feb 17 19:50:06 2011 @@ -34,6 +34,7 @@ import org.apache.cxf.message.Message; import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.service.model.ServiceInfo; import org.apache.neethi.All; +import org.apache.neethi.Assertion; import org.apache.neethi.Constants; import org.apache.neethi.ExactlyOne; import org.apache.neethi.Policy; @@ -84,8 +85,8 @@ public class EndpointPolicyImplTest exte assertNull(epi.getFaultInterceptors()); Policy p = control.createMock(Policy.class); - PolicyAssertion a = control.createMock(PolicyAssertion.class); - List la = Collections.singletonList(a); + Assertion a = control.createMock(Assertion.class); + List la = Collections.singletonList(a); List> li = createMockInterceptorList(); control.replay(); epi.setPolicy(p); @@ -176,11 +177,11 @@ public class EndpointPolicyImplTest exte control.reset(); EasyMock.expect(engine.getAlternativeSelector()).andReturn(selector); - Collection alternative = new ArrayList(); + Collection alternative = new ArrayList(); EasyMock.expect(selector.selectAlternative(policy, engine, assertor)).andReturn(alternative); control.replay(); epi.chooseAlternative(); - Collection choice = epi.getChosenAlternative(); + Collection choice = epi.getChosenAlternative(); assertSame(choice, alternative); control.verify(); } @@ -306,8 +307,8 @@ public class EndpointPolicyImplTest exte PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class); EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, engine, requestor, null); - Collection v = new ArrayList(); - Collection fv = new ArrayList(); + Collection v = new ArrayList(); + Collection fv = new ArrayList(); QName aqn = new QName("http://x.y.z", "a"); v.add(mockAssertion(aqn, requestor ? 2 : 1, false)); v.add(mockAssertion(aqn, requestor ? 2 : 1, false)); Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java (original) +++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java Thu Feb 17 19:50:06 2011 @@ -44,6 +44,7 @@ import org.apache.cxf.service.model.Serv import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.Destination; import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion; +import org.apache.neethi.Assertion; import org.apache.neethi.Constants; import org.apache.neethi.Policy; import org.apache.neethi.PolicyComponent; @@ -598,7 +599,7 @@ public class PolicyEngineTest extends As // EasyMock.expect(a.isOptional()).andReturn(false); control.replay(); - Collection ca = engine.getAssertions(a, true); + Collection ca = engine.getAssertions(a, true); assertEquals(1, ca.size()); assertSame(a, ca.iterator().next()); control.verify(); @@ -607,7 +608,7 @@ public class PolicyEngineTest extends As Policy p = control.createMock(Policy.class); EasyMock.expect(p.getType()).andReturn(Constants.TYPE_POLICY); engine.addAssertions(EasyMock.eq(p), EasyMock.eq(false), - CastUtils.cast(EasyMock.isA(Collection.class), PolicyAssertion.class)); + CastUtils.cast(EasyMock.isA(Collection.class), Assertion.class)); EasyMock.expectLastCall(); control.replay(); @@ -618,7 +619,7 @@ public class PolicyEngineTest extends As @Test public void testAddAssertions() { engine = new PolicyEngineImpl(); - Collection assertions = new ArrayList(); + Collection assertions = new ArrayList(); PolicyAssertion a = control.createMock(PolicyAssertion.class); EasyMock.expect(a.getType()).andReturn(Constants.TYPE_ASSERTION); Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java (original) +++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java Thu Feb 17 19:50:06 2011 @@ -38,6 +38,7 @@ import org.apache.cxf.service.model.Endp import org.apache.cxf.service.model.FaultInfo; import org.apache.cxf.transport.Conduit; import org.apache.cxf.transport.Destination; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; import org.easymock.classextension.EasyMock; import org.easymock.classextension.IMocksControl; @@ -94,8 +95,8 @@ public class PolicyInterceptorsTest exte EasyMock.expect(message.getInterceptorChain()).andReturn(ic); ic.add(li.get(0)); EasyMock.expectLastCall(); - Collection assertions = - CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class); + Collection assertions = + CastUtils.cast(Collections.EMPTY_LIST, Assertion.class); EasyMock.expect(effectivePolicy.getChosenAlternative()).andReturn(assertions); control.replay(); interceptor.handleMessage(message); @@ -147,8 +148,8 @@ public class PolicyInterceptorsTest exte EasyMock.expect(message.getInterceptorChain()).andReturn(ic); ic.add(li.get(0)); EasyMock.expectLastCall(); - Collection assertions = - CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class); + Collection assertions = + CastUtils.cast(Collections.EMPTY_LIST, Assertion.class); EasyMock.expect(endpointPolicy.getFaultVocabulary()).andReturn(assertions); control.replay(); interceptor.handleMessage(message); @@ -172,8 +173,8 @@ public class PolicyInterceptorsTest exte EasyMock.expect(message.getInterceptorChain()).andReturn(ic); ic.add(li.get(0)); EasyMock.expectLastCall(); - Collection assertions = - CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class); + Collection assertions = + CastUtils.cast(Collections.EMPTY_LIST, Assertion.class); EasyMock.expect(endpointPolicy.getVocabulary()).andReturn(assertions); control.replay(); interceptor.handleMessage(message); @@ -198,8 +199,8 @@ public class PolicyInterceptorsTest exte EasyMock.expect(message.getInterceptorChain()).andReturn(ic); ic.add(li.get(0)); EasyMock.expectLastCall(); - Collection assertions = - CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class); + Collection assertions = + CastUtils.cast(Collections.EMPTY_LIST, Assertion.class); EasyMock.expect(effectivePolicy.getChosenAlternative()).andReturn(assertions); control.replay(); interceptor.handleMessage(message); @@ -241,8 +242,8 @@ public class PolicyInterceptorsTest exte EasyMock.expect(message.getInterceptorChain()).andReturn(ic); ic.add(li.get(0)); EasyMock.expectLastCall(); - Collection assertions = - CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class); + Collection assertions = + CastUtils.cast(Collections.EMPTY_LIST, Assertion.class); EasyMock.expect(effectivePolicy.getChosenAlternative()).andReturn(assertions); control.replay(); interceptor.handleMessage(message); Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelectorTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelectorTest.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelectorTest.java (original) +++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelectorTest.java Thu Feb 17 19:50:06 2011 @@ -28,6 +28,7 @@ import org.apache.cxf.ws.policy.PolicyAs import org.apache.cxf.ws.policy.PolicyEngine; import org.apache.cxf.ws.policy.TestAssertion; import org.apache.neethi.All; +import org.apache.neethi.Assertion; import org.apache.neethi.ExactlyOne; import org.apache.neethi.Policy; import org.easymock.classextension.EasyMock; @@ -74,7 +75,7 @@ public class FirstAlternativeSelectorTes control.reset(); EasyMock.expect(engine.supportsAlternative(firstAlternative, assertor)).andReturn(true); control.replay(); - Collection chosen = selector.selectAlternative(policy, engine, assertor); + Collection chosen = selector.selectAlternative(policy, engine, assertor); assertSame(1, chosen.size()); assertSame(chosen.size(), firstAlternative.size()); assertSame(chosen.iterator().next(), firstAlternative.iterator().next()); Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/MinimalMaximalAlternativeSelectorTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/MinimalMaximalAlternativeSelectorTest.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/MinimalMaximalAlternativeSelectorTest.java (original) +++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/MinimalMaximalAlternativeSelectorTest.java Thu Feb 17 19:50:06 2011 @@ -28,6 +28,7 @@ import org.apache.cxf.ws.policy.PolicyAs import org.apache.cxf.ws.policy.PolicyEngine; import org.apache.cxf.ws.policy.TestAssertion; import org.apache.neethi.All; +import org.apache.neethi.Assertion; import org.apache.neethi.ExactlyOne; import org.apache.neethi.Policy; import org.easymock.classextension.EasyMock; @@ -73,7 +74,7 @@ public class MinimalMaximalAlternativeSe EasyMock.expect(engine.supportsAlternative(minAlternative, assertor)).andReturn(true); control.replay(); - Collection choice = + Collection choice = selector.selectAlternative(policy, engine, assertor); assertEquals(0, choice.size()); control.verify(); @@ -103,7 +104,7 @@ public class MinimalMaximalAlternativeSe EasyMock.expect(engine.supportsAlternative(minAlternative, assertor)).andReturn(true); control.replay(); - Collection choice = selector.selectAlternative(policy, engine, assertor); + Collection choice = selector.selectAlternative(policy, engine, assertor); assertEquals(1, choice.size()); assertSame(a1, choice.iterator().next()); control.verify(); Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original) +++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Thu Feb 17 19:50:06 2011 @@ -59,11 +59,11 @@ import org.apache.cxf.ws.addressing.MAPA import org.apache.cxf.ws.addressing.Names; import org.apache.cxf.ws.policy.EffectivePolicy; import org.apache.cxf.ws.policy.EndpointPolicy; -import org.apache.cxf.ws.policy.PolicyAssertion; import org.apache.cxf.ws.policy.PolicyEngine; import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry; import org.apache.cxf.ws.rm.manager.SequenceTerminationPolicyType; import org.apache.cxf.ws.rm.manager.SourcePolicyType; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; public class RMEndpoint { @@ -629,7 +629,7 @@ public class RMEndpoint { interceptors = reg.getInterceptors(endpointPolicy.getChosenAlternative(), outbound, fault); } - public Collection getChosenAlternative() { + public Collection getChosenAlternative() { return endpointPolicy.getChosenAlternative(); } Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java (original) +++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java Thu Feb 17 19:50:06 2011 @@ -25,7 +25,6 @@ import java.util.List; import javax.xml.bind.JAXBException; import javax.xml.namespace.QName; -import org.apache.cxf.ws.policy.PolicyAssertion; import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion; import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertionBuilder; import org.apache.cxf.ws.rm.RMConstants; @@ -63,11 +62,11 @@ public class RMAssertionBuilder extends @Override public boolean equal(PolicyComponent policyComponent) { if (policyComponent.getType() != Constants.TYPE_ASSERTION - || !getName().equals(((PolicyAssertion)policyComponent).getName())) { + || !getName().equals(((Assertion)policyComponent).getName())) { return false; } JaxbAssertion other = - JaxbAssertion.cast((PolicyAssertion)policyComponent); + JaxbAssertion.cast((Assertion)policyComponent); return PolicyUtils.equals(this.getData(), other.getData()); } Modified: cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java (original) +++ cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java Thu Feb 17 19:50:06 2011 @@ -46,9 +46,9 @@ import org.apache.cxf.transport.Conduit; import org.apache.cxf.ws.addressing.Names; import org.apache.cxf.ws.policy.EffectivePolicy; import org.apache.cxf.ws.policy.EndpointPolicy; -import org.apache.cxf.ws.policy.PolicyAssertion; import org.apache.cxf.ws.policy.PolicyEngine; import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry; +import org.apache.neethi.Assertion; import org.apache.neethi.Policy; import org.easymock.classextension.EasyMock; import org.easymock.classextension.IMocksControl; @@ -287,7 +287,7 @@ public class RMEndpointTest extends Asse EasyMock.expect(ae.getEndpointInfo()).andReturn(aei); EndpointPolicy epi = control.createMock(EndpointPolicy.class); EasyMock.expect(pe.getServerEndpointPolicy(aei, null)).andReturn(epi); - EasyMock.expect(epi.getChosenAlternative()).andReturn(new ArrayList()); + EasyMock.expect(epi.getChosenAlternative()).andReturn(new ArrayList()); pe.setServerEndpointPolicy(ei, epi); EasyMock.expectLastCall(); @@ -340,7 +340,7 @@ public class RMEndpointTest extends Asse @Test public void testEffectivePolicyImpl() { EndpointPolicy ep = control.createMock(EndpointPolicy.class); - Collection alt = new ArrayList(); + Collection alt = new ArrayList(); EasyMock.expect(ep.getChosenAlternative()).andReturn(alt).times(2); PolicyInterceptorProviderRegistry reg = control.createMock(PolicyInterceptorProviderRegistry.class); List> li = new ArrayList>(); Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java (original) +++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java Thu Feb 17 19:50:06 2011 @@ -57,7 +57,6 @@ import org.apache.cxf.ws.addressing.MAPA import org.apache.cxf.ws.policy.AssertionInfo; import org.apache.cxf.ws.policy.AssertionInfoMap; import org.apache.cxf.ws.policy.EndpointPolicy; -import org.apache.cxf.ws.policy.PolicyAssertion; import org.apache.cxf.ws.policy.PolicyBuilder; import org.apache.cxf.ws.policy.PolicyEngine; import org.apache.cxf.ws.security.SecurityConstants; @@ -77,6 +76,7 @@ import org.apache.cxf.ws.security.trust. import org.apache.cxf.ws.security.trust.STSUtils; import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor; import org.apache.neethi.All; +import org.apache.neethi.Assertion; import org.apache.neethi.ExactlyOne; import org.apache.neethi.Policy; import org.apache.ws.security.WSConstants; @@ -157,7 +157,7 @@ class SecureConversationInInterceptor ex ExactlyOne ea = new ExactlyOne(); p.addPolicyComponent(ea); All all = new All(); - PolicyAssertion ass = SecureConversationTokenInterceptorProvider + Assertion ass = SecureConversationTokenInterceptorProvider .getAddressingPolicy(aim, false); all.addPolicyComponent(ass); ea.addPolicyComponent(all); @@ -194,7 +194,7 @@ class SecureConversationInInterceptor ex ExactlyOne ea = new ExactlyOne(); p.addPolicyComponent(ea); All all = new All(); - PolicyAssertion ass = SecureConversationTokenInterceptorProvider + Assertion ass = SecureConversationTokenInterceptorProvider .getAddressingPolicy(aim, false); all.addPolicyComponent(ass); ea.addPolicyComponent(all); @@ -247,7 +247,7 @@ class SecureConversationInInterceptor ex message.getInterceptorChain().add(i); } - Collection assertions = ep.getVocabulary(); + Collection assertions = ep.getVocabulary(); if (null != assertions) { message.put(AssertionInfoMap.class, new AssertionInfoMap(assertions)); } Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java?rev=1071761&r1=1071760&r2=1071761&view=diff ============================================================================== --- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java (original) +++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java Thu Feb 17 19:50:06 2011 @@ -41,7 +41,6 @@ import org.apache.cxf.ws.addressing.poli import org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider; import org.apache.cxf.ws.policy.AssertionInfo; import org.apache.cxf.ws.policy.AssertionInfoMap; -import org.apache.cxf.ws.policy.PolicyAssertion; import org.apache.cxf.ws.policy.PolicyBuilder; import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion; import org.apache.cxf.ws.security.SecurityConstants; @@ -58,6 +57,7 @@ import org.apache.cxf.ws.security.tokens import org.apache.cxf.ws.security.tokenstore.TokenStore; import org.apache.cxf.ws.security.trust.STSClient; import org.apache.neethi.All; +import org.apache.neethi.Assertion; import org.apache.neethi.ExactlyOne; import org.apache.neethi.Policy; import org.apache.ws.security.WSSecurityException; @@ -115,9 +115,9 @@ public class SecureConversationTokenInte return tokenStore; } - static PolicyAssertion getAddressingPolicy(AssertionInfoMap aim, boolean optional) { + static Assertion getAddressingPolicy(AssertionInfoMap aim, boolean optional) { Collection lst = aim.get(MetadataConstants.USING_ADDRESSING_2004_QNAME); - PolicyAssertion assertion = null; + Assertion assertion = null; if (null != lst && !lst.isEmpty()) { assertion = lst.iterator().next().getAssertion(); }