Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.update
Class UpdateManager

    java.lang.Object
      org.jivesoftware.openfire.container.BasicModule
          org.jivesoftware.openfire.update.UpdateManager

All Implemented Interfaces:
  Module

    public class UpdateManager

extends BasicModule

Service that frequently checks for new server or plugins releases. By default the service will check every 48 hours for updates. Use the system property `update.frequency` to set new values.

New versions of plugins can be downloaded and installed. However, new server releases should be manually installed.

Author:
  Gaston Dombiak

Field Summary
`protected static org.dom4j.DocumentFactory` | `docFactory`

Constructor Summary
`UpdateManager()`

Method Summary
`void` | `checkForPluginsUpdates(boolean notificationsEnabled)`
`void` | `checkForServerUpdate(boolean notificationsEnabled)` Queries the igniterealtime.org server for new server and plugin updates.
`boolean` | `downloadPlugin(String url)` Download and install latest version of plugin.
`int` | `getCheckFrequency()` Returns the frequency to check for updates.
`String` | `getNotificationMessage()` Returns the message to send to admins when new updates are available.
`List<AvailablePlugin>` | `getNotInstalledPlugins()` Returns the list of available plugins to install as reported by igniterealtime.org.
`Update` | `getPluginUpdate(String pluginName, String 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` | `setCheckFrequency(int checkFrequency)` Sets the frequency to check for updates.
`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.

Methods inherited from class org.jivesoftware.openfire.container.BasicModule
`destroy, getName, stop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### docFactory

    protected static org.dom4j.DocumentFactory docFactory

Constructor Detail

### UpdateManager

    public UpdateManager()

Method Detail

### start

    public void start()
               throws IllegalStateException

  Description copied from class: `BasicModule`

  Starts the basic module.

  Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.

  Specified by:
    `start` in interface `Module`
  Overrides:
    `start` in class `BasicModule`
  Throws:
    `IllegalStateException` - If start is called before initialize successfully returns

### initialize

    public void initialize(XMPPServer server)

  Description copied from class: `BasicModule`

  Initializes the basic module.

  Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

  Specified by:
    `initialize` in interface `Module`
  Overrides:
    `initialize` in class `BasicModule`
  Parameters:
    `server` - the server hosting this module.

### checkForServerUpdate

    public void checkForServerUpdate(boolean notificationsEnabled)
                              throws Exception

  Queries the igniterealtime.org server for new server and plugin updates.

  Parameters:
    `notificationsEnabled` - true if admins will be notified when new updates are found.
  Throws:
    `Exception` - if some error happens during the query.

### checkForPluginsUpdates

    public void checkForPluginsUpdates(boolean notificationsEnabled)
                                throws Exception

  Throws:
    `Exception`

### downloadPlugin

    public boolean downloadPlugin(String url)

  Download and install latest version of plugin.

  Parameters:
    `url` - the URL of the latest version of the plugin.
  Returns:
    true if the plugin was successfully downloaded and installed.

### isPluginDownloaded

    public boolean isPluginDownloaded(String url)

  Returns true if the plugin downloaded from the specified URL has been downloaded. Plugins may be downloaded but not installed. The install process may take like 30 seconds to detect new plugins to install.

  Parameters:
    `url` - the URL of the latest version of the plugin.
  Returns:
    true if the plugin downloaded from the specified URL has been downloaded.

### getNotInstalledPlugins

    public List<AvailablePlugin> getNotInstalledPlugins()

  Returns the list of available plugins to install as reported by igniterealtime.org. Currently installed plugins will not be included or plugins that require a newer server version.

  Returns:
    the list of available plugins to install as reported by igniterealtime.org.

### getNotificationMessage

    public String getNotificationMessage()

  Returns the message to send to admins when new updates are available. When sending this message information about the new updates avaiable will be appended.

  Returns:
    the message to send to admins when new updates are available.

### isServiceEnabled

    public boolean isServiceEnabled()

  Returns true if the check for updates service is enabled.

  Returns:
    true if the check for updates service is enabled.

### setServiceEnabled

    public void setServiceEnabled(boolean enabled)

  Sets if the check for updates service is enabled.

  Parameters:
    `enabled` - true if the check for updates service is enabled.

### isNotificationEnabled

    public boolean isNotificationEnabled()

  Returns true if admins should be notified by IM when new updates are available.

  Returns:
    true if admins should be notified by IM when new updates are available.

### setNotificationEnabled

    public void setNotificationEnabled(boolean enabled)

  Sets if admins should be notified by IM when new updates are available.

  Parameters:
    `enabled` - true if admins should be notified by IM when new updates are available.

### getCheckFrequency

    public int getCheckFrequency()

  Returns the frequency to check for updates. By default, this will happen every 48 hours. The frequency returned will never be less than 12 hours.

  Returns:
    the frequency to check for updates in hours.

### setCheckFrequency

    public void setCheckFrequency(int checkFrequency)

  Sets the frequency to check for updates. By default, this will happen every 48 hours.

  Parameters:
    `checkFrequency` - the frequency to check for updates.

### isUsingProxy

    public boolean isUsingProxy()

  Returns true if a proxy is being used to connect to igniterealtime.org or false if a direct connection should be attempted.

  Returns:
    true if a proxy is being used to connect to igniterealtime.org.

### getProxyHost

    public String getProxyHost()

  Returns the host of the proxy to use to connect to igniterealtime.org or `null` if no proxy is used.

  Returns:
    the host of the proxy or null if no proxy is used.

### setProxyHost

    public void setProxyHost(String host)

  Sets the host of the proxy to use to connect to igniterealtime.org or `null` if no proxy is used.

  Parameters:
    `host` - the host of the proxy or null if no proxy is used.

### getProxyPort

    public int getProxyPort()

  Returns the port of the proxy to use to connect to igniterealtime.org or -1 if no proxy is being used.

  Returns:
    the port of the proxy to use to connect to igniterealtime.org or -1 if no proxy is being used.

### setProxyPort

    public 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.

  Parameters:
    `port` - the port of the proxy to use to connect to igniterealtime.org or -1 if no proxy is being used.

### getServerUpdate

    public Update getServerUpdate()

  Returns the server update or `null` if the server is up to date.

  Returns:
    the server update or null if the server is up to date.

### getPluginUpdate

    public Update getPluginUpdate(String pluginName,
                                  String currentVersion)

  Returns the plugin update or `null` if the plugin is up to date.

  Parameters:
    `pluginName` - the name of the plugin (as described in the meta-data).
    `currentVersion` - current version of the plugin that is installed.
  Returns:
    the plugin update or null if the plugin is up to date.

### getPluginUpdates

    public Collection<Update> getPluginUpdates()

  Returns a previously fetched list of updates.

  Returns:
    a previously fetched list of updates.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.