cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1051883 - in /cxf/branches/wss4j-1.6-port/rt/ws/security: ./ src/main/java/org/apache/cxf/ws/security/wss4j/ src/test/java/org/apache/cxf/ws/security/wss4j/
Date Wed, 22 Dec 2010 13:07:29 GMT
Author: coheigea
Date: Wed Dec 22 13:07:28 2010
New Revision: 1051883

URL: http://svn.apache.org/viewvc?rev=1051883&view=rev
Log:
[WSS-232] - WSS4J now stores default Actions and Processor instances as Class(es) rather than
Strings, which have to be class loaded each invocation.

Modified:
    cxf/branches/wss4j-1.6-port/rt/ws/security/pom.xml
    cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
    cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
    cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
    cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java

Modified: cxf/branches/wss4j-1.6-port/rt/ws/security/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j-1.6-port/rt/ws/security/pom.xml?rev=1051883&r1=1051882&r2=1051883&view=diff
==============================================================================
--- cxf/branches/wss4j-1.6-port/rt/ws/security/pom.xml (original)
+++ cxf/branches/wss4j-1.6-port/rt/ws/security/pom.xml Wed Dec 22 13:07:28 2010
@@ -94,10 +94,6 @@
             <version>1.6-SNAPSHOT</version>
             <exclusions>
                 <exclusion>
-                    <groupId>opensaml</groupId>
-                    <artifactId>opensaml</artifactId>
-                </exclusion>
-                <exclusion>
                     <groupId>xerces</groupId>
                     <artifactId>xercesImpl</artifactId>
                 </exclusion>

Modified: cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java?rev=1051883&r1=1051882&r2=1051883&view=diff
==============================================================================
--- cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
(original)
+++ cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Wed Dec 22 13:07:28 2010
@@ -577,17 +577,12 @@ public class WSS4JInInterceptor extends 
         for (Map.Entry<QName, Object> entry : map.entrySet()) {
             final QName key = entry.getKey();
             Object val = entry.getValue();
-            
-            if (val instanceof String) {
-                String valStr = ((String)val).trim();
-                if ("null".equals(valStr) || valStr.length() == 0) {
-                    valStr = null;
-                }
-                config.setProcessor(key, valStr);
+            if (val instanceof Class<?>) {
+                config.setProcessor(key, (Class<?>)val);
             } else if (val instanceof Processor) {
                 config.setProcessor(key, (Processor)val);
             } else if (val == null) {
-                config.setProcessor(key, (String)val);
+                config.setProcessor(key, (Class<?>)val);
             }
         }
         final WSSecurityEngine ret = new WSSecurityEngine();

Modified: cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java?rev=1051883&r1=1051882&r2=1051883&view=diff
==============================================================================
--- cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
(original)
+++ cxf/branches/wss4j-1.6-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
Wed Dec 22 13:07:28 2010
@@ -52,8 +52,8 @@ public class WSS4JOutInterceptor extends
     
     /**
      * Property name for a map of action IDs ({@link Integer}) to action
-     * class names.  Values can be either {@link String}) or Objects
-     * implementing {@link Action}.  
+     * class names. Values can be either {@link Class}) or Objects
+-    * implementing {@link Action}.
      */
     public static final String WSS4J_ACTION_MAP = "wss4j.action.map";
     
@@ -305,19 +305,19 @@ public class WSS4JOutInterceptor extends
                 (Map<?, ?>)getProperty(mc, WSS4J_ACTION_MAP));
             if (actionMap != null) {
                 for (Map.Entry<Integer, Object> entry : actionMap.entrySet()) {
-                    String removedAction = null;
+                    Class<?> removedAction = null;
                     
                     // Be defensive here since the cast above is slightly risky
                     // with the handler config options not being strongly typed.
                     try {
-                        if (entry.getValue() instanceof String) {
+                        if (entry.getValue() instanceof Class<?>) {
                             removedAction = config.setAction(
-                                    entry.getKey().intValue(),
-                                    (String) entry.getValue());
+                                    entry.getKey().intValue(), 
+                                    (Class<?>)entry.getValue());
                         } else if (entry.getValue() instanceof Action) {
                             removedAction = config.setAction(
-                                    entry.getKey().intValue(),
-                                    (Action) entry.getValue());
+                                    entry.getKey().intValue(), 
+                                    (Action)entry.getValue());
                         } else {
                             throw new SoapFault(new Message("BAD_ACTION", LOG), version
                                     .getReceiver());
@@ -329,7 +329,7 @@ public class WSS4JOutInterceptor extends
                     
                     if (doDebug) {
                         if (removedAction != null) {
-                            LOG.fine("Replaced Action: " + removedAction
+                            LOG.fine("Replaced Action: " + removedAction.getName()
                                     + " with Action: " + entry.getValue()
                                     + " for ID: " + entry.getKey());
                         } else {

Modified: cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java?rev=1051883&r1=1051882&r2=1051883&view=diff
==============================================================================
--- cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
(original)
+++ cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
Wed Dec 22 13:07:28 2010
@@ -601,7 +601,7 @@ public class WSS4JInOutTest extends Abst
                 WSConstants.SIG_NS,
                 WSConstants.SIG_LN
             ),
-            new CustomProcessor()
+            CustomProcessor.class
         );
         properties.put(
             WSS4JInInterceptor.PROCESSOR_MAP,

Modified: cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java?rev=1051883&r1=1051882&r2=1051883&view=diff
==============================================================================
--- cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
(original)
+++ cxf/branches/wss4j-1.6-port/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptorTest.java
Wed Dec 22 13:07:28 2010
@@ -219,7 +219,7 @@ public class WSS4JOutInterceptorTest ext
         }
         
         try {
-            customActions.put(new Object(), action);
+            customActions.put(new Object(), CountingUsernameTokenAction.class);
             handler.handleMessage(msg);
         } catch (SoapFault e) {
             assertEquals("An invalid action configuration was defined.", e.getMessage());



Mime
View raw message