Class 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:
callStartedandcallStoppedare the obvious ones;callCreatedis the one that is easy to miss — a call created already running (the space call button, and any client callingaddCallwithstart=true) is persisted in statestartedand broadcasts onlycallCreated, nevercallStarted. Without it the most common way a visio begins would raise no badge at all.callJoinedis the subtle one. Joining a call that is merely ready auto-starts it, and that path calls the internalstartCall(call, partId, clientId, false)which broadcasts nocallStartedat all — the room goes live announcing onlycallJoined. 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 -
Method Summary
Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, throws ExceptionString>> event) 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
-