Class GamificationTaskUpdateListener

  • All Implemented Interfaces:
    org.exoplatform.container.component.ComponentPlugin

    public class GamificationTaskUpdateListener
    extends org.exoplatform.services.listener.Listener<org.exoplatform.task.service.TaskService,​org.exoplatform.task.service.TaskPayload>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.exoplatform.addons.gamification.service.effective.GamificationService gamificationService  
      protected org.exoplatform.social.core.manager.IdentityManager identityManager  
      protected org.exoplatform.addons.gamification.service.configuration.RuleService ruleService  
      • Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin

        desc, name
    • Constructor Summary

      Constructors 
      Constructor Description
      GamificationTaskUpdateListener​(org.exoplatform.addons.gamification.service.configuration.RuleService ruleService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.addons.gamification.service.effective.GamificationService gamificationService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void createTask​(org.exoplatform.task.dto.TaskDto task)  
      protected boolean isDiff​(Object before, Object after)
      Check whether a task has been updated
      void onEvent​(org.exoplatform.services.listener.Event<org.exoplatform.task.service.TaskService,​org.exoplatform.task.service.TaskPayload> event)  
      protected void updateTask​(org.exoplatform.task.dto.TaskDto before, org.exoplatform.task.dto.TaskDto after)  
      • Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin

        getDescription, getName, setDescription, setName
    • Field Detail

      • ruleService

        protected org.exoplatform.addons.gamification.service.configuration.RuleService ruleService
      • identityManager

        protected org.exoplatform.social.core.manager.IdentityManager identityManager
      • gamificationService

        protected org.exoplatform.addons.gamification.service.effective.GamificationService gamificationService
    • Constructor Detail

      • GamificationTaskUpdateListener

        public GamificationTaskUpdateListener​(org.exoplatform.addons.gamification.service.configuration.RuleService ruleService,
                                              org.exoplatform.social.core.manager.IdentityManager identityManager,
                                              org.exoplatform.addons.gamification.service.effective.GamificationService gamificationService)
    • Method Detail

      • onEvent

        public void onEvent​(org.exoplatform.services.listener.Event<org.exoplatform.task.service.TaskService,​org.exoplatform.task.service.TaskPayload> event)
                     throws Exception
        Specified by:
        onEvent in class org.exoplatform.services.listener.Listener<org.exoplatform.task.service.TaskService,​org.exoplatform.task.service.TaskPayload>
        Throws:
        Exception
      • createTask

        protected void createTask​(org.exoplatform.task.dto.TaskDto task)
      • updateTask

        protected void updateTask​(org.exoplatform.task.dto.TaskDto before,
                                  org.exoplatform.task.dto.TaskDto after)
      • isDiff

        protected boolean isDiff​(Object before,
                                 Object after)
        Check whether a task has been updated
        Parameters:
        before - : Task data before modification
        after - : Task data after modification
        Returns:
        a boolean if task has been changed false else