cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1071045 [2/2] - in /cxf/trunk: api/src/main/java/org/apache/cxf/ws/policy/ api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/ api/src/main/java/org/apache/cxf/ws/policy/builder/primitive/ api/src/test/java/org/apache/cxf/ws/policy/bu...
Date Tue, 15 Feb 2011 20:49:41 GMT
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/TransportBindingBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/TransportBindingBuilder.java?rev=1071045&r1=1071044&r2=1071045&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/TransportBindingBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/TransportBindingBuilder.java
Tue Feb 15 20:49:38 2011
@@ -18,16 +18,12 @@
  */
 package org.apache.cxf.ws.security.policy.builders;
 
-import java.util.Arrays;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
-import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
@@ -38,10 +34,12 @@ import org.apache.cxf.ws.security.policy
 import org.apache.cxf.ws.security.policy.model.SupportingToken;
 import org.apache.cxf.ws.security.policy.model.TransportBinding;
 import org.apache.cxf.ws.security.policy.model.TransportToken;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.AssertionBuilderFactory;
 
 public class TransportBindingBuilder implements AssertionBuilder {
-    private static final List<QName> KNOWN_ELEMENTS 
-        = Arrays.asList(SP11Constants.TRANSPORT_BINDING, SP12Constants.TRANSPORT_BINDING);
+    private static final QName KNOWN_ELEMENTS[] 
+        = {SP11Constants.TRANSPORT_BINDING, SP12Constants.TRANSPORT_BINDING};
 
     
     PolicyBuilder builder;
@@ -49,25 +47,26 @@ public class TransportBindingBuilder imp
         builder = b;
     }
     
-    public PolicyAssertion build(Element element)
+    public Assertion build(Element element, AssertionBuilderFactory factory)
         throws IllegalArgumentException {
         
         SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
             ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;
 
         TransportBinding transportBinding = new TransportBinding(consts, builder);
-        processAlternative(element, transportBinding, consts);
+        processAlternative(element, transportBinding, consts, factory);
 
         return transportBinding;
     }
 
