Package com.ultikits.ultitools.manager
Class UpdateManager
java.lang.Object
com.ultikits.ultitools.manager.UpdateManager
Manages version checking and update notifications for UltiTools-API and modules.
Checks once at startup, stores results for later querying by commands and listeners.
- Since:
- 6.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate UpdateInfoprivate final Loggerprivate final Map<String, UpdateInfo> Players already notified about an available update, for the lifetime of this manager instance -- which is one server run:UltiTools.scheduleStartupMessages()builds a freshUpdateManagerexactly once peronEnable(), so a restart always starts from an empty set. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidvoidRun update checks synchronously.booleanCheck if any updates (framework or modules) are available.booleanisPlayerNotified(UUID uuid) Check if a player has already been notified about available updates.private voidvoidmarkPlayerNotified(UUID uuid) Mark a player as having been notified about available updates.
-
Field Details
-
logger
-
frameworkUpdate
-
moduleUpdates
-
notifiedPlayers
Players already notified about an available update, for the lifetime of this manager instance -- which is one server run:UltiTools.scheduleStartupMessages()builds a freshUpdateManagerexactly once peronEnable(), so a restart always starts from an empty set. Deliberately NOT@PlayerCache(#431): GEN-08/D-03 (plan 05-04) registered this field withPlayerCacheManagerfor quit-based sweeping to bound its size, but that made a quitting-and-rejoining player look never-notified within the SAME server run, breakingUpdateJoinListener's own documented promise of one notification per player per server session. The set's natural size bound is the number of distinct OP UUIDs that join this run, which does not grow on a repeat quit/rejoin of the same player -- there was no real unbounded-growth hazard here to trade the promise away for. Scoped to this field alone: the three other fields GEN-08/D-03 migrated ontoPlayerCacheManager(inInMemoryNotificationServiceandInMemeryTeleportService) represent genuinely connection-scoped state and are untouched. -
checkComplete
private volatile boolean checkComplete
-
-
Constructor Details
-
UpdateManager
-
-
Method Details
-
checkUpdatesSync
public void checkUpdatesSync()Run update checks synchronously. Called from async context (BukkitRunnable). -
checkFrameworkUpdate
private void checkFrameworkUpdate() -
checkModuleUpdates
private void checkModuleUpdates() -
logResults
private void logResults() -
hasAnyUpdates
public boolean hasAnyUpdates()Check if any updates (framework or modules) are available.- Returns:
- true if any updates are available
-
isPlayerNotified
Check if a player has already been notified about available updates.- Parameters:
uuid- the player's UUID- Returns:
- true if the player has been notified
-
markPlayerNotified
Mark a player as having been notified about available updates. The mark lives for this manager instance's lifetime (one server run) and is not cleared when the player quits (#431).- Parameters:
uuid- the player's UUID
-