axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r439954 - in /webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy: builders/ model/
Date Mon, 04 Sep 2006 07:02:51 GMT
Author: sanka
Date: Mon Sep  4 00:02:50 2006
New Revision: 439954

URL: http://svn.apache.org/viewvc?view=rev&rev=439954
Log:
Removing add configuration option from unnecessary Security Assertion classes

Modified:
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/InitiatorTokenBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/LayoutBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/ProtectionTokenBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/RecipientTokenBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SupportingTokensBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportTokenBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS10Builder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS11Builder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/X509TokenBuilder.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AlgorithmSuite.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AsymmetricBinding.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/HttpsToken.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/InitiatorToken.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Layout.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/ProtectionToken.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/RecipientToken.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SupportingToken.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SymmetricBinding.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/UsernameToken.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Wss10.java
    webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/X509Token.java

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AlgorithmSuiteBuilder.java Mon Sep  4 00:02:50 2006
@@ -46,12 +46,12 @@
         policy = (Policy) policy.normalize(false);
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
-            processAlternative((List) iterator.next(), algorithmSuite);
+            buildConfigOption((List) iterator.next(), algorithmSuite);
         }
         return algorithmSuite;
     }
     
-    private void processAlternative(List assertionList, AlgorithmSuite target) {
+    private void buildConfigOption(List assertionList, AlgorithmSuite target) {
         AlgorithmSuite algorithmSuite = new AlgorithmSuite();
         
         XmlPrimtiveAssertion primtiveAssertion;

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/AsymmetricBindingBuilder.java Mon Sep  4 00:02:50 2006
@@ -44,14 +44,18 @@
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), asymmetricBinding);
+            
+            /*
+             * since there should be only one alternative
+             */
+            break;
         }
         
         return asymmetricBinding;
     }
     
-    private void processAlternative(List assertions, AsymmetricBinding parent) {
-        AsymmetricBinding asymmetricBinding = new AsymmetricBinding();
-        
+    private void processAlternative(List assertions, AsymmetricBinding asymmetricBinding) {
+               
         Assertion assertion;
         QName name;
         
@@ -81,8 +85,6 @@
                 asymmetricBinding.setProtectionOrder(Constants.SIGN_BEFORE_ENCRYPTING);
             }  
         }
-                
-        parent.addConfiguration(asymmetricBinding);
     }
     
     public QName getKnownElement() {

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/InitiatorTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/InitiatorTokenBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/InitiatorTokenBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/InitiatorTokenBuilder.java Mon Sep  4 00:02:50 2006
@@ -37,10 +37,11 @@
         InitiatorToken initiatorToken = new InitiatorToken();
         
         Policy policy = PolicyEngine.getPolicy(element.getFirstElement());
-        policy = (Policy) policy.normalize(false);
+        policy = (Policy) policy.normalize(false); 
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), initiatorToken);
+            break; // TODO process all the token that must be set ..
         }
         
         return initiatorToken;
@@ -48,7 +49,6 @@
     
     private void processAlternative(List assertions, InitiatorToken parent) {
         
-        InitiatorToken initiatorToken = new InitiatorToken();
         Object token;
         
         for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
@@ -58,8 +58,6 @@
                 parent.setInitiatorToken((Token) token);
             }
         }
-        
-        parent.addConfiguration(initiatorToken);
     }
 
     public QName getKnownElement() {

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/LayoutBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/LayoutBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/LayoutBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/LayoutBuilder.java Mon Sep  4 00:02:50 2006
@@ -43,7 +43,8 @@
         policy = (Policy) policy.normalize(false);
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext(); ) {
-            processAlternative((List) iterator.next(), layout);                        
+            processAlternative((List) iterator.next(), layout);         
+            break; // there should be only one alternative
         }
                         
         return layout;
@@ -54,24 +55,21 @@
     }
 
     public void processAlternative(List assertions, Layout parent) {
-        Layout layout = new Layout();
         
         for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
             Assertion assertion = (Assertion) iterator.next();
             QName qname = assertion.getName();
             
             if (STRICT.equals(qname)) {
-                layout.setValue(Constants.LAYOUT_STRICT);
+                parent.setValue(Constants.LAYOUT_STRICT);
             } else if (LAX.equals(qname)) {
-                layout.setValue(Constants.LAYOUT_LAX);
+                parent.setValue(Constants.LAYOUT_LAX);
             } else if (LAXTSFIRST.equals(qname)) {
-                layout.setValue(Constants.LAYOUT_LAX_TIMESTAMP_FIRST);
+                parent.setValue(Constants.LAYOUT_LAX_TIMESTAMP_FIRST);
             } else if (LAXTSLAST.equals(qname)) {
-                layout.setValue(Constants.LAYOUT_LAX_TIMESTAMP_LAST);
+                parent.setValue(Constants.LAYOUT_LAX_TIMESTAMP_LAST);
             }
             
         }
