Examples of JobInfo


Examples of com.sforce.async.JobInfo

    return job;
  }

  public void closeJob(BulkConnection connection, String jobId)
      throws AsyncApiException {
    JobInfo job = new JobInfo();
    job.setId(jobId);
    job.setState(JobStateEnum.Closed);
    connection.updateJob(job);
  }
View Full Code Here

Examples of com.sforce.async.JobInfo

    String getJobId() {
        return this.jobInfo.getId();
    }

    void createJob(Config cfg) throws AsyncApiException {
        JobInfo job = new JobInfo();
        final OperationEnum op = cfg.getOperationInfo().getOperationEnum();
        job.setOperation(op);
        if (op == OperationEnum.upsert) {
            job.setExternalIdFieldName(cfg.getString(Config.EXTERNAL_ID_FIELD));
        }
        job.setObject(cfg.getString(Config.ENTITY));
        job.setContentType(cfg.getBoolean(Config.BULK_API_ZIP_CONTENT) && op != OperationEnum.query ? ContentType.ZIP_CSV
                : ContentType.CSV);
        job.setConcurrencyMode(cfg.getBoolean(Config.BULK_API_SERIAL_MODE) ? ConcurrencyMode.Serial
                : ConcurrencyMode.Parallel);

        if (op == OperationEnum.update || op == OperationEnum.upsert || op == OperationEnum.insert) {
            final String assRule = cfg.getString(Config.ASSIGNMENT_RULE);
            if (assRule != null && (assRule.length() == 15 || assRule.length() == 18)) {
                job.setAssignmentRuleId(assRule);
            }
        }
        job = this.client.createJob(job);
        logger.info(Messages.getMessage(getClass(), "logJobCreated", job.getId()));
        this.jobInfo = job;
    }
View Full Code Here

