Package com.microsoft.windowsazure.scheduler.models

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


                }
                throw ex;
            }
           
            // Create Result
            JobGetHistoryResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new JobGetHistoryResponse();
            ObjectMapper objectMapper = new ObjectMapper();
            JsonNode responseDoc = null;
            if (responseContent == null == false) {
                responseDoc = objectMapper.readTree(responseContent);
            }
           
            if (responseDoc != null) {
                JsonNode jobHistoryArray = responseDoc;
                if (jobHistoryArray != null) {
                    for (JsonNode jobHistoryValue : ((ArrayNode) jobHistoryArray)) {
                        JobGetHistoryResponse.JobHistoryEntry jobHistoryEntryInstance = new JobGetHistoryResponse.JobHistoryEntry();
                        result.getJobHistory().add(jobHistoryEntryInstance);
                       
                        JsonNode jobIdValue = jobHistoryValue.get("jobId");
                        if (jobIdValue != null) {
                            String jobIdInstance;
                            jobIdInstance = jobIdValue.getTextValue();
                            jobHistoryEntryInstance.setId(jobIdInstance);
                        }
                       
                        JsonNode timestampValue = jobHistoryValue.get("timestamp");
                        if (timestampValue != null) {
                            Calendar timestampInstance;
                            timestampInstance = DatatypeConverter.parseDateTime(timestampValue.getTextValue());
                            jobHistoryEntryInstance.setTimestamp(timestampInstance);
                        }
                       
                        JsonNode startTimeValue = jobHistoryValue.get("startTime");
                        if (startTimeValue != null) {
                            Calendar startTimeInstance;
                            startTimeInstance = DatatypeConverter.parseDateTime(startTimeValue.getTextValue());
                            jobHistoryEntryInstance.setStartTime(startTimeInstance);
                        }
                       
                        JsonNode endTimeValue = jobHistoryValue.get("endTime");
                        if (endTimeValue != null) {
                            Calendar endTimeInstance;
                            endTimeInstance = DatatypeConverter.parseDateTime(endTimeValue.getTextValue());
                            jobHistoryEntryInstance.setEndTime(endTimeInstance);
                        }
                       
                        JsonNode stateValue = jobHistoryValue.get("state");
                        if (stateValue != null) {
                            JobState stateInstance;
                            stateInstance = SchedulerClientImpl.parseJobState(stateValue.getTextValue());
                            jobHistoryEntryInstance.setState(stateInstance);
                        }
                       
                        JsonNode messageValue = jobHistoryValue.get("message");
                        if (messageValue != null) {
                            String messageInstance;
                            messageInstance = messageValue.getTextValue();
                            jobHistoryEntryInstance.setMessage(messageInstance);
                        }
                       
                        JsonNode statusValue = jobHistoryValue.get("status");
                        if (statusValue != null) {
                            JobHistoryStatus statusInstance;
                            statusInstance = SchedulerClientImpl.parseJobHistoryStatus(statusValue.getTextValue());
                            jobHistoryEntryInstance.setStatus(statusInstance);
                        }
                       
                        JsonNode actionNameValue = jobHistoryValue.get("actionName");
                        if (actionNameValue != null) {
                            JobHistoryActionName actionNameInstance;
                            actionNameInstance = SchedulerClientImpl.parseJobHistoryActionName(actionNameValue.getTextValue());
                            jobHistoryEntryInstance.setActionName(actionNameInstance);
                        }
                       
                        JsonNode repeatCountValue = jobHistoryValue.get("repeatCount");
                        if (repeatCountValue != null) {
                            int repeatCountInstance;
                            repeatCountInstance = repeatCountValue.getIntValue();
                            jobHistoryEntryInstance.setRepeatCount(repeatCountInstance);
                        }
                       
                        JsonNode retryCountValue = jobHistoryValue.get("retryCount");
                        if (retryCountValue != null) {
                            int retryCountInstance;
                            retryCountInstance = retryCountValue.getIntValue();
                            jobHistoryEntryInstance.setRetryCount(retryCountInstance);
                        }
                    }
                }
            }
           
            result.setStatusCode(statusCode);
            if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
                result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue());
            }
           
            if (shouldTrace) {
                CloudTracing.exit(invocationId, result);
            }