-        parent.addCofiguration(layout);
     }
-
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/ProtectionTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/ProtectionTokenBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/ProtectionTokenBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/ProtectionTokenBuilder.java Mon Sep  4 00:02:50 2006
@@ -40,6 +40,7 @@
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), protectionToken);
+            break; // since there should be only one alternative ..
         }
         
         return protectionToken;
@@ -50,11 +51,7 @@
     }
 
     private void processAlternative(List assertions, ProtectionToken parent) {
-        ProtectionToken protectionToken = new ProtectionToken();
-        
         Token token = (Token) assertions.get(0);
-        protectionToken.setToken(token);
-        
-        parent.addOption(protectionToken);
+        parent.setToken(token);
     }
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/RecipientTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/RecipientTokenBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/RecipientTokenBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/RecipientTokenBuilder.java Mon Sep  4 00:02:50 2006
@@ -41,13 +41,17 @@
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), recipientToken);
+            
+            /* 
+             * for the moment we will pick the first token specified in the policy
+             */
+            break;   
         }
         
         return recipientToken;
     }
 
     private void processAlternative(List assertions, RecipientToken parent) {
-        RecipientToken recipientToken = new RecipientToken();
         
         Assertion assertion;
         
@@ -55,12 +59,11 @@
             assertion = (Assertion) iterator.next();
             
             if (assertion instanceof Token) {
-                recipientToken.setToken((Token) assertion);
+                parent.setToken((Token) assertion);
             }
-        }
-                
-        parent.addConfiguration(recipientToken);        
+        }        
     }
+    
     public QName getKnownElement() {
         return Constants.RECIPIENT_TOKEN;
     }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SupportingTokensBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SupportingTokensBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SupportingTokensBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SupportingTokensBuilder.java Mon Sep  4 00:02:50 2006
@@ -35,64 +35,73 @@
 
 public class SupportingTokensBuilder implements AssertionBuilder {
 
-    public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
+    public Assertion build(OMElement element, AssertionBuilderFactory factory)
+            throws IllegalArgumentException {
         QName name = element.getQName();
         SupportingToken supportingToken = null;
-        
+
         if (Constants.SUPPORIING_TOKENS.equals(name)) {
-            supportingToken = new SupportingToken(Constants.SUPPORTING_TOKEN_SUPPORTING);
+            supportingToken = new SupportingToken(
+                    Constants.SUPPORTING_TOKEN_SUPPORTING);
         } else if (Constants.SIGNED_SUPPORTING_TOKENS.equals(name)) {
-            supportingToken = new SupportingToken(Constants.SUPPORTING_TOKEN_SIGNED);
+            supportingToken = new SupportingToken(
+                    Constants.SUPPORTING_TOKEN_SIGNED);
         } else if (Constants.ENDORSING_SUPPORTING_TOKENS.equals(name)) {
-            supportingToken = new SupportingToken(Constants.SUPPORTING_TOKEN_ENDORSING);
+            supportingToken = new SupportingToken(
+                    Constants.SUPPORTING_TOKEN_ENDORSING);
         } else if (Constants.SIGNED_ENDORSING_SUPPORTING_TOKENS.equals(name)) {
-            supportingToken = new SupportingToken(Constants.SUPPORTING_TOKEN_SIGNED_ENDORSING);
+            supportingToken = new SupportingToken(
+                    Constants.SUPPORTING_TOKEN_SIGNED_ENDORSING);
         }
-                
+
         Policy policy = (Policy) PolicyEngine.getPolicy(element);
         policy = (Policy) policy.normalize(false);
-        
+
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), supportingToken);
         }
-        
+
         return supportingToken;
     }
-   
+
     public QName getKnownElement() {
         return Constants.SUPPORIING_TOKENS;
     }
 
     private void processAlternative(List assertions, SupportingToken parent) {
-        SupportingToken supportingToken = new SupportingToken(parent.getTokenType());
-        
+        SupportingToken supportingToken = new SupportingToken(parent
+                .getTokenType());
+
         for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
-            
+
             Assertion primitive = (Assertion) iterator.next();
             QName qname = primitive.getName();
-            
+
             if (Constants.ALGORITHM_SUITE.equals(qname)) {
                 supportingToken.setAlgorithmSuite((AlgorithmSuite) primitive);
-                
+
             } else if (Constants.SIGNED_PARTS.equals(qname)) {
-                supportingToken.setSignedParts((SignedEncryptedParts) primitive);
-                
+                supportingToken
+                        .setSignedParts((SignedEncryptedParts) primitive);
+
             } else if (Constants.SIGNED_ELEMENTS.equals(qname)) {
-                supportingToken.setSignedElements((SignedEncryptedElements) primitive);
-                
+                supportingToken
+                        .setSignedElements((SignedEncryptedElements) primitive);
+
             } else if (Constants.ENCRYPTED_PARTS.equals(qname)) {
-                supportingToken.setEncryptedParts((SignedEncryptedParts) primitive);
-                
+                supportingToken
+                        .setEncryptedParts((SignedEncryptedParts) primitive);
+
             } else if (Constants.ENCRYPTED_ELEMENTS.equals(qname)) {
-                supportingToken.setEncryptedElements((SignedEncryptedElements) primitive);
-                
+                supportingToken
+                        .setEncryptedElements((SignedEncryptedElements) primitive);
+
             } else if (primitive instanceof Token) {
                 supportingToken.addToken((Token) primitive);
             }
         }