-    public List<QName> getKnownElements() {
+    public QName[] getKnownElements() {
         return KNOWN_ELEMENTS;
     }
 
     private void processAlternative(Element element, 
                                     TransportBinding parent,
-                                    SPConstants consts) {
+                                    SPConstants consts,
+                                    AssertionBuilderFactory factory) {
         Element polEl = DOMUtils.getFirstElement(element);
         while (polEl != null) {
             if (PolicyConstants.isPolicyElem(new QName(polEl.getNamespaceURI(),
@@ -76,14 +75,15 @@ public class TransportBindingBuilder imp
                 while (child != null) {
                     String name = child.getLocalName();
                     if (name.equals(SPConstants.ALGO_SUITE)) {
-                        parent.setAlgorithmSuite((AlgorithmSuite)new AlgorithmSuiteBuilder().build(child));
+                        parent.setAlgorithmSuite((AlgorithmSuite)new AlgorithmSuiteBuilder()
+                            .build(child, factory));
                     } else if (name.equals(SPConstants.TRANSPORT_TOKEN)) {
                         parent.setTransportToken((TransportToken)new TransportTokenBuilder(builder)
-                                                        .build(child));
+                                                        .build(child, factory));
                     } else if (name.equals(SPConstants.INCLUDE_TIMESTAMP)) {
                         parent.setIncludeTimestamp(true);
                     } else if (name.equals(SPConstants.LAYOUT)) {
-                        parent.setLayout((Layout)new LayoutBuilder().build(child));
+                        parent.setLayout((Layout)new LayoutBuilder().build(child, factory));
                     } else if (name.equals(SPConstants.PROTECT_TOKENS)) {
                         parent.setTokenProtection(true);
                     } else if (name.equals(SPConstants.SIGNED_SUPPORTING_TOKENS)
@@ -92,11 +92,11 @@ public class TransportBindingBuilder imp
                         if (consts.getVersion() == SPConstants.Version.SP_V11) {
                             parent.setSignedSupportingToken((SupportingToken)
                                                             new SupportingTokensBuilder(builder)
-                                                            .build(child));
+                                                            .build(child, factory));
                         } else {
                             parent.setSignedSupportingToken((SupportingToken)
                                                             new SupportingTokens12Builder(builder)
-                                                                .build(child));         
              
+                                                                .build(child, factory));
                         }
                     }
                     child = DOMUtils.getNextElement(child);
@@ -107,8 +107,4 @@ public class TransportBindingBuilder imp
         
     }
 
-    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/TransportTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/TransportTokenBuilder.java?rev=1071045&r1=1071044&r2=1071045&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/TransportTokenBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/TransportTokenBuilder.java
Tue Feb 15 20:49:38 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.cxf.ws.security.policy.builders;
 
-import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
@@ -28,19 +27,20 @@ import org.w3c.dom.Element;
 
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
-import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
 import org.apache.cxf.ws.security.policy.model.Token;
 import org.apache.cxf.ws.security.policy.model.TransportToken;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.AssertionBuilderFactory;
 import org.apache.neethi.Policy;
 
 
 public class TransportTokenBuilder implements AssertionBuilder {
-    private static final List<QName> KNOWN_ELEMENTS 
-        = Arrays.asList(SP11Constants.TRANSPORT_TOKEN, SP12Constants.TRANSPORT_TOKEN);
+    private static final QName KNOWN_ELEMENTS[] 
+        = {SP11Constants.TRANSPORT_TOKEN, SP12Constants.TRANSPORT_TOKEN};
 
     
     
@@ -49,7 +49,7 @@ public class TransportTokenBuilder imple
         builder = b;
     }
     
-    public PolicyAssertion build(Element element)
+    public Assertion build(Element element, AssertionBuilderFactory factory)
         throws IllegalArgumentException {
         
         SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
@@ -69,12 +69,7 @@ public class TransportTokenBuilder imple
         return transportToken;
     }
 
-    public List<QName> getKnownElements() {
+    public QName[] getKnownElements() {
         return KNOWN_ELEMENTS;
     }
-
-    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust10Builder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust10Builder.java?rev=1071045&r1=1071044&r2=1071045&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust10Builder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust10Builder.java
Tue Feb 15 20:49:38 2011
@@ -18,18 +18,16 @@
  */
 package org.apache.cxf.ws.security.policy.builders;
 
-import java.util.Collections;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
-import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.model.Trust10;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.AssertionBuilderFactory;
 
 
 public class Trust10Builder implements AssertionBuilder {
@@ -37,7 +35,7 @@ public class Trust10Builder implements A
     }
     
 
-    public PolicyAssertion build(Element element)
+    public Assertion build(Element element, AssertionBuilderFactory factory)
         throws IllegalArgumentException {
 
         
@@ -71,14 +69,8 @@ public class Trust10Builder implements A
         return trust10;
     }
 
-    public List<QName> getKnownElements() {
-        return Collections.singletonList(SP11Constants.TRUST_10);
-    }
-
-
-    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
-        // TODO Auto-generated method stub
-        return null;
+    public QName[] getKnownElements() {
+        return new QName[] {SP11Constants.TRUST_10};
     }
 
 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java?rev=1071045&r1=1071044&r2=1071045&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/Trust13Builder.java
Tue Feb 15 20:49:38 2011
@@ -18,24 +18,22 @@
  */
 package org.apache.cxf.ws.security.policy.builders;
 
-import java.util.Collections;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
-import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.model.Trust13;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.AssertionBuilderFactory;
 
 
 public class Trust13Builder implements AssertionBuilder {
 
-    public PolicyAssertion build(Element element) {
+    public Assertion build(Element element, AssertionBuilderFactory factory) {
         element = PolicyConstants.findPolicyElement(element);
 
         if (element == null) {
@@ -78,12 +76,7 @@ public class Trust13Builder implements A
 
         return trust13;
     }
-    public List<QName> getKnownElements() {
-        return Collections.singletonList(SP12Constants.TRUST_13);
-    }
-    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
-        // TODO Auto-generated method stub
-        return null;
+    public QName[] getKnownElements() {
+        return new QName[] {SP12Constants.TRUST_13};
     }
-
 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java?rev=1071045&r1=1071044&r2=1071045&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/UsernameTokenBuilder.java
Tue Feb 15 20:49:38 2011
@@ -18,8 +18,6 @@
  */
 package org.apache.cxf.ws.security.policy.builders;
 
-import java.util.Arrays;
-import java.util.List;
 
 import javax.xml.namespace.QName;
 
@@ -28,25 +26,26 @@ import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 import org.apache.cxf.ws.policy.AssertionBuilder;
-import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
 import org.apache.cxf.ws.security.policy.model.UsernameToken;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.AssertionBuilderFactory;
 
 
 public class UsernameTokenBuilder implements AssertionBuilder {
-    private static final List<QName> KNOWN_ELEMENTS 
-        = Arrays.asList(SP11Constants.USERNAME_TOKEN, SP12Constants.USERNAME_TOKEN);
+    private static final QName KNOWN_ELEMENTS[]  
+        = {SP11Constants.USERNAME_TOKEN, SP12Constants.USERNAME_TOKEN};
 
     PolicyBuilder builder;
     public UsernameTokenBuilder(PolicyBuilder b) {
         builder = b;
     }
     
-    public PolicyAssertion build(Element element) {
+    public Assertion build(Element element, AssertionBuilderFactory factory) {
         
         SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
             ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;
@@ -90,12 +89,7 @@ public class UsernameTokenBuilder implem
         return usernameToken;
     }
 
-    public List<QName> getKnownElements() {
+    public QName[] getKnownElements() {
         return KNOWN_ELEMENTS;
     }
-
-    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java?rev=1071045&r1=1071044&r2=1071045&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS10Builder.java
Tue Feb 15 20:49:38 2011
@@ -18,34 +18,31 @@
  */
 package org.apache.cxf.ws.security.policy.builders;
 
-import java.util.Arrays;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
 
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
-import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
 import org.apache.cxf.ws.security.policy.model.Wss10;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.AssertionBuilderFactory;
 
 
 public class WSS10Builder implements AssertionBuilder {
-    private static final List<QName> KNOWN_ELEMENTS 
-        = Arrays.asList(SP11Constants.WSS10, SP12Constants.WSS10);
+    private static final QName[] KNOWN_ELEMENTS 
+        = {SP11Constants.WSS10, SP12Constants.WSS10};
     
     public WSS10Builder() {
     }
-    public List<QName> getKnownElements() {
+    public QName[] getKnownElements() {
         return KNOWN_ELEMENTS;
     }
-    
-    public PolicyAssertion build(Element element)
+    public Assertion build(Element element, AssertionBuilderFactory factory)
         throws IllegalArgumentException {
 
         SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
@@ -75,9 +72,4 @@ public class WSS10Builder implements Ass
             }
         }
     }
-
-    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java?rev=1071045&r1=1071044&r2=1071045&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/WSS11Builder.java
Tue Feb 15 20:49:38 2011
@@ -18,8 +18,6 @@
  */
 package org.apache.cxf.ws.security.policy.builders;
 
-import java.util.Arrays;
-import java.util.List;
 
 import javax.xml.namespace.QName;
 
@@ -27,23 +25,24 @@ import org.w3c.dom.Element;
 
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
-import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
 import org.apache.cxf.ws.security.policy.SP12Constants;
 import org.apache.cxf.ws.security.policy.SPConstants;
 import org.apache.cxf.ws.security.policy.model.Wss11;
+import org.apache.neethi.Assertion;
+import org.apache.neethi.AssertionBuilderFactory;
 
 
 public class WSS11Builder implements AssertionBuilder {
-    private static final List<QName> KNOWN_ELEMENTS 
-        = Arrays.asList(SP11Constants.WSS11, SP12Constants.WSS11);
+    private static final QName[] KNOWN_ELEMENTS 
+        = {SP11Constants.WSS11, SP12Constants.WSS11};
 
     public WSS11Builder() {
     }
 
     
-    public PolicyAssertion build(Element element)
+    public Assertion build(Element element, AssertionBuilderFactory factory)
         throws IllegalArgumentException {
         SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
             ? SP11Constants.INSTANCE : SP12Constants.INSTANCE;
@@ -52,7 +51,7 @@ public class WSS11Builder implements Ass
         return wss11;
     }
 
-    public List<QName> getKnownElements() {
+    public QName[] getKnownElements() {
         return KNOWN_ELEMENTS;
     }
     private void processAlternative(Element element, Wss11 parent, SPConstants consts) {
@@ -85,8 +84,4 @@ public class WSS11Builder implements Ass
         }
     }
 
-    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/X509TokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/X509TokenBuilder.java?rev=1071045&r1=1071044&r2=1071045&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/X509TokenBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/X509TokenBuilder.java
Tue Feb 15 20:49:38 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.cxf.ws.security.policy.builders;
 
-import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
@@ -28,7 +27,6 @@ import org.w3c.dom.Element;
 
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.ws.policy.AssertionBuilder;
-import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.security.policy.SP11Constants;
@@ -36,11 +34,11 @@ import org.apache.cxf.ws.security.policy
 import org.apache.cxf.ws.security.policy.SPConstants;
 import org.apache.cxf.ws.security.policy.model.X509Token;
 import org.apache.neethi.Assertion;
+import org.apache.neethi.AssertionBuilderFactory;
 import org.apache.neethi.Policy;
 
 public class X509TokenBuilder implements AssertionBuilder {
-    private static final List<QName> KNOWN_ELEMENTS 
-        = Arrays.asList(SP11Constants.X509_TOKEN, SP12Constants.X509_TOKEN);
+    private static final QName KNOWN_ELEMENTS[] = {SP11Constants.X509_TOKEN, SP12Constants.X509_TOKEN};
     
     
     PolicyBuilder builder;
@@ -48,7 +46,7 @@ public class X509TokenBuilder implements
         builder = b;
     }
 
-    public PolicyAssertion build(Element element)
+    public Assertion build(Element element, AssertionBuilderFactory factory)
         throws IllegalArgumentException {
         
         SPConstants consts = SP11Constants.SP_NS.equals(element.getNamespaceURI())
@@ -146,12 +144,8 @@ public class X509TokenBuilder implements
         }
     }
 
-    public List<QName> getKnownElements() {
+    public QName[] getKnownElements() {
         return KNOWN_ELEMENTS;
     }
 
-    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
-        // TODO Auto-generated method stub
-        return null;
-    }
 }



Mime
View raw message