axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r384508 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/deployment/AxisServiceBuilder.java security/src/org/apache/axis2/security/SecurityModule.java
Date Thu, 09 Mar 2006 13:35:39 GMT
Author: hemapani
Date: Thu Mar  9 05:35:38 2006
New Revision: 384508

URL: http://svn.apache.org/viewcvs?rev=384508&view=rev
Log:
fix bug on my updates on AxisServiceBuilder and SecurityModule 

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/SecurityModule.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisServiceBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisServiceBuilder.java?rev=384508&r1=384507&r2=384508&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisServiceBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/AxisServiceBuilder.java
Thu Mar  9 05:35:38 2006
@@ -99,7 +99,7 @@
     }
     
     public AxisServiceBuilder(boolean serverSide){
-    	this.serverSide = true;
+    	this.serverSide = serverSide;
     }
 
     public AxisService getAxisService(InputStream wsdlInputStream)

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/SecurityModule.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/SecurityModule.java?rev=384508&r1=384507&r2=384508&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/SecurityModule.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/SecurityModule.java
Thu Mar  9 05:35:38 2006
@@ -35,100 +35,118 @@
 
 public class SecurityModule implements Module {
 	private AxisModule module;
-	
-	
-	public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault
{
-        this.module = module;
-    }
-	
-	
-    public void engageNotify(AxisDescription axisDescription) throws AxisFault {
-        Policy policy = axisDescription.getPolicyInclude().getEffectivePolicy();
-        if(axisDescription instanceof AxisOperation && policy != null) {
-            try {
-                WSSPolicyProcessor wssPolicyProcessor = new WSSPolicyProcessor();
-                wssPolicyProcessor.setup();
-                wssPolicyProcessor.processPolicy(policy);
-                
-                WSS4JConfig config = WSS4JConfigBuilder.build(wssPolicyProcessor.getRootPED().getTopLevelPEDs());
-                
-                InflowConfiguration policyInflowConfig = config.getInflowConfiguration();
-                OutflowConfiguration policyOutflowConfig = config.getOutflowConfiguration();
-                
-                calcuateCurrentConfiguration(policyInflowConfig,policyOutflowConfig,axisDescription);
-            } catch (Exception e) {
-                throw new AxisFault(e.getMessage(),e);
-            }
-        }
-    }
-
-    public void shutdown(AxisConfiguration axisSystem) throws AxisFault {
-        //Do nothing
-    }
-
-    
-
-    private void calcuateCurrentConfiguration(InflowConfiguration policyInflowConfig,
-    		OutflowConfiguration policyOutflowConfig,AxisDescription axisDescription) throws AxisFault{
-    	//merge inflow configuration
-    	Parameter inflowModuleParam = axisDescription.getParameter(WSSHandlerConstants.INFLOW_SECURITY);
-    	InflowConfiguration moduleInflowConfig = HandlerParameterDecoder.getInflowConfiguration(inflowModuleParam);
-    	
-    	Parameter inflowSecParam = axisDescription.getParameter(WSSHandlerConstants.INFLOW_SECURITY);
-    	InflowConfiguration staticInflowConfig = HandlerParameterDecoder.getInflowConfiguration(inflowSecParam);
-    	
-    	InflowConfiguration mergedInConf = mergeInflowConfiguration(staticInflowConfig,moduleInflowConfig);
-    	InflowConfiguration finalInConf = mergeInflowConfiguration(policyInflowConfig,mergedInConf);
-    	axisDescription.addParameter(finalInConf.getProperty());
-    	
-    	
-    	
-    	//merge outflow configuration
-    	Parameter outfloModuleParam = axisDescription.getParameter(WSSHandlerConstants.OUTFLOW_SECURITY);
-    	OutflowConfiguration moduleOutflowConfig = HandlerParameterDecoder.getOutflowConfiguration(outfloModuleParam);
-        Parameter outflowSecParam = axisDescription.getParameter(WSSHandlerConstants.OUTFLOW_SECURITY);
-        OutflowConfiguration staticOutflowConfig = HandlerParameterDecoder.getOutflowConfiguration(outflowSecParam);
-        
-        OutflowConfiguration mergedOutFlowConf = mergeOutflowConfiguration(staticOutflowConfig,moduleOutflowConfig);
-        OutflowConfiguration finalOutFlowConf = mergeOutflowConfiguration(policyOutflowConfig,mergedOutFlowConf);
-        axisDescription.addParameter(finalOutFlowConf.getProperty());
-    }
-    
-    
-    //overide secondry configuration with primry configuration
-    private OutflowConfiguration mergeOutflowConfiguration(
-    		OutflowConfiguration primaryConfig,OutflowConfiguration secondryConf) {
-    	if(secondryConf == null && primaryConfig != null){
-    		return primaryConfig;
-    	}else if(primaryConfig == null && secondryConf != null){
-    		return secondryConf;
-    	}else if(primaryConfig == null && secondryConf == null){
-    		return null;
-    	}
-    	
-    	secondryConf.setPasswordCallbackClass(primaryConfig.getPasswordCallbackClass());
-    	secondryConf.setSignaturePropFile(primaryConfig.getSignaturePropFile());
-    	secondryConf.setEncryptionPropFile(primaryConfig.getEncryptionPropFile());
-    	secondryConf.setEmbeddedKeyCallbackClass(primaryConfig.getEmbeddedKeyCallbackClass());
-    	secondryConf.setUser(primaryConfig.getUser());
-    	secondryConf.setEncryptionUser(primaryConfig.getEncryptionUser());
-        return secondryConf;
-    }
-    
-    //overide secondry configuration with primry configuration
-    private InflowConfiguration mergeInflowConfiguration(
-    		InflowConfiguration primaryConfig,InflowConfiguration secondryConf) {
-    	if(secondryConf == null && primaryConfig != null){
-    		return primaryConfig;
-    	}else if(primaryConfig == null && secondryConf != null){
-    		return secondryConf;
-    	}else if(primaryConfig == null && secondryConf == null){
-    		return null;
-    	}
-    	
-    	secondryConf.setPasswordCallbackClass(primaryConfig.getPasswordCallbackClass());
-    	secondryConf.setDecryptionPropFile(primaryConfig.getDecryptionPropFile());
-    	secondryConf.setSignaturePropFile(primaryConfig.getSignaturePropFile());
-        return secondryConf;
-    }
+
+	public void init(ConfigurationContext configContext, AxisModule module)
+			throws AxisFault {
+		this.module = module;
+	}
+
+	public void engageNotify(AxisDescription axisDescription) throws AxisFault {
+		Policy policy = axisDescription.getPolicyInclude().getEffectivePolicy();
+		if (axisDescription instanceof AxisOperation && policy != null) {
+			try {
+				WSSPolicyProcessor wssPolicyProcessor = new WSSPolicyProcessor();
+				wssPolicyProcessor.setup();
+				wssPolicyProcessor.processPolicy(policy);
+
+				WSS4JConfig config = WSS4JConfigBuilder
+						.build(wssPolicyProcessor.getRootPED()
+								.getTopLevelPEDs());
+
+				InflowConfiguration policyInflowConfig = config
+						.getInflowConfiguration();
+				OutflowConfiguration policyOutflowConfig = config
+						.getOutflowConfiguration();
+
+				calcuateCurrentConfiguration(policyInflowConfig,
+						policyOutflowConfig, axisDescription);
+			} catch (Exception e) {
+				throw new AxisFault(e.getMessage(), e);
+			}
+		}
+	}
+
+	public void shutdown(AxisConfiguration axisSystem) throws AxisFault {
+		// Do nothing
+	}
+
+	private void calcuateCurrentConfiguration(
+			InflowConfiguration policyInflowConfig,
+			OutflowConfiguration policyOutflowConfig,
+			AxisDescription axisDescription) throws AxisFault {
+		// merge inflow configuration
+		Parameter inflowModuleParam = module
+				.getParameter(WSSHandlerConstants.INFLOW_SECURITY);
+		InflowConfiguration moduleInflowConfig = HandlerParameterDecoder
+				.getInflowConfiguration(inflowModuleParam);
+
+		Parameter inflowSecParam = axisDescription
+				.getParameter(WSSHandlerConstants.INFLOW_SECURITY);
+		InflowConfiguration staticInflowConfig = HandlerParameterDecoder
+				.getInflowConfiguration(inflowSecParam);
+
+		InflowConfiguration mergedInConf = mergeInflowConfiguration(
+				staticInflowConfig, moduleInflowConfig);
+		InflowConfiguration finalInConf = mergeInflowConfiguration(mergedInConf,policyInflowConfig);
+		
+		axisDescription.addParameter(finalInConf.getProperty());
+
+		// merge outflow configuration
+		Parameter outfloModuleParam = module
+				.getParameter(WSSHandlerConstants.OUTFLOW_SECURITY);
+		OutflowConfiguration moduleOutflowConfig = HandlerParameterDecoder
+				.getOutflowConfiguration(outfloModuleParam);
+		Parameter outflowSecParam = axisDescription
+				.getParameter(WSSHandlerConstants.OUTFLOW_SECURITY);
+		OutflowConfiguration staticOutflowConfig = HandlerParameterDecoder
+				.getOutflowConfiguration(outflowSecParam);
+
+		OutflowConfiguration mergedOutFlowConf = mergeOutflowConfiguration(
+				staticOutflowConfig, moduleOutflowConfig);
+		OutflowConfiguration finalOutFlowConf = mergeOutflowConfiguration(mergedOutFlowConf,policyOutflowConfig);
+		axisDescription.addParameter(finalOutFlowConf.getProperty());
+	}
+
+	// overide secondry configuration with primry configuration
+	private OutflowConfiguration mergeOutflowConfiguration(
+			OutflowConfiguration primaryConfig,
+			OutflowConfiguration secondryConf) {
+		if (secondryConf == null && primaryConfig != null) {
+			return primaryConfig;
+		} else if (primaryConfig == null && secondryConf != null) {
+			return secondryConf;
+		} else if (primaryConfig == null && secondryConf == null) {
+			return null;
+		}
+
+		secondryConf.setPasswordCallbackClass(primaryConfig
+				.getPasswordCallbackClass());
+		secondryConf.setSignaturePropFile(primaryConfig.getSignaturePropFile());
+		secondryConf.setEncryptionPropFile(primaryConfig
+				.getEncryptionPropFile());
+		secondryConf.setEmbeddedKeyCallbackClass(primaryConfig
+				.getEmbeddedKeyCallbackClass());
+		secondryConf.setUser(primaryConfig.getUser());
+		secondryConf.setEncryptionUser(primaryConfig.getEncryptionUser());
+		return secondryConf;
+	}
+
+	// overide secondry configuration with primry configuration
+	private InflowConfiguration mergeInflowConfiguration(
+			InflowConfiguration primaryConfig, InflowConfiguration secondryConf) {
+		if (secondryConf == null && primaryConfig != null) {
+			return primaryConfig;
+		} else if (primaryConfig == null && secondryConf != null) {
+			return secondryConf;
+		} else if (primaryConfig == null && secondryConf == null) {
+			return null;
+		}
+
+		secondryConf.setPasswordCallbackClass(primaryConfig
+				.getPasswordCallbackClass());
+		secondryConf.setDecryptionPropFile(primaryConfig
+				.getDecryptionPropFile());
+		secondryConf.setSignaturePropFile(primaryConfig.getSignaturePropFile());
+		return secondryConf;
+	}
 }



Mime
View raw message