Examples of com.sun.grid.jam.job.entry.JobInfo

    } else {
      Transaction txn = null;
      try {
        txn = createTransaction(10 * 1000);
        try {
          JobInfo info = new JobInfo(appParams.getName(),
                                     JobType.BATCH,
                                     name, userProperties.getLogin(),
                                     userProperties.getLogin(),
                                     new Random().nextInt());
          JobParams jp = new JobParams(info, -1,
View Full Code Here

Examples of com.sun.grid.jam.job.entry.JobInfo

  private static void emptyJobRepository(RMServer server)
  {
    try {
      Entry entry;
      Object ob;
      entry = new JobInfo();
      do {
        ob = server.space.take(entry, null,
                               JavaSpace.NO_WAIT);
      } while(ob != null);
      entry = new JobParams();
View Full Code Here

Examples of com.sun.grid.jam.job.entry.JobInfo

    try {
      txn = createTransaction(5 * 1000);
      try {
        jce = (JobControlEntry)
          space.takeIfExists(entry, txn, JavaSpace.NO_WAIT);
        JobInfo ji = jce.jobInfo;
        JobParams jp = (JobParams)
          space.takeIfExists(new JobParams(ji),
                     txn, JavaSpace.NO_WAIT);
        if(jp != null) {
          if(jp.submissionID != null) {
View Full Code Here

Examples of com.sun.grid.jam.job.entry.JobInfo

    displayJobInfo();
  }

  private void displayJobInfo()
  {
    JobInfo ji = jobService.getJobInfo();
    name.setText(ji.name);
    type.setText(ji.type.toString());
    userID.setText(ji.userID);
    groupID.setText(ji.groupID);
    queueName.setText(ji.queueName);
View Full Code Here

Examples of gri.tasks.managers.JobInfo

     
      JobInfo [] jobInfos = new JobInfo[wkfl.getTaskCount()];
      Iterator iTaskStubs = wkfl.taskStubs();
      for (int i=0; i<jobInfos.length; i++) {
        TaskStub stub = (TaskStub)iTaskStubs.next();
        jobInfos[i] = new JobInfo(stub.getId(), stub.getTaskId());
      }
     
      this.wkflInfo = new WorkflowInfo(id, jobInfos);
    }
View Full Code Here

Examples of it.eng.spagobi.tools.scheduler.to.JobInfo

   * @param jobDetSB the job det sb
   *
   * @return the job info from job source bean
   */
  public static JobInfo getJobInfoFromJobSourceBean(SourceBean jobDetSB) {
    JobInfo jobInfo = new JobInfo();
    try{
      List biobjects = new ArrayList();
      String jobNameRecovered = (String)jobDetSB.getAttribute("jobName");
      String jobDescriptionRecovered = (String)jobDetSB.getAttribute("jobDescription");
      String jobGroupNameRecovered = (String)jobDetSB.getAttribute("jobGroupName");
      jobInfo.setJobName(jobNameRecovered);
      jobInfo.setJobDescription(jobDescriptionRecovered);
      jobInfo.setJobGroupName(jobGroupNameRecovered);
      // set all documents and parameters
      SourceBean jobParSB = (SourceBean)jobDetSB.getAttribute("JOB_PARAMETERS");
      if(jobParSB!=null) {
        IBIObjectDAO biobjdao = DAOFactory.getBIObjectDAO();
        IBIObjectParameterDAO biobjpardao = DAOFactory.getBIObjectParameterDAO();
        SourceBean docLblSB = (SourceBean)jobParSB.getFilteredSourceBeanAttribute("JOB_PARAMETER", "name", "documentLabels");
        String docLblStr = (String)docLblSB.getAttribute("value");
        String[] docLbls = docLblStr.split(",");
        for(int i=0; i<docLbls.length; i++) {
          //BIObject biobj = biobjdao.loadBIObjectByLabel(docLbls[i]);
          BIObject biobj = biobjdao.loadBIObjectByLabel(docLbls[i].substring(0, docLbls[i].indexOf("__")));
          List biobjpars = biobjpardao.loadBIObjectParametersById(biobj.getId());
          biobj.setBiObjectParameters(biobjpars);
          String biobjlbl = biobj.getLabel() + "__" + (i+1);
          SourceBean queryStringSB = (SourceBean)jobParSB.getFilteredSourceBeanAttribute("JOB_PARAMETER", "name", biobjlbl);
          SourceBean iterativeSB = (SourceBean)jobParSB.getFilteredSourceBeanAttribute("JOB_PARAMETER", "name", biobjlbl + "_iterative");
          List iterativeParameters = new ArrayList();
          if (iterativeSB != null) {
            String iterativeParametersStr = (String) iterativeSB.getAttribute("value");
            String[] iterativeParametersArray = iterativeParametersStr.split(";");
            iterativeParameters.addAll(Arrays.asList(iterativeParametersArray));
          }
          SourceBean loadAtRuntimeSB = (SourceBean)jobParSB.getFilteredSourceBeanAttribute("JOB_PARAMETER", "name", biobjlbl + "_loadAtRuntime");
          Map<String, String> loadAtRuntimeParameters = new HashMap<String, String>();
          if (loadAtRuntimeSB != null) {
            String loadAtRuntimeStr = (String) loadAtRuntimeSB.getAttribute("value");
            String[] loadAtRuntimeArray = loadAtRuntimeStr.split(";");
            for (int count = 0; count < loadAtRuntimeArray.length; count++) {
              String loadAtRuntime = loadAtRuntimeArray[count];
              int parameterUrlNameIndex = loadAtRuntime.lastIndexOf("(");
              String parameterUrlName = loadAtRuntime.substring(0, parameterUrlNameIndex);
              String userAndRole = loadAtRuntime.substring(parameterUrlNameIndex + 1, loadAtRuntime.length() - 1);
              loadAtRuntimeParameters.put(parameterUrlName, userAndRole);
            }
          }
          SourceBean useFormulaSB = (SourceBean)jobParSB.getFilteredSourceBeanAttribute("JOB_PARAMETER", "name", biobjlbl + "_useFormula");
          Map<String, String> useFormulaParameters = new HashMap<String, String>();
          if (useFormulaSB != null) {
            String useFormulaStr = (String) useFormulaSB.getAttribute("value");
            String[] useFormulaArray = useFormulaStr.split(";");
            for (int count = 0; count < useFormulaArray.length; count++) {
              String useFormula = useFormulaArray[count];
              int parameterUrlNameIndex = useFormula.lastIndexOf("(");
              String parameterUrlName = useFormula.substring(0, parameterUrlNameIndex);
              String fName = useFormula.substring(parameterUrlNameIndex + 1, useFormula.length() - 1);
              useFormulaParameters.put(parameterUrlName, fName);
            }
          }
         
          String queryString = (String)queryStringSB.getAttribute("value");
          String[] parCouples = queryString.split("%26");
          Iterator iterbiobjpar = biobjpars.iterator();
          while(iterbiobjpar.hasNext()) {
            BIObjectParameter biobjpar = (BIObjectParameter)iterbiobjpar.next();
            if (iterativeParameters.contains(biobjpar.getParameterUrlName())) {
              biobjpar.setIterative(true);
            } else {
              biobjpar.setIterative(false);
            }
            if (loadAtRuntimeParameters.containsKey(biobjpar.getParameterUrlName())) {
              RuntimeLoadingParameterValuesRetriever strategy = new RuntimeLoadingParameterValuesRetriever();
              String userRoleStr = loadAtRuntimeParameters.get(biobjpar.getParameterUrlName());
              String[] userRole = userRoleStr.split("\\|");
              strategy.setUserIndentifierToBeUsed(userRole[0]);
              strategy.setRoleToBeUsed(userRole[1]);
              biobjpar.setParameterValuesRetriever(strategy);
            } else if (useFormulaParameters.containsKey(biobjpar.getParameterUrlName())) {
              FormulaParameterValuesRetriever strategy = new FormulaParameterValuesRetriever();
              String fName = useFormulaParameters.get(biobjpar.getParameterUrlName());
              Formula f = Formula.getFormula(fName);
              strategy.setFormula(f);
              biobjpar.setParameterValuesRetriever(strategy);
            } else {
              for(int j=0; j<parCouples.length; j++) {
                String parCouple = parCouples[j];
                String[] parDef = parCouple.split("=");
                if(biobjpar.getParameterUrlName().equals(parDef[0])){
                  String parameterValues = parDef[1];
                  String[] valuesArr = parameterValues.split(";");
                  List values = Arrays.asList(valuesArr);
                  biobjpar.setParameterValues(values);
                  break;
                }
              }
            }
          }
          // calculate parameter
          biobjects.add(biobj);
        }
        jobInfo.setBiobjects(biobjects);
      }
    } catch (Exception e) {
      SpagoBITracer.major(SpagoBIConstants.NAME_MODULE, SchedulerUtilities.class.getName(),
                      "getJobInfoFromJobSourceBean", "Error while extracting job info from xml", e);
    }
View Full Code Here

Examples of jmt.engine.QueueNet.JobInfo

      }
    }

    //print
    ListIterator iterator = list.getJobList().listIterator();
    JobInfo current = null;
    String className;
    int classPr, jobID;

    String strategyType = "";

    switch (strategy) {
      case STRATEGY_HEAD:
        strategyType = "HEAD";
        break;
      case STRATEGY_TAIL:
        strategyType = "TAIL";
        break;
      case STRATEGY_HEAD_PRIORITY:
        strategyType = "HEAD_PR";
        break;
      case STRATEGY_TAIL_PRIORITY:
        strategyType = "TAIL_PR";
        break;
    }

    System.out.println(strategyType);

    //iterator starts from the first (i.e. the job with highest priority)
    while (iterator.hasNext()) {
      current = (JobInfo) iterator.next();

      jobID = current.getJob().getId();
      className = current.getJob().getJobClass().getName();
      classPr = current.getJob().getJobClass().getPriority();

      System.out.println("Job: " + jobID + " Class: " + className + " Priority: " + classPr);

    }
View Full Code Here

Examples of org.apache.camel.component.salesforce.api.dto.bulk.JobInfo

        // make the call and parse the result in callback
        doHttpRequest(post, new ClientResponseCallback() {
            @Override
            public void onResponse(InputStream response, SalesforceException ex) {
                JobInfo value = null;
                if (response != null) {
                    try {
                        value = unmarshalResponse(response, post, JobInfo.class);
                    } catch (SalesforceException e) {
                        ex = e;
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.