Class Updater

java.lang.Object
com.comphenix.protocol.updater.Updater
Direct Known Subclasses:
SpigotUpdater

public abstract class Updater extends Object
  • Field Details

    • REPORT_CANNOT_UPDATE_PLUGIN

      public static final ReportType REPORT_CANNOT_UPDATE_PLUGIN
    • plugin

      protected org.bukkit.plugin.Plugin plugin
    • versionName

      protected String versionName
    • versionType

      protected String versionType
    • versionGameVersion

      protected String versionGameVersion
    • versionFileName

      protected String versionFileName
    • type

      protected Updater.UpdateType type
    • announce

      protected boolean announce
    • thread

      protected Thread thread
    • result

      protected Updater.UpdateResult result
    • listeners

      protected List<Runnable> listeners
  • Constructor Details

    • Updater

      protected Updater(org.bukkit.plugin.Plugin plugin, Updater.UpdateType type, boolean announce)
  • Method Details

    • create

      public static Updater create(org.bukkit.plugin.Plugin plugin, int id, File file, Updater.UpdateType type, boolean announce)
    • versionCheck

      public boolean versionCheck(String title)
    • addListener

      public void addListener(Runnable listener)
      Add a listener to be executed when we have determined if an update is available.

      The listener will be executed on the main thread.

      Parameters:
      listener - - the listener to add.
    • removeListener

      public boolean removeListener(Runnable listener)
      Remove a listener.
      Parameters:
      listener - - the listener to remove.
      Returns:
      TRUE if the listener was removed, FALSE otherwise.
    • getResult

      public String getResult()
      Get the result of the update process.
    • getLatestType

      public String getLatestType()
      Get the latest version's release type (release, beta, or alpha).
    • getLatestGameVersion

      public String getLatestGameVersion()
      Get the latest version's game version.
    • getLatestName

      public String getLatestName()
      Get the latest version's name.
    • getLatestFileLink

      public String getLatestFileLink()
      Get the latest version's file link.
    • waitForThread

      protected void waitForThread()
      As the result of Updater output depends on the thread's completion, it is necessary to wait for the thread to finish before allowing anyone to check the result.
    • isChecking

      public boolean isChecking()
      Determine if we are already checking for an update.
      Returns:
      TRUE if we are, FALSE otherwise.
    • start

      public abstract void start(Updater.UpdateType type)
    • shouldNotify

      public boolean shouldNotify()
    • getRemoteVersion

      public abstract String getRemoteVersion()