java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.session.SessionRegistry

@Internal public final class SessionRegistry extends Object
Tracks the live view session of every player, keyed by player UUID (one open view per player); the v3 counterpart of the 2.x ViewerRegistry as a DI-managed bean.
  • Constructor Details

    • SessionRegistry

      public SessionRegistry()
  • Method Details

    • register

      public void register(@NotNull @NotNull ViewSession session)
      Registers a session under its player's UUID, replacing any previous mapping.
      Parameters:
      session - the session to register
    • unregister

      public void unregister(@NotNull @NotNull ViewSession session)
      Removes a session's mapping.
      Parameters:
      session - the session to unregister
    • find

      @NotNull public @NotNull Optional<ViewSession> find(@NotNull @NotNull UUID playerId)
      Looks up the session of a player.
      Parameters:
      playerId - the player's UUID
      Returns:
      the player's session, or empty when none is registered
    • all

      @NotNull public @NotNull Collection<ViewSession> all()
      Returns every registered session.
      Returns:
      an unmodifiable live view of all sessions