Class MatrixAgentMembershipListener

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.services.organization.MembershipEventListener
io.meeds.chat.listeners.MatrixAgentMembershipListener
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin

@Component public class MatrixAgentMembershipListener extends org.exoplatform.services.organization.MembershipEventListener
Hands every deleted membership to MatrixAgentPusherService.onMembershipDeleted(String, String), which queues a left-kind turn when an account leaves the group of every account kind it belonged to, so that its managed push rules return to the server default once the turn finds it no longer wants a chat pusher.

It is registered from init(), a Spring bean's @PostConstruct, and not as a kernel plugin, because it must run after core's MembershipUpdateListener, which commits the delete (RequestLifeCycle.restartTransaction()): the kernel adds every plugin of the organization service before it hands the service to Spring, while a kernel plugin of an add-on would be sorted against core's by priority and then by a configuration load order nothing guarantees. Run after that commit, the turn thread's re-read sees the membership gone.

  • Field Summary

    Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin

    desc, name
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Registers the listener behind every listener the kernel added.
    void
    postDelete(org.exoplatform.services.organization.Membership membership)
    Hands the deleted membership to the pusher service, which decides whether the account left its account kind.

    Methods inherited from class org.exoplatform.services.organization.MembershipEventListener

    postSave, preDelete, preSave

    Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin

    getDescription, getName, setDescription, setName

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MatrixAgentMembershipListener

      public MatrixAgentMembershipListener()
  • Method Details

    • init

      @PostConstruct public void init()
      Registers the listener behind every listener the kernel added.
    • postDelete

      public void postDelete(org.exoplatform.services.organization.Membership membership)
      Hands the deleted membership to the pusher service, which decides whether the account left its account kind.
      Overrides:
      postDelete in class org.exoplatform.services.organization.MembershipEventListener
      Parameters:
      membership - the deleted membership