public DownloadStatus installPlugin(String username, String url, String version, int hashCode) {

        UpdateManager updateManager = XMPPServer.getInstance().getUpdateManager();

        boolean worked = updateManager.downloadPlugin(url);

        if (worked) {
            final String name = url.substring(url.lastIndexOf('/') + 1);
            SecurityAuditManager.getInstance().logEvent(username, "downloaded plugin " + name, "Downloaded from: " + url);
        }

        final DownloadStatus status = new DownloadStatus();
        status.setHashCode(hashCode);
        status.setVersion(version);
        status.setSuccessfull(worked);
        status.setUrl(url);

        return status;
    }
Installs a new plugin into Openfire.

@param username The user that triggered the install.
@param url the url of the plugin to install.
@param version the version of the new plugin
@param hashCode the matching hashcode of the <code>AvailablePlugin</code>.
@return the hashCode.
xmppserver/src/main/java/org/jivesoftware/openfire/update/PluginDownloadManager.java