ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1683922 - /ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java
Date Sat, 06 Jun 2015 15:44:55 GMT
Author: marrs
Date: Sat Jun  6 15:44:55 2015
New Revision: 1683922

URL: http://svn.apache.org/r1683922
Log:
ACE-508 Added the message of the cause to the event that gets recorded in the audit log.

Modified:
    ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java

Modified: ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java?rev=1683922&r1=1683921&r2=1683922&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java (original)
+++ ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java Sat
Jun  6 15:44:55 2015
@@ -289,7 +289,7 @@ public class DefaultController extends C
         protected final void installationSuccess(UpdateInfo updateInfo) {
             m_lastVersionSuccessful = true;
             m_failureCount = 0;
-            m_controller.sendDeploymentCompletedEvent(updateInfo, true /* success */);
+            m_controller.sendDeploymentCompletedEvent(updateInfo, true /* success */, null);
         }
 
         /**
@@ -306,7 +306,7 @@ public class DefaultController extends C
 
             m_lastVersionSuccessful = false;
             m_failureCount++;
-            m_controller.sendDeploymentCompletedEvent(updateInfo, false /* success */);
+            m_controller.sendDeploymentCompletedEvent(updateInfo, false /* success */, exception.getCause());
         }
 
         /**
@@ -322,7 +322,7 @@ public class DefaultController extends C
 
             m_lastVersionSuccessful = false;
             m_failureCount++;
-            m_controller.sendDeploymentCompletedEvent(updateInfo, false /* success */);
+            m_controller.sendDeploymentCompletedEvent(updateInfo, false /* success */, cause);
         }
 
         protected final DefaultController getController() {
@@ -506,7 +506,7 @@ public class DefaultController extends C
         }
     }
 
-    protected void sendDeploymentCompletedEvent(UpdateInfo updateInfo, boolean success) {
+    protected void sendDeploymentCompletedEvent(UpdateInfo updateInfo, boolean success, Throwable
throwable) {
         Map<String, String> eventProps = new HashMap<String, String>();
         eventProps.put("type", updateInfo.m_type);
         eventProps.put("name", getIdentificationHandler().getAgentId());
@@ -514,6 +514,9 @@ public class DefaultController extends C
         eventProps.put("toVersion", updateInfo.m_to.toString());
         eventProps.put("fixPackage", Boolean.toString(updateInfo.m_fixPackage));
         eventProps.put("successful", Boolean.toString(success));
+        if (throwable != null) {
+            eventProps.put("exception", throwable.getMessage());
+        }
 
         getEventsHandler().postEvent(AGENT_INSTALLATION_COMPLETE, eventProps);
     }



Mime
View raw message