Package com.microsoft.windowsazure.management.scheduler.models

Examples of com.microsoft.windowsazure.management.scheduler.models.JobCollectionUpdateResponse


                }
                throw ex;
            }
           
            // Create Result
            JobCollectionUpdateResponse result = null;
            result = new JobCollectionUpdateResponse();
            result.setStatusCode(statusCode);
            if (httpResponse.getHeaders("ETag").length > 0) {
                result.setETag(httpResponse.getFirstHeader("ETag").getValue());
            }
            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


        try {
            if (shouldTrace) {
                client2 = this.getClient().withRequestFilterLast(new ClientRequestTrackingHandler(invocationId)).withResponseFilterLast(new ClientRequestTrackingHandler(invocationId));
            }
           
            JobCollectionUpdateResponse response = client2.getJobCollectionsOperations().beginUpdatingAsync(cloudServiceName, jobCollectionName, parameters).get();
            SchedulerOperationStatusResponse result = client2.getOperationStatusAsync(response.getRequestId()).get();
            int delayInSeconds = 15;
            if (client2.getLongRunningOperationInitialTimeout() >= 0) {
                delayInSeconds = client2.getLongRunningOperationInitialTimeout();
            }
            while ((result.getStatus() != SchedulerOperationStatus.InProgress) == false) {
                Thread.sleep(delayInSeconds * 1000);
                result = client2.getOperationStatusAsync(response.getRequestId()).get();
                delayInSeconds = 10;
                if (client2.getLongRunningOperationRetryTimeout() >= 0) {
                    delayInSeconds = client2.getLongRunningOperationRetryTimeout();
                }
            }
           
            if (shouldTrace) {
                CloudTracing.exit(invocationId, result);
            }
           
            if (result.getStatus() != SchedulerOperationStatus.Succeeded) {
                if (result.getError() != null) {
                    ServiceException ex = new ServiceException(result.getError().getCode() + " : " + result.getError().getMessage());
                    ex.setErrorCode(result.getError().getCode());
                    ex.setErrorMessage(result.getError().getMessage());
                    if (shouldTrace) {
                        CloudTracing.error(invocationId, ex);
                    }
                    throw ex;
                } else {
                    ServiceException ex = new ServiceException("");
                    if (shouldTrace) {
                        CloudTracing.error(invocationId, ex);
                    }
                    throw ex;
                }
            }
           
            result.setETag(response.getETag());
            return result;
        } finally {
            if (client2 != null && shouldTrace) {
                client2.close();
            }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.management.scheduler.models.JobCollectionUpdateResponse

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.