Examples of Job


Examples of com.microsoft.windowsazure.scheduler.models.Job

            if (responseContent == null == false) {
                responseDoc = objectMapper.readTree(responseContent);
            }
           
            if (responseDoc != null) {
                Job jobInstance = new Job();
                result.setJob(jobInstance);
               
                JsonNode idValue = responseDoc.get("id");
                if (idValue != null) {
                    String idInstance;
                    idInstance = idValue.getTextValue();
                    jobInstance.setId(idInstance);
                }
               
                JsonNode startTimeValue = responseDoc.get("startTime");
                if (startTimeValue != null) {
                    Calendar startTimeInstance;
                    startTimeInstance = DatatypeConverter.parseDateTime(startTimeValue.getTextValue());
                    jobInstance.setStartTime(startTimeInstance);
                }
               
                JsonNode actionValue2 = responseDoc.get("action");
                if (actionValue2 != null) {
                    JobAction actionInstance = new JobAction();
                    jobInstance.setAction(actionInstance);
                   
                    JsonNode typeValue = actionValue2.get("type");
                    if (typeValue != null) {
                        JobActionType typeInstance;
                        typeInstance = SchedulerClientImpl.parseJobActionType(typeValue.getTextValue());
                        actionInstance.setType(typeInstance);
                    }
                   
                    JsonNode retryPolicyValue2 = actionValue2.get("retryPolicy");
                    if (retryPolicyValue2 != null) {
                        RetryPolicy retryPolicyInstance = new RetryPolicy();
                        actionInstance.setRetryPolicy(retryPolicyInstance);
                       
                        JsonNode retryTypeValue = retryPolicyValue2.get("retryType");
                        if (retryTypeValue != null) {
                            RetryType retryTypeInstance;
                            retryTypeInstance = SchedulerClientImpl.parseRetryType(retryTypeValue.getTextValue());
                            retryPolicyInstance.setRetryType(retryTypeInstance);
                        }
                       
                        JsonNode retryIntervalValue = retryPolicyValue2.get("retryInterval");
                        if (retryIntervalValue != null) {
                            Duration retryIntervalInstance;
                            retryIntervalInstance = TimeSpan8601Converter.parse(retryIntervalValue.getTextValue());
                            retryPolicyInstance.setRetryInterval(retryIntervalInstance);
                        }
                       
                        JsonNode retryCountValue = retryPolicyValue2.get("retryCount");
                        if (retryCountValue != null) {
                            int retryCountInstance;
                            retryCountInstance = retryCountValue.getIntValue();
                            retryPolicyInstance.setRetryCount(retryCountInstance);
                        }
                    }
                   
                    JsonNode errorActionValue2 = actionValue2.get("errorAction");
                    if (errorActionValue2 != null) {
                        JobErrorAction errorActionInstance = new JobErrorAction();
                        actionInstance.setErrorAction(errorActionInstance);
                       
                        JsonNode typeValue2 = errorActionValue2.get("type");
                        if (typeValue2 != null) {
                            JobActionType typeInstance2;
                            typeInstance2 = SchedulerClientImpl.parseJobActionType(typeValue2.getTextValue());
                            errorActionInstance.setType(typeInstance2);
                        }
                       
                        JsonNode requestValue3 = errorActionValue2.get("request");
                        if (requestValue3 != null) {
                            JobHttpRequest requestInstance = new JobHttpRequest();
                            errorActionInstance.setRequest(requestInstance);
                           
                            JsonNode uriValue = requestValue3.get("uri");
                            if (uriValue != null) {
                                URI uriInstance;
                                uriInstance = new URI(uriValue.getTextValue());
                                requestInstance.setUri(uriInstance);
                            }
                           
                            JsonNode methodValue = requestValue3.get("method");
                            if (methodValue != null) {
                                String methodInstance;
                                methodInstance = methodValue.getTextValue();
                                requestInstance.setMethod(methodInstance);
                            }
                           
                            JsonNode headersSequenceElement = ((JsonNode) requestValue3.get("headers"));
                            if (headersSequenceElement != null) {
                                Iterator<Map.Entry<String, JsonNode>> itr = headersSequenceElement.getFields();
                                while (itr.hasNext()) {
                                    Map.Entry<String, JsonNode> property = itr.next();
                                    String headersKey3 = property.getKey();
                                    String headersValue3 = property.getValue().getTextValue();
                                    requestInstance.getHeaders().put(headersKey3, headersValue3);
                                }
                            }
                           
                            JsonNode bodyValue = requestValue3.get("body");
                            if (bodyValue != null) {
                                String bodyInstance;
                                bodyInstance = bodyValue.getTextValue();
                                requestInstance.setBody(bodyInstance);
                            }
                        }
                       
                        JsonNode queueMessageValue3 = errorActionValue2.get("queueMessage");
                        if (queueMessageValue3 != null) {
                            JobQueueMessage queueMessageInstance = new JobQueueMessage();
                            errorActionInstance.setQueueMessage(queueMessageInstance);
                           
                            JsonNode storageAccountValue = queueMessageValue3.get("storageAccount");
                            if (storageAccountValue != null) {
                                String storageAccountInstance;
                                storageAccountInstance = storageAccountValue.getTextValue();
                                queueMessageInstance.setStorageAccountName(storageAccountInstance);
                            }
                           
                            JsonNode queueNameValue = queueMessageValue3.get("queueName");
                            if (queueNameValue != null) {
                                String queueNameInstance;
                                queueNameInstance = queueNameValue.getTextValue();
                                queueMessageInstance.setQueueName(queueNameInstance);
                            }
                           
                            JsonNode sasTokenValue = queueMessageValue3.get("sasToken");
                            if (sasTokenValue != null) {
                                String sasTokenInstance;
                                sasTokenInstance = sasTokenValue.getTextValue();
                                queueMessageInstance.setSasToken(sasTokenInstance);
                            }
                           
                            JsonNode messageValue = queueMessageValue3.get("message");
                            if (messageValue != null) {
                                String messageInstance;
                                messageInstance = messageValue.getTextValue();
                                queueMessageInstance.setMessage(messageInstance);
                            }
                        }
                    }
                   
                    JsonNode requestValue4 = actionValue2.get("request");
                    if (requestValue4 != null) {
                        JobHttpRequest requestInstance2 = new JobHttpRequest();
                        actionInstance.setRequest(requestInstance2);
                       
                        JsonNode uriValue2 = requestValue4.get("uri");
                        if (uriValue2 != null) {
                            URI uriInstance2;
                            uriInstance2 = new URI(uriValue2.getTextValue());
                            requestInstance2.setUri(uriInstance2);
                        }
                       
                        JsonNode methodValue2 = requestValue4.get("method");
                        if (methodValue2 != null) {
                            String methodInstance2;
                            methodInstance2 = methodValue2.getTextValue();
                            requestInstance2.setMethod(methodInstance2);
                        }
                       
                        JsonNode headersSequenceElement2 = ((JsonNode) requestValue4.get("headers"));
                        if (headersSequenceElement2 != null) {
                            Iterator<Map.Entry<String, JsonNode>> itr2 = headersSequenceElement2.getFields();
                            while (itr2.hasNext()) {
                                Map.Entry<String, JsonNode> property2 = itr2.next();
                                String headersKey4 = property2.getKey();
                                String headersValue4 = property2.getValue().getTextValue();
                                requestInstance2.getHeaders().put(headersKey4, headersValue4);
                            }
                        }
                       
                        JsonNode bodyValue2 = requestValue4.get("body");
                        if (bodyValue2 != null) {
                            String bodyInstance2;
                            bodyInstance2 = bodyValue2.getTextValue();
                            requestInstance2.setBody(bodyInstance2);
                        }
                    }
                   
                    JsonNode queueMessageValue4 = actionValue2.get("queueMessage");
                    if (queueMessageValue4 != null) {
                        JobQueueMessage queueMessageInstance2 = new JobQueueMessage();
                        actionInstance.setQueueMessage(queueMessageInstance2);
                       
                        JsonNode storageAccountValue2 = queueMessageValue4.get("storageAccount");
                        if (storageAccountValue2 != null) {
                            String storageAccountInstance2;
                            storageAccountInstance2 = storageAccountValue2.getTextValue();
                            queueMessageInstance2.setStorageAccountName(storageAccountInstance2);
                        }
                       
                        JsonNode queueNameValue2 = queueMessageValue4.get("queueName");
                        if (queueNameValue2 != null) {
                            String queueNameInstance2;
                            queueNameInstance2 = queueNameValue2.getTextValue();
                            queueMessageInstance2.setQueueName(queueNameInstance2);
                        }
                       
                        JsonNode sasTokenValue2 = queueMessageValue4.get("sasToken");
                        if (sasTokenValue2 != null) {
                            String sasTokenInstance2;
                            sasTokenInstance2 = sasTokenValue2.getTextValue();
                            queueMessageInstance2.setSasToken(sasTokenInstance2);
                        }
                       
                        JsonNode messageValue2 = queueMessageValue4.get("message");
                        if (messageValue2 != null) {
                            String messageInstance2;
                            messageInstance2 = messageValue2.getTextValue();
                            queueMessageInstance2.setMessage(messageInstance2);
                        }
                    }
                }
               
                JsonNode recurrenceValue2 = responseDoc.get("recurrence");
                if (recurrenceValue2 != null) {
                    JobRecurrence recurrenceInstance = new JobRecurrence();
                    jobInstance.setRecurrence(recurrenceInstance);
                   
                    JsonNode frequencyValue = recurrenceValue2.get("frequency");
                    if (frequencyValue != null) {
                        JobRecurrenceFrequency frequencyInstance;
                        frequencyInstance = SchedulerClientImpl.parseJobRecurrenceFrequency(frequencyValue.getTextValue());
                        recurrenceInstance.setFrequency(frequencyInstance);
                    }
                   
                    JsonNode intervalValue = recurrenceValue2.get("interval");
                    if (intervalValue != null) {
                        int intervalInstance;
                        intervalInstance = intervalValue.getIntValue();
                        recurrenceInstance.setInterval(intervalInstance);
                    }
                   
                    JsonNode countValue = recurrenceValue2.get("count");
                    if (countValue != null) {
                        int countInstance;
                        countInstance = countValue.getIntValue();
                        recurrenceInstance.setCount(countInstance);
                    }
                   
                    JsonNode endTimeValue = recurrenceValue2.get("endTime");
                    if (endTimeValue != null) {
                        Calendar endTimeInstance;
                        endTimeInstance = DatatypeConverter.parseDateTime(endTimeValue.getTextValue());
                        recurrenceInstance.setEndTime(endTimeInstance);
                    }
                   
                    JsonNode scheduleValue2 = recurrenceValue2.get("schedule");
                    if (scheduleValue2 != null) {
                        JobRecurrenceSchedule scheduleInstance = new JobRecurrenceSchedule();
                        recurrenceInstance.setSchedule(scheduleInstance);
                       
                        JsonNode minutesArray2 = scheduleValue2.get("minutes");
                        if (minutesArray2 != null) {
                            for (JsonNode minutesValue : ((ArrayNode) minutesArray2)) {
                                scheduleInstance.getMinutes().add(minutesValue.getIntValue());
                            }
                        }
                       
                        JsonNode hoursArray2 = scheduleValue2.get("hours");
                        if (hoursArray2 != null) {
                            for (JsonNode hoursValue : ((ArrayNode) hoursArray2)) {
                                scheduleInstance.getHours().add(hoursValue.getIntValue());
                            }
                        }
                       
                        JsonNode weekDaysArray2 = scheduleValue2.get("weekDays");
                        if (weekDaysArray2 != null) {
                            for (JsonNode weekDaysValue : ((ArrayNode) weekDaysArray2)) {
                                scheduleInstance.getDays().add(SchedulerClientImpl.parseJobScheduleDay(weekDaysValue.getTextValue()));
                            }
                        }
                       
                        JsonNode monthsArray2 = scheduleValue2.get("months");
                        if (monthsArray2 != null) {
                            for (JsonNode monthsValue : ((ArrayNode) monthsArray2)) {
                                scheduleInstance.getMonths().add(monthsValue.getIntValue());
                            }
                        }
                       
                        JsonNode monthDaysArray2 = scheduleValue2.get("monthDays");
                        if (monthDaysArray2 != null) {
                            for (JsonNode monthDaysValue : ((ArrayNode) monthDaysArray2)) {
                                scheduleInstance.getMonthDays().add(monthDaysValue.getIntValue());
                            }
                        }
                       
                        JsonNode monthlyOccurrencesArray2 = scheduleValue2.get("monthlyOccurrences");
                        if (monthlyOccurrencesArray2 != null) {
                            for (JsonNode monthlyOccurrencesValue : ((ArrayNode) monthlyOccurrencesArray2)) {
                                JobScheduleMonthlyOccurrence jobScheduleMonthlyOccurrenceInstance = new JobScheduleMonthlyOccurrence();
                                scheduleInstance.getMonthlyOccurrences().add(jobScheduleMonthlyOccurrenceInstance);
                               
                                JsonNode dayValue = monthlyOccurrencesValue.get("day");
                                if (dayValue != null) {
                                    JobScheduleDay dayInstance;
                                    dayInstance = SchedulerClientImpl.parseJobScheduleDay(dayValue.getTextValue());
                                    jobScheduleMonthlyOccurrenceInstance.setDay(dayInstance);
                                }
                               
                                JsonNode occurrenceValue = monthlyOccurrencesValue.get("occurrence");
                                if (occurrenceValue != null) {
                                    int occurrenceInstance;
                                    occurrenceInstance = occurrenceValue.getIntValue();
                                    jobScheduleMonthlyOccurrenceInstance.setOccurrence(occurrenceInstance);
                                }
                            }
                        }
                    }
                }
               
                JsonNode statusValue = responseDoc.get("status");
                if (statusValue != null) {
                    JobStatus statusInstance = new JobStatus();
                    jobInstance.setStatus(statusInstance);
                   
                    JsonNode lastExecutionTimeValue = statusValue.get("lastExecutionTime");
                    if (lastExecutionTimeValue != null) {
                        Calendar lastExecutionTimeInstance;
                        lastExecutionTimeInstance = DatatypeConverter.parseDateTime(lastExecutionTimeValue.getTextValue());
                        statusInstance.setLastExecutionTime(lastExecutionTimeInstance);
                    }
                   
                    JsonNode nextExecutionTimeValue = statusValue.get("nextExecutionTime");
                    if (nextExecutionTimeValue != null) {
                        Calendar nextExecutionTimeInstance;
                        nextExecutionTimeInstance = DatatypeConverter.parseDateTime(nextExecutionTimeValue.getTextValue());
                        statusInstance.setNextExecutionTime(nextExecutionTimeInstance);
                    }
                   
                    JsonNode executionCountValue = statusValue.get("executionCount");
                    if (executionCountValue != null) {
                        int executionCountInstance;
                        executionCountInstance = executionCountValue.getIntValue();
                        statusInstance.setExecutionCount(executionCountInstance);
                    }
                   
                    JsonNode failureCountValue = statusValue.get("failureCount");
                    if (failureCountValue != null) {
                        int failureCountInstance;
                        failureCountInstance = failureCountValue.getIntValue();
                        statusInstance.setFailureCount(failureCountInstance);
                    }
                   
                    JsonNode faultedCountValue = statusValue.get("faultedCount");
                    if (faultedCountValue != null) {
                        int faultedCountInstance;
                        faultedCountInstance = faultedCountValue.getIntValue();
                        statusInstance.setFaultedCount(faultedCountInstance);
                    }
                }
               
                JsonNode stateValue = responseDoc.get("state");
                if (stateValue != null) {
                    JobState stateInstance;
                    stateInstance = SchedulerClientImpl.parseJobState(stateValue.getTextValue());
                    jobInstance.setState(stateInstance);
                }
            }
           
            result.setStatusCode(statusCode);
            if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
