cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r705021 - /cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java
Date Wed, 15 Oct 2008 20:22:21 GMT
Author: dkulp
Date: Wed Oct 15 13:22:21 2008
New Revision: 705021

URL: http://svn.apache.org/viewvc?rev=705021&view=rev
Log:
Reverting this as this wasn't meant to be merged off of trunk

Modified:
    cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java

Modified: cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java?rev=705021&r1=705020&r2=705021&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/builders/SecureConversationTokenBuilder.java
Wed Oct 15 13:22:21 2008
@@ -29,7 +29,6 @@
 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;
@@ -68,55 +67,47 @@
 
         conversationToken.setInclusion(consts.getInclusionFromAttributeValue(inclusionValue));
 
-        
-        Element elem = DOMUtils.getFirstElement(element);
-        while (elem != null) {
-            QName qn = DOMUtils.getElementQName(elem);
-            if (PolicyConstants.isPolicyElem(qn)) {
-                if (DOMUtils.getFirstChildWithName(elem, 
-                                                   consts.getNamespace(),
-                                                   SPConstants.REQUIRE_DERIVED_KEYS) != null)
{
-                    conversationToken.setDerivedKeys(true);
-                } else if (DOMUtils.getFirstChildWithName(elem, 
-                                                          SP12Constants
-                                                              .REQUIRE_IMPLIED_DERIVED_KEYS)

-                                                          != null) {
-                    conversationToken.setImpliedDerivedKeys(true);
-                } else if (DOMUtils.getFirstChildWithName(elem, 
-                                                          SP12Constants
-                                                              .REQUIRE_EXPLICIT_DERIVED_KEYS)
-                                                              != null) {
-                    conversationToken.setExplicitDerivedKeys(true);
-                }
-
-
-                if (DOMUtils.getFirstChildWithName(elem,
-                                                   consts.getNamespace(),
-                                                   SPConstants.REQUIRE_EXTERNAL_URI_REFERENCE)
!= null) {
-                    conversationToken.setRequireExternalUriRef(true);
-                }
-
-                if (DOMUtils.getFirstChildWithName(elem, 
-                                                   consts.getNamespace(),
-                                                   SPConstants.SC10_SECURITY_CONTEXT_TOKEN)
!= null) {
-                    conversationToken.setSc10SecurityContextToken(true);
-                }
-
-                Element bootstrapPolicyElement = DOMUtils.getFirstChildWithName(elem, 
-                                                                                consts.getNamespace(),
-                                                                                SPConstants.BOOTSTRAP_POLICY);
-                if (bootstrapPolicyElement != null) {
-                    Policy policy = builder.getPolicy(DOMUtils.getFirstElement(bootstrapPolicyElement));
-                    conversationToken.setBootstrapPolicy(policy);
-                }
-
-            } else if (consts.getNamespace().equals(qn.getNamespaceURI())
-                && SPConstants.ISSUER.equals(qn.getLocalPart())) {
-                conversationToken.setIssuerEpr(DOMUtils.getFirstElement(elem));         
      
+        Element issuer = DOMUtils.getFirstChildWithName(element, consts.getNamespace(), SPConstants.ISSUER);
+        if (issuer != null) {
+            conversationToken.setIssuerEpr(DOMUtils.getFirstElement(issuer));
+        }
+
+        element = DOMUtils.getFirstChildWithName(element, SPConstants.POLICY);
+        if (element != null) {
+            if (DOMUtils.getFirstChildWithName(element, 
+                                               consts.getNamespace(),
+                                               SPConstants.REQUIRE_DERIVED_KEYS) != null)
{
+                conversationToken.setDerivedKeys(true);
+            } else if (DOMUtils.getFirstChildWithName(element, 
+                                                      SP12Constants.REQUIRE_IMPLIED_DERIVED_KEYS)
!= null) {
+                conversationToken.setImpliedDerivedKeys(true);
+            } else if (DOMUtils.getFirstChildWithName(element, 
+                                                      SP12Constants.REQUIRE_EXPLICIT_DERIVED_KEYS)
!= null) {
+                conversationToken.setExplicitDerivedKeys(true);
+            }
+
+
+            if (DOMUtils.getFirstChildWithName(element,
+                                               consts.getNamespace(),
+                                               SPConstants.REQUIRE_EXTERNAL_URI_REFERENCE)
!= null) {
+                conversationToken.setRequireExternalUriRef(true);
+            }
+
+            if (DOMUtils.getFirstChildWithName(element, 
+                                               consts.getNamespace(),
+                                               SPConstants.SC10_SECURITY_CONTEXT_TOKEN) !=
null) {
+                conversationToken.setSc10SecurityContextToken(true);
+            }
+
+            Element bootstrapPolicyElement = DOMUtils.getFirstChildWithName(element, 
+                                                                            consts.getNamespace(),
+                                                                            SPConstants.BOOTSTRAP_POLICY);
+            if (bootstrapPolicyElement != null) {
+                Policy policy = builder.getPolicy(DOMUtils.getFirstElement(bootstrapPolicyElement));
+                conversationToken.setBootstrapPolicy(policy);
             }
-            elem = DOMUtils.getNextElement(elem);
         }
-        
+
         return conversationToken;
     }
 



Mime
View raw message