-        
-        parent.addOption(supportingToken);        
+
+        parent.addConfiguration(supportingToken);
     }
-    
 
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/SymmetricBindingBuilder.java Mon Sep  4 00:02:50 2006
@@ -23,6 +23,8 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.AssertionBuilderFactory;
+import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyEngine;
 import org.apache.neethi.builders.AssertionBuilder;
 import org.apache.ws.secpolicy.Constants;
 import org.apache.ws.secpolicy.model.EncryptionToken;
@@ -35,7 +37,17 @@
     public Assertion build(OMElement element, AssertionBuilderFactory factory) throws IllegalArgumentException {
         SymmetricBinding symmetricBinding = new SymmetricBinding();
         
+        Policy policy = PolicyEngine.getPolicy(element);
+        policy = (Policy) policy.normalize();
         
+        for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
+            processAlternatives((List) iterator.next(), symmetricBinding);
+            
+            /*
+             * since there should be only one alternative ..
+             */
+            break; 
+        }
         return symmetricBinding;
     }
 
@@ -44,8 +56,6 @@
     }
     
     private void processAlternatives(List assertions, SymmetricBinding parent) {
-        SymmetricBinding symmetricBinding = new SymmetricBinding();
-        
         Assertion assertion;
         QName name;
         
@@ -54,18 +64,15 @@
             name = assertion.getName();
             
             if (Constants.ENCRYPTION_TOKEN.equals(name)) {
-                symmetricBinding.setEncryptionToken((EncryptionToken) assertion);
+                parent.setEncryptionToken((EncryptionToken) assertion);
                 
             } else if (Constants.SIGNATURE_TOKEN.equals(name)) {
-                symmetricBinding.setSignatureToken((SignatureToken) assertion);
+                parent.setSignatureToken((SignatureToken) assertion);
                 
             } else if (Constants.PROTECTION_TOKEN.equals(name)) {
-                symmetricBinding.setProtectionToken((ProtectionToken) assertion);
+                parent.setProtectionToken((ProtectionToken) assertion);
                 
             }
-        }
-        
-        parent.addConfiguration(symmetricBinding);
-        
+        }        
     }
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportBindingBuilder.java Mon Sep  4 00:02:50 2006
@@ -44,6 +44,11 @@
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), transportBinding, factory);
+            
+            /*
+             * since there should be only one alternative
+             */
+            break; 
         }
         
         return transportBinding;
@@ -54,7 +59,6 @@
     }
 
     private void processAlternative(List assertionList, TransportBinding parent, AssertionBuilderFactory factory) {
-        TransportBinding transportBinding = new TransportBinding();
         
         for (Iterator iterator = assertionList.iterator(); iterator.hasNext(); ) {
             
@@ -62,24 +66,23 @@
             QName name = primitive.getName();
             
             if (name.equals(Constants.ALGORITHM_SUITE)) {
-                transportBinding.setAlgorithmSuite((AlgorithmSuite) primitive);
+                parent.setAlgorithmSuite((AlgorithmSuite) primitive);
                 
             } else if (name.equals(Constants.TRANSPORT_TOKEN)) {
-                transportBinding.setTransportToken(((TransportToken) primitive));
+                parent.setTransportToken(((TransportToken) primitive));
                 
             } else if (name.equals(Constants.INCLUDE_TIMESTAMP)) {
-                transportBinding.setIncludeTimestamp(true);
+                parent.setIncludeTimestamp(true);
                 
             } else if (name.equals(Constants.LAYOUT)) {
-                transportBinding.setLayout((Layout) primitive);
+                parent.setLayout((Layout) primitive);
                  
             } else if (name.equals(Constants.SIGNED_SUPPORTING_TOKENS)) {
-                transportBinding.setSignedSupportingToken((SupportingToken) primitive);
+                parent.setSignedSupportingToken((SupportingToken) primitive);
                 
             } else if (name.equals(Constants.SIGNED_ENDORSING_SUPPORTING_TOKENS)) {
-                transportBinding.setSignedEndorsingSupportingTokens((SupportingToken) primitive);
+                parent.setSignedEndorsingSupportingTokens((SupportingToken) primitive);
             }
         }
-        parent.addConfiguration(transportBinding);
     }
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportTokenBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportTokenBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/TransportTokenBuilder.java Mon Sep  4 00:02:50 2006
@@ -43,6 +43,7 @@
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), transportToken);
+            break; // since there should be only one alternative
         }
         
         return transportToken;