View Full Code Here

Examples of com.netflix.genie.common.model.Job

        LOG.debug("Called");
        if (StringUtils.isBlank(jobId)) {
            throw new GeniePreconditionException("No job id entered. Unable to continue"
            );
        }
        final Job job = this.jobRepo.findOne(jobId);
        if (job == null) {
            throw new GenieNotFoundException("No job with id " + jobId + " exists. Unable to continue."
            );
        }

        final List<ClusterCriteria> clusterCriterias = job.getClusterCriterias();
        final Set<String> commandCriteria = job.getCommandCriteria();

        for (final ClusterCriteria clusterCriteria : clusterCriterias) {
            @SuppressWarnings("unchecked")
            final List<Cluster> clusters = this.clusterRepo.findAll(
                    ClusterSpecs.findByClusterAndCommandCriteria(
                            clusterCriteria,
                            commandCriteria
                    )
            );

            if (!clusters.isEmpty()) {
                // Add the succesfully criteria to the job object in string form.
                job.setChosenClusterCriteriaString(
                        StringUtils.join(
                                clusterCriteria.getTags(),
                                CRITERIA_DELIMITER
                        )
                );
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter2.recipe3.task.Job

    PrintQueue printQueue=new PrintQueue();
   
    // Creates ten Threads
    Thread thread[]=new Thread[10];
    for (int i=0; i<10; i++){
      thread[i]=new Thread(new Job(printQueue),"Thread "+i);
    }
   
    // Starts the Threads
    for (int i=0; i<10; i++){
      thread[i].start();
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter2.recipe5.task.Job

    PrintQueue printQueue=new PrintQueue();
   
    // Cretes ten jobs and the Threads to run them
    Thread thread[]=new Thread[10];
    for (int i=0; i<10; i++){
      thread[i]=new Thread(new Job(printQueue),"Thread "+i);
    }
   
    // Launch a thread ever 0.1 seconds
    for (int i=0; i<10; i++){
      thread[i].start();
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter3.recipe1.task.Job

    PrintQueue printQueue=new PrintQueue();
   
    // Creates ten Threads
    Thread thread[]=new Thread[10];
    for (int i=0; i<10; i++){
      thread[i]=new Thread(new Job(printQueue),"Thread "+i);
    }
   
    // Starts the Threads
    for (int i=0; i<10; i++){
      thread[i].start();
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter3.recipe2.task.Job

    PrintQueue printQueue=new PrintQueue();
   
    // Creates ten Threads
    Thread thread[]=new Thread[12];
    for (int i=0; i<12; i++){
      thread[i]=new Thread(new Job(printQueue),"Thread "+i);
    }
   
    // Starts the Threads
    for (int i=0; i<12; i++){
      thread[i].start();
View Full Code Here

Examples of com.projity.job.Job

    finishAnyOperations();

    final ArrayList descriptors=new ArrayList();

      Session session=SessionFactory.getInstance().getSession(false);
    Job job=(Job)SessionFactory.callNoEx(session,"getLoadProjectDescriptorsJob",new Class[]{boolean.class,java.util.List.class,boolean.class},new Object[]{true,descriptors,!Environment.isAdministrator()});
      job.addSwingRunnable(new JobRunnable("Local: loadDocument"){ //$NON-NLS-1$
        public Object run() throws Exception{
                 final Closure setter=new Closure(){
                    public void execute(Object obj){

                    }
View Full Code Here

Examples of com.quartz.monitor.object.Job

    QuartzInstance instance = Tools.getQuartzInstance();
    List<Scheduler> schedulers = instance.getSchedulerList();
    log.info(" schedulers list size:"+schedulers.size());

    Job job = JobContainer.getJobById(jobId);
    Scheduler scheduler = instance.getSchedulerByName(job.getSchedulerName());

    List<Trigger> temp = instance.getJmxAdapter().getTriggersForJob(instance, scheduler,job.getJobName(), job.getGroup());
    if(temp == null || temp.size() == 0){
      return "list";
    }
    for (Trigger trigger : temp) {
      String id = Tools.generateUUID();
      trigger.setUuid(id);
      trigger.setJobId(jobId);
      TriggerContainer.addTrigger(id, trigger);
      triggerList.add(trigger);
    }
    log.info("job[" + job.getJobName() + "]'s trigger size:" + triggerList.size());
    return "list";
  }
View Full Code Here

Examples of com.sishuok.es.sys.organization.entity.Job

        Organization organization2 = new Organization();
        organization2.setName("test2");
        organizationService.save(organization1);
        organizationService.save(organization2);

        Job job1 = new Job();
        job1.setName("test1");
        Job job2 = new Job();
        job2.setName("test2");
        jobService.save(job1);
        jobService.save(job2);

        user.addOrganizationJob(new UserOrganizationJob(organization1.getId(), null));
        user.addOrganizationJob(new UserOrganizationJob(organization2.getId(), job1.getId()));
        user.addOrganizationJob(new UserOrganizationJob(organization2.getId(), job2.getId()));
        userService.update(user);

        clear();

        user = userService.findOne(user.getId());
View Full Code Here

Examples of com.socrata.datasync.job.Job

    public SimpleIntegrationRunner(String jobFileToRun) {
        File jobFile = new File(jobFileToRun);
        if(jobFile.exists()) {
            try {
              Job job;
              //TODO BW: Follow how port jobs are run from command line?
              if (jobFileToRun.endsWith(MetadataJobTab.JOB_FILE_EXTENSION)) {
                job = new MetadataJob(jobFileToRun);
              }
              else {
                job = new IntegrationJob(jobFileToRun);
              }
                JobStatus status = job.run();
                if(status.isError()) {
                    System.err.print("Job completed with errors: ");
                    System.err.println(status.getMessage());
                    System.exit(1);
                } else {
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.