cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1556576 - in /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security: policy/interceptors/ wss4j/
Date Wed, 08 Jan 2014 16:46:27 GMT
Author: coheigea
Date: Wed Jan  8 16:46:27 2014
New Revision: 1556576

URL: http://svn.apache.org/r1556576
Log:
More refactoring

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SamlTokenInterceptorProvider.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecurityVerificationOutInterceptor.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoTokenInterceptorProvider.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/UsernameTokenInterceptorProvider.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
Wed Jan  8 16:46:27 2014
@@ -329,5 +329,19 @@ final class NegotiationUtils {
             
         return Collections.emptySet();
     }
+    
+    static boolean isThereAnAssertionByLocalname(
+        AssertionInfoMap aim,
+        String localname
+    ) {
+        Collection<AssertionInfo> sp11Ais = aim.get(new QName(SP11Constants.SP_NS,
localname));
+        Collection<AssertionInfo> sp12Ais = aim.get(new QName(SP12Constants.SP_NS,
localname));
+
+        if ((sp11Ais != null && !sp11Ais.isEmpty()) || (sp12Ais != null &&
!sp12Ais.isEmpty())) {
+            return true;
+        }
+
+        return false;
+    }
 
 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SamlTokenInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SamlTokenInterceptorProvider.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SamlTokenInterceptorProvider.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SamlTokenInterceptorProvider.java
Wed Jan  8 16:46:27 2014
@@ -19,10 +19,7 @@
 
 package org.apache.cxf.ws.security.policy.interceptors;
 
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.xml.namespace.QName;
+import java.util.Arrays;
 
 import org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider;
 import org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JStaxInInterceptor;