@@ -53,7 +54,6 @@
     }
     
     private void processAlternative(List assertions, TransportToken parent) {
-        TransportToken transportToken = new TransportToken();
         
         for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
             XmlPrimtiveAssertion primtive = (XmlPrimtiveAssertion) iterator.next();
@@ -61,10 +61,8 @@
             
             if (Constants.HTTPS_TOKEN.equals(qname)) {
                 HttpsToken httpsToken = new HttpsToken();
-                transportToken.setTransportToken(httpsToken);
+                parent.setTransportToken(httpsToken);
             }
         }
-        
-        parent.addConfiguration(transportToken);
     }
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/UsernameTokenBuilder.java Mon Sep  4 00:02:50 2006
@@ -57,6 +57,11 @@
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), usernameToken);
+            
+            /*
+             * since there should be only one alternative
+             */
+            break;
         }
         
         return usernameToken;
@@ -67,20 +72,17 @@
     }
 
     private void processAlternative(List assertions, UsernameToken parent) {
-        UsernameToken usernameToken = new UsernameToken();
-        usernameToken.setInclusion(parent.getInclusion());
-        
+                
         for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
             Assertion assertion = (Assertion) iterator.next();
             QName qname = assertion.getName();
             
             if (Constants.WSS_USERNAME_TOKEN10.equals(qname)) {
-                usernameToken.setUseUTProfile11(false)
+                parent.setUseUTProfile11(false)
                 ;                
             } else if (Constants.WSS_USERNAME_TOKEN11.equals(qname)) {
-                usernameToken.setUseUTProfile11(true);
+                parent.setUseUTProfile11(true);
             }
         }
-        parent.addConfiguration(usernameToken);
     }
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS10Builder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS10Builder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS10Builder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS10Builder.java Mon Sep  4 00:02:50 2006
@@ -41,6 +41,10 @@
         
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), wss10);
+            /*
+             * since there should be only one alternative
+             */
+            break;
         }
         
         return wss10;
@@ -52,8 +56,6 @@
     
     private void processAlternative(List assertions, Wss10 parent) {
         
-        Wss10 wss10 = new Wss10();
-        
         Assertion assertion;
         QName name;
         
@@ -62,20 +64,17 @@
             name = assertion.getName();
             
             if (Constants.MUST_SUPPORT_REF_KEY_IDENTIFIER.equals(name)) {
-                wss10.setMustSupportRefKeyIdentifier(true);
+                parent.setMustSupportRefKeyIdentifier(true);
                 
             } else if (Constants.MUST_SUPPORT_REF_ISSUER_SERIAL.equals(name)) {
-                wss10.setMustSupportRefIssuerSerial(true);
+                parent.setMustSupportRefIssuerSerial(true);
                 
             } else if (Constants.MUST_SUPPORT_REF_EXTERNAL_URI.equals(name)) {
-                wss10.setMustSupportRefExternalURI(true);
+                parent.setMustSupportRefExternalURI(true);
                 
             } else if (Constants.MUST_SUPPORT_REF_EMBEDDED_TOKEN.equals(name)) {
-                wss10.setMustSupportRefEmbeddedToken(true);
+                parent.setMustSupportRefEmbeddedToken(true);
             }
         }
-        
-        parent.addConfiguration(wss10);
     }
-
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS11Builder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS11Builder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS11Builder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/WSS11Builder.java Mon Sep  4 00:02:50 2006
@@ -40,6 +40,10 @@
 
         for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
             processAlternative((List) iterator.next(), wss11);
+            /*
+             * since there should be only one alternative
+             */
+            break;
         }
 
         return wss11;
