cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1522838 - in /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers: AsymmetricBindingHandler.java SymmetricBindingHandler.java
Date Fri, 13 Sep 2013 09:50:02 GMT
Author: coheigea
Date: Fri Sep 13 09:50:02 2013
New Revision: 1522838

URL: http://svn.apache.org/r1522838
Log:
Improved logging in WS-Security handling

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java?rev=1522838&r1=1522837&r2=1522838&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
Fri Sep 13 09:50:02 2013
@@ -199,6 +199,7 @@ public class AsymmetricBindingHandler ex
         } catch (Exception e) {
             String reason = e.getMessage();
             LOG.log(Level.WARNING, "Sign before encryption failed due to : " + reason);
+            LOG.log(Level.FINE, e.getMessage(), e);
             throw new Fault(e);
         }
     }
@@ -253,6 +254,7 @@ public class AsymmetricBindingHandler ex
                 } catch (Exception e) {
                     String reason = e.getMessage();
                     LOG.log(Level.WARNING, "Encrypt before sign failed due to : " + reason);
+                    LOG.log(Level.FINE, e.getMessage(), e);
                     throw new Fault(e);
                 }
             }
@@ -266,6 +268,7 @@ public class AsymmetricBindingHandler ex
             //will not be included otherwise
             sigParts = getSignedParts();
         } catch (SOAPException ex) {
+            LOG.log(Level.FINE, ex.getMessage(), ex);
             throw new Fault(ex);
         }
         
@@ -289,6 +292,7 @@ public class AsymmetricBindingHandler ex
             try {
                 addSupportingTokens(sigParts);
             } catch (WSSecurityException ex) {
+                LOG.log(Level.FINE, ex.getMessage(), ex);
                 policyNotAsserted(encryptionToken, ex);
             }
         } else {
@@ -311,8 +315,10 @@ public class AsymmetricBindingHandler ex
                 }
             }
         } catch (WSSecurityException ex) {
+            LOG.log(Level.FINE, ex.getMessage(), ex);
             throw new Fault(ex);
         } catch (SOAPException ex) {
+            LOG.log(Level.FINE, ex.getMessage(), ex);
             throw new Fault(ex);
         }
 
@@ -363,6 +369,7 @@ public class AsymmetricBindingHandler ex
                 ((WSSecDKEncrypt)encrBase).addExternalRefElement(secondRefList, secHeader);
 
             } catch (WSSecurityException ex) {
+                LOG.log(Level.FINE, ex.getMessage(), ex);
                 throw new Fault(ex);
             }
         } else if (encrBase instanceof WSSecEncrypt) {
@@ -379,6 +386,7 @@ public class AsymmetricBindingHandler ex
                 ((WSSecEncrypt)encrBase).encryptForRef(secondRefList, secondEncrParts);
 
             } catch (WSSecurityException ex) {
+                LOG.log(Level.FINE, ex.getMessage(), ex);
                 throw new Fault(ex);
             }
         }
@@ -415,6 +423,7 @@ public class AsymmetricBindingHandler ex
                     insertBeforeBottomUp(refList);
                     return dkEncr;
                 } catch (Exception e) {
+                    LOG.log(Level.FINE, e.getMessage(), e);
                     policyNotAsserted(recToken, e);
                 }
             } else {
@@ -465,6 +474,7 @@ public class AsymmetricBindingHandler ex
                     this.addEncryptedKeyElement(encryptedKeyElement);
                     return encr;
                 } catch (WSSecurityException e) {
+                    LOG.log(Level.FINE, e.getMessage(), e);
                     policyNotAsserted(recToken, e);
                 }    
             }
@@ -568,6 +578,7 @@ public class AsymmetricBindingHandler ex
                 
                 mainSigId = dkSign.getSignatureId();
             } catch (Exception ex) {
+                LOG.log(Level.FINE, ex.getMessage(), ex);
                 throw new Fault(ex);
             }
         } else {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java?rev=1522838&r1=1522837&r2=1522838&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
Fri Sep 13 09:50:02 2013
@@ -23,13 +23,13 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
+import java.util.logging.Level;
 
 import javax.xml.crypto.dsig.Reference;
 import javax.xml.soap.SOAPMessage;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.CastUtils;
@@ -275,8 +275,10 @@ public class SymmetricBindingHandler ext
                 }
             }
         } catch (RuntimeException ex) {
+            LOG.log(Level.FINE, ex.getMessage(), ex);
             throw ex;
         } catch (Exception ex) {
+            LOG.log(Level.FINE, ex.getMessage(), ex);
             throw new Fault(ex);
         }
     }
@@ -398,6 +400,7 @@ public class SymmetricBindingHandler ext
                          enc,
                          false);
         } catch (Exception e) {
+            LOG.log(Level.FINE, e.getMessage(), e);
             throw new Fault(e);
         }
     }
@@ -500,6 +503,7 @@ public class SymmetricBindingHandler ext
             }
             return dkEncr;
         } catch (Exception e) {
+            LOG.log(Level.FINE, e.getMessage(), e);
             policyNotAsserted(recToken, e);
         }
         return null;
@@ -609,6 +613,7 @@ public class SymmetricBindingHandler ext
                     }
                     return encr;
                 } catch (WSSecurityException e) {
+                    LOG.log(Level.FINE, e.getMessage(), e);
                     policyNotAsserted(recToken, e);
                 }    
             }
@@ -704,6 +709,7 @@ public class SymmetricBindingHandler ext
         try {
             dkSign.prepare(doc, secHeader);
         } catch (ConversationException e) {
+            LOG.log(Level.FINE, e.getMessage(), e);
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
         }
         
@@ -974,6 +980,7 @@ public class SymmetricBindingHandler ext
             byte[] digestBytes = WSSecurityUtil.generateDigest(input);
             return Base64.encode(digestBytes);
         } catch (WSSecurityException e) {
+            LOG.log(Level.FINE, e.getMessage(), e);
             //REVISIT
         }
         return null;



Mime
View raw message