Examples of UpdateCenter


Examples of hudson.model.UpdateCenter

    public HttpResponse doUpdateSources(StaplerRequest req) throws IOException {
        Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);

        if (req.hasParameter("remove")) {
            UpdateCenter uc = Jenkins.getInstance().getUpdateCenter();
            BulkChange bc = new BulkChange(uc);
            try {
                for (String id : req.getParameterValues("sources"))
                    uc.getSites().remove(uc.getById(id));
            } finally {
                bc.commit();
            }
        } else
        if (req.hasParameter("add"))
View Full Code Here

Examples of hudson.model.UpdateCenter

     * Bare-minimum configuration mechanism to change the update center.
     */
    public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException {
        Jenkins hudson = Jenkins.getInstance();
        hudson.checkPermission(Jenkins.ADMINISTER);
        UpdateCenter uc = hudson.getUpdateCenter();
        PersistedList<UpdateSite> sites = uc.getSites();
        for (UpdateSite s : sites) {
            if (s.getId().equals("default"))
                sites.remove(s);
        }
        sites.add(new UpdateSite("default",site));
View Full Code Here

Examples of hudson.model.UpdateCenter

     * @return
     *      This method may return null &mdash; for example,
     *      the user may have installed a plugin locally developed.
     */
    public UpdateSite.Plugin getUpdateInfo() {
        UpdateCenter uc = Jenkins.getInstance().getUpdateCenter();
        UpdateSite.Plugin p = uc.getPlugin(getShortName());
        if(p!=null && p.isNewerThan(getVersion())) return p;
        return null;
    }
View Full Code Here

Examples of hudson.model.UpdateCenter

   
    /**
     * returns the {@link UpdateSite.Plugin} object, or null.
     */
    public UpdateSite.Plugin getInfo() {
        UpdateCenter uc = Jenkins.getInstance().getUpdateCenter();
        return uc.getPlugin(getShortName());
    }
View Full Code Here

Examples of hudson.model.UpdateCenter

     * @return
     *      This method may return null &mdash; for example,
     *      the user may have installed a plugin locally developed.
     */
    public UpdateSite.Plugin getUpdateInfo() {
        UpdateCenter uc = Hudson.getInstance().getUpdateCenter();
        UpdateSite.Plugin p = uc.getPlugin(getShortName());
        if(p!=null && p.isNewerThan(getVersion())) return p;
        return null;
    }
View Full Code Here

Examples of hudson.model.UpdateCenter

   
    /**
     * returns the {@link UpdateSite.Plugin} object, or null.
     */
    public UpdateSite.Plugin getInfo() {
        UpdateCenter uc = Hudson.getInstance().getUpdateCenter();
        return uc.getPlugin(getShortName());
    }
View Full Code Here

Examples of hudson.model.UpdateCenter

    public HttpResponse doUpdateSources(StaplerRequest req) throws IOException {
        Hudson.getInstance().checkPermission(Hudson.ADMINISTER);

        if (req.hasParameter("remove")) {
            UpdateCenter uc = Hudson.getInstance().getUpdateCenter();
            BulkChange bc = new BulkChange(uc);
            try {
                for (String id : req.getParameterValues("sources"))
                    uc.getSites().remove(uc.getById(id));
            } finally {
                bc.commit();
            }
        } else
        if (req.hasParameter("add"))
View Full Code Here

Examples of hudson.model.UpdateCenter

     * Bare-minimum configuration mechanism to change the update center.
     */
    public HttpResponse doSiteConfigure(@QueryParameter String site) throws IOException {
        Hudson hudson = Hudson.getInstance();
        hudson.checkPermission(Hudson.ADMINISTER);
        UpdateCenter uc = hudson.getUpdateCenter();
        PersistedList<UpdateSite> sites = uc.getSites();
        for (UpdateSite s : sites) {
            if (s.getId().equals("default"))
                sites.remove(s);
        }
        sites.add(new UpdateSite("default",site));
View Full Code Here

Examples of org.sonar.updatecenter.common.UpdateCenter

  }

  @Test
  public void downloadUpdateCenter() throws URISyntaxException {
    when(reader.readString(new URI(BASE_URL), Charsets.UTF_8)).thenReturn("publicVersions=2.2,2.3");
    UpdateCenter plugins = client.getUpdateCenter();
    verify(reader, times(1)).readString(new URI(BASE_URL), Charsets.UTF_8);
    assertThat(plugins.getSonar().getVersions()).containsOnly(Version.create("2.2"), Version.create("2.3"));
    assertThat(client.getLastRefreshDate()).isNotNull();
  }
View Full Code Here

Examples of org.sonar.updatecenter.common.UpdateCenter

    this.installedPluginReferentialFactory = installedPluginReferentialFactory;
    this.sonarVersion = Version.create(server.getVersion());
  }

  public UpdateCenter getUpdateCenter(boolean refreshUpdateCenter) {
    UpdateCenter updatePluginCenter = centerClient.getUpdateCenter(refreshUpdateCenter);
    if (updatePluginCenter != null) {
      return updatePluginCenter.setInstalledSonarVersion(sonarVersion).registerInstalledPlugins(
        installedPluginReferentialFactory.getInstalledPluginReferential())
        .setDate(centerClient.getLastRefreshDate());
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.