@@ -50,8 +54,7 @@
     }
 
     private void processAlternative(List assertions, Wss11 parent) {
-        Wss11 wss11 = new Wss11();
-
+        
         Assertion assertion;
         QName name;
 
@@ -60,29 +63,26 @@
             name = assertion.getName();
 
             if (Constants.MUST_SUPPORT_REF_KEY_IDENTIFIER.equals(name)) {
-                wss11.setMustSupportRefKeyIdentifier(true);
+                parent.setMustSupportRefKeyIdentifier(true);
 
             } else if (Constants.MUST_SUPPORT_REF_ISSUER_SERIAL.equals(name)) {
-                wss11.setMustSupportRefIssuerSerial(true);
+                parent.setMustSupportRefIssuerSerial(true);
 
             } else if (Constants.MUST_SUPPORT_REF_EXTERNAL_URI.equals(name)) {
-                wss11.setMustSupportRefExternalURI(true);
+                parent.setMustSupportRefExternalURI(true);
 
             } else if (Constants.MUST_SUPPORT_REF_EMBEDDED_TOKEN.equals(name)) {
-                wss11.setMustSupportRefEmbeddedToken(true);
+                parent.setMustSupportRefEmbeddedToken(true);
                 
             } else if (Constants.MUST_SUPPORT_REF_THUMBPRINT.equals(name)) {
-                wss11.setMustSupportRefThumbprint(true);
+                parent.setMustSupportRefThumbprint(true);
                 
             } else if (Constants.MUST_SUPPORT_REF_ENCRYPTED_KEY.equals(name)) {
-                wss11.setMustSupportRefEncryptedKey(true);
+                parent.setMustSupportRefEncryptedKey(true);
                 
             } else if (Constants.REQUIRE_SIGNATURE_CONFIRMATION.equals(name)) {
-                wss11.setRequireSignatureConfirmation(true);
+                parent.setRequireSignatureConfirmation(true);
             }
         }
