3232import org .apache .cloudstack .api .Identity ;
3333import org .apache .cloudstack .api .InternalIdentity ;
3434import org .apache .cloudstack .context .CallContext ;
35- import org .apache .cloudstack .framework .config .dao .ConfigurationDao ;
3635import org .apache .cloudstack .framework .events .EventDistributor ;
3736import org .apache .commons .lang3 .ObjectUtils ;
3837import org .apache .commons .lang3 .StringUtils ;
3938import org .apache .logging .log4j .LogManager ;
4039import org .apache .logging .log4j .Logger ;
4140import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
4241
43- import com .cloud .configuration .Config ;
4442import com .cloud .event .dao .EventDao ;
4543import com .cloud .projects .Project ;
4644import com .cloud .projects .dao .ProjectDao ;
45+ import com .cloud .server .ManagementServer ;
4746import com .cloud .server .ManagementService ;
4847import com .cloud .user .Account ;
4948import com .cloud .user .AccountVO ;
@@ -65,7 +64,6 @@ public class ActionEventUtils {
6564 protected static UserDao s_userDao ;
6665 private static EventDistributor eventDistributor ;
6766 protected static EntityManager s_entityMgr ;
68- protected static ConfigurationDao s_configDao ;
6967
7068 public static final String EventDetails = "event_details" ;
7169 public static final String EventId = "event_id" ;
@@ -83,8 +81,6 @@ public class ActionEventUtils {
8381 ProjectDao projectDao ;
8482 @ Inject
8583 EntityManager entityMgr ;
86- @ Inject
87- ConfigurationDao configDao ;
8884
8985 public ActionEventUtils () {
9086 }
@@ -96,7 +92,6 @@ void init() {
9692 s_userDao = userDao ;
9793 s_projectDao = projectDao ;
9894 s_entityMgr = entityMgr ;
99- s_configDao = configDao ;
10095 }
10196
10297 public static Long onActionEvent (Long userId , Long accountId , Long domainId , String type , String description , Long resourceId , String resourceType ) {
@@ -208,9 +203,7 @@ private static Event persistActionEvent(Long userId, Long accountId, Long domain
208203 private static void publishOnEventBus (Event eventRecord , long userId , long accountId , Long domainId ,
209204 String eventCategory , String eventType , Event .State state , String description , String resourceUuid ,
210205 String resourceType ) {
211- String configKey = Config .PublishActionEvent .key ();
212- String value = s_configDao .getValue (configKey );
213- boolean configValue = Boolean .parseBoolean (value );
206+ boolean configValue = ManagementServer .PublishActionEvent .value ();
214207 if (!configValue )
215208 return ;
216209
0 commit comments