axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r431236 [2/2] - in /webservices/axis2/trunk/java/modules: secpolicy/ secpolicy/src/org/apache/ws/secpolicy/ secpolicy/src/org/apache/ws/secpolicy/builders/ secpolicy/src/org/apache/ws/secpolicy/model/ security/src/org/apache/ws/security/pol...
Date Sun, 13 Aug 2006 20:43:33 GMT
Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SymmetricAsymmetricBindingBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SymmetricAsymmetricBindingBase.java?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SymmetricAsymmetricBindingBase.java
(original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/SymmetricAsymmetricBindingBase.java
Sun Aug 13 13:43:31 2006
@@ -14,12 +14,11 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
+package org.apache.ws.security.secpolicy.model;
 
-import org.apache.ws.secpolicy.Constants;
-import org.apache.ws.secpolicy.WSSPolicyException;
+import org.apache.ws.security.secpolicy.Constants;
 
-public class SymmetricAsymmetricBindingBase extends Binding {
+public abstract class SymmetricAsymmetricBindingBase extends Binding {
 
     private String protectionOrder = Constants.SIGN_BEFORE_ENCRYPTING;
     
@@ -54,14 +53,13 @@
     /**
      * @param protectionOrder The protectionOrder to set.
      */
-    public void setProtectionOrder(String protectionOrder)
-            throws WSSPolicyException {
+    public void setProtectionOrder(String protectionOrder) {
         if(Constants.ENCRYPT_BEFORE_SIGNING.equals(protectionOrder) ||
            Constants.SIGN_BEFORE_ENCRYPTING.equals(protectionOrder)) {
             this.protectionOrder = protectionOrder;
         } else {
-            throw new WSSPolicyException("Incorrect protection order value : "
-                    + protectionOrder);
+//            throw new WSSPolicyException("Incorrect protection order value : "
+//                    + protectionOrder);
         }
     }
 

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?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- 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
Sun Aug 13 13:43:31 2006
@@ -14,9 +14,17 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
+package org.apache.ws.security.secpolicy.model;
 
-import org.apache.ws.secpolicy.WSSPolicyException;
+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;
+
+import org.apache.neethi.PolicyComponent;
 
 public class SymmetricBinding extends SymmetricAsymmetricBindingBase {
 
@@ -25,7 +33,9 @@
     private SignatureToken signatureToken;
     
     private ProtectionToken protectionToken;
-
+    
+    private List symmetricBindings = new ArrayList();
+    
     /**
      * @return Returns the encryptionToken.
      */
@@ -36,10 +46,10 @@
     /**
      * @param encryptionToken The encryptionToken to set.
      */
-    public void setEncryptionToken(EncryptionToken encryptionToken) throws WSSPolicyException
{
+    public void setEncryptionToken(EncryptionToken encryptionToken)  {
         if(this.protectionToken != null) {
-            throw new WSSPolicyException("Cannot use an EncryptionToken in a " +
-                    "SymmetricBinding when there is a ProtectionToken");
+//            throw new WSSPolicyException("Cannot use an EncryptionToken in a " +
+//                    "SymmetricBinding when there is a ProtectionToken");
         }
         this.encryptionToken = encryptionToken;
     }
@@ -54,11 +64,11 @@
     /**
      * @param protectionToken The protectionToken to set.
      */
-    public void setProtectionToken(ProtectionToken protectionToken) throws WSSPolicyException
{
+    public void setProtectionToken(ProtectionToken protectionToken)  {
         if(this.encryptionToken != null || this.signatureToken != null) {
-            throw new WSSPolicyException("Cannot use a ProtectionToken in a " +
-            "SymmetricBinding when there is a SignatureToken or an" +
-            "EncryptionToken");
+//            throw new WSSPolicyException("Cannot use a ProtectionToken in a " +
+//            "SymmetricBinding when there is a SignatureToken or an" +
+//            "EncryptionToken");
         }
         this.protectionToken = protectionToken;
     }
@@ -73,12 +83,35 @@
     /**
      * @param signatureToken The signatureToken to set.
      */
-    public void setSignatureToken(SignatureToken signatureToken) throws WSSPolicyException
{
+    public void setSignatureToken(SignatureToken signatureToken) {
         if(this.protectionToken != null) {
-            throw new WSSPolicyException("Cannot use a SignatureToken in a " +
-                    "SymmetricBinding when there is a ProtectionToken");
+//            throw new WSSPolicyException("Cannot use a SignatureToken in a " +
+//                    "SymmetricBinding when there is a ProtectionToken");
         }
         this.signatureToken = signatureToken;
+    }
+    
+    public Iterator getOptions() {
+        return symmetricBindings.iterator();
+    }
+    
+    public void addOption(SymmetricBinding symmetricBinding) {
+        symmetricBindings.add(symmetricBinding);
+    }
+
+    public QName getName() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public PolicyComponent normalize() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+        // TODO Auto-generated method stub
+        
     }
     
     

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Token.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Token.java?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Token.java
(original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Token.java
Sun Aug 13 13:43:31 2006
@@ -14,12 +14,11 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
+package org.apache.ws.security.secpolicy.model;
 
-import org.apache.ws.secpolicy.Constants;
-import org.apache.ws.secpolicy.WSSPolicyException;
+import org.apache.ws.security.secpolicy.Constants;
 
-public class Token {
+public abstract class Token extends AbstractSecurityAssertion {
 
     /**
      * Inclusiong property of a TokenAssertion
@@ -41,14 +40,14 @@
     /**
      * @param inclusion The inclusion to set.
      */
-    public void setInclusion(String inclusion) throws WSSPolicyException {
+    public void setInclusion(String inclusion)  {
         if(Constants.INCLUDE_ALWAYS.equals(inclusion) || 
            Constants.INCLUDE_ALWAYS_TO_RECIPIENT.equals(inclusion) ||
            Constants.INCLUDE_NEVER.equals(inclusion) ||
            Constants.INCLUDE_ONCE.equals(inclusion)) {
             this.inclusion = inclusion;
         } else {
-            throw new WSSPolicyException("Incorrect inclusion value: " + inclusion);
+//            throw new WSSPolicyException("Incorrect inclusion value: " + inclusion);
         }
     }
     

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TokenWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TokenWrapper.java?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TokenWrapper.java
(original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TokenWrapper.java
Sun Aug 13 13:43:31 2006
@@ -14,11 +14,9 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
-
-import org.apache.ws.secpolicy.WSSPolicyException;
+package org.apache.ws.security.secpolicy.model;
 
 public interface TokenWrapper {
 
-    public void setToken(Token tok) throws WSSPolicyException;
+    public void setToken(Token tok);
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TransportBinding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TransportBinding.java?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TransportBinding.java
(original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TransportBinding.java
Sun Aug 13 13:43:31 2006
@@ -14,24 +14,59 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
+package org.apache.ws.security.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.security.secpolicy.Constants;
 
 public class TransportBinding extends Binding {
     
-    private Token transportToken;
-
+    private TransportToken transportToken;
+    
+    private List transportBindings;
+    
     /**
      * @return Returns the transportToken.
      */
-    public Token getTransportToken() {
+    public TransportToken getTransportToken() {
         return transportToken;
     }
 
     /**
      * @param transportToken The transportToken to set.
      */
-    public void setTransportToken(Token transportToken) {
+    public void setTransportToken(TransportToken transportToken) {
         this.transportToken = transportToken;
+    }
+    
+    public List getOptions() {
+        return transportBindings;
+    }
+    
+    public void addOption(TransportBinding transportBinding) {
+        if (transportBindings == null) {
+            transportBindings = new ArrayList();
+        }
+        transportBindings.add(transportBinding);
+    }
+
+    public QName getName() {
+        return Constants.TRANSPORT_BINDING;
+    }
+
+    public PolicyComponent normalize() {
+        throw new UnsupportedOperationException();
+    }
+    
+    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+        throw new UnsupportedOperationException();
     }
 
 }

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TransportToken.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TransportToken.java?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TransportToken.java
(original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/TransportToken.java
Sun Aug 13 13:43:31 2006
@@ -14,13 +14,25 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
+package org.apache.ws.security.secpolicy.model;
 
+import java.util.ArrayList;
+import java.util.Iterator;
 
-public class TransportToken {
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.neethi.Assertion;
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.secpolicy.Constants;
 
-    private Token transportToken;
 
+public class TransportToken implements Assertion {
+
+    private Token transportToken;
+    
+    private ArrayList transportTokens = new ArrayList();
 
     /**
      * @return Returns the transportToken.
@@ -35,4 +47,37 @@
     public void setTransportToken(Token transportToken) {
         this.transportToken = transportToken;
     }
+    
+    public Iterator getOptions() {
+        return transportTokens.iterator();
+    }
+    
+    public void addOption(TransportToken transportToken) {
+        transportTokens.add(transportToken);
+    }
+
+    public QName getName() {
+        return new QName(Constants.SP_NS, "TransportToken");
+    }
+
+    public boolean isOptional() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public PolicyComponent normalize() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public short getType() {
+        return Assertion.ASSERTION;
+    }
+
+    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+        // TODO Auto-generated method stub
+        
+    }
+    
+    
 }

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?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- 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
Sun Aug 13 13:43:31 2006
@@ -14,10 +14,22 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
+package org.apache.ws.security.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.security.secpolicy.Constants;
 
 public class UsernameToken extends Token {
     
+    private List usernameTokens;
+    
     private boolean useUTProfile11;
 
     /**
@@ -34,5 +46,26 @@
         this.useUTProfile11 = useUTProfile11;
     }
     
+    public List getOptions() {
+        return usernameTokens;
+    }
     
+    public void addOption(UsernameToken usernameToken) {
+        if (usernameTokens == null) {
+            usernameTokens= new ArrayList();
+        }
+        usernameTokens.add(usernameToken);
+    }
+
+    public QName getName() {
+        return Constants.USERNAME_TOKEN;
+    }
+
+    public PolicyComponent normalize() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+        throw new UnsupportedOperationException();
+    }       
 }

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?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- 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
Sun Aug 13 13:43:31 2006
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
+package org.apache.ws.security.secpolicy.model;
 
 public class Wss10 {
     

Modified: webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Wss11.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Wss11.java?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Wss11.java
(original)
+++ webservices/axis2/trunk/java/modules/secpolicy/src/org/apache/ws/secpolicy/model/Wss11.java
Sun Aug 13 13:43:31 2006
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
+package org.apache.ws.security.secpolicy.model;
 
 public class Wss11 extends Wss10 {
     

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?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- 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
Sun Aug 13 13:43:31 2006
@@ -14,7 +14,18 @@
  * limitations under the License.
  */
 
-package org.apache.ws.secpolicy.model;
+package org.apache.ws.security.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;
+
+import org.apache.neethi.PolicyComponent;
+import org.apache.ws.security.secpolicy.Constants;
 
 public class X509Token extends Token {
 
@@ -27,7 +38,9 @@
     private boolean requireThumbprintReference;
     
     private String tokenVersionAndType;
-
+    
+    private List x509Tokens = new ArrayList();
+    
     /**
      * @return Returns the requireEmbeddedTokenReference.
      */
@@ -99,6 +112,27 @@
     public void setTokenVersionAndType(String tokenVersionAndType) {
         this.tokenVersionAndType = tokenVersionAndType;
     }
+    
+    public Iterator getOptions() {
+        return x509Tokens.iterator();
+    }
+    
+    public void addOption(X509Token token) {
+        x509Tokens.add(token);
+    }
+
+    public QName getName() {
+        return Constants.X509_TOKEN;
+    }
+
+    public PolicyComponent normalize() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+        throw new UnsupportedOperationException();
+    }
+    
     
     
 }

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy/extension/WSSCodegenPolicyExtension.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy/extension/WSSCodegenPolicyExtension.java?rev=431236&r1=431235&r2=431236&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy/extension/WSSCodegenPolicyExtension.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/ws/security/policy/extension/WSSCodegenPolicyExtension.java
Sun Aug 13 13:43:31 2006
@@ -40,7 +40,7 @@
             }
             
             processor.processPolicy(policy);
-            
+                
             RootPolicyEngineData data = processor.getRootPED();
             
             WSS4JConfig wss4jConfig = WSS4JConfigBuilder.build(data.getTopLevelPEDs(), false);



---------------------------------------------------------------------
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