Commit ca60a47c authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Initial version. JM-715

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3981 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3b72d830
package org.jivesoftware.wildfire.update;
/**
* Information about an available plugin (i.e. not installed). The information was obtained
* from jivesoftware.org after executing
* {@link org.jivesoftware.wildfire.update.UpdateManager#getAvailablePlugins()}.
*
* @author Gaston Dombiak
*/
public class AvailablePlugin {
/**
* Name of the plugin.
*/
private String name;
/**
* Latest version of the plugin that was found.
*/
private String latestVersion;
/**
* URL from where the latest version of the plugin can be downloaded.
*/
private String url;
/**
* Icon's URL of the latest version of the plugin.
*/
private String icon;
/**
* README URL of the latest version of the plugin.
*/
private String readme;
/**
* Changelog URL of the latest version of the plugin.
*/
private String changelog;
/**
* Flag that indicates whether the plugin is commercial or not.
*/
private boolean commercial;
/**
* Description of the plugin as specified in plugin.xml.
*/
private String description;
/**
* Author of the plugin as specified in plugin.xml.
*/
private String author;
/**
* Minimum server version required by this plugin as specified in plugin.xml.
*/
private String minServerVersion;
public AvailablePlugin(String name, String description, String latestVersion, String author,
String icon, String changelog, String readme, boolean commercial,
String minServerVersion, String url) {
this.author = author;
this.icon = icon;
this.changelog = changelog;
this.readme = readme;
this.commercial = commercial;
this.description = description;
this.latestVersion = latestVersion;
this.minServerVersion = minServerVersion;
this.name = name;
this.url = url;
}
/**
* Returns the name of the plugin that is not installed.
*
* @return the name of the plugin that is not installed.
*/
public String getName() {
return name;
}
/**
* Returns the latest version of the plugin that is not installed.
*
* @return the latest version of the plugin that is not installed.
*/
public String getLatestVersion() {
return latestVersion;
}
/**
* Return the icon's URL of the latest version of the plugin.
*
* @return the icon's URL of the latest version of the plugin.
*/
public String getIcon() {
return icon;
}
/**
* Returns the URL to the README file of the latest version of the plugin.
*
* @return the URL to the README file of the latest version of the plugin.
*/
public String getReadme() {
return readme;
}
/**
* Returns the URL to the change log of the plugin.
*
* @return the URL to the change log of the plugin.
*/
public String getChangelog() {
return changelog;
}
/**
* Returns the URL from where the plugin.
*
* @return the URL from where the plugin.
*/
public String getURL() {
return url;
}
/**
* Returns the author of the plugin as specified in plugin.xml.
*
* @return author of the plugin as specified in plugin.xml.
*/
public String getAuthor() {
return author;
}
/**
* Returns true if the plugin is commercial.
*
* @return true if the plugin is commercial.
*/
public boolean isCommercial() {
return commercial;
}
/**
* Returns the description of the plugin as specified in plugin.xml.
*
* @return description of the plugin as specified in plugin.xml.
*/
public String getDescription() {
return description;
}
/**
* Returns the minimum server version required by this plugin as specified in plugin.xml.
*
* @return minimum server version required by this plugin as specified in plugin.xml.
*/
public String getMinServerVersion() {
return minServerVersion;
}
}
package org.jivesoftware.wildfire.update;
/**
* An Update represents a component that needs to be updated. By component we can refer
* to the Wildfire server itself or to any of the installed plugins.
*
* @author Gaston Dombiak
*/
public class Update {
/**
* Name of the component that is outdated. The name could be of the server
* (i.e. "Wildfire") or of installed plugins.
*/
private String componentName;
/**
* Latest version of the component that was found.
*/
private String latestVersion;
/**
* URL from where the latest version of the component can be downloaded.
*/
private String url;
/**
* Changelog URL of the latest version of the component.
*/
private String changelog;
/**
* Flag that indicates if the plugin was downloaded. This flag only makes sense for
* plugins since we currently do not support download new wildfire releases.
*/
private boolean downloaded;
public Update(String componentName, String latestVersion, String changelog, String url) {
this.componentName = componentName;
this.latestVersion = latestVersion;
this.changelog = changelog;
this.url = url;
}
/**
* Returns the name of the component that is outdated. When the server is the
* outdated component then a "Wildfire" will be returned. Otherwise, the name of
* the outdated plugin is returned.
*
* @return the name of the component that is outdated.
*/
public String getComponentName() {
return componentName;
}
/**
* Returns the latest version of the component that was found.
*
* @return the latest version of the component that was found.
*/
public String getLatestVersion() {
return latestVersion;
}
/**
* Returns the URL to the change log of the latest version of the component.
*
* @return the URL to the change log of the latest version of the component.
*/
public String getChangelog() {
return changelog;
}
/**
* Returns the URL from where the latest version of the component can be downloaded.
*
* @return the URL from where the latest version of the component can be downloaded.
*/
public String getURL() {
return url;
}
/**
* Returns true if this update means that the server needs to be updated. When false
* then it means that a plugin needs to be updated.
*
* @return true if this update means that the server needs to be updated.
*/
public boolean isServer() {
return "Wildfire".equals(componentName);
}
/**
* Returns true if the plugin was downloaded. Once a plugin has been downloaded
* it may take a couple of seconds to be installed. This flag only makes sense for
* plugins since we currently do not support download new wildfire releases.
*
* @return true if the plugin was downloaded.
*/
public boolean isDownloaded() {
return downloaded;
}
/**
* Sets if the plugin was downloaded. Once a plugin has been downloaded
* it may take a couple of seconds to be installed. This flag only makes sense for
* plugins since we currently do not support download new wildfire releases.
*
* @param downloaded true if the plugin was downloaded.
*/
public void setDownloaded(boolean downloaded) {
this.downloaded = downloaded;
}
}
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<p>Classes that provide the "check for update" service or the "get available plugins" service.</p>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment