You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2015/04/15 14:41:32 UTC

svn commit: r1673743 - /webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java

Author: coheigea
Date: Wed Apr 15 12:41:31 2015
New Revision: 1673743

URL: http://svn.apache.org/r1673743
Log:
[WSS-534] - Allow SupportingToken policies to have more than one token

Modified:
    webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java

Modified: webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java?rev=1673743&r1=1673742&r2=1673743&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java (original)
+++ webservices/wss4j/branches/2_0_x-fixes/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java Wed Apr 15 12:41:31 2015
@@ -21,16 +21,18 @@ package org.apache.wss4j.policy.model;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
+import org.apache.neethi.PolicyContainingAssertion;
 import org.apache.wss4j.policy.SPConstants;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-public class SupportingTokens extends AbstractTokenWrapper {
+public class SupportingTokens extends AbstractSecurityAssertion implements PolicyContainingAssertion {
 
     private SupportingTokenType supportingTokenType;
     private final List<AbstractToken> tokens = new ArrayList<AbstractToken>();
@@ -39,10 +41,12 @@ public class SupportingTokens extends Ab
     private SignedElements signedElements;
     private EncryptedParts encryptedParts;
     private EncryptedElements encryptedElements;
+    private Policy nestedPolicy;
 
     public SupportingTokens(SPConstants.SPVersion version, SupportingTokenType supportingTokenType, Policy nestedPolicy) {
-        super(version, nestedPolicy);
+        super(version);
         this.supportingTokenType = supportingTokenType;
+        this.nestedPolicy = nestedPolicy;
 
         parseNestedPolicy(nestedPolicy, this);
     }
@@ -66,6 +70,11 @@ public class SupportingTokens extends Ab
     protected AbstractSecurityAssertion cloneAssertion(Policy nestedPolicy) {
         return new SupportingTokens(getVersion(), getSupportingTokenType(), nestedPolicy);
     }
+    
+    @Override
+    public Policy getPolicy() {
+        return nestedPolicy;
+    }
 
     protected void parseNestedPolicy(Policy nestedPolicy, SupportingTokens supportingTokens) {
         Iterator<List<Assertion>> alternatives = nestedPolicy.getAlternatives();
@@ -205,4 +214,5 @@ public class SupportingTokens extends Ab
         }
         return false;
     }
+
 }