Package org.apache.oodt.cas.resource.structs.exceptions

Examples of org.apache.oodt.cas.resource.structs.exceptions.JobRepositoryException


        try {
            jobHash = (Hashtable) client.execute("resourcemgr.getJobInfo",
                    argList);
        } catch (XmlRpcException e) {
            throw new JobRepositoryException(e.getMessage(), e);
        } catch (IOException e) {
            throw new JobRepositoryException(e.getMessage(), e);
        }

        return XmlRpcStructFactory.getJobFromXmlRpc(jobHash);
    }
View Full Code Here


    public int getJobQueueSize() throws JobRepositoryException {
        try {
            Vector argList = new Vector();
            return ((Integer) client.execute("resourcemgr.getJobQueueSize", argList));
        } catch (Exception e) {
            throw new JobRepositoryException("Failed to get JobQueue from server : " + e.getMessage(), e);
        }
    }
View Full Code Here

    public int getJobQueueCapacity() throws JobRepositoryException {
        try {
            Vector argList = new Vector();
            return ((Integer) client.execute("resourcemgr.getJobQueueCapacity", argList));
        } catch (Exception e) {
            throw new JobRepositoryException("Failed to get JobQueue capacity from server : " + e.getMessage(), e);
        }
    }
View Full Code Here

    if (spec.getJob() != null) {
      spec.getJob().setId(jobId);
      jobMap.put(jobId, spec);
      return jobId;
    } else
      throw new JobRepositoryException("Exception persisting job: job is null!");
  }
View Full Code Here

   *
   * @see org.apache.oodt.cas.resource.jobrepo.JobRepository#removeJob(org.apache.oodt.cas.resource.structs.JobSpec)
   */
  public void removeJob(JobSpec spec) throws JobRepositoryException {
    if (jobMap.remove(spec.getJob().getId()) == null) {
      throw new JobRepositoryException("Attempt to remove a job: ["
          + spec.getJob().getId() + "] that is not currently persisted");
    }

  }
View Full Code Here

        FileUtils.forceDelete(new File(jobMap.remove(jobPrecedence.remove(0))));
     
      if (spec.getJob().getId() == null)
          spec.getJob().setId(UUID.randomUUID().toString());
      else if (this.jobMap.containsKey(spec.getJob().getId()))
        throw new JobRepositoryException("JobId '" + spec.getJob().getId() + "' already in use -- must pick unique JobId");
     
      File file = this.generateFilePath(spec.getJob().getId());
      os = new FileOutputStream(file);
        xstream.toXML(spec, os);
        jobMap.put(spec.getJob().getId(), file.getAbsolutePath());
        jobPrecedence.add(spec.getJob().getId());
      return spec.getJob().getId();
    }catch (Exception e) {
      throw new JobRepositoryException("Failed to add job spec to repo : " + e.getMessage(), e);
    }finally {
      try {
        os.close();
      }catch (Exception e) {}
    }
View Full Code Here

      FileInputStream is = null;
    try {
      is = new FileInputStream(new File(this.jobMap.get(jobId)));
        return (JobSpec) xstream.fromXML(is);
    }catch (Exception e) {
      throw new JobRepositoryException("Failed to load job spec from repo by id '" + jobId + "' : " + e.getMessage(), e);
    }finally {
      try {
        is.close();
      }catch (Exception e) {}
    }
View Full Code Here

    try {
      FileUtils.forceDelete(new File(this.jobMap.get(spec.getJob().getId())));
        jobMap.remove(spec.getJob().getId());
        jobPrecedence.remove(spec.getJob().getId());
    }catch (Exception e) {
      throw new JobRepositoryException("Failed to delete job '" + spec.getJob().getId() + "' : " + e.getMessage(), e);
    }
  }
View Full Code Here

    try {
      FileUtils.forceDelete(new File(this.jobMap.get(spec.getJob().getId())));
      os = new FileOutputStream(new File(this.jobMap.get(spec.getJob().getId())));
        xstream.toXML(spec, os);
    }catch (Exception e) {
      throw new JobRepositoryException("Failed to add job spec to repo : " + e.getMessage(), e);
    }finally {
      try {
        os.close();
      }catch (Exception e) {}
    }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.resource.structs.exceptions.JobRepositoryException

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.