exposed data about installed plugins, installable plugins, update center jobs, etc., to the REST API

This commit is contained in:
Kohsuke Kawaguchi committed 2012-05-21 16:59:24 -07:00
1 parent 5dd512973d
commit 76832379d8
5 files changed
+101 -6

No files matched your search

+13 -1
View File
@@ -29,6 +29,7 @@ import hudson.init.InitStrategy;
import hudson.init.InitializerFinder;
import hudson.model.AbstractModelObject;
import hudson.model.AdministrativeMonitor;
import hudson.model.Api;
import hudson.model.Descriptor;
import hudson.model.Failure;
import hudson.model.UpdateCenter;
@@ -60,6 +61,8 @@ import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -93,6 +96,7 @@ import static hudson.init.InitMilestone.*;
*
* @author Kohsuke Kawaguchi
*/
@ExportedBean
public abstract class PluginManager extends AbstractModelObject {
/**
* All discovered plugins.
@@ -157,6 +161,10 @@ public abstract class PluginManager extends AbstractModelObject {
strategy = createPluginStrategy();
}
public Api getApi() {
return new Api(this);
}
/**
* Called immediately after the construction.
* This is a separate method so that code executed from here will see a valid value in
@@ -496,7 +504,11 @@ public abstract class PluginManager extends AbstractModelObject {
public boolean isPluginUploaded() {
return pluginUploaded;
}
/**
* All discovered plugins.
*/
@Exported
public List<PluginWrapper> getPlugins() {
return plugins;
}