Class VisioApplicationBadgePlugin
- All Implemented Interfaces:
io.meeds.appcenter.plugin.ApplicationBadgePlugin
Carries no counting logic of its own: it reads
WebConferencingService.getUserCalls(String) — the same
participant-scoped view the Visio drawer and the platform's own call buttons
are built on — and keeps the rows whose state is
CallState.STARTED. Badge and drawer can therefore never disagree
about what is live.
Semantics: every started call the user belongs to, whether
or not they already joined it. The nicer "only the ones I have not joined
yet" variant needs one extra getCall(id) read per started call, and
App Center's ApplicationBadgeCounter enforces a ~2000 ms budget with
a 3-failure/60 s breaker that returns 0 — a per-call fan-out inside
that budget risks a badge that silently zeroes under load. This is a product
decision, not a technical one, and it is one predicate either way.
Two known under-reports, both inherited from the underlying query and documented rather than papered over:
- a user who joins a space while a call is already running gets no participant row, because participants are only ever synced when a call starts — so that call never appears in their count;
- a scheduled visio nobody has joined yet has no participant rows at all, which is intended: the badge reports what is live, not what is planned.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringStable identifier of the badge, on the WebSocket frame and in the administration form. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcountBadge(String username) Counts the visios currently going on among the ones that user belongs to.getName()voidinit()Registers this plugin with the Application Center, unless the add-on is not deployed.booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.meeds.appcenter.plugin.ApplicationBadgePlugin
getDeclaredUrls, getDeclaredUrls, getPortletNames, isSelfCached
-
Field Details
-
BADGE_NAME
Stable identifier of the badge, on the WebSocket frame and in the administration form.- See Also:
-
-
Constructor Details
-
VisioApplicationBadgePlugin
public VisioApplicationBadgePlugin()
-
-
Method Details
-
init
@PostConstruct public void init()Registers this plugin with the Application Center, unless the add-on is not deployed. Self-registration from@PostConstructis what makes the contribution independent of the order in which the WARs boot. -
getName
- Specified by:
getNamein interfaceio.meeds.appcenter.plugin.ApplicationBadgePlugin- Returns:
- the stable identifier of this badge
-
getDrawerNames
- Specified by:
getDrawerNamesin interfaceio.meeds.appcenter.plugin.ApplicationBadgePlugin- Returns:
- the
urlof every DRAWER catalog entry this badge binds to
-
countBadge
Counts the visios currently going on among the ones that user belongs to.The underlying query joins the participants table, so it is already scoped to the queried user and returns no call they are not part of. It returns every state though — participant rows survive a call being stopped — hence the explicit
CallState.STARTEDpredicate. It also spans every kind of call: one-to-one, space, chat room and agenda-event visios alike. The drawer narrows that set at read time — an agenda-event visio only when the user accepted the meeting, a space or room visio only while they are still a member — from what agenda and the call owner say, which this count, with no dependency on agenda, cannot; it may therefore run ahead of the list.- Specified by:
countBadgein interfaceio.meeds.appcenter.plugin.ApplicationBadgePlugin- Parameters:
username- the user the count is computed for- Returns:
- the number of ongoing visios,
0when there is none or when the count could not be established
-
isEnabled
- Specified by:
isEnabledin interfaceio.meeds.appcenter.plugin.ApplicationBadgePlugin- Parameters:
username- the user to test- Returns:
truefor any identified user: every user can be invited to a visio, so none is opted out
-