@@ -36,16 +33,10 @@ import org.apache.wss4j.policy.SP12Const
  */
 public class SamlTokenInterceptorProvider extends AbstractPolicyInterceptorProvider {
     private static final long serialVersionUID = -2270910622513357794L;
-    private static final Collection<QName> ASSERTION_TYPES;
-    static {
-        ASSERTION_TYPES = new ArrayList<QName>();
-        
-        ASSERTION_TYPES.add(SP12Constants.SAML_TOKEN);
-        ASSERTION_TYPES.add(SP11Constants.SAML_TOKEN);
-    }
 
     public SamlTokenInterceptorProvider() {
-        super(ASSERTION_TYPES);
+        super(Arrays.asList(SP12Constants.SAML_TOKEN, SP11Constants.SAML_TOKEN));
+        
         this.getOutInterceptors().add(new SamlTokenInterceptor());
         this.getInInterceptors().add(new SamlTokenInterceptor());
         

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
Wed Jan  8 16:46:27 2014
@@ -23,7 +23,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
-import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
 
@@ -32,7 +31,6 @@ import org.w3c.dom.Element;
 import org.apache.cxf.binding.soap.SoapBindingConstants;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor;
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.interceptor.Fault;
@@ -73,7 +71,6 @@ import org.apache.wss4j.policy.model.Tru
 import org.apache.xml.security.utils.Base64;
 
 class SecureConversationInInterceptor extends AbstractPhaseInterceptor<SoapMessage>
{
-    static final Logger LOG = LogUtils.getL7dLogger(SecureConversationInInterceptor.class);
     
     public SecureConversationInInterceptor() {
         super(Phase.PRE_STREAM);

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
Wed Jan  8 16:46:27 2014
@@ -21,11 +21,9 @@ package org.apache.cxf.ws.security.polic
 
 import java.util.Arrays;
 import java.util.Map;
-import java.util.logging.Logger;
 
 import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.binding.soap.SoapMessage;
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider;
 import org.apache.cxf.ws.policy.AssertionInfoMap;
@@ -45,7 +43,6 @@ import org.apache.wss4j.policy.model.Sup
  * 
  */
 public class SecureConversationTokenInterceptorProvider extends AbstractPolicyInterceptorProvider
{
-    static final Logger LOG = LogUtils.getL7dLogger(SecureConversationTokenInterceptorProvider.class);
 
     private static final long serialVersionUID = 8739057200687855383L;
 

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecurityVerificationOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecurityVerificationOutInterceptor.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecurityVerificationOutInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecurityVerificationOutInterceptor.java
Wed Jan  8 16:46:27 2014
@@ -57,50 +57,63 @@ public class SecurityVerificationOutInte
     public void handleMessage(SoapMessage message) throws Fault {
         if (MessageUtils.isRequestor(message)) {
             AssertionInfoMap aim = message.get(AssertionInfoMap.class);
-            if (aim != null) {
-                Collection<AssertionInfo> aisTransport = 
-                    NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.TRANSPORT_BINDING);
-                Collection<AssertionInfo> aisAssymetric = 
-                    NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.ASYMMETRIC_BINDING);
-                Collection<AssertionInfo> aisSymetric = 
-                    NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.SYMMETRIC_BINDING);
-                
-                if (aisTransport.isEmpty() && aisAssymetric.isEmpty() &&
aisSymetric.isEmpty()) {
-                    
-                    Collection<AssertionInfo> aisSignedParts = 
-                        NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.SIGNED_PARTS);
-                    checkAssertion(aisSignedParts, SPConstants.SIGNED_PARTS);
-                    
-                    Collection<AssertionInfo> aisSignedElements = aim.get(SP12Constants.SIGNED_ELEMENTS);
-                    checkAssertion(aisSignedElements, SPConstants.SIGNED_ELEMENTS);
-                    
-                    Collection<AssertionInfo> aisEncryptedParts = aim.get(SP12Constants.ENCRYPTED_PARTS);
-                    checkAssertion(aisEncryptedParts, SPConstants.ENCRYPTED_PARTS);
-                    
-                    Collection<AssertionInfo> aisEncryptedElements = 
-                        aim.get(SP12Constants.ENCRYPTED_ELEMENTS);
-                    checkAssertion(aisEncryptedElements, SPConstants.ENCRYPTED_ELEMENTS);
-                    
-                    Collection<AssertionInfo> aisContentEncryptedElements = 
-                        aim.get(SP12Constants.CONTENT_ENCRYPTED_ELEMENTS);
-                    checkAssertion(aisContentEncryptedElements, SPConstants.CONTENT_ENCRYPTED_ELEMENTS);
+            if (aim != null && !isThereASecurityBinding(aim)) {
+                AssertionInfo assertion = getSecuredPart(aim);
+                if (assertion != null) {
+                    String error = String
+                        .format("%s assertion cannot be fulfilled without binding. "
+                            + "At least one binding assertion (%s, %s, %s) must be specified
in policy.",
+                            assertion.getAssertion().getName(),
+                            SP12Constants.TRANSPORT_BINDING.getLocalPart(),
+                            SP12Constants.ASYMMETRIC_BINDING.getLocalPart(),
+                            SP12Constants.SYMMETRIC_BINDING.getLocalPart());
+                    assertion.setNotAsserted(error);
+                    LOG.severe(error);
+                    throw new PolicyException(assertion);
                 }
             }
         }
     }
-
-    private void checkAssertion(Collection<AssertionInfo> ais, String assertionName)
{
-        if ((ais != null) && (!ais.isEmpty())) {
-            String error = String
-                .format("%s assertion cannot be fulfilled without binding. "
-                        + "At least one binding assertion (%s, %s, %s) must be specified
in policy.",
-                        assertionName, SP12Constants.TRANSPORT_BINDING.getLocalPart(),
-                        SP12Constants.ASYMMETRIC_BINDING.getLocalPart(),
-                        SP12Constants.SYMMETRIC_BINDING.getLocalPart());
-            AssertionInfo info = ais.iterator().next();
-            info.setNotAsserted(error);
-            LOG.severe(error);
-            throw new PolicyException(info);
+    
+    private boolean isThereASecurityBinding(AssertionInfoMap aim) {
+        return 
+            NegotiationUtils.isThereAnAssertionByLocalname(aim, SPConstants.TRANSPORT_BINDING)
+            || NegotiationUtils.isThereAnAssertionByLocalname(aim, SPConstants.ASYMMETRIC_BINDING)
+            || NegotiationUtils.isThereAnAssertionByLocalname(aim, SPConstants.SYMMETRIC_BINDING);
+    }
+    
+    private AssertionInfo getSecuredPart(AssertionInfoMap aim) {
+        Collection<AssertionInfo> assertions = 
+            NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.SIGNED_PARTS);
+        if (!assertions.isEmpty()) {
+            return assertions.iterator().next();
+        }
+        
+        assertions = 
+            NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.SIGNED_ELEMENTS);
+        if (!assertions.isEmpty()) {
+            return assertions.iterator().next();
+        }
+        
+        assertions = 
+            NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.ENCRYPTED_PARTS);
+        if (!assertions.isEmpty()) {
+            return assertions.iterator().next();
         }
+        
+        assertions = 
+            NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.ENCRYPTED_ELEMENTS);
+        if (!assertions.isEmpty()) {
+            return assertions.iterator().next();
+        }
+        
+        assertions = 
+            NegotiationUtils.getAllAssertionsByLocalname(aim, SPConstants.CONTENT_ENCRYPTED_ELEMENTS);
+        if (!assertions.isEmpty()) {
+            return assertions.iterator().next();
+        }
+        
+        return null;
     }
+
 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoContextTokenInInterceptor.java
Wed Jan  8 16:46:27 2014
@@ -21,15 +21,14 @@ package org.apache.cxf.ws.security.polic
 
 import java.util.Collection;
 import java.util.Date;
-import java.util.logging.Logger;
 
 import javax.security.auth.callback.CallbackHandler;
 
 import org.w3c.dom.Element;
+
 import org.apache.cxf.binding.soap.SoapBindingConstants;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor;
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.interceptor.Fault;
@@ -61,7 +60,6 @@ import org.apache.wss4j.policy.SPConstan
 import org.apache.xml.security.utils.Base64;
 
 class SpnegoContextTokenInInterceptor extends AbstractPhaseInterceptor<SoapMessage>
{
-    static final Logger LOG = LogUtils.getL7dLogger(SpnegoContextTokenInInterceptor.class);
     
     public SpnegoContextTokenInInterceptor() {
         super(Phase.PRE_STREAM);

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoTokenInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoTokenInterceptorProvider.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoTokenInterceptorProvider.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SpnegoTokenInterceptorProvider.java
Wed Jan  8 16:46:27 2014
@@ -21,11 +21,9 @@ package org.apache.cxf.ws.security.polic
 
 import java.util.Arrays;
 import java.util.Map;
-import java.util.logging.Logger;
 
 import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.binding.soap.SoapMessage;
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider;
 import org.apache.cxf.ws.policy.AssertionInfoMap;
@@ -43,7 +41,6 @@ import org.apache.wss4j.policy.model.Alg
  * 
  */
 public class SpnegoTokenInterceptorProvider extends AbstractPolicyInterceptorProvider {
-    static final Logger LOG = LogUtils.getL7dLogger(SpnegoTokenInterceptorProvider.class);
 
     private static final long serialVersionUID = -3412111025613191505L;
 

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/UsernameTokenInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/UsernameTokenInterceptorProvider.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/UsernameTokenInterceptorProvider.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/UsernameTokenInterceptorProvider.java
Wed Jan  8 16:46:27 2014
@@ -19,10 +19,7 @@
 
 package org.apache.cxf.ws.security.policy.interceptors;
 
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.xml.namespace.QName;
+import java.util.Arrays;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider;
@@ -37,13 +34,6 @@ import org.apache.wss4j.policy.SP12Const
  */
 public class UsernameTokenInterceptorProvider extends AbstractPolicyInterceptorProvider {
     private static final long serialVersionUID = -1507727324874727254L;
-    private static final Collection<QName> ASSERTION_TYPES;
-    static {
-        ASSERTION_TYPES = new ArrayList<QName>();
-        
-        ASSERTION_TYPES.add(SP12Constants.USERNAME_TOKEN);
-        ASSERTION_TYPES.add(SP11Constants.USERNAME_TOKEN);
-    }
 
     public UsernameTokenInterceptorProvider() {
         this(new UsernameTokenInterceptor());
@@ -55,7 +45,8 @@ public class UsernameTokenInterceptorPro
     }
     
     public UsernameTokenInterceptorProvider(UsernameTokenInterceptor inInterceptor) {
-        super(ASSERTION_TYPES);
+        super(Arrays.asList(SP12Constants.USERNAME_TOKEN, SP11Constants.USERNAME_TOKEN));
+
         this.getOutInterceptors().add(new UsernameTokenInterceptor());
         this.getInInterceptors().add(inInterceptor == null ? new UsernameTokenInterceptor()
: inInterceptor);
         //not needed on fault chains

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
Wed Jan  8 16:46:27 2014
@@ -93,6 +93,11 @@ public abstract class AbstractWSS4JStaxI
         id = getClass().getName();
         this.properties = properties;
     }
+    
+    public AbstractWSS4JStaxInterceptor() {
+        super();
+        id = getClass().getName();
+    }
 
     protected WSSSecurityProperties createSecurityProperties() {
         if (userSecurityProperties != null) {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxInInterceptor.java
Wed Jan  8 16:46:27 2014
@@ -25,7 +25,6 @@ import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -83,10 +82,6 @@ public class PolicyBasedWSS4JStaxInInter
         = new PolicyBasedWSS4JStaxInInterceptor();
     private static final Logger LOG = LogUtils.getL7dLogger(PolicyBasedWSS4JStaxInInterceptor.class);
 
-    public PolicyBasedWSS4JStaxInInterceptor() {
-        super(new HashMap<String, Object>());
-    }
-    
     public void handleMessage(SoapMessage msg) throws Fault {
         AssertionInfoMap aim = msg.get(AssertionInfoMap.class);
         boolean enableStax = 

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JStaxOutInterceptor.java
Wed Jan  8 16:46:27 2014
@@ -24,7 +24,6 @@ import java.io.InputStream;
 import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Properties;
@@ -70,10 +69,6 @@ public class PolicyBasedWSS4JStaxOutInte
         = new PolicyBasedWSS4JStaxOutInterceptor();
     private static final Logger LOG = LogUtils.getL7dLogger(PolicyBasedWSS4JStaxOutInterceptor.class);
 
-    public PolicyBasedWSS4JStaxOutInterceptor() {
-        super(new HashMap<String, Object>());
-    }
-    
     public void handleMessage(SoapMessage msg) throws Fault {
         AssertionInfoMap aim = msg.get(AssertionInfoMap.class);
         boolean enableStax = 

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
Wed Jan  8 16:46:27 2014
@@ -61,17 +61,10 @@ public class WSS4JOutInterceptor extends
     private static final Logger LOG = LogUtils
             .getL7dLogger(WSS4JOutInterceptor.class);
 
-    private static final Logger TIME_LOG = LogUtils
-            .getL7dLogger(WSS4JOutInterceptor.class,
-                          null,
-                          WSS4JOutInterceptor.class.getName() + "-Time");
-        
     private WSS4JOutInterceptorInternal ending;
     private SAAJOutInterceptor saajOut = new SAAJOutInterceptor();
     private boolean mtomEnabled;
     
-    
-
     public WSS4JOutInterceptor() {
         super();
         setPhase(Phase.PRE_PROTOCOL);
@@ -147,15 +140,6 @@ public class WSS4JOutInterceptor extends
         public void handleMessage(SoapMessage mc) throws Fault {
             
             boolean doDebug = LOG.isLoggable(Level.FINE);
-            boolean doTimeDebug = TIME_LOG.isLoggable(Level.FINE);
-    
-            long t0 = 0;
-            long t1 = 0;
-            long t2 = 0;
-    
-            if (doTimeDebug) {
-                t0 = System.currentTimeMillis();
-            }
     
             if (doDebug) {
                 LOG.fine("WSS4JOutInterceptor: enter handleMessage()");
@@ -271,21 +255,9 @@ public class WSS4JOutInterceptor extends
     
                 Document doc = saaj.getSOAPPart();
 
-                if (doTimeDebug) {
-                    t1 = System.currentTimeMillis();
-                }
-    
                 doSenderAction(doc, reqData, actions, Boolean.TRUE
                         .equals(getProperty(mc, org.apache.cxf.message.Message.REQUESTOR_ROLE)));
     
-                if (doTimeDebug) {
-                    t2 = System.currentTimeMillis();
-                    TIME_LOG.fine("Send request: total= " + (t2 - t0)
-                            + " request preparation= " + (t1 - t0)
-                            + " request processing= " + (t2 - t1)
-                            + "\n");
-                }
-    
                 if (doDebug) {
                     LOG.fine("WSS4JOutInterceptor: exit handleMessage()");
                 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxInInterceptor.java
Wed Jan  8 16:46:27 2014
@@ -75,6 +75,12 @@ public class WSS4JStaxInInterceptor exte
         setPhase(Phase.POST_STREAM);
         getAfter().add(StaxInInterceptor.class.getName());
     }
+    
+    public WSS4JStaxInInterceptor() {
+        super();
+        setPhase(Phase.POST_STREAM);
+        getAfter().add(StaxInInterceptor.class.getName());
+    }
 
     public final boolean isGET(SoapMessage message) {
         String method = (String)message.get(SoapMessage.HTTP_REQUEST_METHOD);

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java?rev=1556576&r1=1556575&r2=1556576&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JStaxOutInterceptor.java
Wed Jan  8 16:46:27 2014
@@ -58,13 +58,6 @@ import org.apache.xml.security.stax.secu
 
 public class WSS4JStaxOutInterceptor extends AbstractWSS4JStaxInterceptor {
     
-    /**
-     * Property name for a map of action IDs ({@link Integer}) to action
-     * class names. Values can be either {@link Class}) or Objects
--    * implementing {@link Action}.
-     */
-    public static final String WSS4J_ACTION_MAP = "wss4j.action.map";
-    
     public static final String OUTPUT_STREAM_HOLDER = 
         WSS4JStaxOutInterceptor.class.getName() + ".outputstream";
     private WSS4JStaxOutInterceptorInternal ending;
@@ -87,6 +80,14 @@ public class WSS4JStaxOutInterceptor ext
         ending = createEndingInterceptor();
     }
     
+    public WSS4JStaxOutInterceptor() {
+        super();
+        setPhase(Phase.PRE_STREAM);
+        getBefore().add(StaxOutInterceptor.class.getName());
+        
+        ending = createEndingInterceptor();
+    }
+    
     public boolean isAllowMTOM() {
         return mtomEnabled;
     }



Mime
View raw message