Package org.platformlayer.jobs.model

Examples of org.platformlayer.jobs.model.JobDataList


  @Override
  public Object runCommand() throws PlatformLayerClientException {
    PlatformLayerClient client = getPlatformLayerClient();

    JobDataList jobs;
    if (path == null) {
      jobs = client.listJobs();
    } else {
      PlatformLayerKey resolved = path.resolve(getContext());
      jobs = client.listJobs(resolved);
View Full Code Here


    return new SimpleAutoCompleter();
  }

  @Override
  public void formatRaw(Object o, PrintWriter writer) {
    JobDataList jobs = (JobDataList) o;

    switch (getFormat()) {
    case JSON:
      JsonHelper<JobDataList> jsonHelper = JsonHelper.build(JobDataList.class);
      boolean formatted = true;
      try {
        String json = jsonHelper.marshal(jobs, formatted);
        writer.println(json);
        return;
      } catch (IOException e) {
        throw new CliException("Error formatting for output", e);
      }
    }

    Ansi ansi = new Ansi(writer);

    for (JobData job : jobs.getJobs()) {
      // JobState state = job.state;
      // if (state != null) {
      // ansi.setColorBlue();
      // switch (job.state) {
      // case FAILED:
View Full Code Here

      return new AddHostToJob(inner);
    }

    @Override
    public JobDataList apply(final ChildClient child) throws PlatformLayerClientException {
      JobDataList ret = JobDataList.create();
      JobDataList innerJobs = inner.apply(child);
      Iterable<JobData> outerJobs = Iterables.transform(innerJobs.getJobs(), new Function<JobData, JobData>() {
        @Override
        public JobData apply(JobData item) {
          child.setHost(item);
          return item;
        }
View Full Code Here

  @Override
  public JobDataList listJobs(PlatformLayerKey key) throws PlatformLayerClientException {
    String relativePath = buildRelativePath(key) + "/jobs";

    JobDataList jobs = doRequest(HttpMethod.GET, relativePath, JobDataList.class, Format.XML, null, null);
    return jobs;
  }
View Full Code Here

  }

  @Override
  public JobDataList listJobs() throws PlatformLayerClientException {
    String relativePath = "jobs";
    JobDataList jobs = doRequest(HttpMethod.GET, relativePath, JobDataList.class, Format.XML, null, null);

    return jobs;
  }
View Full Code Here

  @Produces({ XML, JSON })
  public JobDataList getActiveJobs() throws OpsException {
    JobQuery jobQuery = JobQuery.build(getProject(), filterTarget);

    List<JobData> jobList = jobRegistry.listRecentJobs(jobQuery);
    JobDataList jobs = JobDataList.create();
    jobs.jobs = Lists.newArrayList();
    for (JobData jobData : jobList) {
      jobs.jobs.add(jobData);
    }
    return jobs;
View Full Code Here

TOP

Related Classes of org.platformlayer.jobs.model.JobDataList

Copyright © 2018 www.massapicom. 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.