View Full Code Here


                }
                throw ex;
            }
           
            // Create Result
            JobGetHistoryResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new JobGetHistoryResponse();
            ObjectMapper objectMapper = new ObjectMapper();
            JsonNode responseDoc = null;
            if (responseContent == null == false) {
                responseDoc = objectMapper.readTree(responseContent);
            }
           
            if (responseDoc != null) {
                JsonNode jobHistoryArray = responseDoc;
                if (jobHistoryArray != null) {
                    for (JsonNode jobHistoryValue : ((ArrayNode) jobHistoryArray)) {
                        JobGetHistoryResponse.JobHistoryEntry jobHistoryEntryInstance = new JobGetHistoryResponse.JobHistoryEntry();
                        result.getJobHistory().add(jobHistoryEntryInstance);
                       
                        JsonNode jobIdValue = jobHistoryValue.get("jobId");
                        if (jobIdValue != null) {
                            String jobIdInstance;
                            jobIdInstance = jobIdValue.getTextValue();
                            jobHistoryEntryInstance.setId(jobIdInstance);
                        }
                       
                        JsonNode timestampValue = jobHistoryValue.get("timestamp");
                        if (timestampValue != null) {
                            Calendar timestampInstance;
                            timestampInstance = DatatypeConverter.parseDateTime(timestampValue.getTextValue());
                            jobHistoryEntryInstance.setTimestamp(timestampInstance);
                        }
                       
                        JsonNode startTimeValue = jobHistoryValue.get("startTime");
                        if (startTimeValue != null) {
                            Calendar startTimeInstance;
                            startTimeInstance = DatatypeConverter.parseDateTime(startTimeValue.getTextValue());
                            jobHistoryEntryInstance.setStartTime(startTimeInstance);
                        }
                       
                        JsonNode endTimeValue = jobHistoryValue.get("endTime");
                        if (endTimeValue != null) {
                            Calendar endTimeInstance;
                            endTimeInstance = DatatypeConverter.parseDateTime(endTimeValue.getTextValue());
                            jobHistoryEntryInstance.setEndTime(endTimeInstance);
                        }
                       
                        JsonNode stateValue = jobHistoryValue.get("state");
                        if (stateValue != null) {
                            JobState stateInstance;
                            stateInstance = SchedulerClientImpl.parseJobState(stateValue.getTextValue());
                            jobHistoryEntryInstance.setState(stateInstance);
                        }
                       
                        JsonNode messageValue = jobHistoryValue.get("message");
                        if (messageValue != null) {
                            String messageInstance;
                            messageInstance = messageValue.getTextValue();
                            jobHistoryEntryInstance.setMessage(messageInstance);
                        }
                       
                        JsonNode statusValue = jobHistoryValue.get("status");
                        if (statusValue != null) {
                            JobHistoryStatus statusInstance;
                            statusInstance = SchedulerClientImpl.parseJobHistoryStatus(statusValue.getTextValue());
                            jobHistoryEntryInstance.setStatus(statusInstance);
                        }
                       
                        JsonNode actionNameValue = jobHistoryValue.get("actionName");
                        if (actionNameValue != null) {
                            JobHistoryActionName actionNameInstance;
                            actionNameInstance = SchedulerClientImpl.parseJobHistoryActionName(actionNameValue.getTextValue());
                            jobHistoryEntryInstance.setActionName(actionNameInstance);
                        }
                       
                        JsonNode repeatCountValue = jobHistoryValue.get("repeatCount");
                        if (repeatCountValue != null) {
                            int repeatCountInstance;
                            repeatCountInstance = repeatCountValue.getIntValue();
                            jobHistoryEntryInstance.setRepeatCount(repeatCountInstance);
                        }
                       
                        JsonNode retryCountValue = jobHistoryValue.get("retryCount");
                        if (retryCountValue != null) {
                            int retryCountInstance;
                            retryCountInstance = retryCountValue.getIntValue();
                            jobHistoryEntryInstance.setRetryCount(retryCountInstance);
                        }
                    }
                }
            }
           
            result.setStatusCode(statusCode);
            if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
                result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue());
            }
           
            if (shouldTrace) {
                CloudTracing.exit(invocationId, result);
            }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.scheduler.models.JobGetHistoryResponse

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.