public abstract class Updater extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Updater.UpdateResult
Gives the dev the result of the update process.
|
static class |
Updater.UpdateType
Allows the dev to specify the type of update that will be run.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
announce |
protected List<Runnable> |
listeners |
protected org.bukkit.plugin.Plugin |
plugin |
static ReportType |
REPORT_CANNOT_UPDATE_PLUGIN |
protected Updater.UpdateResult |
result |
protected Thread |
thread |
protected Updater.UpdateType |
type |
protected String |
versionFileName |
protected String |
versionGameVersion |
protected String |
versionLink |
protected String |
versionName |
protected String |
versionType |
| Modifier | Constructor and Description |
|---|---|
protected |
Updater(org.bukkit.plugin.Plugin plugin,
Updater.UpdateType type,
boolean announce) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(Runnable listener)
Add a listener to be executed when we have determined if an update is available.
|
static Updater |
create(ProtocolLib protocolLib,
int id,
File file,
Updater.UpdateType type,
boolean announce) |
String |
getLatestFileLink()
Get the latest version's file link.
|
String |
getLatestGameVersion()
Get the latest version's game version.
|
String |
getLatestName()
Get the latest version's name.
|
String |
getLatestType()
Get the latest version's release type (release, beta, or alpha).
|
abstract String |
getRemoteVersion() |
String |
getResult()
Get the result of the update process.
|
boolean |
isChecking()
Determine if we are already checking for an update.
|
boolean |
removeListener(Runnable listener)
Remove a listener.
|
boolean |
shouldNotify() |
abstract void |
start(Updater.UpdateType type) |
boolean |
versionCheck(String title) |
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.
|
protected org.bukkit.plugin.Plugin plugin
protected String versionName
protected String versionLink
protected String versionType
protected String versionGameVersion
protected String versionFileName
protected Updater.UpdateType type
protected boolean announce
protected Thread thread
protected Updater.UpdateResult result
public static final ReportType REPORT_CANNOT_UPDATE_PLUGIN
protected Updater(org.bukkit.plugin.Plugin plugin,
Updater.UpdateType type,
boolean announce)
public boolean versionCheck(String title)
public void addListener(Runnable listener)
The listener will be executed on the main thread.
listener - - the listener to add.public boolean removeListener(Runnable listener)
listener - - the listener to remove.public String getResult()
public String getLatestType()
public String getLatestGameVersion()
public String getLatestName()
public String getLatestFileLink()
protected void waitForThread()
public boolean isChecking()
public static Updater create(ProtocolLib protocolLib, int id, File file, Updater.UpdateType type, boolean announce)
public abstract void start(Updater.UpdateType type)
public boolean shouldNotify()
public abstract String getRemoteVersion()
Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.