Class VisioApplicationBadgeListener

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.services.listener.Listener<CallInfo,Map<String,String>>
org.exoplatform.webconferencing.listener.VisioApplicationBadgeListener
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin, org.exoplatform.services.listener.ListenerBase<CallInfo,Map<String,String>>

@Component @ConditionalOnClass(io.meeds.appcenter.plugin.ApplicationBadgePlugin.class) public class VisioApplicationBadgeListener extends org.exoplatform.services.listener.Listener<CallInfo,Map<String,String>>
Refreshes the Visio badge of every participant of a call that just started or just stopped.

Pure glue: it holds no counting logic, it only tells the Application Center that those users' counts went stale. This is what makes the badge real-time — a colleague starting the space visio makes the icon light up without anyone reloading a page.

The three event names below are the complete set of broadcasts that change whether a call is live:

  • callStarted and callStopped are the obvious ones;
  • callCreated is the one that is easy to miss — a call created already running (the space call button, and any client calling addCall with start=true) is persisted in state started and broadcasts only callCreated, never callStarted. Without it the most common way a visio begins would raise no badge at all.
  • callJoined is the subtle one. Joining a call that is merely ready auto-starts it, and that path calls the internal startCall(call, partId, clientId, false) which broadcasts no callStarted at all — the room goes live announcing only callJoined. This is how every instant room begins, so without it the badge waits for the cache to expire.
callJoined is nonetheless filtered down to that one transition: with the plugin's "every started call" semantics the count does not move when a second or third person joins, and subscribing unconditionally would evict and push to every participant of every call on every join, for no change. callLeft is not listened to at all — the leave that empties a room broadcasts callStopped, which is already covered.

Two paths change a call's liveness without broadcasting anything, and both are left to the badge cache's own expiry rather than papered over here: an outdated started call silently deleted while a replacement is created, and the reset of lingering started calls at server start — where the cache is empty anyway.

  • 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
    Subscribes to the call lifecycle broadcasts, unless the Application Center is not deployed.
    void
    onEvent(org.exoplatform.services.listener.Event<CallInfo,Map<String,String>> event)
    Marks the badge of every eXo user taking part in the call as stale.

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

    getDescription, getName, setDescription, setName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.exoplatform.services.listener.ListenerBase

    getName
  • Constructor Details

    • VisioApplicationBadgeListener

      public VisioApplicationBadgeListener()
  • Method Details

    • init

      @PostConstruct public void init()
      Subscribes to the call lifecycle broadcasts, unless the Application Center is not deployed.
    • onEvent

      public void onEvent(org.exoplatform.services.listener.Event<CallInfo,Map<String,String>> event) throws Exception
      Marks the badge of every eXo user taking part in the call as stale.
      Parameters:
      event - the call lifecycle event, carrying the call as its source
      Throws:
      Exception