Skip to content

Commit c301734

Browse files
committed
CLOUDSTACK-3440: action events are not published due to conflict of
Eventutils and ActionEventUtils files removing the 'EventUtils' file which got merged back during the Spring changes to master at 4.1. 'EventUtils' file was replaced by 'ActionEventUtils', and the original file was removed for events frameworks. This file conflict was resulting in action events not to be published on to event bus
1 parent 3d1c873 commit c301734

3 files changed

Lines changed: 5 additions & 124 deletions

File tree

‎client/tomcatconf/applicationContext.xml.in‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,6 @@
716716
<bean id="defaultImageMotionStrategy" class="org.apache.cloudstack.storage.image.motion.DefaultImageMotionStrategy" />
717717
<bean id="defaultPrimaryDataStoreProviderManagerImpl" class="org.apache.cloudstack.storage.datastore.manager.DefaultPrimaryDataStoreProviderManagerImpl" />
718718
<bean id="defaultPrimaryDatastoreProviderImpl" class="org.apache.cloudstack.storage.datastore.provider.DefaultPrimaryDatastoreProviderImpl" />
719-
<bean id="eventUtils" class="com.cloud.event.EventUtils" />
720719
<bean id="hypervisorBasedSnapshot" class="org.apache.cloudstack.storage.snapshot.strategy.HypervisorBasedSnapshot" />
721720
<bean id="hypervsiorHostEndPointRpcServer" class="org.apache.cloudstack.storage.HypervsiorHostEndPointRpcServer" />
722721
<bean id="iSCSI" class="org.apache.cloudstack.storage.datastore.type.ISCSI" />

‎server/src/com/cloud/event/ActionEventInterceptor.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public Object interceptStart(Method method, Object target) {
4444
if(ctx.getEventDetails() != null){
4545
eventDescription += ". "+ctx.getEventDetails();
4646
}
47-
EventUtils.saveStartedEvent(userId, accountId, actionEvent.eventType(), eventDescription, startEventId);
47+
ActionEventUtils.onStartedActionEvent(userId, accountId, actionEvent.eventType(), eventDescription, startEventId);
4848
}
4949
}
5050
return event;
@@ -64,10 +64,10 @@ public void interceptComplete(Method method, Object target, Object event) {
6464
}
6565
if(actionEvent.create()){
6666
//This start event has to be used for subsequent events of this action
67-
startEventId = EventUtils.saveCreatedEvent(userId, accountId, EventVO.LEVEL_INFO, actionEvent.eventType(), "Successfully created entity for "+eventDescription);
67+
startEventId = ActionEventUtils.onCreatedActionEvent(userId, accountId, EventVO.LEVEL_INFO, actionEvent.eventType(), "Successfully created entity for "+eventDescription);
6868
ctx.setStartEventId(startEventId);
6969
} else {
70-
EventUtils.saveEvent(userId, accountId, EventVO.LEVEL_INFO, actionEvent.eventType(), "Successfully completed "+eventDescription, startEventId);
70+
ActionEventUtils.onCompletedActionEvent(userId, accountId, EventVO.LEVEL_INFO, actionEvent.eventType(), "Successfully completed "+eventDescription, startEventId);
7171
}
7272
}
7373
}
@@ -85,10 +85,10 @@ public void interceptException(Method method, Object target, Object event) {
8585
eventDescription += ". "+ctx.getEventDetails();
8686
}
8787
if(actionEvent.create()){
88-
long eventId = EventUtils.saveCreatedEvent(userId, accountId, EventVO.LEVEL_ERROR, actionEvent.eventType(), "Error while creating entity for "+eventDescription);
88+
long eventId = ActionEventUtils.onCreatedActionEvent(userId, accountId, EventVO.LEVEL_ERROR, actionEvent.eventType(), "Error while creating entity for "+eventDescription);
8989
ctx.setStartEventId(eventId);
9090
} else {
91-
EventUtils.saveEvent(userId, accountId, EventVO.LEVEL_ERROR, actionEvent.eventType(), "Error while "+eventDescription, startEventId);
91+
ActionEventUtils.onCompletedActionEvent(userId, accountId, EventVO.LEVEL_ERROR, actionEvent.eventType(), "Error while "+eventDescription, startEventId);
9292
}
9393
}
9494
}

‎server/src/com/cloud/event/EventUtils.java‎

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)