public class UpdateManager extends BasicModule
update.frequency
to set new values.
New versions of plugins can be downloaded and installed. However, new server releases should be manually installed.
Constructor and Description |
---|
UpdateManager() |
Modifier and Type | Method and Description |
---|---|
void |
checkForPluginsUpdates(boolean notificationsEnabled)
Queries the igniterealtime.org server.
|
void |
checkForServerUpdate(boolean notificationsEnabled)
Queries the igniterealtime.org server with a request that contains the currently installed
server version.
|
boolean |
downloadPlugin(String url)
Download and install latest version of plugin.
|
String |
getNotificationMessage()
Returns the message to send to admins when new updates are available.
|
List<AvailablePlugin> |
getNotInstalledPlugins()
Returns the list of available plugins, sorted alphabetically, to install as reported by igniterealtime.org.
|
Update |
getPluginUpdate(String pluginName,
Version currentVersion)
Returns the plugin update or
null if the plugin is up to date. |
Collection<Update> |
getPluginUpdates()
Returns a previously fetched list of updates.
|
String |
getProxyHost()
Returns the host of the proxy to use to connect to igniterealtime.org or
null
if no proxy is used. |
int |
getProxyPort()
Returns the port of the proxy to use to connect to igniterealtime.org or -1 if no
proxy is being used.
|
Update |
getServerUpdate()
Returns the server update or
null if the server is up to date. |
void |
initialize(XMPPServer server)
Initializes the basic module.
|
boolean |
isNotificationEnabled()
Returns true if admins should be notified by IM when new updates are available.
|
boolean |
isPluginDownloaded(String url)
Returns true if the plugin downloaded from the specified URL has been downloaded.
|
boolean |
isServiceEnabled()
Returns true if the check for updates service is enabled.
|
boolean |
isUsingProxy()
Returns true if a proxy is being used to connect to igniterealtime.org or false if
a direct connection should be attempted.
|
void |
setNotificationEnabled(boolean enabled)
Sets if admins should be notified by IM when new updates are available.
|
void |
setProxyHost(String host)
Sets the host of the proxy to use to connect to igniterealtime.org or
null
if no proxy is used. |
void |
setProxyPort(int port)
Sets the port of the proxy to use to connect to igniterealtime.org or -1 if no
proxy is being used.
|
void |
setServiceEnabled(boolean enabled)
Sets if the check for updates service is enabled.
|
void |
start()
Starts the basic module.
|
destroy, getName, stop
public void start() throws IllegalStateException
BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start
in interface Module
start
in class BasicModule
IllegalStateException
- If start is called before initialize
successfully returnspublic void initialize(XMPPServer server)
BasicModule
Initializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize
in interface Module
initialize
in class BasicModule
server
- the server hosting this module.public void checkForServerUpdate(boolean notificationsEnabled) throws Exception
notificationsEnabled
- true if admins will be notified when new updates are found.Exception
- if some error happens during the query.public void checkForPluginsUpdates(boolean notificationsEnabled) throws Exception
notificationsEnabled
- true if admins will be notified when new updates are found.Exception
- if some error happens during the query.public boolean downloadPlugin(String url)
url
- the URL of the latest version of the plugin.public boolean isPluginDownloaded(String url)
url
- the URL of the latest version of the plugin.public List<AvailablePlugin> getNotInstalledPlugins()
public String getNotificationMessage()
public boolean isServiceEnabled()
public void setServiceEnabled(boolean enabled)
enabled
- true if the check for updates service is enabled.public boolean isNotificationEnabled()
public void setNotificationEnabled(boolean enabled)
enabled
- true if admins should be notified by IM when new updates are available.public boolean isUsingProxy()
public String getProxyHost()
null
if no proxy is used.public void setProxyHost(String host)
null
if no proxy is used.host
- the host of the proxy or null if no proxy is used.public int getProxyPort()
public void setProxyPort(int port)
port
- the port of the proxy to use to connect to igniterealtime.org or -1 if no
proxy is being used.public Update getServerUpdate()
null
if the server is up to date.public Update getPluginUpdate(String pluginName, Version currentVersion)
null
if the plugin is up to date.pluginName
- the name of the plugin (as described in the meta-data).currentVersion
- current version of the plugin that is installed.public Collection<Update> getPluginUpdates()
Copyright © 2003–2020 Ignite Realtime. All rights reserved.