Class SessionRegistry
java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.session.SessionRegistry
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<ViewSession>all()Returns every registered session.@NotNull Optional<ViewSession>Looks up the session of a player.voidregister(@NotNull ViewSession session) Registers a session under its player's UUID, replacing any previous mapping.voidunregister(@NotNull ViewSession session) Removes a session's mapping.
-
Constructor Details
-
SessionRegistry
public SessionRegistry()
-
-
Method Details
-
register
Registers a session under its player's UUID, replacing any previous mapping.- Parameters:
session- the session to register
-
unregister
Removes a session's mapping.- Parameters:
session- the session to unregister
-
find
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
Returns every registered session.- Returns:
- an unmodifiable live view of all sessions
-