axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r740254 - in /webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy: MTOMInHandler.java MTOMOutHandler.java MTOMPolicy.java Utils.java
Date Tue, 03 Feb 2009 09:19:04 GMT
Author: nandana
Date: Tue Feb  3 09:19:04 2009
New Revision: 740254

URL: http://svn.apache.org/viewvc?rev=740254&view=rev
Log:
AXIS2-4220 applying javadoc patches. Thanks Dobri.

Modified:
    webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMInHandler.java
    webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java
    webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java
    webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java

Modified: webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMInHandler.java?rev=740254&r1=740253&r2=740254&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMInHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMInHandler.java
Tue Feb  3 09:19:04 2009
@@ -31,8 +31,20 @@
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
+/**
+ * This class does a MTOM validation of the message. It checks if it should be MTOMised,
or </br>
+ * if the message is compliant with the MTOM policy set. 
+ */
 public class MTOMInHandler extends AbstractHandler {
 
+	/**
+	 * Checks if the message should be MTOMised. If it is not but the policy states that it
should be </br>
+	 * then an {@link AxisFault} is thrown.
+     * 
+     * @param msgCtx the {@link MessageContext}
+     * 
+     * @throws AxisFault if the message is not MTOMised, but the policy states so.
+	 */
     public InvocationResponse invoke(MessageContext msgCtx) throws AxisFault {
         Policy policy = msgCtx.getEffectivePolicy();
         if (policy == null) {
@@ -44,7 +56,7 @@
             if (assertion instanceof MTOMAssertion) {
                 String contentType = (String) msgCtx.getProperty(Constants.Configuration.CONTENT_TYPE);
                 if (!assertion.isOptional()) {
-                    if (contentType == null || contentType.indexOf(MTOMConstants.MTOM_TYPE)
== -1) {//!MTOMConstants.MTOM_TYPE.equals(contentType)
+                    if (contentType == null || contentType.indexOf(MTOMConstants.MTOM_TYPE)
== -1) {
                         if (msgCtx.isServerSide()) {
                         throw new AxisFault(
                                 "The SOAP REQUEST sent by the client IS NOT MTOMized!");

Modified: webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java?rev=740254&r1=740253&r2=740254&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMOutHandler.java
Tue Feb  3 09:19:04 2009
@@ -29,8 +29,20 @@
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
+/**
+ * This out handler does a check of the effective policy set. Based on that the corresponding
MTOM property </br>
+ * value is set.
+ */
 public class MTOMOutHandler extends AbstractHandler {
 
+	/**
+	 * Checks the effective policy set and based on it the <code>enableMTOM</code>
is set to the appropriate value.</br>
+	 * E.g. if the policy states that MTOM is <code>optional</code> then the <code>enableMTOM</code>
is set to this value.  
+	 * 
+	 * @param msgCtx the {@link MessageContext}
+     * 
+     * @throws AxisFault
+	 */
     public InvocationResponse invoke(MessageContext msgCtx) throws AxisFault {
 
         Policy policy = msgCtx.getEffectivePolicy();

Modified: webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java?rev=740254&r1=740253&r2=740254&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java
(original)
+++ webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/MTOMPolicy.java
Tue Feb  3 09:19:04 2009
@@ -33,11 +33,12 @@
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
+/**
+ * The module implementation class for the MTOM module.
+ *
+ */
 public class MTOMPolicy implements Module {
 
-    /*
-     * setup for logging
-     */
     private static final Log log = LogFactory.getLog(MTOMPolicy.class);
 
     public void applyPolicy(Policy policy, AxisDescription axisDescription)
@@ -45,7 +46,7 @@
         if (log.isDebugEnabled()) {
             log.debug("applyPolicy() called on MTOMPolicy module");
         }
-
+        
     }
 
     public boolean canSupportAssertion(Assertion assertion) {

Modified: webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java?rev=740254&r1=740253&r2=740254&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java
(original)
+++ webservices/axis2/trunk/java/modules/mtompolicy-mar/src/org/apache/axis2/mtompolicy/Utils.java
Tue Feb  3 09:19:04 2009
@@ -34,16 +34,32 @@
 import org.apache.axis2.policy.model.MTOM10Assertion;
 import org.apache.axis2.policy.model.MTOMAssertion;
 import org.apache.axis2.util.PolicyUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
+/**
+ * This is a MTOM module utility class. It contains some useful methods used into the MTOM
module. 
+ */
 public class Utils {
 
+	private static final Log log = LogFactory.getLog(Utils.class);
+	
     private static final String MTOM_ASSERTION_APPLIED = "MTOM_ASSERTION_APPLIED";
 
+    /**
+     * Extracts the MTOM assertion object if it is exists into the policy based on a given
{@link AxisDescription}.
+     * 
+     * @param axisDescription the {@link AxisDescription} object that should be searched.
+     * @return {@link MTOMAssertion}  the {@link MTOMAssertion} found. If it is not found
"null" is returned.
+     */
     public static MTOMAssertion getMTOMAssertion(AxisDescription axisDescription) {
 
         if (axisDescription == null) {
+            if (log.isDebugEnabled()) {
+                log.debug("AxisDescription passed as parameter has a \"null\" value.");
+            }        	
             return null;
         }
 
@@ -70,6 +86,13 @@
 
     }
 
+    /**
+     * Locates the {@link AxisService} object searching up in the hierarchy recursively </br>
+     * the {@link AxisDescription} object passed.
+     *   
+     * @param axisDescription the {@link AxisDescription} object that should be checked.
+     * @return the {@link AxisService} object found or "null".
+     */
     public static AxisService locateAxisService(AxisDescription axisDescription) {
 
         if (axisDescription == null || axisDescription instanceof AxisService) {
@@ -79,12 +102,21 @@
         }
     }
 
+    /**
+     * Based on the parameter passed a {@link MTOM10Assertion} object is created by default.
</br>
+     * Then it is added to a {@link Policy} object and returned. 
+     * 
+     * @param param the {@link Parameter} object that contains the value of the "enableMTOM"
parameter: </br>
+     * "true" or "optional".
+     * @return The {@link Policy} object for the MTOM assertion. 
+     */
     public static Policy getMTOMPolicy(Parameter param) {
 
         if (param == null) {
             return null;
         }
 
+        // TODO We need to give the user the ability to specify if MTOM 1.0 or MTOM 1.1 should
be used.
         MTOMAssertion mtom10;
 
         if (Constants.VALUE_TRUE.equals(param.getValue())) {
@@ -103,6 +135,13 @@
 
     }
 
+    /**
+     * Applies the MTOM policy to the binding level of the web service.
+     * 
+     * @param axisService the {@link AxisService} to whom binding level the MTOM policy should
be attached.
+     * @param policy the {@link Policy} object that contains the MTOM assertion.
+     * @throws AxisFault thrown if the parameter is locked on a parent level - thus it could
not be added.
+     */
     public static void applyPolicyToSOAPBindings(AxisService axisService,
             Policy policy) throws AxisFault {
         
@@ -115,8 +154,7 @@
         for (Object obj : axisService.getEndpoints().values()) {
 
             AxisEndpoint endpoint = (AxisEndpoint) obj;
-            AxisBinding binding = endpoint.getBinding();
-
+            AxisBinding binding = endpoint.getBinding(); 
             if (Java2WSDLConstants.TRANSPORT_URI.equals(binding.getType())
                     || WSDL2Constants.URI_WSDL2_SOAP.equals(binding.getType())) {
                 binding.getPolicySubject().attachPolicy(policy);



Mime
View raw message