Class VisioApplicationBadgePlugin

java.lang.Object
org.exoplatform.webconferencing.plugin.VisioApplicationBadgePlugin
All Implemented Interfaces:
io.meeds.appcenter.plugin.ApplicationBadgePlugin

@Component @ConditionalOnClass(io.meeds.appcenter.plugin.ApplicationBadgePlugin.class) public class VisioApplicationBadgePlugin extends Object implements io.meeds.appcenter.plugin.ApplicationBadgePlugin
Reports how many visios are going on right now among the ones the user belongs to, on the Visio drawer tile of the Application Center.

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 Details

    • BADGE_NAME

      public static final String 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 @PostConstruct is what makes the contribution independent of the order in which the WARs boot.
    • getName

      public String getName()
      Specified by:
      getName in interface io.meeds.appcenter.plugin.ApplicationBadgePlugin
      Returns:
      the stable identifier of this badge
    • getDrawerNames

      public List<String> getDrawerNames()
      Specified by:
      getDrawerNames in interface io.meeds.appcenter.plugin.ApplicationBadgePlugin
      Returns:
      the url of every DRAWER catalog entry this badge binds to
    • countBadge

      public long countBadge(String username)
      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.STARTED predicate. 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:
      countBadge in interface io.meeds.appcenter.plugin.ApplicationBadgePlugin
      Parameters:
      username - the user the count is computed for
      Returns:
      the number of ongoing visios, 0 when there is none or when the count could not be established
    • isEnabled

      public boolean isEnabled(String username)
      Specified by:
      isEnabled in interface io.meeds.appcenter.plugin.ApplicationBadgePlugin
      Parameters:
      username - the user to test
      Returns:
      true for any identified user: every user can be invited to a visio, so none is opted out