axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r415517 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/codegen/extension/ security/src/org/apache/rampart/ security/src/org/apache/rampart/handler/ security/src/org/apache/rampart/handler/config/
Date Tue, 20 Jun 2006 06:25:03 GMT
Author: sanka
Date: Mon Jun 19 23:25:02 2006
New Revision: 415517

URL: http://svn.apache.org/viewvc?rev=415517&view=rev
Log:
Modified the InflowConfig and OutflowConfig s.t getProperty() returns null if those configuration
classes doesn't contain any action items.
In such scenarios, the configuration will not be set as a parameter.

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/InflowConfiguration.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/OutflowConfiguration.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java?rev=415517&r1=415516&r2=415517&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
Mon Jun 19 23:25:02 2006
@@ -141,8 +141,10 @@
 
 		ExactlyOne XOR = (ExactlyOne) policy.getTerms()
 				.get(0);
-		All AND = (All) XOR.getTerms().get(
+		All iAND = (All) XOR.getTerms().get(
 				0);
+        All AND = new All();
+        AND.addTerms(iAND.getTerms());
 
 		for (Iterator iterator = AND.getTerms().iterator(); iterator.hasNext();) {
 

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java?rev=415517&r1=415516&r2=415517&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/Rampart.java Mon
Jun 19 23:25:02 2006
@@ -61,13 +61,20 @@
                         .getInflowConfiguration();
 
                 Parameter infp = calcuateCurrentInflowConfiguration(policyInflowConfig,axisDescription).getProperty();
-                infp.setName(WSSHandlerConstants.INFLOW_SECURITY_SERVER);
-                axisDescription.addParameter(infp);
                 
+                if (infp != null) {
+                    infp.setName(WSSHandlerConstants.INFLOW_SECURITY_SERVER);
+                    axisDescription.addParameter(infp);                    
+                }
+                                
                 OutflowConfiguration policyOutflowConfig = serverConfig.getOutflowConfiguration();
                 Parameter outfp = calcuateCurrentOutflowConfiguration(policyOutflowConfig,axisDescription).getProperty();
-                outfp.setName(WSSHandlerConstants.OUTFLOW_SECURITY_SERVER);
-                axisDescription.addParameter(outfp);
+                
+                if (outfp != null) {
+                    outfp.setName(WSSHandlerConstants.OUTFLOW_SECURITY_SERVER);
+                    axisDescription.addParameter(outfp);                    
+                }
+                
                 
                 
                 //create client side config
@@ -82,13 +89,20 @@
                 policyInflowConfig = clientConfig.getInflowConfiguration();
 
                 infp = calcuateCurrentInflowConfiguration(policyInflowConfig,axisDescription).getProperty();
-                infp.setName(WSSHandlerConstants.INFLOW_SECURITY_CLIENT);
-                axisDescription.addParameter(infp);
+                
+                if (infp != null) {
+                    infp.setName(WSSHandlerConstants.INFLOW_SECURITY_CLIENT);
+                    axisDescription.addParameter(infp);
+                }
         
                  policyOutflowConfig = clientConfig.getOutflowConfiguration();
-                 outfp = calcuateCurrentOutflowConfiguration(policyOutflowConfig,axisDescription).getProperty();
-                 outfp.setName(WSSHandlerConstants.OUTFLOW_SECURITY_CLIENT);
-                 axisDescription.addParameter(outfp);
+                 outfp = calcuateCurrentOutflowConfiguration(policyOutflowConfig, axisDescription).getProperty();
+                 
+                 if (outfp != null) {
+                     outfp.setName(WSSHandlerConstants.OUTFLOW_SECURITY_CLIENT);
+                     axisDescription.addParameter(outfp);
+                 }
+                 
             } catch (Exception e) {
                 throw new AxisFault(e.getMessage(), e);
             }

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java?rev=415517&r1=415516&r2=415517&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllReceiver.java
Mon Jun 19 23:25:02 2006
@@ -179,17 +179,21 @@
 
         reqData.setMsgContext(msgContext);
 
-        // Figureout if the handler should run
-        Object inFlowSecurity = null;
-        if ((inFlowSecurity = getOption(WSSHandlerConstants.INFLOW_SECURITY)) == null) {
-            inFlowSecurity = getProperty(msgContext,
-                    WSSHandlerConstants.INFLOW_SECURITY);
+        if (((getOption(WSSHandlerConstants.INFLOW_SECURITY)) == null) &&
+            ((getProperty(msgContext, WSSHandlerConstants.INFLOW_SECURITY)) == null)) {
+            
+            if (msgContext.isServerSide() && 
+                ((getOption(WSSHandlerConstants.INFLOW_SECURITY_SERVER)) == null) &&
+                ((getProperty(msgContext, WSSHandlerConstants.INFLOW_SECURITY_SERVER)) ==
null)) {
+            
+                return;
+            } else if (((getOption(WSSHandlerConstants.INFLOW_SECURITY_CLIENT)) == null)
&&
+                    ((getProperty(msgContext, WSSHandlerConstants.INFLOW_SECURITY_CLIENT))
== null))  {
+                
+                return;
+            }
         }
-
-        if (inFlowSecurity == null) {
-            return;
-        }
-
+        
         Vector actions = new Vector();
         String action = null;
         if ((action = (String) getOption(WSSHandlerConstants.ACTION_ITEMS)) == null) {

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java?rev=415517&r1=415516&r2=415517&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/WSDoAllSender.java
Mon Jun 19 23:25:02 2006
@@ -176,17 +176,21 @@
         reqData.setNoSerialization(false);
         reqData.setMsgContext(msgContext);
         
-        //Figureout if the handler should run
-        Object outFlowSecurity;
-        if((outFlowSecurity = getOption(WSSHandlerConstants.OUTFLOW_SECURITY)) == null) {
-            outFlowSecurity = getProperty(msgContext, WSSHandlerConstants.OUTFLOW_SECURITY);
-        }
+        if (((getOption(WSSHandlerConstants.OUTFLOW_SECURITY)) == null) &&
+                ((getProperty(msgContext, WSSHandlerConstants.OUTFLOW_SECURITY)) == null))
{
+                
+                if (msgContext.isServerSide() && 
+                    ((getOption(WSSHandlerConstants.OUTFLOW_SECURITY_SERVER)) == null) &&
+                    ((getProperty(msgContext, WSSHandlerConstants.OUTFLOW_SECURITY_SERVER))
== null)) {
+                
+                    return;
+                } else if (((getOption(WSSHandlerConstants.OUTFLOW_SECURITY_CLIENT)) == null)
&&
+                        ((getProperty(msgContext, WSSHandlerConstants.OUTFLOW_SECURITY_CLIENT))
== null))  {
+                    
+                    return;
+                }
+            }
         
-        if(outFlowSecurity == null) {
-            return;
-        }
-        
-
         Vector actions = new Vector();
         String action = null;
         if ((action = (String) getOption(WSSHandlerConstants.ACTION_ITEMS)) == null) {

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/InflowConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/InflowConfiguration.java?rev=415517&r1=415516&r2=415517&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/InflowConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/InflowConfiguration.java
Mon Jun 19 23:25:02 2006
@@ -40,6 +40,11 @@
 	 * @return Returns Parameter.
 	 */
 	public Parameter getProperty() {
+        
+        if (! action.containsKey("items")) {
+            return null;
+        }
+                
 		OMFactory fac = OMAbstractFactory.getOMFactory();
 		OMNamespace ns = fac.createOMNamespace("", null);
         //TODO: Find the constants for "Parameter" and "name"

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/OutflowConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/OutflowConfiguration.java?rev=415517&r1=415516&r2=415517&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/OutflowConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/config/OutflowConfiguration.java
Mon Jun 19 23:25:02 2006
@@ -65,6 +65,15 @@
 	 */
 	public Parameter getProperty() {
 		
+
+        for (int i = 0; i < actionList.length; i++) {
+            HashMap action = actionList[i];
+            
+            if (! action.keySet().contains("items")) {
+                return null;
+            }
+        }
+                
 		OMFactory fac = OMAbstractFactory.getOMFactory();
 		OMNamespace ns = fac.createOMNamespace("", null);
         //TODO: Find the constants for "Parameter" and "name"



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