cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r561203 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/headers/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/
Date Tue, 31 Jul 2007 01:04:39 GMT
Author: dkulp
Date: Mon Jul 30 18:04:36 2007
New Revision: 561203

URL: http://svn.apache.org/viewvc?view=rev&rev=561203
Log:
Do Glenn's suggestion of just the Enum

Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/headers/Header.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/headers/Header.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/headers/Header.java?view=diff&rev=561203&r1=561202&r2=561203
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/headers/Header.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/headers/Header.java Mon Jul 30 18:04:36
2007
@@ -23,17 +23,18 @@
 import org.apache.cxf.databinding.DataBinding;
 
 public class Header {
-    public static final int DIRECTION_IN = 0;
-    public static final int DIRECTION_OUT = 1;
-    public static final int DIRECTION_INOUT = 2;
+    public enum Direction  { 
+        DIRECTION_IN, 
+        DIRECTION_OUT, 
+        DIRECTION_INOUT 
+    };
+        
     public static final String HEADER_LIST = Header.class.getName() + ".list";
    
     
     private DataBinding dataBinding;
     private QName name;
     private Object object;
-//    private boolean inbound;
-    private enum Direction  { DIRECTION_IN, DIRECTION_OUT, DIRECTION_INOUT }  
     
     private Direction direction = Header.Direction.DIRECTION_OUT;
 
@@ -66,34 +67,12 @@
         this.object = object;
     }
     
-    public void setDirection(int hdrDirection) {
-       //this.inbound = true;
-        switch (hdrDirection) {
-        case DIRECTION_IN:
-            this.direction = Header.Direction.DIRECTION_IN;
-            break;
-        case DIRECTION_INOUT:
-            this.direction = Header.Direction.DIRECTION_INOUT;
-            break;
-        default:
-            this.direction = Header.Direction.DIRECTION_OUT;
-        }
-    }
-    
-    public int getDirection() {
-        int retval;
-        switch (this.direction) {
-        case DIRECTION_IN:
-            retval = Header.DIRECTION_IN;
-            break;
-        case DIRECTION_INOUT:
-            retval = Header.DIRECTION_INOUT;
-            break;
-        default:
-            retval = Header.DIRECTION_OUT;
-        }
-        
-        return retval;
+    public void setDirection(Direction hdrDirection) {
+        this.direction = hdrDirection;
+    }
+    
+    public Direction getDirection() {
+        return direction;
     }
     
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java?view=diff&rev=561203&r1=561202&r2=561203
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
Mon Jul 30 18:04:36 2007
@@ -165,7 +165,7 @@
                             shead.setMustUnderstand(Boolean.valueOf(mu) || "1".equals(mu));
                             //mark header as inbound header.(for distinguishing between the
 direction to 
                             //avoid piggybacking of headers from request->server->response.
-                            shead.setDirection(SoapHeader.DIRECTION_IN);
+                            shead.setDirection(SoapHeader.Direction.DIRECTION_IN);
                             message.getHeaders().add(shead);
                         }                        
                     }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java?view=diff&rev=561203&r1=561202&r2=561203
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderOutFilterInterceptor.java
Mon Jul 30 18:04:36 2007
@@ -39,7 +39,7 @@
         while (iter.hasNext()) {
             Header hdr  = (Header) iter.next();
             //ubhole: Only remove inbound marked headers..
-            if (hdr.getDirection() == Header.DIRECTION_IN) {
+            if (hdr.getDirection() == Header.Direction.DIRECTION_IN) {
                 iter.remove(); 
             }
         }



Mime
View raw message