-
-        parent.addConfiguration(wss11);
-
     }
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/X509TokenBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/X509TokenBuilder.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/X509TokenBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/builders/X509TokenBuilder.java Mon Sep  4 00:02:50 2006
@@ -44,15 +44,18 @@
             for (Iterator iterator = policy.getAlternatives(); iterator
                     .hasNext();) {
                 processAlternative((List) iterator.next(), x509Token);
+                
+                /*
+                 * since there should be only one alternative
+                 */
+                break;
             }
         }
         return x509Token;
     }
 
     private void processAlternative(List assertions, X509Token parent) {
-        X509Token x509Token = new X509Token();
-
-        Assertion assertion;
+                Assertion assertion;
         QName name;
 
         for (Iterator iterator = assertions.iterator(); iterator.hasNext();) {
@@ -60,48 +63,46 @@
             name = (QName) assertion.getName();
 
             if (Constants.REQUIRE_KEY_IDENTIFIRE_REFERENCE.equals(name)) {
-                x509Token.setRequireKeyIdentifierReference(true);
+                parent.setRequireKeyIdentifierReference(true);
 
             } else if (Constants.REQUIRE_ISSUER_SERIAL_REFERENCE.equals(name)) {
-                x509Token.setRequireIssuerSerialReference(true);
+                parent.setRequireIssuerSerialReference(true);
 
             } else if (Constants.REQUIRE_EMBEDDED_TOKEN_REFERENCE.equals(name)) {
-                x509Token.setRequireEmbeddedTokenReference(true);
+                parent.setRequireEmbeddedTokenReference(true);
 
             } else if (Constants.REQUIRE_THUMBPRINT_REFERENCE.equals(name)) {
-                x509Token.setRequireThumbprintReference(true);
+                parent.setRequireThumbprintReference(true);
 
             } else if (Constants.WSS_X509_V1_TOKEN_10.equals(name)) {
-                x509Token.setTokenVersionAndType(Constants.WSS_X509_V1_TOKEN10);
+                parent.setTokenVersionAndType(Constants.WSS_X509_V1_TOKEN10);
 
             } else if (Constants.WSS_X509_V1_TOKEN_11.equals(name)) {
-                x509Token.setTokenVersionAndType(Constants.WSS_X509_V1_TOKEN11);
+                parent.setTokenVersionAndType(Constants.WSS_X509_V1_TOKEN11);
 
             } else if (Constants.WSS_X509_V3_TOKEN_10.equals(name)) {
-                x509Token.setTokenVersionAndType(Constants.WSS_X509_V3_TOKEN10);
+                parent.setTokenVersionAndType(Constants.WSS_X509_V3_TOKEN10);
 
             } else if (Constants.WSS_X509_V3_TOKEN_11.equals(name)) {
-                x509Token.setTokenVersionAndType(Constants.WSS_X509_V3_TOKEN11);
+                parent.setTokenVersionAndType(Constants.WSS_X509_V3_TOKEN11);
 
             } else if (Constants.WSS_X509_PKCS7_TOKEN_10.equals(name)) {
-                x509Token
+                parent
                         .setTokenVersionAndType(Constants.WSS_X509_PKCS7_TOKEN10);
 
             } else if (Constants.WSS_X509_PKCS7_TOKEN_11.equals(name)) {
-                x509Token
+                parent
                         .setTokenVersionAndType(Constants.WSS_X509_PKCS7_TOKEN11);
 
             } else if (Constants.WSS_X509_PKI_PATH_V1_TOKEN_10.equals(name)) {
-                x509Token
+                parent
                         .setTokenVersionAndType(Constants.WSS_X509_PKI_PATH_V1_TOKEN10);
 
             } else if (Constants.WSS_X509_PKI_PATH_V1_TOKEN_11.equals(name)) {
-                x509Token
+                parent
                         .setTokenVersionAndType(Constants.WSS_X509_PKI_PATH_V1_TOKEN11);
             }
         }
-
-        parent.addConfiguration(x509Token);
     }
 
     public QName getKnownElement() {

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AlgorithmSuite.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AlgorithmSuite.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AlgorithmSuite.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AlgorithmSuite.java Mon Sep  4 00:02:50 2006
@@ -15,17 +15,15 @@
  */
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.neethi.PolicyComponent;
 import org.apache.ws.secpolicy.Constants;
+import org.apache.ws.secpolicy.WSSPolicyException;
 
-public class AlgorithmSuite extends AbstractSecurityAssertion {
+public class AlgorithmSuite extends AbstractConfigurableSecurityAssertion {
     
     private String symmetricSignature = Constants.HMAC_SHA1;
     
@@ -61,12 +59,6 @@
     
     private String xPath;
     
-    private List algorithmSuites;
-        
-//    public AlgorithmSuite (String algoSuite) throws WSSPolicyException {
-//        this.setAlgorithmSuite(algoSuite);
-//    }
-    
     /**
      * Set the algorithm suite
      * @param algoSuite
@@ -370,24 +362,6 @@
         xPath = path;
     }
     
-    public List getConfigurations() {
-        return algorithmSuites;
-    }
-    
-    public AlgorithmSuite getDefaultConfiguration() {
-        if (algorithmSuites != null) {
-            return (AlgorithmSuite) algorithmSuites.get(0);
-        }
-        return null;
-    }
-    
-    public void addConfiguration(AlgorithmSuite algorithmSuite) {
-        if (algorithmSuites == null) {
-            algorithmSuites = new ArrayList();
-        }
-        algorithmSuites.add(algorithmSuite);
-    }
-
     public QName getName() {
         return Constants.ALGORITHM_SUITE;
     }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AsymmetricBinding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AsymmetricBinding.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AsymmetricBinding.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/AsymmetricBinding.java Mon Sep  4 00:02:50 2006
@@ -16,9 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -32,8 +29,6 @@
     
     private RecipientToken recipientToken;
     
-    private List asymmetricBindings = new  ArrayList();
-    
     /**
      * @return Returns the initiatorToken.
      */
@@ -59,20 +54,6 @@
         this.recipientToken = recipientToken;
     }
     
-    public List getConfigurations() {
-        return asymmetricBindings;
-    }
-    
-    public AsymmetricBinding getDefaultConfiguration() {
-        if (asymmetricBindings != null) {
-            return (AsymmetricBinding) asymmetricBindings.get(0);
-        }
-        return null;
-    }
-    
-    public void addConfiguration(AsymmetricBinding asymmetricBinding) {
-        asymmetricBindings.add(asymmetricBinding);
-    }
     public QName getName() {
         return Constants.ASYMMETRIC_BINDING;
     }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/HttpsToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/HttpsToken.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/HttpsToken.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/HttpsToken.java Mon Sep  4 00:02:50 2006
@@ -16,9 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -34,8 +31,6 @@
 
     private Token httpsToken;
     
-    private List httpsTokens = new ArrayList();
-
     /**
      * @return Returns the httpsToken.
      */
@@ -49,21 +44,6 @@
     public void setHttpsToken(Token httpsToken) {
         this.httpsToken = httpsToken;
     }
-    
-    public List getConfigurations() {
-        return httpsTokens;
-    }
-    
-    public HttpsToken getDefaultConfiguration() {
-        if (httpsTokens != null) {
-            return (HttpsToken) httpsTokens.get(0);
-        }
-        return null;
-    }
-        
-    public void addConfiguration(HttpsToken httpsToken) {
-        httpsTokens.add(httpsToken);
-    }
 
     public QName getName() {
         return Constants.HTTPS_TOKEN;
@@ -76,7 +56,4 @@
     public void serialize(XMLStreamWriter writer) throws XMLStreamException {
         throw new UnsupportedOperationException();
     }
-    
-    
-
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/InitiatorToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/InitiatorToken.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/InitiatorToken.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/InitiatorToken.java Mon Sep  4 00:02:50 2006
@@ -16,9 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -28,8 +25,6 @@
 
 public class InitiatorToken extends AbstractSecurityAssertion implements TokenWrapper {
     
-    private ArrayList initiatorTokens = null;
-    
     private Token initiatorToken;
 
     /**
@@ -53,25 +48,6 @@
         this.setInitiatorToken(tok);
     }
     
-    public List getConfigurations() {
-        return initiatorTokens;
-    }
-    
-    public InitiatorToken getDefaultConfiguration() {
-        if (initiatorTokens != null) {
-            return (InitiatorToken) initiatorTokens.get(0);
-        }
-        return null;
-    }
-    
-    public void addConfiguration(InitiatorToken initiatorToken) {
-        
-        if (initiatorTokens == null) {
-           initiatorTokens = new ArrayList();
-       }
-       initiatorTokens.add(initiatorToken);
-    }
-
     public QName getName() {
         return Constants.INITIATOR_TOKEN;
     }
@@ -83,8 +59,4 @@
     public void serialize(XMLStreamWriter writer) throws XMLStreamException {
         throw new UnsupportedOperationException();
     }
-    
-    
-    
-    
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Layout.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Layout.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Layout.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Layout.java Mon Sep  4 00:02:50 2006
@@ -16,9 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -30,8 +27,6 @@
    
     private String value = Constants.LAYOUT_LAX;
     
-    private List layouts;
-
     /**
      * @return Returns the value.
      */
@@ -53,24 +48,6 @@
              }
     }
     
-    public List getConfigurations() {
-        return layouts;
-    }
-    
-    public Layout getDefaultConfiguration() {
-        if (layouts != null) {
-            return (Layout) layouts.get(0);
-        }
-        return null;
-    }
-    
-    public void addCofiguration(Layout layout) {
-        if (layouts == null) {
-            layouts = new ArrayList();
-        }
-        layouts.add(layout);
-    }
-
     public QName getName() {
         return Constants.LAYOUT;
     }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/ProtectionToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/ProtectionToken.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/ProtectionToken.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/ProtectionToken.java Mon Sep  4 00:02:50 2006
@@ -16,10 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -30,8 +26,6 @@
 public class ProtectionToken extends AbstractSecurityAssertion implements TokenWrapper {
     
     private Token protectionToken;
-    
-    private List protectionTokens = new ArrayList();
 
     /**
      * @return Returns the protectionToken.
@@ -51,14 +45,6 @@
         this.setProtectionToken(tok);
     }
     
-    public Iterator getOptions() {
-        return protectionTokens.iterator();
-    }
-    
-    public void addOption(ProtectionToken protectionToken) {
-        protectionTokens.add(protectionToken);
-    }
-
     public QName getName() {
         return Constants.PROTECTION_TOKEN;
     }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/RecipientToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/RecipientToken.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/RecipientToken.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/RecipientToken.java Mon Sep  4 00:02:50 2006
@@ -16,9 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -29,8 +26,7 @@
 public class RecipientToken extends AbstractSecurityAssertion implements TokenWrapper {
     
     private Token receipientToken;
-    private ArrayList recipientTokens = null;
-
+   
     /**
      * @return Returns the receipientToken.
      */
@@ -43,24 +39,6 @@
      */
     public void setReceipientToken(Token receipientToken) {
         this.receipientToken = receipientToken;
-    }
-    
-    public List getConfigurations() {
-        return recipientTokens;
-    }
-    
-    public RecipientToken getDefaultConfiguration() {
-        if (recipientTokens != null) {
-            return (RecipientToken) recipientTokens.get(0);
-        }
-        return null;
-    }
-    
-    public void addConfiguration(RecipientToken recipientToken) {
-        if (recipientTokens == null) {
-            recipientTokens = new ArrayList();
-        }
-        recipientTokens.add(recipientToken);
     }
 
     /* (non-Javadoc)

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SupportingToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SupportingToken.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SupportingToken.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SupportingToken.java Mon Sep  4 00:02:50 2006
@@ -15,8 +15,8 @@
  */
 
 package org.apache.ws.secpolicy.model;
+
 import java.util.ArrayList;
-import java.util.Iterator;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
@@ -26,8 +26,8 @@
 import org.apache.neethi.PolicyComponent;
 import org.apache.ws.secpolicy.Constants;
 
-public class SupportingToken extends AbstractSecurityAssertion implements AlgorithmWrapper, TokenWrapper
-         {
+public class SupportingToken extends AbstractConfigurableSecurityAssertion
+        implements AlgorithmWrapper, TokenWrapper {
 
     /**
      * Type of SupportingToken
@@ -51,8 +51,6 @@
 
     private SignedEncryptedParts encryptedParts;
 
-    private ArrayList SupportingTokens = new ArrayList();
-
     public SupportingToken(int type) {
         this.type = type;
     }
@@ -202,13 +200,4 @@
         // TODO Auto-generated method stub
 
     }
-
-    public void addOption(SupportingToken supportingToken) {
-        this.SupportingTokens.add(supportingToken);
-    }
-
-    public Iterator getOptions() {
-        return this.SupportingTokens.iterator();
-    }
-
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SymmetricBinding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SymmetricBinding.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SymmetricBinding.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SymmetricBinding.java Mon Sep  4 00:02:50 2006
@@ -16,9 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -34,8 +31,6 @@
     
     private ProtectionToken protectionToken;
     
-    private List symmetricBindings = null;
-    
     /**
      * @return Returns the encryptionToken.
      */
@@ -91,24 +86,6 @@
         this.signatureToken = signatureToken;
     }
     
-    public List getConfigurations() {
-        return symmetricBindings;
-    }
-    
-    public SymmetricBinding getDefaultConfiguration() {
-        if (symmetricBindings != null) {
-            return (SymmetricBinding) symmetricBindings.get(0);
-        }
-        return null;
-    }
-    
-    public void addConfiguration(SymmetricBinding symmetricBinding) {
-        if (symmetricBindings == null) {
-            symmetricBindings = new ArrayList();
-        }
-        symmetricBindings.add(symmetricBinding);
-    }
-
     public QName getName() {
         return Constants.SYMMETRIC_BINDING;
     }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/UsernameToken.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/UsernameToken.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/UsernameToken.java Mon Sep  4 00:02:50 2006
@@ -16,9 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -28,8 +25,6 @@
 
 public class UsernameToken extends Token {
     
-    private List usernameTokens;
-    
     private boolean useUTProfile11;
 
     /**
@@ -46,24 +41,6 @@
         this.useUTProfile11 = useUTProfile11;
     }
     
-    public List getConfigurations() {
-        return usernameTokens;
-    }
-    
-    public UsernameToken getDefaultConfiguration() {
-        if (usernameTokens != null) {
-            return (UsernameToken) usernameTokens.get(0);
-        }
-        return null;
-    }
-    
-    public void addConfiguration(UsernameToken usernameToken) {
-        if (usernameTokens == null) {
-            usernameTokens= new ArrayList();
-        }
-        usernameTokens.add(usernameToken);
-    }
-
     public QName getName() {
         return Constants.USERNAME_TOKEN;
     }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Wss10.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Wss10.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Wss10.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Wss10.java Mon Sep  4 00:02:50 2006
@@ -16,9 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -33,8 +30,6 @@
     private boolean MustSupportRefExternalURI;
     private boolean MustSupportRefEmbeddedToken;
     
-    private ArrayList wss10s = null;
-    
     /**
      * @return Returns the mustSupportRefEmbeddedToken.
      */
@@ -82,24 +77,6 @@
      */
     public void setMustSupportRefKeyIdentifier(boolean mustSupportRefKeyIdentifier) {
         this.mustSupportRefKeyIdentifier = mustSupportRefKeyIdentifier;
-    }
-    
-    public List getConfiguration() {
-        return wss10s;
-    }
-    
-    public Wss10 getDefaultConfiguration() {
-        if (wss10s != null) {
-            wss10s = new ArrayList();
-        }
-        return null;
-    }
-    
-    public void addConfiguration(Wss10 wss10) {
-        if (wss10s == null) {
-            wss10s = new ArrayList();
-        }
-        wss10s.add(wss10);
     }
     
     public QName getName() {

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/X509Token.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/X509Token.java?view=diff&rev=439954&r1=439953&r2=439954
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/X509Token.java (original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/X509Token.java Mon Sep  4 00:02:50 2006
@@ -16,10 +16,6 @@
 
 package org.apache.ws.secpolicy.model;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
@@ -39,8 +35,6 @@
     
     private String tokenVersionAndType;
     
-    private List x509Tokens = null;
-    
     /**
      * @return Returns the requireEmbeddedTokenReference.
      */
@@ -111,26 +105,6 @@
      */
     public void setTokenVersionAndType(String tokenVersionAndType) {
         this.tokenVersionAndType = tokenVersionAndType;
-    }
-    
-    public Iterator getConfigurations() {
-        return x509Tokens.iterator();
-    }
-    
-    public X509Token getDefualtConfiguration() {
-        
-        if (x509Tokens != null) {
-            return (X509Token) x509Tokens.get(0);
-        }
-        return null;
-    }
-    
-    public void addConfiguration(X509Token token) {
-        
-        if (x509Tokens == null) {
-            x509Tokens = new ArrayList();
-        }
-        x509Tokens.add(token);
     }
 
     public QName getName() {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message