Passing description string through to the EventBus for ActionEvents
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ee13e19a Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ee13e19a Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ee13e19a Branch: refs/heads/master Commit: ee13e19a037250e8888ca955c35d2283f66889b4 Parents: c86f3bc Author: Chip Childers <[email protected]> Authored: Tue Sep 3 12:34:36 2013 -0400 Committer: Chip Childers <[email protected]> Committed: Tue Sep 3 12:34:36 2013 -0400 ---------------------------------------------------------------------- server/src/com/cloud/event/ActionEventUtils.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ee13e19a/server/src/com/cloud/event/ActionEventUtils.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/event/ActionEventUtils.java b/server/src/com/cloud/event/ActionEventUtils.java index e89c8a0..1cdcf1c 100755 --- a/server/src/com/cloud/event/ActionEventUtils.java +++ b/server/src/com/cloud/event/ActionEventUtils.java @@ -72,7 +72,7 @@ public class ActionEventUtils { public static Long onActionEvent(Long userId, Long accountId, Long domainId, String type, String description) { publishOnEventBus(userId, accountId, EventCategory.ACTION_EVENT.getName(), - type, com.cloud.event.Event.State.Completed); + type, com.cloud.event.Event.State.Completed, description); Event event = persistActionEvent(userId, accountId, domainId, null, type, Event.State.Completed, description, null); @@ -87,7 +87,7 @@ public class ActionEventUtils { long startEventId) { publishOnEventBus(userId, accountId, EventCategory.ACTION_EVENT.getName(), type, - com.cloud.event.Event.State.Scheduled); + com.cloud.event.Event.State.Scheduled, description); Event event = persistActionEvent(userId, accountId, null, null, type, Event.State.Scheduled, description, startEventId); @@ -102,7 +102,7 @@ public class ActionEventUtils { long startEventId) { publishOnEventBus(userId, accountId, EventCategory.ACTION_EVENT.getName(), type, - com.cloud.event.Event.State.Started); + com.cloud.event.Event.State.Started, description); Event event = persistActionEvent(userId, accountId, null, null, type, Event.State.Started, description, startEventId); @@ -113,7 +113,7 @@ public class ActionEventUtils { String description, long startEventId) { publishOnEventBus(userId, accountId, EventCategory.ACTION_EVENT.getName(), type, - com.cloud.event.Event.State.Completed); + com.cloud.event.Event.State.Completed, description); Event event = persistActionEvent(userId, accountId, null, level, type, Event.State.Completed, description, startEventId); @@ -124,7 +124,7 @@ public class ActionEventUtils { public static Long onCreatedActionEvent(Long userId, Long accountId, String level, String type, String description) { publishOnEventBus(userId, accountId, EventCategory.ACTION_EVENT.getName(), type, - com.cloud.event.Event.State.Created); + com.cloud.event.Event.State.Created, description); Event event = persistActionEvent(userId, accountId, null, level, type, Event.State.Created, description, null); @@ -155,7 +155,7 @@ public class ActionEventUtils { } private static void publishOnEventBus(long userId, long accountId, String eventCategory, - String eventType, Event.State state) { + String eventType, Event.State state, String description) { try { _eventBus = ComponentContext.getComponent(EventBus.class); } catch(NoSuchBeanDefinitionException nbe) { @@ -191,6 +191,7 @@ public class ActionEventUtils { eventDescription.put("status", state.toString()); eventDescription.put("entity", entityType); eventDescription.put("entityuuid", entityUuid); + eventDescription.put("description", description); String eventDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); eventDescription.put("eventDateTime", eventDate);
