congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MainView
Code IndexAdd Tabnine to your IDE (free)

How to use
MainView
in
com.offbytwo.jenkins.model

Best Java code snippets using com.offbytwo.jenkins.model.MainView (Showing top 4 results out of 315)

origin: Verigreen/verigreen

/**
 * Get a list of all the defined jobs on the server (at the summary level)
 *
 * @return list of defined jobs (summary level, for details @see Job#details
 * @throws IOException
 */
public Map<String, Job> getJobs() throws IOException {
  List<Job> jobs = client.get("/", MainView.class).getJobs();
  return Maps.uniqueIndex(jobs, new Function<Job, String>() {
    @Override
    public String apply(Job job) {
      job.setClient(client);
      return job.getName().toLowerCase();
    }
  });
}
origin: Verigreen/verigreen

  @Test
  public void defaultConstructorShouldInitializeWithEmptyJobs() {
    MainView mainView = new MainView();
    assertNotNull(mainView.getJobs());
    assertEquals(0, mainView.getJobs().size());
  }
}
origin: com.offbytwo.jenkins/jenkins-client

/**
 * Get a list of all the defined views on the server (at the summary level
 * and in the given folder)
 * 
 * @param folder {@link FolderJob}
 * @return list of defined views
 * @throws IOException in case of an error.
 */
public Map<String, View> getViews(FolderJob folder) throws IOException {
  // This is much better than using &depth=2
  // http://localhost:8080/api/json?pretty&tree=views[name,url,jobs[name,url]]
  List<View> views = client.get(UrlUtils.toBaseUrl(folder) + "?tree=views[name,url,jobs[name,url]]", MainView.class).getViews();
  return Maps.uniqueIndex(views, new Function<View, String>() {
    @Override
    public String apply(View view) {
      view.setClient(client);
      // TODO: Think about the following? Does there exists a
      // simpler/more elegant method?
      for (Job job : view.getJobs()) {
        job.setClient(client);
      }
      for (View item : view.getViews()) {
        item.setClient(client);
      }
      return view.getName();
    }
  });
}
origin: com.offbytwo.jenkins/jenkins-client

/**
 * Get a list of all the defined jobs on the server (at the specified view
 * level and in the specified folder)
 * 
 * @param folder {@link FolderJob}
 * @param view The view to use.
 * @return list of defined jobs (view level, for details @see Job#details
 * @throws IOException in case of an error.
 */
public Map<String, Job> getJobs(FolderJob folder, String view) throws IOException {
  String path = UrlUtils.toBaseUrl(folder);
  Class<? extends MainView> viewClass = MainView.class;
  if (view != null) {
    path = path + "view/" + EncodingUtils.encode(view) + "/";
    viewClass = View.class;
  }
  List<Job> jobs = client.get(path, viewClass).getJobs();
  return Maps.uniqueIndex(jobs, new Function<Job, String>() {
    @Override
    public String apply(Job job) {
      job.setClient(client);
      return job.getName();
    }
  });
}
com.offbytwo.jenkins.modelMainView

Most used methods

  • getJobs
  • <init>
  • getViews

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now