From 8cd59a60e59a96b4f22cdc78923ea76df03fcafe Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Mon, 20 Jan 2014 10:46:10 +0100 Subject: [PATCH 1/4] Add cloudservice wrappers --- .../CloudServiceManagementClient.java | 148 ++ .../CloudServiceManagementClientImpl.java | 545 ++++++++ .../scheduler/CloudServiceOperations.java | 234 ++++ .../scheduler/CloudServiceOperationsImpl.java | 1186 +++++++++++++++++ .../models/CloudServiceCreateParameters.java | 109 ++ .../models/CloudServiceGetResponse.java | 302 +++++ .../models/CloudServiceListResponse.java | 539 ++++++++ .../models/CloudServiceOperationStatus.java | 45 + .../CloudServiceOperationStatusResponse.java | 177 +++ .../models/EntitleResourceParameters.java | 89 ++ .../models/GetCloudServiceResourceState.java | 57 + 11 files changed, 3431 insertions(+) create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementClient.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementClientImpl.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceOperations.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceOperationsImpl.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceCreateParameters.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceGetResponse.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceListResponse.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceOperationStatus.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceOperationStatusResponse.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/EntitleResourceParameters.java create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/GetCloudServiceResourceState.java diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementClient.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementClient.java new file mode 100644 index 0000000000000..1dcfc0fdddb61 --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementClient.java @@ -0,0 +1,148 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler; + +import com.microsoft.windowsazure.core.FilterableService; +import com.microsoft.windowsazure.core.OperationResponse; +import com.microsoft.windowsazure.credentials.SubscriptionCloudCredentials; +import com.microsoft.windowsazure.exception.ServiceException; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceOperationStatusResponse; +import com.microsoft.windowsazure.management.scheduler.models.EntitleResourceParameters; +import java.io.IOException; +import java.net.URI; +import java.util.concurrent.Future; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerException; +import org.xml.sax.SAXException; + +public interface CloudServiceManagementClient extends FilterableService +{ + /** + * The URI used as the base for all cloud service management requests. + * @return The BaseUri value. + */ + URI getBaseUri(); + + /** + * When you create a Windows Azure subscription, it is uniquely identified + * by a subscription ID. The subscription ID forms part of the URI for + * every call that you make to the Service Management API. The Windows + * Azure Service ManagementAPI use mutual authentication of management + * certificates over SSL to ensure that a request made to the service is + * secure. No anonymous requests are allowed. + * @return The Credentials value. + */ + SubscriptionCloudCredentials getCredentials(); + + /** + * @return The CloudServicesOperations value. + */ + CloudServiceOperations getCloudServicesOperations(); + + /** + * EntitleResource is used only for 3rd party Store providers. Each + * subscription must be entitled for the resource before creating that + * particular type of resource. + * + * @param parameters Parameters provided to the EntitleResource method. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + OperationResponse entitleResource(EntitleResourceParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; + + /** + * EntitleResource is used only for 3rd party Store providers. Each + * subscription must be entitled for the resource before creating that + * particular type of resource. + * + * @param parameters Parameters provided to the EntitleResource method. + * @return A standard service response including an HTTP status code and + * request ID. + */ + Future entitleResourceAsync(EntitleResourceParameters parameters); + + /** + * The Get Operation Status operation returns the status of thespecified + * operation. After calling an asynchronous operation, you can call Get + * Operation Status to determine whether the operation has succeeded, + * failed, or is still in progress. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/ee460783.aspx for + * more information) + * + * @param requestId The request ID for the request you wish to track. The + * request ID is returned in the x-ms-request-id response header for every + * request. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + CloudServiceOperationStatusResponse getOperationStatus(String requestId) throws IOException, ServiceException, ParserConfigurationException, SAXException; + + /** + * The Get Operation Status operation returns the status of thespecified + * operation. After calling an asynchronous operation, you can call Get + * Operation Status to determine whether the operation has succeeded, + * failed, or is still in progress. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/ee460783.aspx for + * more information) + * + * @param requestId The request ID for the request you wish to track. The + * request ID is returned in the x-ms-request-id response header for every + * request. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + Future getOperationStatusAsync(String requestId); +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementClientImpl.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementClientImpl.java new file mode 100644 index 0000000000000..5905281c5f25e --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementClientImpl.java @@ -0,0 +1,545 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler; + +import com.microsoft.windowsazure.core.OperationResponse; +import com.microsoft.windowsazure.core.ServiceClient; +import com.microsoft.windowsazure.credentials.SubscriptionCloudCredentials; +import com.microsoft.windowsazure.exception.ServiceException; +import com.microsoft.windowsazure.management.ManagementConfiguration; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceOperationStatus; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceOperationStatusResponse; +import com.microsoft.windowsazure.management.scheduler.models.EntitleResourceParameters; +import com.microsoft.windowsazure.tracing.CloudTracing; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.net.URI; +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.TimeZone; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import javax.inject.Inject; +import javax.inject.Named; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class CloudServiceManagementClientImpl extends ServiceClient implements CloudServiceManagementClient +{ + private URI baseUri; + + /** + * The URI used as the base for all cloud service management requests. + * @return The BaseUri value. + */ + public URI getBaseUri() + { + return this.baseUri; + } + + private SubscriptionCloudCredentials credentials; + + /** + * When you create a Windows Azure subscription, it is uniquely identified + * by a subscription ID. The subscription ID forms part of the URI for + * every call that you make to the Service Management API. The Windows + * Azure Service ManagementAPI use mutual authentication of management + * certificates over SSL to ensure that a request made to the service is + * secure. No anonymous requests are allowed. + * @return The Credentials value. + */ + public SubscriptionCloudCredentials getCredentials() + { + return this.credentials; + } + + private CloudServiceOperations cloudServices; + + /** + * @return The CloudServicesOperations value. + */ + public CloudServiceOperations getCloudServicesOperations() + { + return this.cloudServices; + } + + /** + * Initializes a new instance of the CloudServiceManagementClientImpl class. + * + * @param httpBuilder The HTTP client builder. + * @param executorService The executor service. + */ + private CloudServiceManagementClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService) + { + super(httpBuilder, executorService); + this.cloudServices = new CloudServiceOperationsImpl(this); + } + + /** + * Initializes a new instance of the CloudServiceManagementClientImpl class. + * + * @param httpBuilder The HTTP client builder. + * @param executorService The executor service. + * @param credentials When you create a Windows Azure subscription, it is + * uniquely identified by a subscription ID. The subscription ID forms part + * of the URI for every call that you make to the Service Management API. + * The Windows Azure Service ManagementAPI use mutual authentication of + * management certificates over SSL to ensure that a request made to the + * service is secure. No anonymous requests are allowed. + * @param baseUri The URI used as the base for all cloud service management + * requests. + */ + public CloudServiceManagementClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService, SubscriptionCloudCredentials credentials, URI baseUri) + { + this(httpBuilder, executorService); + if (credentials == null) + { + throw new NullPointerException("credentials"); + } + if (baseUri == null) + { + throw new NullPointerException("baseUri"); + } + this.credentials = credentials; + this.baseUri = baseUri; + } + + /** + * Initializes a new instance of the CloudServiceManagementClientImpl class. + * Initializes a new instance of the CloudServiceManagementClientImpl class. + * + * @param httpBuilder The HTTP client builder. + * @param executorService The executor service. + * @param credentials When you create a Windows Azure subscription, it is + * uniquely identified by a subscription ID. The subscription ID forms part + * of the URI for every call that you make to the Service Management API. + * The Windows Azure Service ManagementAPI use mutual authentication of + * management certificates over SSL to ensure that a request made to the + * service is secure. No anonymous requests are allowed. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + */ + @Inject + public CloudServiceManagementClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService, @Named(ManagementConfiguration.SUBSCRIPTION_CLOUD_CREDENTIALS) SubscriptionCloudCredentials credentials) throws java.net.URISyntaxException + { + this(httpBuilder, executorService); + if (credentials == null) + { + throw new NullPointerException("credentials"); + } + this.credentials = credentials; + this.baseUri = new URI("https://management.core.windows.net"); + } + + /** + * + * @param httpBuilder The HTTP client builder. + * @param executorService The executor service. + */ + protected CloudServiceManagementClientImpl newInstance(HttpClientBuilder httpBuilder, ExecutorService executorService) + { + return new CloudServiceManagementClientImpl(httpBuilder, executorService, this.getCredentials(), this.getBaseUri()); + } + + /** + * EntitleResource is used only for 3rd party Store providers. Each + * subscription must be entitled for the resource before creating that + * particular type of resource. + * + * @param parameters Parameters provided to the EntitleResource method. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future entitleResourceAsync(final EntitleResourceParameters parameters) + { + return this.getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception + { + return entitleResource(parameters); + } + }); + } + + /** + * EntitleResource is used only for 3rd party Store providers. Each + * subscription must be entitled for the resource before creating that + * particular type of resource. + * + * @param parameters Parameters provided to the EntitleResource method. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse entitleResource(EntitleResourceParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException + { + // Validate + if (parameters == null) + { + throw new NullPointerException("parameters"); + } + if (parameters.getResourceNamespace() == null) + { + throw new NullPointerException("parameters.ResourceNamespace"); + } + if (parameters.getResourceType() == null) + { + throw new NullPointerException("parameters.ResourceType"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "entitleResourceAsync", tracingParameters); + } + + // Construct URL + String url = this.getBaseUri() + this.getCredentials().getSubscriptionId() + "/EntitleResource"; + + // Create HTTP transport objects + HttpPost httpRequest = new HttpPost(url); + + // Set Headers + httpRequest.setHeader("Content-Type", "application/xml"); + httpRequest.setHeader("x-ms-version", "2013-03-01"); + + // Serialize Request + String requestContent = null; + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document requestDoc = documentBuilder.newDocument(); + + Element entitleResourceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EntitleResource"); + requestDoc.appendChild(entitleResourceElement); + + Element resourceProviderNameSpaceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ResourceProviderNameSpace"); + resourceProviderNameSpaceElement.appendChild(requestDoc.createTextNode(parameters.getResourceNamespace())); + entitleResourceElement.appendChild(resourceProviderNameSpaceElement); + + Element typeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Type"); + typeElement.appendChild(requestDoc.createTextNode(parameters.getResourceType())); + entitleResourceElement.appendChild(typeElement); + + Element registrationDateElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RegistrationDate"); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmZ"); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + registrationDateElement.appendChild(requestDoc.createTextNode(simpleDateFormat.format(parameters.getRegistrationDate().getTime()))); + entitleResourceElement.appendChild(registrationDateElement); + + DOMSource domSource = new DOMSource(requestDoc); + StringWriter stringWriter = new StringWriter(); + StreamResult streamResult = new StreamResult(stringWriter); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + transformer.transform(domSource, streamResult); + requestContent = stringWriter.toString(); + StringEntity entity = new StringEntity(requestContent); + httpRequest.setEntity(entity); + httpRequest.setHeader("Content-Type", "application/xml"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * The Get Operation Status operation returns the status of thespecified + * operation. After calling an asynchronous operation, you can call Get + * Operation Status to determine whether the operation has succeeded, + * failed, or is still in progress. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/ee460783.aspx for + * more information) + * + * @param requestId The request ID for the request you wish to track. The + * request ID is returned in the x-ms-request-id response header for every + * request. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + @Override + public Future getOperationStatusAsync(final String requestId) + { + return this.getExecutorService().submit(new Callable() { + @Override + public CloudServiceOperationStatusResponse call() throws Exception + { + return getOperationStatus(requestId); + } + }); + } + + /** + * The Get Operation Status operation returns the status of thespecified + * operation. After calling an asynchronous operation, you can call Get + * Operation Status to determine whether the operation has succeeded, + * failed, or is still in progress. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/ee460783.aspx for + * more information) + * + * @param requestId The request ID for the request you wish to track. The + * request ID is returned in the x-ms-request-id response header for every + * request. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + @Override + public CloudServiceOperationStatusResponse getOperationStatus(String requestId) throws IOException, ServiceException, ParserConfigurationException, SAXException + { + // Validate + if (requestId == null) + { + throw new NullPointerException("requestId"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("requestId", requestId); + CloudTracing.enter(invocationId, this, "getOperationStatusAsync", tracingParameters); + } + + // Construct URL + String url = this.getBaseUri() + this.getCredentials().getSubscriptionId() + "/operations/" + requestId; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + CloudServiceOperationStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new CloudServiceOperationStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Operation"); + Element operationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operationElement != null) + { + NodeList elements2 = operationElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setId(idInstance); + } + + NodeList elements3 = operationElement.getElementsByTagName("Status"); + Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (statusElement != null) + { + CloudServiceOperationStatus statusInstance; + statusInstance = CloudServiceOperationStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); + } + + NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); + Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (httpStatusCodeElement != null) + { + Integer httpStatusCodeInstance; + httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); + result.setHttpStatusCode(httpStatusCodeInstance); + } + + NodeList elements5 = operationElement.getElementsByTagName("Error"); + Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (errorElement != null) + { + CloudServiceOperationStatusResponse.ErrorDetails errorInstance = new CloudServiceOperationStatusResponse.ErrorDetails(); + result.setError(errorInstance); + + NodeList elements6 = errorElement.getElementsByTagName("Code"); + Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (codeElement != null) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + errorInstance.setCode(codeInstance); + } + + NodeList elements7 = errorElement.getElementsByTagName("Message"); + Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceOperations.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceOperations.java new file mode 100644 index 0000000000000..2c65b87aba8f2 --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceOperations.java @@ -0,0 +1,234 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler; + +import com.microsoft.windowsazure.core.OperationResponse; +import com.microsoft.windowsazure.exception.ServiceException; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceCreateParameters; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceGetResponse; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceListResponse; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceOperationStatusResponse; +import java.io.IOException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerException; +import org.xml.sax.SAXException; + +public interface CloudServiceOperations +{ + /** + * Create a cloud service. + * + * @param cloudServiceName The cloud service name. + * @param parameters Parameters supplied to the Create cloud service + * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + OperationResponse beginCreating(String cloudServiceName, CloudServiceCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; + + /** + * Create a cloud service. + * + * @param cloudServiceName The cloud service name. + * @param parameters Parameters supplied to the Create cloud service + * operation. + * @return A standard service response including an HTTP status code and + * request ID. + */ + Future beginCreatingAsync(String cloudServiceName, CloudServiceCreateParameters parameters); + + /** + * Delete a cloud service. + * + * @param cloudServiceName The cloud service name. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + OperationResponse beginDeleting(String cloudServiceName) throws IOException, ServiceException; + + /** + * Delete a cloud service. + * + * @param cloudServiceName The cloud service name. + * @return A standard service response including an HTTP status code and + * request ID. + */ + Future beginDeletingAsync(String cloudServiceName); + + /** + * Create a cloud service. + * + * @param cloudServiceName The cloud service name. + * @param parameters Parameters supplied to the Create cloud service + * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + CloudServiceOperationStatusResponse create(String cloudServiceName, CloudServiceCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException; + + /** + * Create a cloud service. + * + * @param cloudServiceName The cloud service name. + * @param parameters Parameters supplied to the Create cloud service + * operation. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + Future createAsync(String cloudServiceName, CloudServiceCreateParameters parameters); + + /** + * Delete a cloud service. + * + * @param cloudServiceName The cloud service name. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + CloudServiceOperationStatusResponse delete(String cloudServiceName) throws InterruptedException, ExecutionException, ServiceException, IOException; + + /** + * Delete a cloud service. + * + * @param cloudServiceName The cloud service name. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + Future deleteAsync(String cloudServiceName); + + /** + * Retreive a cloud service. + * + * @param cloudServiceName The cloud service name. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @return Information about a retrieved Cloud Service. + */ + CloudServiceGetResponse get(String cloudServiceName) throws IOException, ServiceException, ParserConfigurationException, SAXException; + + /** + * Retreive a cloud service. + * + * @param cloudServiceName The cloud service name. + * @return Information about a retrieved Cloud Service. + */ + Future getAsync(String cloudServiceName); + + /** + * The List Cloud Services operation enumerates services that are + * provisioned for a subscription. + * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @return The response structure for the Cloud Service List operation + */ + CloudServiceListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException; + + /** + * The List Cloud Services operation enumerates services that are + * provisioned for a subscription. + * + * @return The response structure for the Cloud Service List operation + */ + Future listAsync(); +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceOperationsImpl.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceOperationsImpl.java new file mode 100644 index 0000000000000..703657b911f36 --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceOperationsImpl.java @@ -0,0 +1,1186 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler; + +import com.microsoft.windowsazure.core.OperationResponse; +import com.microsoft.windowsazure.core.ServiceOperations; +import com.microsoft.windowsazure.core.pipeline.apache.CustomHttpDelete; +import com.microsoft.windowsazure.exception.ServiceException; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceCreateParameters; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceGetResponse; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceListResponse; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceOperationStatus; +import com.microsoft.windowsazure.management.scheduler.models.CloudServiceOperationStatusResponse; +import com.microsoft.windowsazure.tracing.ClientRequestTrackingHandler; +import com.microsoft.windowsazure.tracing.CloudTracing; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.entity.StringEntity; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class CloudServiceOperationsImpl implements ServiceOperations, CloudServiceOperations +{ + /** + * Initializes a new instance of the CloudServiceOperationsImpl class. + * + * @param client Reference to the service client. + */ + CloudServiceOperationsImpl(CloudServiceManagementClientImpl client) + { + this.client = client; + } + + private CloudServiceManagementClientImpl client; + + /** + * Gets a reference to the + * microsoft.windowsazure.management.scheduler.CloudServiceManagementClientImpl. + * @return The Client value. + */ + public CloudServiceManagementClientImpl getClient() + { + return this.client; + } + + /** + * Create a cloud service. + * + * @param cloudServiceName The cloud service name. + * @param parameters Parameters supplied to the Create cloud service + * operation. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future beginCreatingAsync(final String cloudServiceName, final CloudServiceCreateParameters parameters) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception + { + return beginCreating(cloudServiceName, parameters); + } + }); + } + + /** + * Create a cloud service. + * + * @param cloudServiceName The cloud service name. + * @param parameters Parameters supplied to the Create cloud service + * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse beginCreating(String cloudServiceName, CloudServiceCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException + { + // Validate + if (cloudServiceName == null) + { + throw new NullPointerException("cloudServiceName"); + } + if (cloudServiceName.length() > 100) + { + throw new IllegalArgumentException("cloudServiceName"); + } + if (parameters == null) + { + throw new NullPointerException("parameters"); + } + if (parameters.getDescription() == null) + { + throw new NullPointerException("parameters.Description"); + } + if (parameters.getDescription().length() > 1024) + { + throw new IllegalArgumentException("parameters.Description"); + } + if (parameters.getGeoRegion() == null) + { + throw new NullPointerException("parameters.GeoRegion"); + } + if (parameters.getLabel() == null) + { + throw new NullPointerException("parameters.Label"); + } + if (parameters.getLabel().length() > 100) + { + throw new IllegalArgumentException("parameters.Label"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("cloudServiceName", cloudServiceName); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "beginCreatingAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + this.getClient().getCredentials().getSubscriptionId() + "/CloudServices/" + cloudServiceName; + + // Create HTTP transport objects + HttpPut httpRequest = new HttpPut(url); + + // Set Headers + httpRequest.setHeader("Content-Type", "application/xml"); + httpRequest.setHeader("x-ms-version", "2013-03-01"); + + // Serialize Request + String requestContent = null; + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document requestDoc = documentBuilder.newDocument(); + + Element cloudServiceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CloudService"); + requestDoc.appendChild(cloudServiceElement); + + Element labelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Label"); + labelElement.appendChild(requestDoc.createTextNode(parameters.getLabel())); + cloudServiceElement.appendChild(labelElement); + + Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); + descriptionElement.appendChild(requestDoc.createTextNode(parameters.getDescription())); + cloudServiceElement.appendChild(descriptionElement); + + Element geoRegionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "GeoRegion"); + geoRegionElement.appendChild(requestDoc.createTextNode(parameters.getGeoRegion())); + cloudServiceElement.appendChild(geoRegionElement); + + if (parameters.getEmail() != null) + { + Element emailElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Email"); + emailElement.appendChild(requestDoc.createTextNode(parameters.getEmail())); + cloudServiceElement.appendChild(emailElement); + } + + DOMSource domSource = new DOMSource(requestDoc); + StringWriter stringWriter = new StringWriter(); + StreamResult streamResult = new StreamResult(stringWriter); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + transformer.transform(domSource, streamResult); + requestContent = stringWriter.toString(); + StringEntity entity = new StringEntity(requestContent); + httpRequest.setEntity(entity); + httpRequest.setHeader("Content-Type", "application/xml"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * Delete a cloud service. + * + * @param cloudServiceName The cloud service name. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future beginDeletingAsync(final String cloudServiceName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception + { + return beginDeleting(cloudServiceName); + } + }); + } + + /** + * Delete a cloud service. + * + * @param cloudServiceName The cloud service name. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse beginDeleting(String cloudServiceName) throws IOException, ServiceException + { + // Validate + if (cloudServiceName == null) + { + throw new NullPointerException("cloudServiceName"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("cloudServiceName", cloudServiceName); + CloudTracing.enter(invocationId, this, "beginDeletingAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + this.getClient().getCredentials().getSubscriptionId() + "/CloudServices/" + cloudServiceName; + + // Create HTTP transport objects + CustomHttpDelete httpRequest = new CustomHttpDelete(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * Create a cloud service. + * + * @param cloudServiceName The cloud service name. + * @param parameters Parameters supplied to the Create cloud service + * operation. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + @Override + public Future createAsync(final String cloudServiceName, final CloudServiceCreateParameters parameters) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public CloudServiceOperationStatusResponse call() throws Exception + { + return create(cloudServiceName, parameters); + } + }); + } + + /** + * Create a cloud service. + * + * @param cloudServiceName The cloud service name. + * @param parameters Parameters supplied to the Create cloud service + * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + @Override + public CloudServiceOperationStatusResponse create(String cloudServiceName, CloudServiceCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException + { + CloudServiceManagementClient client2 = this.getClient(); + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("cloudServiceName", cloudServiceName); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "createAsync", tracingParameters); + } + try + { + if (shouldTrace) + { + client2 = this.getClient().withRequestFilterLast(new ClientRequestTrackingHandler(invocationId)).withResponseFilterLast(new ClientRequestTrackingHandler(invocationId)); + } + + OperationResponse response = client2.getCloudServicesOperations().beginCreatingAsync(cloudServiceName, parameters).get(); + CloudServiceOperationStatusResponse result = client2.getOperationStatusAsync(response.getRequestId()).get(); + int delayInSeconds = 10; + while ((result.getStatus() != CloudServiceOperationStatus.InProgress) == false) + { + Thread.sleep(delayInSeconds * 1000); + result = client2.getOperationStatusAsync(response.getRequestId()).get(); + delayInSeconds = 5; + } + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + + if (result.getStatus() != CloudServiceOperationStatus.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; + } + } + + return result; + } + finally + { + if (this.getClient() != null && shouldTrace) + { + this.getClient().close(); + } + } + } + + /** + * Delete a cloud service. + * + * @param cloudServiceName The cloud service name. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + @Override + public Future deleteAsync(final String cloudServiceName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public CloudServiceOperationStatusResponse call() throws Exception + { + return delete(cloudServiceName); + } + }); + } + + /** + * Delete a cloud service. + * + * @param cloudServiceName The cloud service name. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + @Override + public CloudServiceOperationStatusResponse delete(String cloudServiceName) throws InterruptedException, ExecutionException, ServiceException, IOException + { + CloudServiceManagementClient client2 = this.getClient(); + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("cloudServiceName", cloudServiceName); + CloudTracing.enter(invocationId, this, "deleteAsync", tracingParameters); + } + try + { + if (shouldTrace) + { + client2 = this.getClient().withRequestFilterLast(new ClientRequestTrackingHandler(invocationId)).withResponseFilterLast(new ClientRequestTrackingHandler(invocationId)); + } + + OperationResponse response = client2.getCloudServicesOperations().beginDeletingAsync(cloudServiceName).get(); + CloudServiceOperationStatusResponse result = client2.getOperationStatusAsync(response.getRequestId()).get(); + int delayInSeconds = 10; + while ((result.getStatus() != CloudServiceOperationStatus.InProgress) == false) + { + Thread.sleep(delayInSeconds * 1000); + result = client2.getOperationStatusAsync(response.getRequestId()).get(); + delayInSeconds = 5; + } + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + + if (result.getStatus() != CloudServiceOperationStatus.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; + } + } + + return result; + } + finally + { + if (this.getClient() != null && shouldTrace) + { + this.getClient().close(); + } + } + } + + /** + * Retreive a cloud service. + * + * @param cloudServiceName The cloud service name. + * @return Information about a retrieved Cloud Service. + */ + @Override + public Future getAsync(final String cloudServiceName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public CloudServiceGetResponse call() throws Exception + { + return get(cloudServiceName); + } + }); + } + + /** + * Retreive a cloud service. + * + * @param cloudServiceName The cloud service name. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @return Information about a retrieved Cloud Service. + */ + @Override + public CloudServiceGetResponse get(String cloudServiceName) throws IOException, ServiceException, ParserConfigurationException, SAXException + { + // Validate + if (cloudServiceName == null) + { + throw new NullPointerException("cloudServiceName"); + } + if (cloudServiceName.length() > 100) + { + throw new IllegalArgumentException("cloudServiceName"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("cloudServiceName", cloudServiceName); + CloudTracing.enter(invocationId, this, "getAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + this.getClient().getCredentials().getSubscriptionId() + "/CloudServices/" + cloudServiceName; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + CloudServiceGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new CloudServiceGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("CloudService"); + Element cloudServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (cloudServiceElement != null) + { + NodeList elements2 = cloudServiceElement.getElementsByTagName("GeoLocation"); + Element geoLocationElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (geoLocationElement != null) + { + String geoLocationInstance; + geoLocationInstance = geoLocationElement.getTextContent(); + result.setGeoLocation(geoLocationInstance); + } + + NodeList elements3 = cloudServiceElement.getElementsByTagName("Resources"); + Element resourcesSequenceElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (resourcesSequenceElement != null) + { + for (int i1 = 0; i1 < resourcesSequenceElement.getElementsByTagName("Resource").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element resourcesElement = ((org.w3c.dom.Element) resourcesSequenceElement.getElementsByTagName("Resource").item(i1)); + CloudServiceGetResponse.Resource resourceInstance = new CloudServiceGetResponse.Resource(); + result.getResources().add(resourceInstance); + + NodeList elements4 = resourcesElement.getElementsByTagName("ResourceProviderNamespace"); + Element resourceProviderNamespaceElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (resourceProviderNamespaceElement != null) + { + String resourceProviderNamespaceInstance; + resourceProviderNamespaceInstance = resourceProviderNamespaceElement.getTextContent(); + resourceInstance.setResourceProviderNamespace(resourceProviderNamespaceInstance); + } + + NodeList elements5 = resourcesElement.getElementsByTagName("Type"); + Element typeElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + resourceInstance.setType(typeInstance); + } + + NodeList elements6 = resourcesElement.getElementsByTagName("ETag"); + Element eTagElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (eTagElement != null) + { + String eTagInstance; + eTagInstance = eTagElement.getTextContent(); + resourceInstance.setETag(eTagInstance); + } + + NodeList elements7 = resourcesElement.getElementsByTagName("SchemaVersion"); + Element schemaVersionElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (schemaVersionElement != null) + { + String schemaVersionInstance; + schemaVersionInstance = schemaVersionElement.getTextContent(); + resourceInstance.setSchemaVersion(schemaVersionInstance); + } + + NodeList elements8 = resourcesElement.getElementsByTagName("Name"); + Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + resourceInstance.setName(nameInstance); + } + + NodeList elements9 = resourcesElement.getElementsByTagName("Plan"); + Element planElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (planElement != null) + { + String planInstance; + planInstance = planElement.getTextContent(); + resourceInstance.setPlan(planInstance); + } + + NodeList elements10 = resourcesElement.getElementsByTagName("OutputItems"); + Element outputItemsSequenceElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (outputItemsSequenceElement != null) + { + for (int i2 = 0; i2 < outputItemsSequenceElement.getElementsByTagName("OutputItem").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element outputItemsElement = ((org.w3c.dom.Element) outputItemsSequenceElement.getElementsByTagName("OutputItem").item(i2)); + NodeList elements11 = outputItemsElement.getElementsByTagName("Name"); + String outputItemsKey = elements11.getLength() > 0 ? ((org.w3c.dom.Element) elements11.item(0)).getTextContent() : null; + NodeList elements12 = outputItemsElement.getElementsByTagName("Value"); + String outputItemsValue = elements12.getLength() > 0 ? ((org.w3c.dom.Element) elements12.item(0)).getTextContent() : null; + resourceInstance.getOutputItems().put(outputItemsKey, outputItemsValue); + } + } + + NodeList elements13 = resourcesElement.getElementsByTagName("State"); + Element stateElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + resourceInstance.setState(stateInstance); + } + + NodeList elements14 = resourcesElement.getElementsByTagName("SubState"); + Element subStateElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (subStateElement != null) + { + String subStateInstance; + subStateInstance = subStateElement.getTextContent(); + resourceInstance.setSubState(subStateInstance); + } + + NodeList elements15 = resourcesElement.getElementsByTagName("Label"); + Element labelElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent(); + resourceInstance.setLabel(labelInstance); + } + } + } + } + + result.setStatusCode(statusCode); + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * The List Cloud Services operation enumerates services that are + * provisioned for a subscription. + * + * @return The response structure for the Cloud Service List operation + */ + @Override + public Future listAsync() + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public CloudServiceListResponse call() throws Exception + { + return list(); + } + }); + } + + /** + * The List Cloud Services operation enumerates services that are + * provisioned for a subscription. + * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @return The response structure for the Cloud Service List operation + */ + @Override + public CloudServiceListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException + { + // Validate + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + this.getClient().getCredentials().getSubscriptionId() + "/CloudServices"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + CloudServiceListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new CloudServiceListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("CloudServices"); + Element cloudServicesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (cloudServicesSequenceElement != null) + { + for (int i1 = 0; i1 < cloudServicesSequenceElement.getElementsByTagName("CloudService").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element cloudServicesElement = ((org.w3c.dom.Element) cloudServicesSequenceElement.getElementsByTagName("CloudService").item(i1)); + CloudServiceListResponse.CloudService cloudServiceInstance = new CloudServiceListResponse.CloudService(); + result.getCloudServices().add(cloudServiceInstance); + + NodeList elements2 = cloudServicesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + cloudServiceInstance.setName(nameInstance); + } + + NodeList elements3 = cloudServicesElement.getElementsByTagName("Label"); + Element labelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent(); + cloudServiceInstance.setLabel(labelInstance); + } + + NodeList elements4 = cloudServicesElement.getElementsByTagName("Description"); + Element descriptionElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (descriptionElement != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + cloudServiceInstance.setDescription(descriptionInstance); + } + + NodeList elements5 = cloudServicesElement.getElementsByTagName("GeoRegion"); + Element geoRegionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (geoRegionElement != null) + { + String geoRegionInstance; + geoRegionInstance = geoRegionElement.getTextContent(); + cloudServiceInstance.setGeoRegion(geoRegionInstance); + } + + NodeList elements6 = cloudServicesElement.getElementsByTagName("Resources"); + Element resourcesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (resourcesSequenceElement != null) + { + for (int i2 = 0; i2 < resourcesSequenceElement.getElementsByTagName("Resource").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element resourcesElement = ((org.w3c.dom.Element) resourcesSequenceElement.getElementsByTagName("Resource").item(i2)); + CloudServiceListResponse.CloudService.AddOnResource resourceInstance = new CloudServiceListResponse.CloudService.AddOnResource(); + cloudServiceInstance.getResources().add(resourceInstance); + + NodeList elements7 = resourcesElement.getElementsByTagName("ResourceProviderNamespace"); + Element resourceProviderNamespaceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (resourceProviderNamespaceElement != null) + { + String resourceProviderNamespaceInstance; + resourceProviderNamespaceInstance = resourceProviderNamespaceElement.getTextContent(); + resourceInstance.setNamespace(resourceProviderNamespaceInstance); + } + + NodeList elements8 = resourcesElement.getElementsByTagName("Type"); + Element typeElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + resourceInstance.setType(typeInstance); + } + + NodeList elements9 = resourcesElement.getElementsByTagName("Name"); + Element nameElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + resourceInstance.setName(nameInstance2); + } + + NodeList elements10 = resourcesElement.getElementsByTagName("Plan"); + Element planElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (planElement != null) + { + String planInstance; + planInstance = planElement.getTextContent(); + resourceInstance.setPlan(planInstance); + } + + NodeList elements11 = resourcesElement.getElementsByTagName("SchemaVersion"); + Element schemaVersionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (schemaVersionElement != null) + { + String schemaVersionInstance; + schemaVersionInstance = schemaVersionElement.getTextContent(); + resourceInstance.setSchemaVersion(schemaVersionInstance); + } + + NodeList elements12 = resourcesElement.getElementsByTagName("ETag"); + Element eTagElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (eTagElement != null) + { + String eTagInstance; + eTagInstance = eTagElement.getTextContent(); + resourceInstance.setETag(eTagInstance); + } + + NodeList elements13 = resourcesElement.getElementsByTagName("State"); + Element stateElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + resourceInstance.setState(stateInstance); + } + + NodeList elements14 = resourcesElement.getElementsByTagName("UsageMeters"); + Element usageMetersSequenceElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (usageMetersSequenceElement != null) + { + for (int i3 = 0; i3 < usageMetersSequenceElement.getElementsByTagName("UsageMeter").getLength(); i3 = i3 + 1) + { + org.w3c.dom.Element usageMetersElement = ((org.w3c.dom.Element) usageMetersSequenceElement.getElementsByTagName("UsageMeter").item(i3)); + CloudServiceListResponse.CloudService.AddOnResource.UsageLimit usageMeterInstance = new CloudServiceListResponse.CloudService.AddOnResource.UsageLimit(); + resourceInstance.getUsageLimits().add(usageMeterInstance); + + NodeList elements15 = usageMetersElement.getElementsByTagName("Name"); + Element nameElement3 = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (nameElement3 != null) + { + String nameInstance3; + nameInstance3 = nameElement3.getTextContent(); + usageMeterInstance.setName(nameInstance3); + } + + NodeList elements16 = usageMetersElement.getElementsByTagName("Unit"); + Element unitElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (unitElement != null) + { + String unitInstance; + unitInstance = unitElement.getTextContent(); + usageMeterInstance.setUnit(unitInstance); + } + + NodeList elements17 = usageMetersElement.getElementsByTagName("Included"); + Element includedElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (includedElement != null) + { + long includedInstance; + includedInstance = Long.parseLong(includedElement.getTextContent()); + usageMeterInstance.setAmountIncluded(includedInstance); + } + + NodeList elements18 = usageMetersElement.getElementsByTagName("Used"); + Element usedElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (usedElement != null) + { + long usedInstance; + usedInstance = Long.parseLong(usedElement.getTextContent()); + usageMeterInstance.setAmountUsed(usedInstance); + } + } + } + + NodeList elements19 = resourcesElement.getElementsByTagName("OutputItems"); + Element outputItemsSequenceElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (outputItemsSequenceElement != null) + { + for (int i4 = 0; i4 < outputItemsSequenceElement.getElementsByTagName("OutputItem").getLength(); i4 = i4 + 1) + { + org.w3c.dom.Element outputItemsElement = ((org.w3c.dom.Element) outputItemsSequenceElement.getElementsByTagName("OutputItem").item(i4)); + NodeList elements20 = outputItemsElement.getElementsByTagName("Key"); + String outputItemsKey = elements20.getLength() > 0 ? ((org.w3c.dom.Element) elements20.item(0)).getTextContent() : null; + NodeList elements21 = outputItemsElement.getElementsByTagName("Value"); + String outputItemsValue = elements21.getLength() > 0 ? ((org.w3c.dom.Element) elements21.item(0)).getTextContent() : null; + resourceInstance.getOutputItems().put(outputItemsKey, outputItemsValue); + } + } + + NodeList elements22 = resourcesElement.getElementsByTagName("OperationStatus"); + Element operationStatusElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (operationStatusElement != null) + { + CloudServiceListResponse.CloudService.AddOnResource.OperationStatus operationStatusInstance = new CloudServiceListResponse.CloudService.AddOnResource.OperationStatus(); + resourceInstance.setStatus(operationStatusInstance); + + NodeList elements23 = operationStatusElement.getElementsByTagName("Type"); + Element typeElement2 = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (typeElement2 != null) + { + String typeInstance2; + typeInstance2 = typeElement2.getTextContent(); + operationStatusInstance.setType(typeInstance2); + } + + NodeList elements24 = operationStatusElement.getElementsByTagName("Result"); + Element resultElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (resultElement != null) + { + String resultInstance; + resultInstance = resultElement.getTextContent(); + operationStatusInstance.setResult(resultInstance); + } + } + } + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceCreateParameters.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceCreateParameters.java new file mode 100644 index 0000000000000..eb4580d6f6307 --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceCreateParameters.java @@ -0,0 +1,109 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler.models; + +public class CloudServiceCreateParameters +{ + private String description; + + /** + * Description for the cloud service. + * @return The Description value. + */ + public String getDescription() + { + return this.description; + } + + /** + * Description for the cloud service. + * @param descriptionValue The Description value. + */ + public void setDescription(final String descriptionValue) + { + this.description = descriptionValue; + } + + private String email; + + /** + * Optional e-mail address to associate with the service. + * @return The Email value. + */ + public String getEmail() + { + return this.email; + } + + /** + * Optional e-mail address to associate with the service. + * @param emailValue The Email value. + */ + public void setEmail(final String emailValue) + { + this.email = emailValue; + } + + private String geoRegion; + + /** + * The region for the cloud service. This field cannot be updated after the + * cloud service is created. + * @return The GeoRegion value. + */ + public String getGeoRegion() + { + return this.geoRegion; + } + + /** + * The region for the cloud service. This field cannot be updated after the + * cloud service is created. + * @param geoRegionValue The GeoRegion value. + */ + public void setGeoRegion(final String geoRegionValue) + { + this.geoRegion = geoRegionValue; + } + + private String label; + + /** + * Label for the cloud service. + * @return The Label value. + */ + public String getLabel() + { + return this.label; + } + + /** + * Label for the cloud service. + * @param labelValue The Label value. + */ + public void setLabel(final String labelValue) + { + this.label = labelValue; + } +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceGetResponse.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceGetResponse.java new file mode 100644 index 0000000000000..8c8b93bf978f1 --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceGetResponse.java @@ -0,0 +1,302 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler.models; + +import com.microsoft.windowsazure.core.OperationResponse; +import java.util.ArrayList; +import java.util.HashMap; + +/** +* Information about a retrieved Cloud Service. +*/ +public class CloudServiceGetResponse extends OperationResponse +{ + private String geoLocation; + + /** + * The location associated with the cloud service. + * @return The GeoLocation value. + */ + public String getGeoLocation() + { + return this.geoLocation; + } + + /** + * The location associated with the cloud service. + * @param geoLocationValue The GeoLocation value. + */ + public void setGeoLocation(final String geoLocationValue) + { + this.geoLocation = geoLocationValue; + } + + private ArrayList resources; + + /** + * A collection of resources. + * @return The Resources value. + */ + public ArrayList getResources() + { + return this.resources; + } + + /** + * A collection of resources. + * @param resourcesValue The Resources value. + */ + public void setResources(final ArrayList resourcesValue) + { + this.resources = resourcesValue; + } + + /** + * Initializes a new instance of the CloudServiceGetResponse class. + * + */ + public CloudServiceGetResponse() + { + super(); + this.resources = new ArrayList(); + } + + /** + * A resource. + */ + public static class Resource + { + private String eTag; + + /** + * ETag identifying the current entity revision on the server. + * @return The ETag value. + */ + public String getETag() + { + return this.eTag; + } + + /** + * ETag identifying the current entity revision on the server. + * @param eTagValue The ETag value. + */ + public void setETag(final String eTagValue) + { + this.eTag = eTagValue; + } + + private String label; + + /** + * Label of the resource. + * @return The Label value. + */ + public String getLabel() + { + return this.label; + } + + /** + * Label of the resource. + * @param labelValue The Label value. + */ + public void setLabel(final String labelValue) + { + this.label = labelValue; + } + + private String name; + + /** + * A name for the resource. The name must be unique within the + * subscription ID and cloud service. + * @return The Name value. + */ + public String getName() + { + return this.name; + } + + /** + * A name for the resource. The name must be unique within the + * subscription ID and cloud service. + * @param nameValue The Name value. + */ + public void setName(final String nameValue) + { + this.name = nameValue; + } + + private HashMap outputItems; + + /** + * @return The OutputItems value. + */ + public HashMap getOutputItems() + { + return this.outputItems; + } + + /** + * @param outputItemsValue The OutputItems value. + */ + public void setOutputItems(final HashMap outputItemsValue) + { + this.outputItems = outputItemsValue; + } + + private String plan; + + /** + * The plan of the resource. + * @return The Plan value. + */ + public String getPlan() + { + return this.plan; + } + + /** + * The plan of the resource. + * @param planValue The Plan value. + */ + public void setPlan(final String planValue) + { + this.plan = planValue; + } + + private String resourceProviderNamespace; + + /** + * Namespace identifier for the resource provider. + * @return The ResourceProviderNamespace value. + */ + public String getResourceProviderNamespace() + { + return this.resourceProviderNamespace; + } + + /** + * Namespace identifier for the resource provider. + * @param resourceProviderNamespaceValue The ResourceProviderNamespace + * value. + */ + public void setResourceProviderNamespace(final String resourceProviderNamespaceValue) + { + this.resourceProviderNamespace = resourceProviderNamespaceValue; + } + + private String schemaVersion; + + /** + * Optional version of the intrinsic properties for the resource. If not + * specified, you must conform to the default contract resource. + * @return The SchemaVersion value. + */ + public String getSchemaVersion() + { + return this.schemaVersion; + } + + /** + * Optional version of the intrinsic properties for the resource. If not + * specified, you must conform to the default contract resource. + * @param schemaVersionValue The SchemaVersion value. + */ + public void setSchemaVersion(final String schemaVersionValue) + { + this.schemaVersion = schemaVersionValue; + } + + private String state; + + /** + * The current resource status. + * @return The State value. + */ + public String getState() + { + return this.state; + } + + /** + * The current resource status. + * @param stateValue The State value. + */ + public void setState(final String stateValue) + { + this.state = stateValue; + } + + private String subState; + + /** + * An optional, more detailed resource status. + * @return The SubState value. + */ + public String getSubState() + { + return this.subState; + } + + /** + * An optional, more detailed resource status. + * @param subStateValue The SubState value. + */ + public void setSubState(final String subStateValue) + { + this.subState = subStateValue; + } + + private String type; + + /** + * The Type for the resource. + * @return The Type value. + */ + public String getType() + { + return this.type; + } + + /** + * The Type for the resource. + * @param typeValue The Type value. + */ + public void setType(final String typeValue) + { + this.type = typeValue; + } + + /** + * Initializes a new instance of the Resource class. + * + */ + public Resource() + { + this.outputItems = new HashMap(); + } + } +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceListResponse.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceListResponse.java new file mode 100644 index 0000000000000..2c81cca5798b0 --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceListResponse.java @@ -0,0 +1,539 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler.models; + +import com.microsoft.windowsazure.core.OperationResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; + +/** +* The response structure for the Cloud Service List operation +*/ +public class CloudServiceListResponse extends OperationResponse implements Iterable +{ + private ArrayList cloudServices; + + /** + * The list of cloud service locations for this subscription. + * @return The CloudServices value. + */ + public ArrayList getCloudServices() + { + return this.cloudServices; + } + + /** + * The list of cloud service locations for this subscription. + * @param cloudServicesValue The CloudServices value. + */ + public void setCloudServices(final ArrayList cloudServicesValue) + { + this.cloudServices = cloudServicesValue; + } + + /** + * Initializes a new instance of the CloudServiceListResponse class. + * + */ + public CloudServiceListResponse() + { + super(); + this.cloudServices = new ArrayList(); + } + + /** + * Gets the sequence of CloudServices. + * + */ + public Iterator iterator() + { + return this.getCloudServices().iterator(); + } + + /** + * Defines a cloud service-supporting region in which a item is located. + */ + public static class CloudService + { + private String description; + + /** + * The description of the cloud service region. + * @return The Description value. + */ + public String getDescription() + { + return this.description; + } + + /** + * The description of the cloud service region. + * @param descriptionValue The Description value. + */ + public void setDescription(final String descriptionValue) + { + this.description = descriptionValue; + } + + private String geoRegion; + + /** + * The geographical region in which this cloud service can run. + * @return The GeoRegion value. + */ + public String getGeoRegion() + { + return this.geoRegion; + } + + /** + * The geographical region in which this cloud service can run. + * @param geoRegionValue The GeoRegion value. + */ + public void setGeoRegion(final String geoRegionValue) + { + this.geoRegion = geoRegionValue; + } + + private String label; + + /** + * The label of the cloud service region. + * @return The Label value. + */ + public String getLabel() + { + return this.label; + } + + /** + * The label of the cloud service region. + * @param labelValue The Label value. + */ + public void setLabel(final String labelValue) + { + this.label = labelValue; + } + + private String name; + + /** + * The name of the cloud service region. + * @return The Name value. + */ + public String getName() + { + return this.name; + } + + /** + * The name of the cloud service region. + * @param nameValue The Name value. + */ + public void setName(final String nameValue) + { + this.name = nameValue; + } + + private ArrayList resources; + + /** + * A list of existing resources installed into a cloud service region. + * @return The Resources value. + */ + public ArrayList getResources() + { + return this.resources; + } + + /** + * A list of existing resources installed into a cloud service region. + * @param resourcesValue The Resources value. + */ + public void setResources(final ArrayList resourcesValue) + { + this.resources = resourcesValue; + } + + /** + * Initializes a new instance of the CloudService class. + * + */ + public CloudService() + { + this.resources = new ArrayList(); + } + + /** + * A store add-on item. + */ + public static class AddOnResource + { + private String eTag; + + /** + * The ETag for this resource. + * @return The ETag value. + */ + public String getETag() + { + return this.eTag; + } + + /** + * The ETag for this resource. + * @param eTagValue The ETag value. + */ + public void setETag(final String eTagValue) + { + this.eTag = eTagValue; + } + + private String name; + + /** + * The user-input name of this item. + * @return The Name value. + */ + public String getName() + { + return this.name; + } + + /** + * The user-input name of this item. + * @param nameValue The Name value. + */ + public void setName(final String nameValue) + { + this.name = nameValue; + } + + private String namespace; + + /** + * The namespace in which this item resides. + * @return The Namespace value. + */ + public String getNamespace() + { + return this.namespace; + } + + /** + * The namespace in which this item resides. + * @param namespaceValue The Namespace value. + */ + public void setNamespace(final String namespaceValue) + { + this.namespace = namespaceValue; + } + + private HashMap outputItems; + + /** + * Output items associated with an individual resource. + * @return The OutputItems value. + */ + public HashMap getOutputItems() + { + return this.outputItems; + } + + /** + * Output items associated with an individual resource. + * @param outputItemsValue The OutputItems value. + */ + public void setOutputItems(final HashMap outputItemsValue) + { + this.outputItems = outputItemsValue; + } + + private String plan; + + /** + * The plan for this item as selected by the user. + * @return The Plan value. + */ + public String getPlan() + { + return this.plan; + } + + /** + * The plan for this item as selected by the user. + * @param planValue The Plan value. + */ + public void setPlan(final String planValue) + { + this.plan = planValue; + } + + private String schemaVersion; + + /** + * The schema version for this resource. + * @return The SchemaVersion value. + */ + public String getSchemaVersion() + { + return this.schemaVersion; + } + + /** + * The schema version for this resource. + * @param schemaVersionValue The SchemaVersion value. + */ + public void setSchemaVersion(final String schemaVersionValue) + { + this.schemaVersion = schemaVersionValue; + } + + private String state; + + /** + * The state of this resource. + * @return The State value. + */ + public String getState() + { + return this.state; + } + + /** + * The state of this resource. + * @param stateValue The State value. + */ + public void setState(final String stateValue) + { + this.state = stateValue; + } + + private CloudServiceListResponse.CloudService.AddOnResource.OperationStatus status; + + /** + * Operation status items associated with an individual resource. + * @return The Status value. + */ + public CloudServiceListResponse.CloudService.AddOnResource.OperationStatus getStatus() + { + return this.status; + } + + /** + * Operation status items associated with an individual resource. + * @param statusValue The Status value. + */ + public void setStatus(final CloudServiceListResponse.CloudService.AddOnResource.OperationStatus statusValue) + { + this.status = statusValue; + } + + private String type; + + /** + * The type of store item. + * @return The Type value. + */ + public String getType() + { + return this.type; + } + + /** + * The type of store item. + * @param typeValue The Type value. + */ + public void setType(final String typeValue) + { + this.type = typeValue; + } + + private ArrayList usageLimits; + + /** + * Usage meters associated with an individual resource. + * @return The UsageLimits value. + */ + public ArrayList getUsageLimits() + { + return this.usageLimits; + } + + /** + * Usage meters associated with an individual resource. + * @param usageLimitsValue The UsageLimits value. + */ + public void setUsageLimits(final ArrayList usageLimitsValue) + { + this.usageLimits = usageLimitsValue; + } + + /** + * Initializes a new instance of the AddOnResource class. + * + */ + public AddOnResource() + { + this.outputItems = new HashMap(); + this.usageLimits = new ArrayList(); + } + + /** + * The operation status of an individual resource item. + */ + public static class OperationStatus + { + private String result; + + /** + * The result of this operation status. + * @return The Result value. + */ + public String getResult() + { + return this.result; + } + + /** + * The result of this operation status. + * @param resultValue The Result value. + */ + public void setResult(final String resultValue) + { + this.result = resultValue; + } + + private String type; + + /** + * The type of this operation status. + * @return The Type value. + */ + public String getType() + { + return this.type; + } + + /** + * The type of this operation status. + * @param typeValue The Type value. + */ + public void setType(final String typeValue) + { + this.type = typeValue; + } + } + + /** + * Describes the current utilization and metering of a resource item. + */ + public static class UsageLimit + { + private long amountIncluded; + + /** + * Defines the limit of this usage included in this resource's + * plan. + * @return The AmountIncluded value. + */ + public long getAmountIncluded() + { + return this.amountIncluded; + } + + /** + * Defines the limit of this usage included in this resource's + * plan. + * @param amountIncludedValue The AmountIncluded value. + */ + public void setAmountIncluded(final long amountIncludedValue) + { + this.amountIncluded = amountIncludedValue; + } + + private long amountUsed; + + /** + * The amount of this resource that has already been used. + * @return The AmountUsed value. + */ + public long getAmountUsed() + { + return this.amountUsed; + } + + /** + * The amount of this resource that has already been used. + * @param amountUsedValue The AmountUsed value. + */ + public void setAmountUsed(final long amountUsedValue) + { + this.amountUsed = amountUsedValue; + } + + private String name; + + /** + * The name of this usage limit. + * @return The Name value. + */ + public String getName() + { + return this.name; + } + + /** + * The name of this usage limit. + * @param nameValue The Name value. + */ + public void setName(final String nameValue) + { + this.name = nameValue; + } + + private String unit; + + /** + * The unit in which this usage limit is measured. + * @return The Unit value. + */ + public String getUnit() + { + return this.unit; + } + + /** + * The unit in which this usage limit is measured. + * @param unitValue The Unit value. + */ + public void setUnit(final String unitValue) + { + this.unit = unitValue; + } + } + } + } +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceOperationStatus.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceOperationStatus.java new file mode 100644 index 0000000000000..2734852a82a9f --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceOperationStatus.java @@ -0,0 +1,45 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler.models; + +/** +* The status of the asynchronous request. +*/ +public enum CloudServiceOperationStatus +{ + /** + * The asynchronous request is in progress. + */ + InProgress, + + /** + * The asynchronous request succeeded. + */ + Succeeded, + + /** + * The asynchronous request failed. + */ + Failed, +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceOperationStatusResponse.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceOperationStatusResponse.java new file mode 100644 index 0000000000000..46bc986df9fe1 --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/CloudServiceOperationStatusResponse.java @@ -0,0 +1,177 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler.models; + +import com.microsoft.windowsazure.core.OperationResponse; + +/** +* The response body contains the status of the specified asynchronous +* operation, indicating whether it has succeeded, is inprogress, or has +* failed. Note that this status is distinct from the HTTP status code returned +* for the Get Operation Status operation itself. If the asynchronous +* operation succeeded, the response body includes the HTTP status code for the +* successful request. If the asynchronous operation failed, the response body +* includes the HTTP status code for the failed request, and also includes +* error information regarding the failure. +*/ +public class CloudServiceOperationStatusResponse extends OperationResponse +{ + private CloudServiceOperationStatusResponse.ErrorDetails error; + + /** + * If the asynchronous operation failed, the response body includes the HTTP + * status code for the failed request, and also includes error information + * regarding the failure. + * @return The Error value. + */ + public CloudServiceOperationStatusResponse.ErrorDetails getError() + { + return this.error; + } + + /** + * If the asynchronous operation failed, the response body includes the HTTP + * status code for the failed request, and also includes error information + * regarding the failure. + * @param errorValue The Error value. + */ + public void setError(final CloudServiceOperationStatusResponse.ErrorDetails errorValue) + { + this.error = errorValue; + } + + private Integer httpStatusCode; + + /** + * The HTTP status code for the asynchronous request. + * @return The HttpStatusCode value. + */ + public Integer getHttpStatusCode() + { + return this.httpStatusCode; + } + + /** + * The HTTP status code for the asynchronous request. + * @param httpStatusCodeValue The HttpStatusCode value. + */ + public void setHttpStatusCode(final Integer httpStatusCodeValue) + { + this.httpStatusCode = httpStatusCodeValue; + } + + private String id; + + /** + * The request ID of the asynchronous request. This value is returned in the + * x-ms-request-id response header of the asynchronous request. + * @return The Id value. + */ + public String getId() + { + return this.id; + } + + /** + * The request ID of the asynchronous request. This value is returned in the + * x-ms-request-id response header of the asynchronous request. + * @param idValue The Id value. + */ + public void setId(final String idValue) + { + this.id = idValue; + } + + private CloudServiceOperationStatus status; + + /** + * The status of the asynchronous request. + * @return The Status value. + */ + public CloudServiceOperationStatus getStatus() + { + return this.status; + } + + /** + * The status of the asynchronous request. + * @param statusValue The Status value. + */ + public void setStatus(final CloudServiceOperationStatus statusValue) + { + this.status = statusValue; + } + + /** + * If the asynchronous operation failed, the response body includes the HTTP + * status code for the failed request, and also includes error information + * regarding the failure. + */ + public static class ErrorDetails + { + private String code; + + /** + * The management service error code returned if the asynchronous + * request failed. + * @return The Code value. + */ + public String getCode() + { + return this.code; + } + + /** + * The management service error code returned if the asynchronous + * request failed. + * @param codeValue The Code value. + */ + public void setCode(final String codeValue) + { + this.code = codeValue; + } + + private String message; + + /** + * The management service error message returned if the asynchronous + * request failed. + * @return The Message value. + */ + public String getMessage() + { + return this.message; + } + + /** + * The management service error message returned if the asynchronous + * request failed. + * @param messageValue The Message value. + */ + public void setMessage(final String messageValue) + { + this.message = messageValue; + } + } +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/EntitleResourceParameters.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/EntitleResourceParameters.java new file mode 100644 index 0000000000000..89ecd4208807f --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/EntitleResourceParameters.java @@ -0,0 +1,89 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler.models; + +import java.util.Calendar; + +public class EntitleResourceParameters +{ + private Calendar registrationDate; + + /** + * The required data when the entitlement is performed. + * @return The RegistrationDate value. + */ + public Calendar getRegistrationDate() + { + return this.registrationDate; + } + + /** + * The required data when the entitlement is performed. + * @param registrationDateValue The RegistrationDate value. + */ + public void setRegistrationDate(final Calendar registrationDateValue) + { + this.registrationDate = registrationDateValue; + } + + private String resourceNamespace; + + /** + * Required NameSpace identifier for the resource provider. + * @return The ResourceNamespace value. + */ + public String getResourceNamespace() + { + return this.resourceNamespace; + } + + /** + * Required NameSpace identifier for the resource provider. + * @param resourceNamespaceValue The ResourceNamespace value. + */ + public void setResourceNamespace(final String resourceNamespaceValue) + { + this.resourceNamespace = resourceNamespaceValue; + } + + private String resourceType; + + /** + * Required type for the resource. + * @return The ResourceType value. + */ + public String getResourceType() + { + return this.resourceType; + } + + /** + * Required type for the resource. + * @param resourceTypeValue The ResourceType value. + */ + public void setResourceType(final String resourceTypeValue) + { + this.resourceType = resourceTypeValue; + } +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/GetCloudServiceResourceState.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/GetCloudServiceResourceState.java new file mode 100644 index 0000000000000..985783cba55f8 --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/GetCloudServiceResourceState.java @@ -0,0 +1,57 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.scheduler.models; + +/** +* Specifies the state for a cloud service resource. +*/ +public class GetCloudServiceResourceState +{ + /** + * The resource state is unknown, there may have been a communicaiton + * failure, or the resource has not yet been processed. + */ + public static final String Unknown = "Unknown"; + + /** + * The resource provider did not respond with information for the resource. + */ + public static final String NotFound = "NotFound"; + + /** + * The resource has started and is running fine. + */ + public static final String Started = "Started"; + + /** + * The resource was stopped due to an issue. + */ + public static final String Stopped = "Stopped"; + + /** + * The resource was temporarily put on hold. This may be due to a monetary + * event. + */ + public static final String Paused = "Paused"; +} From 82b8742b1e784234fee93ee04afd0bb6fac7d323 Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Mon, 20 Jan 2014 10:48:15 +0100 Subject: [PATCH 2/4] Add exports --- .../CloudServiceManagementService.java | 80 +++++++++++++++++++ .../management/scheduler/Exports.java | 5 +- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementService.java diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementService.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementService.java new file mode 100644 index 0000000000000..741964feb2b20 --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/CloudServiceManagementService.java @@ -0,0 +1,80 @@ +/** + * Copyright Microsoft Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.microsoft.windowsazure.management.scheduler; + +import com.microsoft.windowsazure.Configuration; + +/** + * + * Access cloud service management functionality. + * + */ +public final class CloudServiceManagementService +{ + private CloudServiceManagementService() + { + // class is not instantiated + } + + /** + * Creates an instance of the CloudServiceManagementClient API. + * @return An instance of the CloudServiceManagementClient API. + */ + public static CloudServiceManagementClient create() + { + return Configuration.getInstance().create( + CloudServiceManagementClient.class); + } + + /** + * Creates an instance of the CloudServiceManagementClient API + * using the specified configuration. + * + * @param config A Configuration object that represents the + * configuration for the service management. + * @return An instance of the CloudServiceManagementClient API. + */ + public static CloudServiceManagementClient create(final Configuration config) + { + return config.create(CloudServiceManagementClient.class); + } + + /** + * Creates an instance of the CloudServiceManagementClient API. + * + * @param profile A String object that representing the profile + * of the service management service. + * @return An instance of the CloudServiceManagementClient API. + */ + public static CloudServiceManagementClient create(final String profile) + { + return Configuration.getInstance().create(profile, + CloudServiceManagementClient.class); + } + + /** + * Creates an instance of the CloudServiceManagementClient API + * using the specified configuration. + * + * @param config A Configuration object that represents the + * configuration for the service management. + * @return An instance of the CloudServiceManagementClient API. + */ + public static CloudServiceManagementClient create(final String profile, + final Configuration config) + { + return config.create(profile, CloudServiceManagementClient.class); + } +} diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/Exports.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/Exports.java index 0a77a857a1223..a03b48b3787a8 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/Exports.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/Exports.java @@ -27,8 +27,11 @@ public class Exports implements Builder.Exports @Override public void register(final Builder.Registry registry) { - // provide contract implementation + // provide contract implementations registry.add(SchedulerManagementClient.class, SchedulerManagementClientImpl.class); + + registry.add(CloudServiceManagementClient.class, + CloudServiceManagementClientImpl.class); } } From 818e71530e3db46838642aa403bb8dc6ee81d25d Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Mon, 20 Jan 2014 11:21:45 +0100 Subject: [PATCH 3/4] update all wrappers --- .../compute/ComputeManagementClient.java | 17 + .../compute/ComputeManagementClientImpl.java | 183 +- .../compute/DeploymentOperations.java | 407 +- .../compute/DeploymentOperationsImpl.java | 6286 ++++++------ .../compute/HostedServiceOperations.java | 191 +- .../compute/HostedServiceOperationsImpl.java | 4278 +++++---- .../compute/OperatingSystemOperations.java | 20 + .../OperatingSystemOperationsImpl.java | 429 +- .../compute/ServiceCertificateOperations.java | 81 +- .../ServiceCertificateOperationsImpl.java | 472 +- .../compute/VirtualMachineDiskOperations.java | 104 +- .../VirtualMachineDiskOperationsImpl.java | 1606 ++-- .../VirtualMachineImageOperations.java | 91 +- .../VirtualMachineImageOperationsImpl.java | 1756 ++-- .../compute/VirtualMachineOperations.java | 361 +- .../compute/VirtualMachineOperationsImpl.java | 8454 +++++++++-------- .../compute/models/AccessControlListRule.java | 24 +- .../ComputeOperationStatusResponse.java | 36 +- .../compute/models/ConfigurationSet.java | 132 +- .../compute/models/DataVirtualHardDisk.java | 36 +- ...ploymentChangeConfigurationParameters.java | 32 +- .../models/DeploymentCreateParameters.java | 52 +- .../DeploymentGetPackageParameters.java | 14 +- .../compute/models/DeploymentGetResponse.java | 144 +- ...mentRollbackUpdateOrUpgradeParameters.java | 14 +- .../models/DeploymentSwapParameters.java | 12 +- .../DeploymentUpdateStatusParameters.java | 6 +- .../models/DeploymentUpgradeParameters.java | 50 +- ...DeploymentWalkUpgradeDomainParameters.java | 6 +- .../management/compute/models/DnsServer.java | 12 +- .../compute/models/DnsSettings.java | 6 +- .../compute/models/DomainJoinCredentials.java | 18 +- .../models/DomainJoinProvisioning.java | 6 +- .../compute/models/DomainJoinSettings.java | 24 +- .../compute/models/EndpointAcl.java | 6 +- .../models/ExtensionConfiguration.java | 30 +- .../HostedServiceAddExtensionParameters.java | 42 +- ...dServiceCheckNameAvailabilityResponse.java | 14 +- .../models/HostedServiceCreateParameters.java | 36 +- .../HostedServiceGetDetailedResponse.java | 138 +- .../HostedServiceGetExtensionResponse.java | 42 +- .../models/HostedServiceGetResponse.java | 18 +- ...erviceListAvailableExtensionsResponse.java | 62 +- .../HostedServiceListExtensionsResponse.java | 48 +- .../models/HostedServiceListResponse.java | 24 +- .../models/HostedServiceProperties.java | 48 +- .../models/HostedServiceUpdateParameters.java | 18 +- .../compute/models/InputEndpoint.java | 57 +- .../compute/models/InstanceEndpoint.java | 30 +- .../compute/models/LoadBalancerProbe.java | 30 +- .../compute/models/OSVirtualHardDisk.java | 36 +- .../OperatingSystemListFamiliesResponse.java | 52 +- .../models/OperatingSystemListResponse.java | 46 +- .../compute/models/PersistentVMDowntime.java | 18 +- .../management/compute/models/Role.java | 65 +- .../compute/models/RoleInstance.java | 83 +- .../ServiceCertificateCreateParameters.java | 18 +- .../ServiceCertificateDeleteParameters.java | 18 +- .../ServiceCertificateGetParameters.java | 18 +- .../models/ServiceCertificateGetResponse.java | 6 +- .../ServiceCertificateListResponse.java | 30 +- .../compute/models/SshSettingKeyPair.java | 12 +- .../compute/models/SshSettingPublicKey.java | 12 +- .../compute/models/SshSettings.java | 12 +- .../models/StoredCertificateSettings.java | 12 +- .../compute/models/UpgradeStatus.java | 18 +- .../compute/models/VirtualIPAddress.java | 20 +- .../VirtualMachineCaptureParameters.java | 24 +- ...tualMachineCreateDeploymentParameters.java | 42 +- .../VirtualMachineCreateParameters.java | 40 +- ...alMachineDiskCreateDataDiskParameters.java | 42 +- ...irtualMachineDiskCreateDiskParameters.java | 24 +- .../VirtualMachineDiskCreateDiskResponse.java | 80 +- ...VirtualMachineDiskGetDataDiskResponse.java | 36 +- .../VirtualMachineDiskGetDiskResponse.java | 88 +- .../VirtualMachineDiskListResponse.java | 94 +- ...alMachineDiskUpdateDataDiskParameters.java | 36 +- ...irtualMachineDiskUpdateDiskParameters.java | 32 +- .../VirtualMachineDiskUpdateDiskResponse.java | 50 +- ...alMachineGetRemoteDesktopFileResponse.java | 6 +- .../models/VirtualMachineGetResponse.java | 59 +- .../VirtualMachineImageCreateParameters.java | 98 +- .../VirtualMachineImageCreateResponse.java | 122 +- .../VirtualMachineImageGetResponse.java | 128 +- .../VirtualMachineImageListResponse.java | 126 +- .../VirtualMachineImageUpdateParameters.java | 72 +- .../VirtualMachineImageUpdateResponse.java | 122 +- .../models/VirtualMachineRoleSize.java | 22 +- .../VirtualMachineShutdownParameters.java | 6 +- ...VirtualMachineShutdownRolesParameters.java | 12 +- .../VirtualMachineStartRolesParameters.java | 6 +- ...achineUpdateLoadBalancedSetParameters.java | 64 +- .../VirtualMachineUpdateParameters.java | 46 +- .../WindowsRemoteManagementListener.java | 12 +- .../WindowsRemoteManagementSettings.java | 6 +- .../monitoring/alerts/AlertsClient.java | 4 + .../monitoring/alerts/AlertsClientImpl.java | 6 + .../monitoring/alerts/IncidentOperations.java | 18 + .../alerts/IncidentOperationsImpl.java | 290 +- .../monitoring/alerts/RuleOperations.java | 23 +- .../monitoring/alerts/RuleOperationsImpl.java | 350 +- .../monitoring/alerts/models/Incident.java | 30 +- .../alerts/models/IncidentCollection.java | 6 +- .../alerts/models/IncidentGetResponse.java | 6 +- .../alerts/models/IncidentListResponse.java | 39 +- .../monitoring/alerts/models/Rule.java | 42 +- .../alerts/models/RuleCollection.java | 6 +- .../models/RuleCreateOrUpdateParameters.java | 6 +- .../alerts/models/RuleEmailAction.java | 12 +- .../alerts/models/RuleGetResponse.java | 6 +- .../alerts/models/RuleListResponse.java | 39 +- .../alerts/models/RuleMetricDataSource.java | 18 +- .../alerts/models/ThresholdRuleCondition.java | 24 +- .../monitoring/autoscale/AutoscaleClient.java | 3 + .../autoscale/AutoscaleClientImpl.java | 5 + .../autoscale/SettingOperations.java | 17 +- .../autoscale/SettingOperationsImpl.java | 232 +- .../autoscale/models/AutoscaleProfile.java | 30 +- .../autoscale/models/AutoscaleSetting.java | 20 +- ...oscaleSettingCreateOrUpdateParameters.java | 6 +- .../models/AutoscaleSettingGetResponse.java | 10 +- .../autoscale/models/MetricTrigger.java | 54 +- .../autoscale/models/Recurrence.java | 20 +- .../autoscale/models/RecurrentSchedule.java | 40 +- .../autoscale/models/ScaleAction.java | 24 +- .../autoscale/models/ScaleCapacity.java | 16 +- .../autoscale/models/ScaleRule.java | 12 +- .../autoscale/models/TimeWindow.java | 18 +- .../metrics/MetricDefinitionOperations.java | 8 + .../MetricDefinitionOperationsImpl.java | 105 +- .../metrics/MetricSettingOperations.java | 15 +- .../metrics/MetricSettingOperationsImpl.java | 171 +- .../metrics/MetricValueOperations.java | 8 + .../metrics/MetricValueOperationsImpl.java | 105 +- .../monitoring/metrics/MetricsClient.java | 11 + .../monitoring/metrics/MetricsClientImpl.java | 13 + .../AvailabilityMetricSettingValue.java | 12 +- .../metrics/models/EndpointConfig.java | 24 +- .../metrics/models/MetricAvailability.java | 12 +- .../metrics/models/MetricDefinition.java | 55 +- .../models/MetricDefinitionCollection.java | 6 +- .../models/MetricDefinitionListResponse.java | 7 +- .../metrics/models/MetricSetting.java | 18 +- .../models/MetricSettingCollection.java | 6 +- .../models/MetricSettingListResponse.java | 6 +- .../models/MetricSettingsPutParameters.java | 6 +- .../metrics/models/MetricValue.java | 42 +- .../models/MetricValueListResponse.java | 6 +- .../metrics/models/MetricValueSet.java | 54 +- .../models/MetricValueSetCollection.java | 6 +- .../monitoring/metrics/models/NameConfig.java | 12 +- .../scheduler/JobCollectionOperations.java | 82 +- .../JobCollectionOperationsImpl.java | 757 +- .../scheduler/SchedulerManagementClient.java | 33 + .../SchedulerManagementClientImpl.java | 429 +- ...llectionCheckNameAvailabilityResponse.java | 6 +- .../models/JobCollectionCreateParameters.java | 18 +- .../models/JobCollectionCreateResponse.java | 6 +- .../models/JobCollectionGetResponse.java | 78 +- .../JobCollectionIntrinsicSettings.java | 12 +- .../models/JobCollectionMaxRecurrence.java | 12 +- .../scheduler/models/JobCollectionQuota.java | 18 +- .../models/JobCollectionUpdateParameters.java | 24 +- .../models/JobCollectionUpdateResponse.java | 6 +- ...ResourceProviderGetPropertiesResponse.java | 10 +- .../SchedulerOperationStatusResponse.java | 42 +- .../management/sql/DacOperations.java | 38 +- .../management/sql/DacOperationsImpl.java | 504 +- .../sql/DatabaseCopyOperations.java | 54 +- .../sql/DatabaseCopyOperationsImpl.java | 1487 +-- .../sql/DatabaseOperationOperations.java | 30 + .../sql/DatabaseOperationOperationsImpl.java | 1095 ++- .../management/sql/DatabaseOperations.java | 54 +- .../sql/DatabaseOperationsImpl.java | 1537 +-- .../sql/FirewallRuleOperations.java | 44 +- .../sql/FirewallRuleOperationsImpl.java | 569 +- .../management/sql/ServerOperations.java | 42 +- .../management/sql/ServerOperationsImpl.java | 429 +- .../sql/ServiceObjectiveOperations.java | 20 + .../sql/ServiceObjectiveOperationsImpl.java | 751 +- .../management/sql/SqlManagementClient.java | 9 + .../sql/SqlManagementClientImpl.java | 11 + .../sql/models/DacExportParameters.java | 48 +- .../sql/models/DacGetStatusResponse.java | 60 +- .../sql/models/DacImportExportResponse.java | 6 +- .../sql/models/DacImportParameters.java | 54 +- .../models/DatabaseCopyCreateParameters.java | 30 +- .../sql/models/DatabaseCopyListResponse.java | 6 +- .../sql/models/DatabaseCopyResponse.java | 104 +- .../models/DatabaseCopyUpdateParameters.java | 30 +- .../sql/models/DatabaseCreateParameters.java | 30 +- .../sql/models/DatabaseCreateResponse.java | 107 +- .../sql/models/DatabaseGetResponse.java | 107 +- .../sql/models/DatabaseListResponse.java | 113 +- .../models/DatabaseOperationGetResponse.java | 96 +- .../models/DatabaseOperationListResponse.java | 102 +- .../sql/models/DatabaseUpdateParameters.java | 36 +- .../sql/models/DatabaseUpdateResponse.java | 107 +- .../models/FirewallRuleCreateParameters.java | 18 +- .../models/FirewallRuleCreateResponse.java | 30 +- .../sql/models/FirewallRuleListResponse.java | 30 +- .../models/FirewallRuleUpdateParameters.java | 18 +- .../models/FirewallRuleUpdateResponse.java | 30 +- ...ChangeAdministratorPasswordParameters.java | 6 +- .../sql/models/ServerCreateParameters.java | 18 +- .../sql/models/ServerCreateResponse.java | 6 +- .../sql/models/ServerListResponse.java | 30 +- .../models/ServiceObjectiveGetResponse.java | 120 +- .../models/ServiceObjectiveListResponse.java | 126 +- .../storage/StorageAccountOperations.java | 98 +- .../storage/StorageAccountOperationsImpl.java | 1558 +-- .../storage/StorageManagementClient.java | 11 + .../storage/StorageManagementClientImpl.java | 177 +- .../models/CheckNameAvailabilityResponse.java | 12 +- .../StorageAccountCreateParameters.java | 42 +- .../models/StorageAccountGetKeysResponse.java | 18 +- ...torageAccountRegenerateKeysParameters.java | 12 +- .../StorageAccountRegenerateKeysResponse.java | 18 +- .../StorageAccountUpdateParameters.java | 28 +- .../StorageOperationStatusResponse.java | 36 +- .../models/StorageServiceGetResponse.java | 30 +- .../models/StorageServiceListResponse.java | 34 +- .../models/StorageServiceProperties.java | 73 +- .../management/store/AddOnOperations.java | 54 +- .../management/store/AddOnOperationsImpl.java | 247 +- .../store/CloudServiceOperations.java | 34 +- .../store/CloudServiceOperationsImpl.java | 555 +- .../store/StoreManagementClient.java | 12 + .../store/StoreManagementClientImpl.java | 178 +- .../store/models/AddOnCreateParameters.java | 18 +- .../models/AddOnOperationStatusResponse.java | 36 +- .../store/models/AddOnUpdateParameters.java | 18 +- .../models/CloudServiceCreateParameters.java | 24 +- .../models/CloudServiceListResponse.java | 132 +- .../ClientRootCertificateOperations.java | 59 +- .../ClientRootCertificateOperationsImpl.java | 480 +- .../virtualnetworks/GatewayOperations.java | 190 +- .../GatewayOperationsImpl.java | 1750 ++-- .../virtualnetworks/NetworkOperations.java | 33 +- .../NetworkOperationsImpl.java | 644 +- .../virtualnetworks/ReservedIPOperations.java | 80 +- .../ReservedIPOperationsImpl.java | 679 +- .../virtualnetworks/StaticIPOperations.java | 65 + .../StaticIPOperationsImpl.java | 221 + .../VirtualNetworkManagementClient.java | 27 + .../VirtualNetworkManagementClientImpl.java | 199 +- ...ClientRootCertificateCreateParameters.java | 6 +- .../ClientRootCertificateGetResponse.java | 6 +- .../ClientRootCertificateListResponse.java | 24 +- ...ewayConnectDisconnectOrTestParameters.java | 12 +- .../models/GatewayConnectivityState.java | 2 + .../models/GatewayCreateParameters.java | 6 +- .../virtualnetworks/models/GatewayEvent.java | 24 +- ...wayGenerateVpnClientPackageParameters.java | 6 +- ...etDeviceConfigurationScriptParameters.java | 18 +- ...yGetDeviceConfigurationScriptResponse.java | 6 +- .../GatewayGetOperationStatusResponse.java | 36 +- .../models/GatewayGetResponse.java | 24 +- .../models/GatewayGetSharedKeyResponse.java | 6 +- .../GatewayListConnectionsResponse.java | 53 +- .../GatewayListSupportedDevicesResponse.java | 42 +- .../models/GatewayOperationResponse.java | 10 +- .../GatewayResetSharedKeyParameters.java | 6 +- .../NetworkGetConfigurationResponse.java | 6 +- .../models/NetworkListResponse.java | 152 +- .../NetworkReservedIPCreateParameters.java | 30 +- .../models/NetworkReservedIPGetResponse.java | 56 +- .../models/NetworkReservedIPListResponse.java | 66 +- .../NetworkSetConfigurationParameters.java | 6 +- .../NetworkStaticIPAvailabilityResponse.java | 86 + ...VirtualNetworkOperationStatusResponse.java | 36 +- .../websites/ServerFarmOperations.java | 58 +- .../websites/ServerFarmOperationsImpl.java | 817 +- .../websites/WebSiteManagementClient.java | 73 + .../websites/WebSiteManagementClientImpl.java | 550 +- .../websites/WebSiteOperations.java | 269 +- .../websites/WebSiteOperationsImpl.java | 6158 +++++++----- .../websites/WebSpaceOperations.java | 70 +- .../websites/WebSpaceOperationsImpl.java | 2065 ++-- .../models/ServerFarmCreateParameters.java | 30 +- .../models/ServerFarmCreateResponse.java | 36 +- .../models/ServerFarmGetResponse.java | 36 +- .../models/ServerFarmListResponse.java | 42 +- .../models/ServerFarmUpdateParameters.java | 30 +- .../models/ServerFarmUpdateResponse.java | 36 +- .../management/websites/models/WebSite.java | 248 +- .../models/WebSiteCreateParameters.java | 60 +- .../models/WebSiteCreateResponse.java | 6 +- .../models/WebSiteDeleteParameters.java | 92 + .../WebSiteDeleteRepositoryResponse.java | 6 +- .../WebSiteGetConfigurationResponse.java | 170 +- ...teGetHistoricalUsageMetricsParameters.java | 18 +- ...SiteGetHistoricalUsageMetricsResponse.java | 102 +- .../websites/models/WebSiteGetParameters.java | 6 +- .../WebSiteGetPublishProfileResponse.java | 113 +- .../models/WebSiteGetRepositoryResponse.java | 6 +- .../websites/models/WebSiteGetResponse.java | 6 +- .../WebSiteGetUsageMetricsResponse.java | 60 +- .../models/WebSiteListParameters.java | 6 +- .../models/WebSiteOperationStatus.java | 55 + .../WebSiteOperationStatusResponse.java | 344 + .../WebSiteUpdateConfigurationParameters.java | 170 +- .../models/WebSiteUpdateParameters.java | 106 +- .../models/WebSiteUpdateResponse.java | 6 +- ...bSpacesCreatePublishingUserParameters.java | 18 +- ...WebSpacesCreatePublishingUserResponse.java | 18 +- .../models/WebSpacesGetDnsSuffixResponse.java | 6 +- .../websites/models/WebSpacesGetResponse.java | 60 +- .../WebSpacesListGeoRegionsResponse.java | 24 +- .../WebSpacesListPublishingUsersResponse.java | 12 +- .../models/WebSpacesListResponse.java | 66 +- .../models/WebSpacesListWebSitesResponse.java | 6 +- parent/src/config/checkstyle.xml | 10 +- 313 files changed, 36337 insertions(+), 24129 deletions(-) create mode 100644 management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/StaticIPOperations.java create mode 100644 management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/StaticIPOperationsImpl.java create mode 100644 management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkStaticIPAvailabilityResponse.java create mode 100644 management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteDeleteParameters.java create mode 100644 management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteOperationStatus.java create mode 100644 management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteOperationStatusResponse.java diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ComputeManagementClient.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ComputeManagementClient.java index e3f08d5946e70..c45b633da3840 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ComputeManagementClient.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ComputeManagementClient.java @@ -45,6 +45,7 @@ public interface ComputeManagementClient extends FilterableService 0 ? ((Element) elements.item(0)) : null; - if (operationElement != null) - { - NodeList elements2 = operationElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = operationElement.getElementsByTagName("Status"); - Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (statusElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - OperationStatus statusInstance; - statusInstance = OperationStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); - Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (httpStatusCodeElement != null) - { - Integer httpStatusCodeInstance; - httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); - result.setHttpStatusCode(httpStatusCodeInstance); - } + // Create Result + ComputeOperationStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ComputeOperationStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements5 = operationElement.getElementsByTagName("Error"); - Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (errorElement != null) + NodeList elements = responseDoc.getElementsByTagName("Operation"); + Element operationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operationElement != null) { - ComputeOperationStatusResponse.ErrorDetails errorInstance = new ComputeOperationStatusResponse.ErrorDetails(); - result.setError(errorInstance); + NodeList elements2 = operationElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setId(idInstance); + } - NodeList elements6 = errorElement.getElementsByTagName("Code"); - Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (codeElement != null) + NodeList elements3 = operationElement.getElementsByTagName("Status"); + Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (statusElement != null) { - String codeInstance; - codeInstance = codeElement.getTextContent(); - errorInstance.setCode(codeInstance); + OperationStatus statusInstance; + statusInstance = OperationStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); } - NodeList elements7 = errorElement.getElementsByTagName("Message"); - Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (messageElement != null) + NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); + Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (httpStatusCodeElement != null) { - String messageInstance; - messageInstance = messageElement.getTextContent(); - errorInstance.setMessage(messageInstance); + Integer httpStatusCodeInstance; + httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); + result.setHttpStatusCode(httpStatusCodeInstance); + } + + NodeList elements5 = operationElement.getElementsByTagName("Error"); + Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (errorElement != null) + { + ComputeOperationStatusResponse.ErrorDetails errorInstance = new ComputeOperationStatusResponse.ErrorDetails(); + result.setError(errorInstance); + + NodeList elements6 = errorElement.getElementsByTagName("Code"); + Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (codeElement != null) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + errorInstance.setCode(codeInstance); + } + + NodeList elements7 = errorElement.getElementsByTagName("Message"); + Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/DeploymentOperations.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/DeploymentOperations.java index d44936d9dee62..db57b64adac81 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/DeploymentOperations.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/DeploymentOperations.java @@ -37,13 +37,11 @@ import com.microsoft.windowsazure.management.compute.models.DeploymentUpgradeParameters; import com.microsoft.windowsazure.management.compute.models.DeploymentWalkUpgradeDomainParameters; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -70,10 +68,20 @@ public interface DeploymentOperations * @param deploymentName The deployment to change configuration for. * @param parameters Parameters supplied to the Change Configuration * Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginChangingConfigurationByName(String serviceName, String deploymentName, DeploymentChangeConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginChangingConfigurationByName(String serviceName, String deploymentName, DeploymentChangeConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Change Deployment Configuration operation initiates a change to the @@ -110,10 +118,20 @@ public interface DeploymentOperations * @param deploymentSlot The slot to change deployment configuration for. * @param parameters Parameters supplied to the Change Configuration * Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginChangingConfigurationBySlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentChangeConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginChangingConfigurationBySlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentChangeConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Change Deployment Configuration operation initiates a change to the @@ -148,10 +166,20 @@ public interface DeploymentOperations * @param serviceName The cloud service to create a deployment for. * @param deploymentSlot The slot to create a deployment for. * @param parameters Parameters supplied to the Create Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginCreating(String serviceName, DeploymentSlot deploymentSlot, DeploymentCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginCreating(String serviceName, DeploymentSlot deploymentSlot, DeploymentCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Create Deployment operation uploads a new service package and creates @@ -184,6 +212,10 @@ public interface DeploymentOperations * @param deploymentName The name of your deployment. * @param deleteFromStorage Optional. Specifies that the source blob for the * disk should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -218,6 +250,10 @@ public interface DeploymentOperations * * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -252,6 +288,10 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param roleInstanceName The name of your role instance. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -288,6 +328,10 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param roleInstanceName The name of your role instance. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -324,6 +368,10 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param roleInstanceName The name of your role instance. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -360,6 +408,10 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param roleInstanceName The name of your role instance. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -396,10 +448,20 @@ public interface DeploymentOperations * * @param serviceName The cloud service to swap deployments for. * @param parameters Parameters supplied to the Swap Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginSwapping(String serviceName, DeploymentSwapParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginSwapping(String serviceName, DeploymentSwapParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Swap Deployment operation initiates a virtual IP address swap between @@ -434,10 +496,20 @@ public interface DeploymentOperations * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Update Deployment Status * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginUpdatingStatusByDeploymentName(String serviceName, String deploymentName, DeploymentUpdateStatusParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginUpdatingStatusByDeploymentName(String serviceName, String deploymentName, DeploymentUpdateStatusParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Update Deployment Status operation initiates a change in the running @@ -474,10 +546,20 @@ public interface DeploymentOperations * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Update Deployment Status * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginUpdatingStatusByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentUpdateStatusParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginUpdatingStatusByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentUpdateStatusParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Update Deployment Status operation initiates a change in the running @@ -533,10 +615,20 @@ public interface DeploymentOperations * @param serviceName The cloud service to upgrade. * @param deploymentName The deployment to upgrade. * @param parameters Parameters supplied to the Upgrade Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginUpgradingByName(String serviceName, String deploymentName, DeploymentUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginUpgradingByName(String serviceName, String deploymentName, DeploymentUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Upgrade Deployment operation initiates an update of role instances in @@ -611,10 +703,20 @@ public interface DeploymentOperations * @param serviceName The cloud service to upgrade. * @param deploymentSlot The slot to upgrade. * @param parameters Parameters supplied to the Upgrade Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginUpgradingBySlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginUpgradingBySlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Upgrade Deployment operation initiates an update of role instances in @@ -689,10 +791,20 @@ public interface DeploymentOperations * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Walk Upgrade Domain * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginWalkingUpgradeDomainByDeploymentName(String serviceName, String deploymentName, DeploymentWalkUpgradeDomainParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginWalkingUpgradeDomainByDeploymentName(String serviceName, String deploymentName, DeploymentWalkUpgradeDomainParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Walk Upgrade Domain operation specifies an update domain in which a @@ -767,10 +879,20 @@ public interface DeploymentOperations * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Walk Upgrade Domain * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginWalkingUpgradeDomainByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentWalkUpgradeDomainParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginWalkingUpgradeDomainByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentWalkUpgradeDomainParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Walk Upgrade Domain operation specifies an update domain in which a @@ -826,6 +948,18 @@ public interface DeploymentOperations * @param deploymentName The deployment to change configuration for. * @param parameters Parameters supplied to the Change Configuration * Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -880,6 +1014,18 @@ public interface DeploymentOperations * @param deploymentSlot The slot to change deployment configuration for. * @param parameters Parameters supplied to the Change Configuration * Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -932,6 +1078,29 @@ public interface DeploymentOperations * @param serviceName The cloud service to create a deployment for. * @param deploymentSlot The slot to create a deployment for. * @param parameters Parameters supplied to the Create Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -942,7 +1111,7 @@ public interface DeploymentOperations * the failed request, and also includes error information regarding the * failure. */ - ComputeOperationStatusResponse create(String serviceName, DeploymentSlot deploymentSlot, DeploymentCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, ServiceException, URISyntaxException, ParseException; + ComputeOperationStatusResponse create(String serviceName, DeploymentSlot deploymentSlot, DeploymentCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerException, ServiceException, URISyntaxException, ParseException; /** * The Create Deployment operation uploads a new service package and creates @@ -982,6 +1151,18 @@ public interface DeploymentOperations * @param deploymentName The name of your deployment. * @param deleteFromStorage Optional. Specifies that the source blob for the * disk should also be deleted from storage. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1030,6 +1211,18 @@ public interface DeploymentOperations * * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1073,6 +1266,18 @@ public interface DeploymentOperations * * @param serviceName The name of the cloud service. * @param deploymentName The name of the deployment. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A deployment that exists in the cloud service. */ DeploymentGetResponse getByName(String serviceName, String deploymentName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -1097,6 +1302,18 @@ public interface DeploymentOperations * * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A deployment that exists in the cloud service. */ DeploymentGetResponse getBySlot(String serviceName, DeploymentSlot deploymentSlot) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -1128,6 +1345,10 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Get Package operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1168,6 +1389,10 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Get Package operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1206,6 +1431,18 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param roleInstanceName The name of your role instance. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1256,6 +1493,18 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param roleInstanceName The name of your role instance. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1306,6 +1555,18 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param roleInstanceName The name of your role instance. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1356,6 +1617,18 @@ public interface DeploymentOperations * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param roleInstanceName The name of your role instance. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1409,10 +1682,20 @@ public interface DeploymentOperations * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Rollback Update Or Upgrade * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse rollbackUpdateOrUpgradeByDeploymentName(String serviceName, String deploymentName, DeploymentRollbackUpdateOrUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse rollbackUpdateOrUpgradeByDeploymentName(String serviceName, String deploymentName, DeploymentRollbackUpdateOrUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Rollback Update Or Upgrade operation cancels an in-progress @@ -1451,10 +1734,20 @@ public interface DeploymentOperations * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Rollback Update Or Upgrade * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse rollbackUpdateOrUpgradeByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentRollbackUpdateOrUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse rollbackUpdateOrUpgradeByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentRollbackUpdateOrUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Rollback Update Or Upgrade operation cancels an in-progress @@ -1490,6 +1783,18 @@ public interface DeploymentOperations * * @param serviceName The cloud service to swap deployments for. * @param parameters Parameters supplied to the Swap Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1542,6 +1847,18 @@ public interface DeploymentOperations * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Update Deployment Status * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1596,6 +1913,18 @@ public interface DeploymentOperations * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Update Deployment Status * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1669,6 +1998,18 @@ public interface DeploymentOperations * @param serviceName The cloud service to upgrade. * @param deploymentName The deployment to upgrade. * @param parameters Parameters supplied to the Upgrade Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1761,6 +2102,18 @@ public interface DeploymentOperations * @param serviceName The cloud service to upgrade. * @param deploymentSlot The slot to upgrade. * @param parameters Parameters supplied to the Upgrade Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1853,6 +2206,18 @@ public interface DeploymentOperations * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Walk Upgrade Domain * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1945,6 +2310,18 @@ public interface DeploymentOperations * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Walk Upgrade Domain * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/DeploymentOperationsImpl.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/DeploymentOperationsImpl.java index fc5ade92c1f0f..6e6517c1a7dea 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/DeploymentOperationsImpl.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/DeploymentOperationsImpl.java @@ -68,7 +68,6 @@ import com.microsoft.windowsazure.management.compute.models.UpgradeStatus; import com.microsoft.windowsazure.management.compute.models.VirtualHardDiskHostCaching; import com.microsoft.windowsazure.management.compute.models.VirtualIPAddress; -import com.microsoft.windowsazure.management.compute.models.VirtualMachineRoleSize; import com.microsoft.windowsazure.management.compute.models.VirtualMachineWindowsRemoteManagementListenerType; import com.microsoft.windowsazure.management.compute.models.WindowsRemoteManagementListener; import com.microsoft.windowsazure.management.compute.models.WindowsRemoteManagementSettings; @@ -77,11 +76,9 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; -import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -94,7 +91,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -133,6 +129,7 @@ public class DeploymentOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -459,11 +476,21 @@ public OperationResponse call() throws Exception * @param deploymentSlot The slot to change deployment configuration for. * @param parameters Parameters supplied to the Change Configuration * Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginChangingConfigurationBySlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentChangeConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginChangingConfigurationBySlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentChangeConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -553,10 +580,10 @@ public OperationResponse beginChangingConfigurationBySlot(String serviceName, De configurationElement.appendChild(requestDoc.createTextNode(new String(Base64.encodeBase64(parameters.getConfiguration().getBytes())))); changeConfigurationElement.appendChild(configurationElement); - if (parameters.getTreatWarningsAsError() != null) + if (parameters.isTreatWarningsAsError() != null) { Element treatWarningsAsErrorElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TreatWarningsAsError"); - treatWarningsAsErrorElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getTreatWarningsAsError()).toLowerCase())); + treatWarningsAsErrorElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.isTreatWarningsAsError()).toLowerCase())); changeConfigurationElement.appendChild(treatWarningsAsErrorElement); } @@ -649,40 +676,50 @@ public OperationResponse beginChangingConfigurationBySlot(String serviceName, De // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -726,11 +763,21 @@ public OperationResponse call() throws Exception * @param serviceName The cloud service to create a deployment for. * @param deploymentSlot The slot to create a deployment for. * @param parameters Parameters supplied to the Create Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginCreating(String serviceName, DeploymentSlot deploymentSlot, DeploymentCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginCreating(String serviceName, DeploymentSlot deploymentSlot, DeploymentCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -848,17 +895,17 @@ public OperationResponse beginCreating(String serviceName, DeploymentSlot deploy configurationElement.appendChild(requestDoc.createTextNode(new String(Base64.encodeBase64(parameters.getConfiguration().getBytes())))); createDeploymentElement.appendChild(configurationElement); - if (parameters.getStartDeployment() != null) + if (parameters.isStartDeployment() != null) { Element startDeploymentElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StartDeployment"); - startDeploymentElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getStartDeployment()).toLowerCase())); + startDeploymentElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.isStartDeployment()).toLowerCase())); createDeploymentElement.appendChild(startDeploymentElement); } - if (parameters.getTreatWarningsAsError() != null) + if (parameters.isTreatWarningsAsError() != null) { Element treatWarningsAsErrorElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TreatWarningsAsError"); - treatWarningsAsErrorElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getTreatWarningsAsError()).toLowerCase())); + treatWarningsAsErrorElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.isTreatWarningsAsError()).toLowerCase())); createDeploymentElement.appendChild(treatWarningsAsErrorElement); } @@ -944,40 +991,50 @@ public OperationResponse beginCreating(String serviceName, DeploymentSlot deploy // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1021,6 +1078,10 @@ public OperationResponse call() throws Exception * @param deploymentName The name of your deployment. * @param deleteFromStorage Optional. Specifies that the source blob for the * disk should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1051,11 +1112,7 @@ public OperationResponse beginDeletingByName(String serviceName, String deployme } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "?"; - if (deleteFromStorage == true) - { - url = url + "&comp=" + URLEncoder.encode("media", "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "?comp=" + deleteFromStorage; // Create HTTP transport objects CustomHttpDelete httpRequest = new CustomHttpDelete(url); @@ -1065,40 +1122,50 @@ public OperationResponse beginDeletingByName(String serviceName, String deployme // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1138,6 +1205,10 @@ public OperationResponse call() throws Exception * * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1173,40 +1244,50 @@ public OperationResponse beginDeletingBySlot(String serviceName, DeploymentSlot // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1250,6 +1331,10 @@ public OperationResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param roleInstanceName The name of your role instance. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1296,40 +1381,50 @@ public OperationResponse beginRebootingRoleInstanceByDeploymentName(String servi // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1373,6 +1468,10 @@ public OperationResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param roleInstanceName The name of your role instance. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1415,40 +1514,50 @@ public OperationResponse beginRebootingRoleInstanceByDeploymentSlot(String servi // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1492,6 +1601,10 @@ public OperationResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param roleInstanceName The name of your role instance. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1538,40 +1651,50 @@ public OperationResponse beginReimagingRoleInstanceByDeploymentName(String servi // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1615,6 +1738,10 @@ public OperationResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param roleInstanceName The name of your role instance. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1657,40 +1784,50 @@ public OperationResponse beginReimagingRoleInstanceByDeploymentSlot(String servi // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1734,11 +1871,21 @@ public OperationResponse call() throws Exception * * @param serviceName The cloud service to swap deployments for. * @param parameters Parameters supplied to the Swap Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginSwapping(String serviceName, DeploymentSwapParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginSwapping(String serviceName, DeploymentSwapParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -1810,40 +1957,50 @@ public OperationResponse beginSwapping(String serviceName, DeploymentSwapParamet // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1891,11 +2048,21 @@ public OperationResponse call() throws Exception * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Update Deployment Status * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginUpdatingStatusByDeploymentName(String serviceName, String deploymentName, DeploymentUpdateStatusParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginUpdatingStatusByDeploymentName(String serviceName, String deploymentName, DeploymentUpdateStatusParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -1961,40 +2128,50 @@ public OperationResponse beginUpdatingStatusByDeploymentName(String serviceName, // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -2042,11 +2219,21 @@ public OperationResponse call() throws Exception * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Update Deployment Status * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginUpdatingStatusByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentUpdateStatusParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginUpdatingStatusByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentUpdateStatusParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -2108,40 +2295,50 @@ public OperationResponse beginUpdatingStatusByDeploymentSlot(String serviceName, // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -2227,11 +2424,21 @@ public OperationResponse call() throws Exception * @param serviceName The cloud service to upgrade. * @param deploymentName The deployment to upgrade. * @param parameters Parameters supplied to the Upgrade Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginUpgradingByName(String serviceName, String deploymentName, DeploymentUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginUpgradingByName(String serviceName, String deploymentName, DeploymentUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -2357,7 +2564,7 @@ public OperationResponse beginUpgradingByName(String serviceName, String deploym } Element forceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Force"); - forceElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getForce()).toLowerCase())); + forceElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.isForce()).toLowerCase())); upgradeDeploymentElement.appendChild(forceElement); if (parameters.getExtendedProperties() != null) @@ -2442,40 +2649,50 @@ public OperationResponse beginUpgradingByName(String serviceName, String deploym // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -2561,11 +2778,21 @@ public OperationResponse call() throws Exception * @param serviceName The cloud service to upgrade. * @param deploymentSlot The slot to upgrade. * @param parameters Parameters supplied to the Upgrade Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginUpgradingBySlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginUpgradingBySlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -2687,7 +2914,7 @@ public OperationResponse beginUpgradingBySlot(String serviceName, DeploymentSlot } Element forceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Force"); - forceElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getForce()).toLowerCase())); + forceElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.isForce()).toLowerCase())); upgradeDeploymentElement.appendChild(forceElement); if (parameters.getExtendedProperties() != null) @@ -2772,40 +2999,50 @@ public OperationResponse beginUpgradingBySlot(String serviceName, DeploymentSlot // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -2891,11 +3128,21 @@ public OperationResponse call() throws Exception * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Walk Upgrade Domain * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginWalkingUpgradeDomainByDeploymentName(String serviceName, String deploymentName, DeploymentWalkUpgradeDomainParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginWalkingUpgradeDomainByDeploymentName(String serviceName, String deploymentName, DeploymentWalkUpgradeDomainParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -2960,40 +3207,50 @@ public OperationResponse beginWalkingUpgradeDomainByDeploymentName(String servic // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -3079,11 +3336,21 @@ public OperationResponse call() throws Exception * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Walk Upgrade Domain * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginWalkingUpgradeDomainByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentWalkUpgradeDomainParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginWalkingUpgradeDomainByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentWalkUpgradeDomainParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -3144,40 +3411,50 @@ public OperationResponse beginWalkingUpgradeDomainByDeploymentSlot(String servic // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -3232,6 +3509,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentName The deployment to change configuration for. * @param parameters Parameters supplied to the Change Configuration * Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -3366,6 +3655,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentSlot The slot to change deployment configuration for. * @param parameters Parameters supplied to the Change Configuration * Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -3496,6 +3797,29 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The cloud service to create a deployment for. * @param deploymentSlot The slot to create a deployment for. * @param parameters Parameters supplied to the Create Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -3507,7 +3831,7 @@ public ComputeOperationStatusResponse call() throws Exception * failure. */ @Override - public ComputeOperationStatusResponse create(String serviceName, DeploymentSlot deploymentSlot, DeploymentCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, ServiceException, URISyntaxException, ParseException + public ComputeOperationStatusResponse create(String serviceName, DeploymentSlot deploymentSlot, DeploymentCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerException, ServiceException, URISyntaxException, ParseException { ComputeManagementClient client2 = this.getClient(); boolean shouldTrace = CloudTracing.getIsEnabled(); @@ -3626,6 +3950,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentName The name of your deployment. * @param deleteFromStorage Optional. Specifies that the source blob for the * disk should also be deleted from storage. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -3752,6 +4088,18 @@ public ComputeOperationStatusResponse call() throws Exception * * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -3863,6 +4211,18 @@ public DeploymentGetResponse call() throws Exception * * @param serviceName The name of the cloud service. * @param deploymentName The name of the deployment. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A deployment that exists in the cloud service. */ @Override @@ -3901,1337 +4261,1356 @@ public DeploymentGetResponse getByName(String serviceName, String deploymentName // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - DeploymentGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DeploymentGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Deployment"); - Element deploymentElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (deploymentElement != null) - { - NodeList elements2 = deploymentElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = deploymentElement.getElementsByTagName("DeploymentSlot"); - Element deploymentSlotElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (deploymentSlotElement != null) - { - DeploymentSlot deploymentSlotInstance; - deploymentSlotInstance = DeploymentSlot.valueOf(deploymentSlotElement.getTextContent()); - result.setDeploymentSlot(deploymentSlotInstance); - } - - NodeList elements4 = deploymentElement.getElementsByTagName("PrivateID"); - Element privateIDElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (privateIDElement != null) - { - String privateIDInstance; - privateIDInstance = privateIDElement.getTextContent(); - result.setPrivateId(privateIDInstance); - } - - NodeList elements5 = deploymentElement.getElementsByTagName("Status"); - Element statusElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (statusElement != null) - { - DeploymentStatus statusInstance; - statusInstance = DeploymentStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); - } - - NodeList elements6 = deploymentElement.getElementsByTagName("Label"); - Element labelElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - result.setLabel(labelInstance); - } - - NodeList elements7 = deploymentElement.getElementsByTagName("Url"); - Element urlElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (urlElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - URI urlInstance; - urlInstance = new URI(urlElement.getTextContent()); - result.setUri(urlInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements8 = deploymentElement.getElementsByTagName("Configuration"); - Element configurationElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (configurationElement != null) - { - String configurationInstance; - configurationInstance = configurationElement.getTextContent() != null ? new String(Base64.decodeBase64(configurationElement.getTextContent().getBytes())) : null; - result.setConfiguration(configurationInstance); - } + // Create Result + DeploymentGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DeploymentGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements9 = deploymentElement.getElementsByTagName("RoleInstanceList"); - Element roleInstanceListSequenceElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (roleInstanceListSequenceElement != null) + NodeList elements = responseDoc.getElementsByTagName("Deployment"); + Element deploymentElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (deploymentElement != null) { - for (int i1 = 0; i1 < roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").getLength(); i1 = i1 + 1) + NodeList elements2 = deploymentElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) { - org.w3c.dom.Element roleInstanceListElement = ((org.w3c.dom.Element) roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").item(i1)); - RoleInstance roleInstanceInstance = new RoleInstance(); - result.getRoleInstances().add(roleInstanceInstance); - - NodeList elements10 = roleInstanceListElement.getElementsByTagName("RoleName"); - Element roleNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (roleNameElement != null) - { - String roleNameInstance; - roleNameInstance = roleNameElement.getTextContent(); - roleInstanceInstance.setRoleName(roleNameInstance); - } - - NodeList elements11 = roleInstanceListElement.getElementsByTagName("InstanceName"); - Element instanceNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (instanceNameElement != null) - { - String instanceNameInstance; - instanceNameInstance = instanceNameElement.getTextContent(); - roleInstanceInstance.setInstanceName(instanceNameInstance); - } - - NodeList elements12 = roleInstanceListElement.getElementsByTagName("InstanceStatus"); - Element instanceStatusElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (instanceStatusElement != null) - { - String instanceStatusInstance; - instanceStatusInstance = instanceStatusElement.getTextContent(); - roleInstanceInstance.setInstanceStatus(instanceStatusInstance); - } - - NodeList elements13 = roleInstanceListElement.getElementsByTagName("InstanceUpgradeDomain"); - Element instanceUpgradeDomainElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (instanceUpgradeDomainElement != null && (instanceUpgradeDomainElement.getTextContent() != null && instanceUpgradeDomainElement.getTextContent().isEmpty() != true) == false) - { - int instanceUpgradeDomainInstance; - instanceUpgradeDomainInstance = Integer.parseInt(instanceUpgradeDomainElement.getTextContent()); - roleInstanceInstance.setInstanceUpgradeDomain(instanceUpgradeDomainInstance); - } - - NodeList elements14 = roleInstanceListElement.getElementsByTagName("InstanceFaultDomain"); - Element instanceFaultDomainElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (instanceFaultDomainElement != null && (instanceFaultDomainElement.getTextContent() != null && instanceFaultDomainElement.getTextContent().isEmpty() != true) == false) - { - int instanceFaultDomainInstance; - instanceFaultDomainInstance = Integer.parseInt(instanceFaultDomainElement.getTextContent()); - roleInstanceInstance.setInstanceFaultDomain(instanceFaultDomainInstance); - } - - NodeList elements15 = roleInstanceListElement.getElementsByTagName("InstanceSize"); - Element instanceSizeElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (instanceSizeElement != null && (instanceSizeElement.getTextContent() != null && instanceSizeElement.getTextContent().isEmpty() != true) == false) - { - VirtualMachineRoleSize instanceSizeInstance; - instanceSizeInstance = VirtualMachineRoleSize.valueOf(instanceSizeElement.getTextContent()); - roleInstanceInstance.setInstanceSize(instanceSizeInstance); - } - - NodeList elements16 = roleInstanceListElement.getElementsByTagName("InstanceStateDetails"); - Element instanceStateDetailsElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (instanceStateDetailsElement != null) - { - String instanceStateDetailsInstance; - instanceStateDetailsInstance = instanceStateDetailsElement.getTextContent(); - roleInstanceInstance.setInstanceStateDetails(instanceStateDetailsInstance); - } - - NodeList elements17 = roleInstanceListElement.getElementsByTagName("InstanceErrorCode"); - Element instanceErrorCodeElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (instanceErrorCodeElement != null) - { - String instanceErrorCodeInstance; - instanceErrorCodeInstance = instanceErrorCodeElement.getTextContent(); - roleInstanceInstance.setInstanceErrorCode(instanceErrorCodeInstance); - } - - NodeList elements18 = roleInstanceListElement.getElementsByTagName("IpAddress"); - Element ipAddressElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (ipAddressElement != null) - { - InetAddress ipAddressInstance; - ipAddressInstance = InetAddress.getByName(ipAddressElement.getTextContent()); - roleInstanceInstance.setIPAddress(ipAddressInstance); - } - - NodeList elements19 = roleInstanceListElement.getElementsByTagName("InstanceEndpoints"); - Element instanceEndpointsSequenceElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (instanceEndpointsSequenceElement != null) + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = deploymentElement.getElementsByTagName("DeploymentSlot"); + Element deploymentSlotElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (deploymentSlotElement != null) + { + DeploymentSlot deploymentSlotInstance; + deploymentSlotInstance = DeploymentSlot.valueOf(deploymentSlotElement.getTextContent()); + result.setDeploymentSlot(deploymentSlotInstance); + } + + NodeList elements4 = deploymentElement.getElementsByTagName("PrivateID"); + Element privateIDElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (privateIDElement != null) + { + String privateIDInstance; + privateIDInstance = privateIDElement.getTextContent(); + result.setPrivateId(privateIDInstance); + } + + NodeList elements5 = deploymentElement.getElementsByTagName("Status"); + Element statusElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (statusElement != null) + { + DeploymentStatus statusInstance; + statusInstance = DeploymentStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); + } + + NodeList elements6 = deploymentElement.getElementsByTagName("Label"); + Element labelElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + result.setLabel(labelInstance); + } + + NodeList elements7 = deploymentElement.getElementsByTagName("Url"); + Element urlElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (urlElement != null) + { + URI urlInstance; + urlInstance = new URI(urlElement.getTextContent()); + result.setUri(urlInstance); + } + + NodeList elements8 = deploymentElement.getElementsByTagName("Configuration"); + Element configurationElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (configurationElement != null) + { + String configurationInstance; + configurationInstance = configurationElement.getTextContent() != null ? new String(Base64.decodeBase64(configurationElement.getTextContent().getBytes())) : null; + result.setConfiguration(configurationInstance); + } + + NodeList elements9 = deploymentElement.getElementsByTagName("RoleInstanceList"); + Element roleInstanceListSequenceElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (roleInstanceListSequenceElement != null) + { + for (int i1 = 0; i1 < roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").getLength(); i1 = i1 + 1) { - for (int i2 = 0; i2 < instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").getLength(); i2 = i2 + 1) + org.w3c.dom.Element roleInstanceListElement = ((org.w3c.dom.Element) roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").item(i1)); + RoleInstance roleInstanceInstance = new RoleInstance(); + result.getRoleInstances().add(roleInstanceInstance); + + NodeList elements10 = roleInstanceListElement.getElementsByTagName("RoleName"); + Element roleNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (roleNameElement != null) { - org.w3c.dom.Element instanceEndpointsElement = ((org.w3c.dom.Element) instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").item(i2)); - InstanceEndpoint instanceEndpointInstance = new InstanceEndpoint(); - roleInstanceInstance.getInstanceEndpoints().add(instanceEndpointInstance); - - NodeList elements20 = instanceEndpointsElement.getElementsByTagName("LocalPort"); - Element localPortElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (localPortElement != null && (localPortElement.getTextContent() != null && localPortElement.getTextContent().isEmpty() != true) == false) - { - int localPortInstance; - localPortInstance = Integer.parseInt(localPortElement.getTextContent()); - instanceEndpointInstance.setLocalPort(localPortInstance); - } - - NodeList elements21 = instanceEndpointsElement.getElementsByTagName("Name"); - Element nameElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance2; - nameInstance2 = nameElement2.getTextContent(); - instanceEndpointInstance.setName(nameInstance2); - } - - NodeList elements22 = instanceEndpointsElement.getElementsByTagName("PublicPort"); - Element publicPortElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (publicPortElement != null) - { - int publicPortInstance; - publicPortInstance = Integer.parseInt(publicPortElement.getTextContent()); - instanceEndpointInstance.setPort(publicPortInstance); - } - - NodeList elements23 = instanceEndpointsElement.getElementsByTagName("Protocol"); - Element protocolElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (protocolElement != null) - { - String protocolInstance; - protocolInstance = protocolElement.getTextContent(); - instanceEndpointInstance.setProtocol(protocolInstance); - } - - NodeList elements24 = instanceEndpointsElement.getElementsByTagName("Vip"); - Element vipElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (vipElement != null) + String roleNameInstance; + roleNameInstance = roleNameElement.getTextContent(); + roleInstanceInstance.setRoleName(roleNameInstance); + } + + NodeList elements11 = roleInstanceListElement.getElementsByTagName("InstanceName"); + Element instanceNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (instanceNameElement != null) + { + String instanceNameInstance; + instanceNameInstance = instanceNameElement.getTextContent(); + roleInstanceInstance.setInstanceName(instanceNameInstance); + } + + NodeList elements12 = roleInstanceListElement.getElementsByTagName("InstanceStatus"); + Element instanceStatusElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (instanceStatusElement != null) + { + String instanceStatusInstance; + instanceStatusInstance = instanceStatusElement.getTextContent(); + roleInstanceInstance.setInstanceStatus(instanceStatusInstance); + } + + NodeList elements13 = roleInstanceListElement.getElementsByTagName("InstanceUpgradeDomain"); + Element instanceUpgradeDomainElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (instanceUpgradeDomainElement != null && (instanceUpgradeDomainElement.getTextContent() != null && instanceUpgradeDomainElement.getTextContent().isEmpty() != true) == false) + { + int instanceUpgradeDomainInstance; + instanceUpgradeDomainInstance = Integer.parseInt(instanceUpgradeDomainElement.getTextContent()); + roleInstanceInstance.setInstanceUpgradeDomain(instanceUpgradeDomainInstance); + } + + NodeList elements14 = roleInstanceListElement.getElementsByTagName("InstanceFaultDomain"); + Element instanceFaultDomainElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (instanceFaultDomainElement != null && (instanceFaultDomainElement.getTextContent() != null && instanceFaultDomainElement.getTextContent().isEmpty() != true) == false) + { + int instanceFaultDomainInstance; + instanceFaultDomainInstance = Integer.parseInt(instanceFaultDomainElement.getTextContent()); + roleInstanceInstance.setInstanceFaultDomain(instanceFaultDomainInstance); + } + + NodeList elements15 = roleInstanceListElement.getElementsByTagName("InstanceSize"); + Element instanceSizeElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (instanceSizeElement != null) + { + String instanceSizeInstance; + instanceSizeInstance = instanceSizeElement.getTextContent(); + roleInstanceInstance.setInstanceSize(instanceSizeInstance); + } + + NodeList elements16 = roleInstanceListElement.getElementsByTagName("InstanceStateDetails"); + Element instanceStateDetailsElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (instanceStateDetailsElement != null) + { + String instanceStateDetailsInstance; + instanceStateDetailsInstance = instanceStateDetailsElement.getTextContent(); + roleInstanceInstance.setInstanceStateDetails(instanceStateDetailsInstance); + } + + NodeList elements17 = roleInstanceListElement.getElementsByTagName("InstanceErrorCode"); + Element instanceErrorCodeElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (instanceErrorCodeElement != null) + { + String instanceErrorCodeInstance; + instanceErrorCodeInstance = instanceErrorCodeElement.getTextContent(); + roleInstanceInstance.setInstanceErrorCode(instanceErrorCodeInstance); + } + + NodeList elements18 = roleInstanceListElement.getElementsByTagName("IpAddress"); + Element ipAddressElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (ipAddressElement != null) + { + InetAddress ipAddressInstance; + ipAddressInstance = InetAddress.getByName(ipAddressElement.getTextContent()); + roleInstanceInstance.setIPAddress(ipAddressInstance); + } + + NodeList elements19 = roleInstanceListElement.getElementsByTagName("InstanceEndpoints"); + Element instanceEndpointsSequenceElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (instanceEndpointsSequenceElement != null) + { + for (int i2 = 0; i2 < instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").getLength(); i2 = i2 + 1) { - InetAddress vipInstance; - vipInstance = InetAddress.getByName(vipElement.getTextContent()); - instanceEndpointInstance.setVirtualIPAddress(vipInstance); + org.w3c.dom.Element instanceEndpointsElement = ((org.w3c.dom.Element) instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").item(i2)); + InstanceEndpoint instanceEndpointInstance = new InstanceEndpoint(); + roleInstanceInstance.getInstanceEndpoints().add(instanceEndpointInstance); + + NodeList elements20 = instanceEndpointsElement.getElementsByTagName("LocalPort"); + Element localPortElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (localPortElement != null && (localPortElement.getTextContent() != null && localPortElement.getTextContent().isEmpty() != true) == false) + { + int localPortInstance; + localPortInstance = Integer.parseInt(localPortElement.getTextContent()); + instanceEndpointInstance.setLocalPort(localPortInstance); + } + + NodeList elements21 = instanceEndpointsElement.getElementsByTagName("Name"); + Element nameElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + instanceEndpointInstance.setName(nameInstance2); + } + + NodeList elements22 = instanceEndpointsElement.getElementsByTagName("PublicPort"); + Element publicPortElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (publicPortElement != null) + { + int publicPortInstance; + publicPortInstance = Integer.parseInt(publicPortElement.getTextContent()); + instanceEndpointInstance.setPort(publicPortInstance); + } + + NodeList elements23 = instanceEndpointsElement.getElementsByTagName("Protocol"); + Element protocolElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (protocolElement != null) + { + String protocolInstance; + protocolInstance = protocolElement.getTextContent(); + instanceEndpointInstance.setProtocol(protocolInstance); + } + + NodeList elements24 = instanceEndpointsElement.getElementsByTagName("Vip"); + Element vipElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (vipElement != null) + { + InetAddress vipInstance; + vipInstance = InetAddress.getByName(vipElement.getTextContent()); + instanceEndpointInstance.setVirtualIPAddress(vipInstance); + } } } + + NodeList elements25 = roleInstanceListElement.getElementsByTagName("PowerState"); + Element powerStateElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (powerStateElement != null) + { + RoleInstancePowerState powerStateInstance; + powerStateInstance = RoleInstancePowerState.valueOf(powerStateElement.getTextContent()); + roleInstanceInstance.setPowerState(powerStateInstance); + } + + NodeList elements26 = roleInstanceListElement.getElementsByTagName("HostName"); + Element hostNameElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (hostNameElement != null) + { + String hostNameInstance; + hostNameInstance = hostNameElement.getTextContent(); + roleInstanceInstance.setHostName(hostNameInstance); + } + + NodeList elements27 = roleInstanceListElement.getElementsByTagName("RemoteAccessCertificateThumbprint"); + Element remoteAccessCertificateThumbprintElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; + if (remoteAccessCertificateThumbprintElement != null) + { + String remoteAccessCertificateThumbprintInstance; + remoteAccessCertificateThumbprintInstance = remoteAccessCertificateThumbprintElement.getTextContent(); + roleInstanceInstance.setRemoteAccessCertificateThumbprint(remoteAccessCertificateThumbprintInstance); + } } + } + + NodeList elements28 = deploymentElement.getElementsByTagName("UpgradeStatus"); + Element upgradeStatusElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; + if (upgradeStatusElement != null) + { + UpgradeStatus upgradeStatusInstance = new UpgradeStatus(); + result.setUpgradeStatus(upgradeStatusInstance); - NodeList elements25 = roleInstanceListElement.getElementsByTagName("PowerState"); - Element powerStateElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (powerStateElement != null) + NodeList elements29 = upgradeStatusElement.getElementsByTagName("UpgradeType"); + Element upgradeTypeElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; + if (upgradeTypeElement != null) { - RoleInstancePowerState powerStateInstance; - powerStateInstance = RoleInstancePowerState.valueOf(powerStateElement.getTextContent()); - roleInstanceInstance.setPowerState(powerStateInstance); + DeploymentUpgradeType upgradeTypeInstance; + upgradeTypeInstance = DeploymentUpgradeType.valueOf(upgradeTypeElement.getTextContent()); + upgradeStatusInstance.setUpgradeType(upgradeTypeInstance); } - NodeList elements26 = roleInstanceListElement.getElementsByTagName("HostName"); - Element hostNameElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (hostNameElement != null) + NodeList elements30 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomainState"); + Element currentUpgradeDomainStateElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; + if (currentUpgradeDomainStateElement != null) { - String hostNameInstance; - hostNameInstance = hostNameElement.getTextContent(); - roleInstanceInstance.setHostName(hostNameInstance); + UpgradeDomainState currentUpgradeDomainStateInstance; + currentUpgradeDomainStateInstance = UpgradeDomainState.valueOf(currentUpgradeDomainStateElement.getTextContent()); + upgradeStatusInstance.setCurrentUpgradeDomainState(currentUpgradeDomainStateInstance); } - NodeList elements27 = roleInstanceListElement.getElementsByTagName("RemoteAccessCertificateThumbprint"); - Element remoteAccessCertificateThumbprintElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; - if (remoteAccessCertificateThumbprintElement != null) + NodeList elements31 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomain"); + Element currentUpgradeDomainElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; + if (currentUpgradeDomainElement != null) { - String remoteAccessCertificateThumbprintInstance; - remoteAccessCertificateThumbprintInstance = remoteAccessCertificateThumbprintElement.getTextContent(); - roleInstanceInstance.setRemoteAccessCertificateThumbprint(remoteAccessCertificateThumbprintInstance); + int currentUpgradeDomainInstance; + currentUpgradeDomainInstance = Integer.parseInt(currentUpgradeDomainElement.getTextContent()); + upgradeStatusInstance.setCurrentUpgradeDomain(currentUpgradeDomainInstance); } } - } - - NodeList elements28 = deploymentElement.getElementsByTagName("UpgradeStatus"); - Element upgradeStatusElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; - if (upgradeStatusElement != null) - { - UpgradeStatus upgradeStatusInstance = new UpgradeStatus(); - result.setUpgradeStatus(upgradeStatusInstance); - - NodeList elements29 = upgradeStatusElement.getElementsByTagName("UpgradeType"); - Element upgradeTypeElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; - if (upgradeTypeElement != null) - { - DeploymentUpgradeType upgradeTypeInstance; - upgradeTypeInstance = DeploymentUpgradeType.valueOf(upgradeTypeElement.getTextContent()); - upgradeStatusInstance.setUpgradeType(upgradeTypeInstance); - } - NodeList elements30 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomainState"); - Element currentUpgradeDomainStateElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; - if (currentUpgradeDomainStateElement != null) + NodeList elements32 = deploymentElement.getElementsByTagName("UpgradeDomainCount"); + Element upgradeDomainCountElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; + if (upgradeDomainCountElement != null) { - UpgradeDomainState currentUpgradeDomainStateInstance; - currentUpgradeDomainStateInstance = UpgradeDomainState.valueOf(currentUpgradeDomainStateElement.getTextContent()); - upgradeStatusInstance.setCurrentUpgradeDomainState(currentUpgradeDomainStateInstance); + int upgradeDomainCountInstance; + upgradeDomainCountInstance = Integer.parseInt(upgradeDomainCountElement.getTextContent()); + result.setUpgradeDomainCount(upgradeDomainCountInstance); } - NodeList elements31 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomain"); - Element currentUpgradeDomainElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; - if (currentUpgradeDomainElement != null) + NodeList elements33 = deploymentElement.getElementsByTagName("RoleList"); + Element roleListSequenceElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; + if (roleListSequenceElement != null) { - int currentUpgradeDomainInstance; - currentUpgradeDomainInstance = Integer.parseInt(currentUpgradeDomainElement.getTextContent()); - upgradeStatusInstance.setCurrentUpgradeDomain(currentUpgradeDomainInstance); - } - } - - NodeList elements32 = deploymentElement.getElementsByTagName("UpgradeDomainCount"); - Element upgradeDomainCountElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; - if (upgradeDomainCountElement != null) - { - int upgradeDomainCountInstance; - upgradeDomainCountInstance = Integer.parseInt(upgradeDomainCountElement.getTextContent()); - result.setUpgradeDomainCount(upgradeDomainCountInstance); - } - - NodeList elements33 = deploymentElement.getElementsByTagName("RoleList"); - Element roleListSequenceElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; - if (roleListSequenceElement != null) - { - for (int i3 = 0; i3 < roleListSequenceElement.getElementsByTagName("Role").getLength(); i3 = i3 + 1) - { - org.w3c.dom.Element roleListElement = ((org.w3c.dom.Element) roleListSequenceElement.getElementsByTagName("Role").item(i3)); - Role roleInstance = new Role(); - result.getRoles().add(roleInstance); - - NodeList elements34 = roleListElement.getElementsByTagName("RoleName"); - Element roleNameElement2 = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; - if (roleNameElement2 != null) - { - String roleNameInstance2; - roleNameInstance2 = roleNameElement2.getTextContent(); - roleInstance.setRoleName(roleNameInstance2); - } - - NodeList elements35 = roleListElement.getElementsByTagName("OsVersion"); - Element osVersionElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; - if (osVersionElement != null) - { - String osVersionInstance; - osVersionInstance = osVersionElement.getTextContent(); - roleInstance.setOSVersion(osVersionInstance); - } - - NodeList elements36 = roleListElement.getElementsByTagName("RoleType"); - Element roleTypeElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; - if (roleTypeElement != null) - { - String roleTypeInstance; - roleTypeInstance = roleTypeElement.getTextContent(); - roleInstance.setRoleType(roleTypeInstance); - } - - NodeList elements37 = roleListElement.getElementsByTagName("ConfigurationSets"); - Element configurationSetsSequenceElement = elements37.getLength() > 0 ? ((Element) elements37.item(0)) : null; - if (configurationSetsSequenceElement != null) + for (int i3 = 0; i3 < roleListSequenceElement.getElementsByTagName("Role").getLength(); i3 = i3 + 1) { - for (int i4 = 0; i4 < configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").getLength(); i4 = i4 + 1) + org.w3c.dom.Element roleListElement = ((org.w3c.dom.Element) roleListSequenceElement.getElementsByTagName("Role").item(i3)); + Role roleInstance = new Role(); + result.getRoles().add(roleInstance); + + NodeList elements34 = roleListElement.getElementsByTagName("RoleName"); + Element roleNameElement2 = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; + if (roleNameElement2 != null) { - org.w3c.dom.Element configurationSetsElement = ((org.w3c.dom.Element) configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").item(i4)); - ConfigurationSet configurationSetInstance = new ConfigurationSet(); - roleInstance.getConfigurationSets().add(configurationSetInstance); - - NodeList elements38 = configurationSetsElement.getElementsByTagName("ConfigurationSetType"); - Element configurationSetTypeElement = elements38.getLength() > 0 ? ((Element) elements38.item(0)) : null; - if (configurationSetTypeElement != null) - { - String configurationSetTypeInstance; - configurationSetTypeInstance = configurationSetTypeElement.getTextContent(); - configurationSetInstance.setConfigurationSetType(configurationSetTypeInstance); - } - - NodeList elements39 = configurationSetsElement.getElementsByTagName("InputEndpoints"); - Element inputEndpointsSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; - if (inputEndpointsSequenceElement != null) + String roleNameInstance2; + roleNameInstance2 = roleNameElement2.getTextContent(); + roleInstance.setRoleName(roleNameInstance2); + } + + NodeList elements35 = roleListElement.getElementsByTagName("OsVersion"); + Element osVersionElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; + if (osVersionElement != null) + { + String osVersionInstance; + osVersionInstance = osVersionElement.getTextContent(); + roleInstance.setOSVersion(osVersionInstance); + } + + NodeList elements36 = roleListElement.getElementsByTagName("RoleType"); + Element roleTypeElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; + if (roleTypeElement != null) + { + String roleTypeInstance; + roleTypeInstance = roleTypeElement.getTextContent(); + roleInstance.setRoleType(roleTypeInstance); + } + + NodeList elements37 = roleListElement.getElementsByTagName("ConfigurationSets"); + Element configurationSetsSequenceElement = elements37.getLength() > 0 ? ((Element) elements37.item(0)) : null; + if (configurationSetsSequenceElement != null) + { + for (int i4 = 0; i4 < configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").getLength(); i4 = i4 + 1) { - for (int i5 = 0; i5 < inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").getLength(); i5 = i5 + 1) + org.w3c.dom.Element configurationSetsElement = ((org.w3c.dom.Element) configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").item(i4)); + ConfigurationSet configurationSetInstance = new ConfigurationSet(); + roleInstance.getConfigurationSets().add(configurationSetInstance); + + NodeList elements38 = configurationSetsElement.getElementsByTagName("ConfigurationSetType"); + Element configurationSetTypeElement = elements38.getLength() > 0 ? ((Element) elements38.item(0)) : null; + if (configurationSetTypeElement != null) { - org.w3c.dom.Element inputEndpointsElement = ((org.w3c.dom.Element) inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").item(i5)); - InputEndpoint inputEndpointInstance = new InputEndpoint(); - configurationSetInstance.getInputEndpoints().add(inputEndpointInstance); - - NodeList elements40 = inputEndpointsElement.getElementsByTagName("LoadBalancedEndpointSetName"); - Element loadBalancedEndpointSetNameElement = elements40.getLength() > 0 ? ((Element) elements40.item(0)) : null; - if (loadBalancedEndpointSetNameElement != null) - { - String loadBalancedEndpointSetNameInstance; - loadBalancedEndpointSetNameInstance = loadBalancedEndpointSetNameElement.getTextContent(); - inputEndpointInstance.setLoadBalancedEndpointSetName(loadBalancedEndpointSetNameInstance); - } - - NodeList elements41 = inputEndpointsElement.getElementsByTagName("LocalPort"); - Element localPortElement2 = elements41.getLength() > 0 ? ((Element) elements41.item(0)) : null; - if (localPortElement2 != null && (localPortElement2.getTextContent() != null && localPortElement2.getTextContent().isEmpty() != true) == false) - { - int localPortInstance2; - localPortInstance2 = Integer.parseInt(localPortElement2.getTextContent()); - inputEndpointInstance.setLocalPort(localPortInstance2); - } - - NodeList elements42 = inputEndpointsElement.getElementsByTagName("Name"); - Element nameElement3 = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; - if (nameElement3 != null) - { - String nameInstance3; - nameInstance3 = nameElement3.getTextContent(); - inputEndpointInstance.setName(nameInstance3); - } - - NodeList elements43 = inputEndpointsElement.getElementsByTagName("Port"); - Element portElement = elements43.getLength() > 0 ? ((Element) elements43.item(0)) : null; - if (portElement != null && (portElement.getTextContent() != null && portElement.getTextContent().isEmpty() != true) == false) - { - int portInstance; - portInstance = Integer.parseInt(portElement.getTextContent()); - inputEndpointInstance.setPort(portInstance); - } - - NodeList elements44 = inputEndpointsElement.getElementsByTagName("LoadBalancerProbe"); - Element loadBalancerProbeElement = elements44.getLength() > 0 ? ((Element) elements44.item(0)) : null; - if (loadBalancerProbeElement != null) + String configurationSetTypeInstance; + configurationSetTypeInstance = configurationSetTypeElement.getTextContent(); + configurationSetInstance.setConfigurationSetType(configurationSetTypeInstance); + } + + NodeList elements39 = configurationSetsElement.getElementsByTagName("InputEndpoints"); + Element inputEndpointsSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; + if (inputEndpointsSequenceElement != null) + { + for (int i5 = 0; i5 < inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").getLength(); i5 = i5 + 1) { - LoadBalancerProbe loadBalancerProbeInstance = new LoadBalancerProbe(); - inputEndpointInstance.setLoadBalancerProbe(loadBalancerProbeInstance); + org.w3c.dom.Element inputEndpointsElement = ((org.w3c.dom.Element) inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").item(i5)); + InputEndpoint inputEndpointInstance = new InputEndpoint(); + configurationSetInstance.getInputEndpoints().add(inputEndpointInstance); + + NodeList elements40 = inputEndpointsElement.getElementsByTagName("LoadBalancedEndpointSetName"); + Element loadBalancedEndpointSetNameElement = elements40.getLength() > 0 ? ((Element) elements40.item(0)) : null; + if (loadBalancedEndpointSetNameElement != null) + { + String loadBalancedEndpointSetNameInstance; + loadBalancedEndpointSetNameInstance = loadBalancedEndpointSetNameElement.getTextContent(); + inputEndpointInstance.setLoadBalancedEndpointSetName(loadBalancedEndpointSetNameInstance); + } - NodeList elements45 = loadBalancerProbeElement.getElementsByTagName("Path"); - Element pathElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; - if (pathElement != null) + NodeList elements41 = inputEndpointsElement.getElementsByTagName("LocalPort"); + Element localPortElement2 = elements41.getLength() > 0 ? ((Element) elements41.item(0)) : null; + if (localPortElement2 != null && (localPortElement2.getTextContent() != null && localPortElement2.getTextContent().isEmpty() != true) == false) { - String pathInstance; - pathInstance = pathElement.getTextContent(); - loadBalancerProbeInstance.setPath(pathInstance); + int localPortInstance2; + localPortInstance2 = Integer.parseInt(localPortElement2.getTextContent()); + inputEndpointInstance.setLocalPort(localPortInstance2); } - NodeList elements46 = loadBalancerProbeElement.getElementsByTagName("Port"); - Element portElement2 = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; - if (portElement2 != null) + NodeList elements42 = inputEndpointsElement.getElementsByTagName("Name"); + Element nameElement3 = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; + if (nameElement3 != null) { - int portInstance2; - portInstance2 = Integer.parseInt(portElement2.getTextContent()); - loadBalancerProbeInstance.setPort(portInstance2); + String nameInstance3; + nameInstance3 = nameElement3.getTextContent(); + inputEndpointInstance.setName(nameInstance3); } - NodeList elements47 = loadBalancerProbeElement.getElementsByTagName("Protocol"); - Element protocolElement2 = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; - if (protocolElement2 != null) + NodeList elements43 = inputEndpointsElement.getElementsByTagName("Port"); + Element portElement = elements43.getLength() > 0 ? ((Element) elements43.item(0)) : null; + if (portElement != null && (portElement.getTextContent() != null && portElement.getTextContent().isEmpty() != true) == false) { - LoadBalancerProbeTransportProtocol protocolInstance2; - protocolInstance2 = com.microsoft.windowsazure.management.compute.ComputeManagementClientImpl.parseLoadBalancerProbeTransportProtocol(protocolElement2.getTextContent()); - loadBalancerProbeInstance.setProtocol(protocolInstance2); + int portInstance; + portInstance = Integer.parseInt(portElement.getTextContent()); + inputEndpointInstance.setPort(portInstance); } - NodeList elements48 = loadBalancerProbeElement.getElementsByTagName("IntervalInSeconds"); - Element intervalInSecondsElement = elements48.getLength() > 0 ? ((Element) elements48.item(0)) : null; - if (intervalInSecondsElement != null && (intervalInSecondsElement.getTextContent() != null && intervalInSecondsElement.getTextContent().isEmpty() != true) == false) + NodeList elements44 = inputEndpointsElement.getElementsByTagName("LoadBalancerProbe"); + Element loadBalancerProbeElement = elements44.getLength() > 0 ? ((Element) elements44.item(0)) : null; + if (loadBalancerProbeElement != null) { - int intervalInSecondsInstance; - intervalInSecondsInstance = Integer.parseInt(intervalInSecondsElement.getTextContent()); - loadBalancerProbeInstance.setIntervalInSeconds(intervalInSecondsInstance); + LoadBalancerProbe loadBalancerProbeInstance = new LoadBalancerProbe(); + inputEndpointInstance.setLoadBalancerProbe(loadBalancerProbeInstance); + + NodeList elements45 = loadBalancerProbeElement.getElementsByTagName("Path"); + Element pathElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; + if (pathElement != null) + { + String pathInstance; + pathInstance = pathElement.getTextContent(); + loadBalancerProbeInstance.setPath(pathInstance); + } + + NodeList elements46 = loadBalancerProbeElement.getElementsByTagName("Port"); + Element portElement2 = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; + if (portElement2 != null) + { + int portInstance2; + portInstance2 = Integer.parseInt(portElement2.getTextContent()); + loadBalancerProbeInstance.setPort(portInstance2); + } + + NodeList elements47 = loadBalancerProbeElement.getElementsByTagName("Protocol"); + Element protocolElement2 = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; + if (protocolElement2 != null) + { + LoadBalancerProbeTransportProtocol protocolInstance2; + protocolInstance2 = com.microsoft.windowsazure.management.compute.ComputeManagementClientImpl.parseLoadBalancerProbeTransportProtocol(protocolElement2.getTextContent()); + loadBalancerProbeInstance.setProtocol(protocolInstance2); + } + + NodeList elements48 = loadBalancerProbeElement.getElementsByTagName("IntervalInSeconds"); + Element intervalInSecondsElement = elements48.getLength() > 0 ? ((Element) elements48.item(0)) : null; + if (intervalInSecondsElement != null && (intervalInSecondsElement.getTextContent() != null && intervalInSecondsElement.getTextContent().isEmpty() != true) == false) + { + int intervalInSecondsInstance; + intervalInSecondsInstance = Integer.parseInt(intervalInSecondsElement.getTextContent()); + loadBalancerProbeInstance.setIntervalInSeconds(intervalInSecondsInstance); + } + + NodeList elements49 = loadBalancerProbeElement.getElementsByTagName("TimeoutInSeconds"); + Element timeoutInSecondsElement = elements49.getLength() > 0 ? ((Element) elements49.item(0)) : null; + if (timeoutInSecondsElement != null && (timeoutInSecondsElement.getTextContent() != null && timeoutInSecondsElement.getTextContent().isEmpty() != true) == false) + { + int timeoutInSecondsInstance; + timeoutInSecondsInstance = Integer.parseInt(timeoutInSecondsElement.getTextContent()); + loadBalancerProbeInstance.setTimeoutInSeconds(timeoutInSecondsInstance); + } } - NodeList elements49 = loadBalancerProbeElement.getElementsByTagName("TimeoutInSeconds"); - Element timeoutInSecondsElement = elements49.getLength() > 0 ? ((Element) elements49.item(0)) : null; - if (timeoutInSecondsElement != null && (timeoutInSecondsElement.getTextContent() != null && timeoutInSecondsElement.getTextContent().isEmpty() != true) == false) + NodeList elements50 = inputEndpointsElement.getElementsByTagName("Protocol"); + Element protocolElement3 = elements50.getLength() > 0 ? ((Element) elements50.item(0)) : null; + if (protocolElement3 != null) { - int timeoutInSecondsInstance; - timeoutInSecondsInstance = Integer.parseInt(timeoutInSecondsElement.getTextContent()); - loadBalancerProbeInstance.setTimeoutInSeconds(timeoutInSecondsInstance); + String protocolInstance3; + protocolInstance3 = protocolElement3.getTextContent(); + inputEndpointInstance.setProtocol(protocolInstance3); + } + + NodeList elements51 = inputEndpointsElement.getElementsByTagName("Vip"); + Element vipElement2 = elements51.getLength() > 0 ? ((Element) elements51.item(0)) : null; + if (vipElement2 != null) + { + InetAddress vipInstance2; + vipInstance2 = InetAddress.getByName(vipElement2.getTextContent()); + inputEndpointInstance.setVirtualIPAddress(vipInstance2); + } + + NodeList elements52 = inputEndpointsElement.getElementsByTagName("EnableDirectServerReturn"); + Element enableDirectServerReturnElement = elements52.getLength() > 0 ? ((Element) elements52.item(0)) : null; + if (enableDirectServerReturnElement != null && (enableDirectServerReturnElement.getTextContent() != null && enableDirectServerReturnElement.getTextContent().isEmpty() != true) == false) + { + boolean enableDirectServerReturnInstance; + enableDirectServerReturnInstance = Boolean.parseBoolean(enableDirectServerReturnElement.getTextContent()); + inputEndpointInstance.setEnableDirectServerReturn(enableDirectServerReturnInstance); } - } - - NodeList elements50 = inputEndpointsElement.getElementsByTagName("Protocol"); - Element protocolElement3 = elements50.getLength() > 0 ? ((Element) elements50.item(0)) : null; - if (protocolElement3 != null) - { - String protocolInstance3; - protocolInstance3 = protocolElement3.getTextContent(); - inputEndpointInstance.setProtocol(protocolInstance3); - } - - NodeList elements51 = inputEndpointsElement.getElementsByTagName("Vip"); - Element vipElement2 = elements51.getLength() > 0 ? ((Element) elements51.item(0)) : null; - if (vipElement2 != null) - { - InetAddress vipInstance2; - vipInstance2 = InetAddress.getByName(vipElement2.getTextContent()); - inputEndpointInstance.setVirtualIPAddress(vipInstance2); - } - - NodeList elements52 = inputEndpointsElement.getElementsByTagName("EnableDirectServerReturn"); - Element enableDirectServerReturnElement = elements52.getLength() > 0 ? ((Element) elements52.item(0)) : null; - if (enableDirectServerReturnElement != null && (enableDirectServerReturnElement.getTextContent() != null && enableDirectServerReturnElement.getTextContent().isEmpty() != true) == false) - { - boolean enableDirectServerReturnInstance; - enableDirectServerReturnInstance = Boolean.parseBoolean(enableDirectServerReturnElement.getTextContent()); - inputEndpointInstance.setEnableDirectServerReturn(enableDirectServerReturnInstance); - } - - NodeList elements53 = inputEndpointsElement.getElementsByTagName("EndpointAcl"); - Element endpointAclElement = elements53.getLength() > 0 ? ((Element) elements53.item(0)) : null; - if (endpointAclElement != null) - { - EndpointAcl endpointAclInstance = new EndpointAcl(); - inputEndpointInstance.setEndpointAcl(endpointAclInstance); - NodeList elements54 = endpointAclElement.getElementsByTagName("Rules"); - Element rulesSequenceElement = elements54.getLength() > 0 ? ((Element) elements54.item(0)) : null; - if (rulesSequenceElement != null) + NodeList elements53 = inputEndpointsElement.getElementsByTagName("EndpointAcl"); + Element endpointAclElement = elements53.getLength() > 0 ? ((Element) elements53.item(0)) : null; + if (endpointAclElement != null) { - for (int i6 = 0; i6 < rulesSequenceElement.getElementsByTagName("Rule").getLength(); i6 = i6 + 1) + EndpointAcl endpointAclInstance = new EndpointAcl(); + inputEndpointInstance.setEndpointAcl(endpointAclInstance); + + NodeList elements54 = endpointAclElement.getElementsByTagName("Rules"); + Element rulesSequenceElement = elements54.getLength() > 0 ? ((Element) elements54.item(0)) : null; + if (rulesSequenceElement != null) { - org.w3c.dom.Element rulesElement = ((org.w3c.dom.Element) rulesSequenceElement.getElementsByTagName("Rule").item(i6)); - AccessControlListRule ruleInstance = new AccessControlListRule(); - endpointAclInstance.getRules().add(ruleInstance); - - NodeList elements55 = rulesElement.getElementsByTagName("Order"); - Element orderElement = elements55.getLength() > 0 ? ((Element) elements55.item(0)) : null; - if (orderElement != null && (orderElement.getTextContent() != null && orderElement.getTextContent().isEmpty() != true) == false) - { - int orderInstance; - orderInstance = Integer.parseInt(orderElement.getTextContent()); - ruleInstance.setOrder(orderInstance); - } - - NodeList elements56 = rulesElement.getElementsByTagName("Action"); - Element actionElement = elements56.getLength() > 0 ? ((Element) elements56.item(0)) : null; - if (actionElement != null) - { - String actionInstance; - actionInstance = actionElement.getTextContent(); - ruleInstance.setAction(actionInstance); - } - - NodeList elements57 = rulesElement.getElementsByTagName("RemoteSubnet"); - Element remoteSubnetElement = elements57.getLength() > 0 ? ((Element) elements57.item(0)) : null; - if (remoteSubnetElement != null) + for (int i6 = 0; i6 < rulesSequenceElement.getElementsByTagName("Rule").getLength(); i6 = i6 + 1) { - String remoteSubnetInstance; - remoteSubnetInstance = remoteSubnetElement.getTextContent(); - ruleInstance.setRemoteSubnet(remoteSubnetInstance); - } - - NodeList elements58 = rulesElement.getElementsByTagName("Description"); - Element descriptionElement = elements58.getLength() > 0 ? ((Element) elements58.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - ruleInstance.setDescription(descriptionInstance); + org.w3c.dom.Element rulesElement = ((org.w3c.dom.Element) rulesSequenceElement.getElementsByTagName("Rule").item(i6)); + AccessControlListRule ruleInstance = new AccessControlListRule(); + endpointAclInstance.getRules().add(ruleInstance); + + NodeList elements55 = rulesElement.getElementsByTagName("Order"); + Element orderElement = elements55.getLength() > 0 ? ((Element) elements55.item(0)) : null; + if (orderElement != null && (orderElement.getTextContent() != null && orderElement.getTextContent().isEmpty() != true) == false) + { + int orderInstance; + orderInstance = Integer.parseInt(orderElement.getTextContent()); + ruleInstance.setOrder(orderInstance); + } + + NodeList elements56 = rulesElement.getElementsByTagName("Action"); + Element actionElement = elements56.getLength() > 0 ? ((Element) elements56.item(0)) : null; + if (actionElement != null) + { + String actionInstance; + actionInstance = actionElement.getTextContent(); + ruleInstance.setAction(actionInstance); + } + + NodeList elements57 = rulesElement.getElementsByTagName("RemoteSubnet"); + Element remoteSubnetElement = elements57.getLength() > 0 ? ((Element) elements57.item(0)) : null; + if (remoteSubnetElement != null) + { + String remoteSubnetInstance; + remoteSubnetInstance = remoteSubnetElement.getTextContent(); + ruleInstance.setRemoteSubnet(remoteSubnetInstance); + } + + NodeList elements58 = rulesElement.getElementsByTagName("Description"); + Element descriptionElement = elements58.getLength() > 0 ? ((Element) elements58.item(0)) : null; + if (descriptionElement != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + ruleInstance.setDescription(descriptionInstance); + } } } } } } - } - - NodeList elements59 = configurationSetsElement.getElementsByTagName("SubnetNames"); - Element subnetNamesSequenceElement = elements59.getLength() > 0 ? ((Element) elements59.item(0)) : null; - if (subnetNamesSequenceElement != null) - { - for (int i7 = 0; i7 < subnetNamesSequenceElement.getElementsByTagName("SubnetName").getLength(); i7 = i7 + 1) - { - org.w3c.dom.Element subnetNamesElement = ((org.w3c.dom.Element) subnetNamesSequenceElement.getElementsByTagName("SubnetName").item(i7)); - configurationSetInstance.getSubnetNames().add(subnetNamesElement.getTextContent()); - } - } - - NodeList elements60 = configurationSetsElement.getElementsByTagName("ComputerName"); - Element computerNameElement = elements60.getLength() > 0 ? ((Element) elements60.item(0)) : null; - if (computerNameElement != null) - { - String computerNameInstance; - computerNameInstance = computerNameElement.getTextContent(); - configurationSetInstance.setComputerName(computerNameInstance); - } - - NodeList elements61 = configurationSetsElement.getElementsByTagName("AdminPassword"); - Element adminPasswordElement = elements61.getLength() > 0 ? ((Element) elements61.item(0)) : null; - if (adminPasswordElement != null) - { - String adminPasswordInstance; - adminPasswordInstance = adminPasswordElement.getTextContent(); - configurationSetInstance.setAdminPassword(adminPasswordInstance); - } - - NodeList elements62 = configurationSetsElement.getElementsByTagName("ResetPasswordOnFirstLogon"); - Element resetPasswordOnFirstLogonElement = elements62.getLength() > 0 ? ((Element) elements62.item(0)) : null; - if (resetPasswordOnFirstLogonElement != null && (resetPasswordOnFirstLogonElement.getTextContent() != null && resetPasswordOnFirstLogonElement.getTextContent().isEmpty() != true) == false) - { - boolean resetPasswordOnFirstLogonInstance; - resetPasswordOnFirstLogonInstance = Boolean.parseBoolean(resetPasswordOnFirstLogonElement.getTextContent()); - configurationSetInstance.setResetPasswordOnFirstLogon(resetPasswordOnFirstLogonInstance); - } - - NodeList elements63 = configurationSetsElement.getElementsByTagName("EnableAutomaticUpdates"); - Element enableAutomaticUpdatesElement = elements63.getLength() > 0 ? ((Element) elements63.item(0)) : null; - if (enableAutomaticUpdatesElement != null && (enableAutomaticUpdatesElement.getTextContent() != null && enableAutomaticUpdatesElement.getTextContent().isEmpty() != true) == false) - { - boolean enableAutomaticUpdatesInstance; - enableAutomaticUpdatesInstance = Boolean.parseBoolean(enableAutomaticUpdatesElement.getTextContent()); - configurationSetInstance.setEnableAutomaticUpdates(enableAutomaticUpdatesInstance); - } - - NodeList elements64 = configurationSetsElement.getElementsByTagName("TimeZone"); - Element timeZoneElement = elements64.getLength() > 0 ? ((Element) elements64.item(0)) : null; - if (timeZoneElement != null) - { - String timeZoneInstance; - timeZoneInstance = timeZoneElement.getTextContent(); - configurationSetInstance.setTimeZone(timeZoneInstance); - } - - NodeList elements65 = configurationSetsElement.getElementsByTagName("DomainJoin"); - Element domainJoinElement = elements65.getLength() > 0 ? ((Element) elements65.item(0)) : null; - if (domainJoinElement != null) - { - DomainJoinSettings domainJoinInstance = new DomainJoinSettings(); - configurationSetInstance.setDomainJoin(domainJoinInstance); - NodeList elements66 = domainJoinElement.getElementsByTagName("Credentials"); - Element credentialsElement = elements66.getLength() > 0 ? ((Element) elements66.item(0)) : null; - if (credentialsElement != null) + NodeList elements59 = configurationSetsElement.getElementsByTagName("SubnetNames"); + Element subnetNamesSequenceElement = elements59.getLength() > 0 ? ((Element) elements59.item(0)) : null; + if (subnetNamesSequenceElement != null) { - DomainJoinCredentials credentialsInstance = new DomainJoinCredentials(); - domainJoinInstance.setCredentials(credentialsInstance); - - NodeList elements67 = credentialsElement.getElementsByTagName("Domain"); - Element domainElement = elements67.getLength() > 0 ? ((Element) elements67.item(0)) : null; - if (domainElement != null) - { - String domainInstance; - domainInstance = domainElement.getTextContent(); - credentialsInstance.setDomain(domainInstance); - } - - NodeList elements68 = credentialsElement.getElementsByTagName("Username"); - Element usernameElement = elements68.getLength() > 0 ? ((Element) elements68.item(0)) : null; - if (usernameElement != null) - { - String usernameInstance; - usernameInstance = usernameElement.getTextContent(); - credentialsInstance.setUserName(usernameInstance); - } - - NodeList elements69 = credentialsElement.getElementsByTagName("Password"); - Element passwordElement = elements69.getLength() > 0 ? ((Element) elements69.item(0)) : null; - if (passwordElement != null) + for (int i7 = 0; i7 < subnetNamesSequenceElement.getElementsByTagName("SubnetName").getLength(); i7 = i7 + 1) { - String passwordInstance; - passwordInstance = passwordElement.getTextContent(); - credentialsInstance.setPassword(passwordInstance); + org.w3c.dom.Element subnetNamesElement = ((org.w3c.dom.Element) subnetNamesSequenceElement.getElementsByTagName("SubnetName").item(i7)); + configurationSetInstance.getSubnetNames().add(subnetNamesElement.getTextContent()); } } - NodeList elements70 = domainJoinElement.getElementsByTagName("JoinDomain"); - Element joinDomainElement = elements70.getLength() > 0 ? ((Element) elements70.item(0)) : null; - if (joinDomainElement != null) + NodeList elements60 = configurationSetsElement.getElementsByTagName("StaticVirtualNetworkIPAddress"); + Element staticVirtualNetworkIPAddressElement = elements60.getLength() > 0 ? ((Element) elements60.item(0)) : null; + if (staticVirtualNetworkIPAddressElement != null) + { + String staticVirtualNetworkIPAddressInstance; + staticVirtualNetworkIPAddressInstance = staticVirtualNetworkIPAddressElement.getTextContent(); + configurationSetInstance.setStaticVirtualNetworkIPAddress(staticVirtualNetworkIPAddressInstance); + } + + NodeList elements61 = configurationSetsElement.getElementsByTagName("ComputerName"); + Element computerNameElement = elements61.getLength() > 0 ? ((Element) elements61.item(0)) : null; + if (computerNameElement != null) + { + String computerNameInstance; + computerNameInstance = computerNameElement.getTextContent(); + configurationSetInstance.setComputerName(computerNameInstance); + } + + NodeList elements62 = configurationSetsElement.getElementsByTagName("AdminPassword"); + Element adminPasswordElement = elements62.getLength() > 0 ? ((Element) elements62.item(0)) : null; + if (adminPasswordElement != null) + { + String adminPasswordInstance; + adminPasswordInstance = adminPasswordElement.getTextContent(); + configurationSetInstance.setAdminPassword(adminPasswordInstance); + } + + NodeList elements63 = configurationSetsElement.getElementsByTagName("ResetPasswordOnFirstLogon"); + Element resetPasswordOnFirstLogonElement = elements63.getLength() > 0 ? ((Element) elements63.item(0)) : null; + if (resetPasswordOnFirstLogonElement != null && (resetPasswordOnFirstLogonElement.getTextContent() != null && resetPasswordOnFirstLogonElement.getTextContent().isEmpty() != true) == false) + { + boolean resetPasswordOnFirstLogonInstance; + resetPasswordOnFirstLogonInstance = Boolean.parseBoolean(resetPasswordOnFirstLogonElement.getTextContent()); + configurationSetInstance.setResetPasswordOnFirstLogon(resetPasswordOnFirstLogonInstance); + } + + NodeList elements64 = configurationSetsElement.getElementsByTagName("EnableAutomaticUpdates"); + Element enableAutomaticUpdatesElement = elements64.getLength() > 0 ? ((Element) elements64.item(0)) : null; + if (enableAutomaticUpdatesElement != null && (enableAutomaticUpdatesElement.getTextContent() != null && enableAutomaticUpdatesElement.getTextContent().isEmpty() != true) == false) { - String joinDomainInstance; - joinDomainInstance = joinDomainElement.getTextContent(); - domainJoinInstance.setDomainToJoin(joinDomainInstance); + boolean enableAutomaticUpdatesInstance; + enableAutomaticUpdatesInstance = Boolean.parseBoolean(enableAutomaticUpdatesElement.getTextContent()); + configurationSetInstance.setEnableAutomaticUpdates(enableAutomaticUpdatesInstance); } - NodeList elements71 = domainJoinElement.getElementsByTagName("MachineObjectOU"); - Element machineObjectOUElement = elements71.getLength() > 0 ? ((Element) elements71.item(0)) : null; - if (machineObjectOUElement != null) + NodeList elements65 = configurationSetsElement.getElementsByTagName("TimeZone"); + Element timeZoneElement = elements65.getLength() > 0 ? ((Element) elements65.item(0)) : null; + if (timeZoneElement != null) { - String machineObjectOUInstance; - machineObjectOUInstance = machineObjectOUElement.getTextContent(); - domainJoinInstance.setLdapMachineObjectOU(machineObjectOUInstance); + String timeZoneInstance; + timeZoneInstance = timeZoneElement.getTextContent(); + configurationSetInstance.setTimeZone(timeZoneInstance); } - NodeList elements72 = domainJoinElement.getElementsByTagName("Provisioning"); - Element provisioningElement = elements72.getLength() > 0 ? ((Element) elements72.item(0)) : null; - if (provisioningElement != null) + NodeList elements66 = configurationSetsElement.getElementsByTagName("DomainJoin"); + Element domainJoinElement = elements66.getLength() > 0 ? ((Element) elements66.item(0)) : null; + if (domainJoinElement != null) { - DomainJoinProvisioning provisioningInstance = new DomainJoinProvisioning(); - domainJoinInstance.setProvisioning(provisioningInstance); + DomainJoinSettings domainJoinInstance = new DomainJoinSettings(); + configurationSetInstance.setDomainJoin(domainJoinInstance); - NodeList elements73 = provisioningElement.getElementsByTagName("AccountData"); - Element accountDataElement = elements73.getLength() > 0 ? ((Element) elements73.item(0)) : null; - if (accountDataElement != null) + NodeList elements67 = domainJoinElement.getElementsByTagName("Credentials"); + Element credentialsElement = elements67.getLength() > 0 ? ((Element) elements67.item(0)) : null; + if (credentialsElement != null) { - String accountDataInstance; - accountDataInstance = accountDataElement.getTextContent(); - provisioningInstance.setAccountData(accountDataInstance); + DomainJoinCredentials credentialsInstance = new DomainJoinCredentials(); + domainJoinInstance.setCredentials(credentialsInstance); + + NodeList elements68 = credentialsElement.getElementsByTagName("Domain"); + Element domainElement = elements68.getLength() > 0 ? ((Element) elements68.item(0)) : null; + if (domainElement != null) + { + String domainInstance; + domainInstance = domainElement.getTextContent(); + credentialsInstance.setDomain(domainInstance); + } + + NodeList elements69 = credentialsElement.getElementsByTagName("Username"); + Element usernameElement = elements69.getLength() > 0 ? ((Element) elements69.item(0)) : null; + if (usernameElement != null) + { + String usernameInstance; + usernameInstance = usernameElement.getTextContent(); + credentialsInstance.setUserName(usernameInstance); + } + + NodeList elements70 = credentialsElement.getElementsByTagName("Password"); + Element passwordElement = elements70.getLength() > 0 ? ((Element) elements70.item(0)) : null; + if (passwordElement != null) + { + String passwordInstance; + passwordInstance = passwordElement.getTextContent(); + credentialsInstance.setPassword(passwordInstance); + } } - } - } - - NodeList elements74 = configurationSetsElement.getElementsByTagName("StoredCertificateSettings"); - Element storedCertificateSettingsSequenceElement = elements74.getLength() > 0 ? ((Element) elements74.item(0)) : null; - if (storedCertificateSettingsSequenceElement != null) - { - for (int i8 = 0; i8 < storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").getLength(); i8 = i8 + 1) - { - org.w3c.dom.Element storedCertificateSettingsElement = ((org.w3c.dom.Element) storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").item(i8)); - StoredCertificateSettings certificateSettingInstance = new StoredCertificateSettings(); - configurationSetInstance.getStoredCertificateSettings().add(certificateSettingInstance); - NodeList elements75 = storedCertificateSettingsElement.getElementsByTagName("StoreLocation"); - Element storeLocationElement = elements75.getLength() > 0 ? ((Element) elements75.item(0)) : null; - if (storeLocationElement != null) + NodeList elements71 = domainJoinElement.getElementsByTagName("JoinDomain"); + Element joinDomainElement = elements71.getLength() > 0 ? ((Element) elements71.item(0)) : null; + if (joinDomainElement != null) { + String joinDomainInstance; + joinDomainInstance = joinDomainElement.getTextContent(); + domainJoinInstance.setDomainToJoin(joinDomainInstance); } - NodeList elements76 = storedCertificateSettingsElement.getElementsByTagName("StoreName"); - Element storeNameElement = elements76.getLength() > 0 ? ((Element) elements76.item(0)) : null; - if (storeNameElement != null) + NodeList elements72 = domainJoinElement.getElementsByTagName("MachineObjectOU"); + Element machineObjectOUElement = elements72.getLength() > 0 ? ((Element) elements72.item(0)) : null; + if (machineObjectOUElement != null) { - String storeNameInstance; - storeNameInstance = storeNameElement.getTextContent(); - certificateSettingInstance.setStoreName(storeNameInstance); + String machineObjectOUInstance; + machineObjectOUInstance = machineObjectOUElement.getTextContent(); + domainJoinInstance.setLdapMachineObjectOU(machineObjectOUInstance); } - NodeList elements77 = storedCertificateSettingsElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements77.getLength() > 0 ? ((Element) elements77.item(0)) : null; - if (thumbprintElement != null) + NodeList elements73 = domainJoinElement.getElementsByTagName("Provisioning"); + Element provisioningElement = elements73.getLength() > 0 ? ((Element) elements73.item(0)) : null; + if (provisioningElement != null) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - certificateSettingInstance.setThumbprint(thumbprintInstance); + DomainJoinProvisioning provisioningInstance = new DomainJoinProvisioning(); + domainJoinInstance.setProvisioning(provisioningInstance); + + NodeList elements74 = provisioningElement.getElementsByTagName("AccountData"); + Element accountDataElement = elements74.getLength() > 0 ? ((Element) elements74.item(0)) : null; + if (accountDataElement != null) + { + String accountDataInstance; + accountDataInstance = accountDataElement.getTextContent(); + provisioningInstance.setAccountData(accountDataInstance); + } } } - } - - NodeList elements78 = configurationSetsElement.getElementsByTagName("WinRM"); - Element winRMElement = elements78.getLength() > 0 ? ((Element) elements78.item(0)) : null; - if (winRMElement != null) - { - WindowsRemoteManagementSettings winRMInstance = new WindowsRemoteManagementSettings(); - configurationSetInstance.setWindowsRemoteManagement(winRMInstance); - NodeList elements79 = winRMElement.getElementsByTagName("Listeners"); - Element listenersSequenceElement = elements79.getLength() > 0 ? ((Element) elements79.item(0)) : null; - if (listenersSequenceElement != null) + NodeList elements75 = configurationSetsElement.getElementsByTagName("StoredCertificateSettings"); + Element storedCertificateSettingsSequenceElement = elements75.getLength() > 0 ? ((Element) elements75.item(0)) : null; + if (storedCertificateSettingsSequenceElement != null) { - for (int i9 = 0; i9 < listenersSequenceElement.getElementsByTagName("Listener").getLength(); i9 = i9 + 1) + for (int i8 = 0; i8 < storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").getLength(); i8 = i8 + 1) { - org.w3c.dom.Element listenersElement = ((org.w3c.dom.Element) listenersSequenceElement.getElementsByTagName("Listener").item(i9)); - WindowsRemoteManagementListener listenerInstance = new WindowsRemoteManagementListener(); - winRMInstance.getListeners().add(listenerInstance); + org.w3c.dom.Element storedCertificateSettingsElement = ((org.w3c.dom.Element) storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").item(i8)); + StoredCertificateSettings certificateSettingInstance = new StoredCertificateSettings(); + configurationSetInstance.getStoredCertificateSettings().add(certificateSettingInstance); + + NodeList elements76 = storedCertificateSettingsElement.getElementsByTagName("StoreLocation"); + Element storeLocationElement = elements76.getLength() > 0 ? ((Element) elements76.item(0)) : null; + if (storeLocationElement != null) + { + } - NodeList elements80 = listenersElement.getElementsByTagName("Protocol"); - Element protocolElement4 = elements80.getLength() > 0 ? ((Element) elements80.item(0)) : null; - if (protocolElement4 != null) + NodeList elements77 = storedCertificateSettingsElement.getElementsByTagName("StoreName"); + Element storeNameElement = elements77.getLength() > 0 ? ((Element) elements77.item(0)) : null; + if (storeNameElement != null) { - VirtualMachineWindowsRemoteManagementListenerType protocolInstance4; - protocolInstance4 = VirtualMachineWindowsRemoteManagementListenerType.valueOf(protocolElement4.getTextContent()); - listenerInstance.setListenerType(protocolInstance4); + String storeNameInstance; + storeNameInstance = storeNameElement.getTextContent(); + certificateSettingInstance.setStoreName(storeNameInstance); } - NodeList elements81 = listenersElement.getElementsByTagName("CertificateThumbprint"); - Element certificateThumbprintElement = elements81.getLength() > 0 ? ((Element) elements81.item(0)) : null; - if (certificateThumbprintElement != null) + NodeList elements78 = storedCertificateSettingsElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements78.getLength() > 0 ? ((Element) elements78.item(0)) : null; + if (thumbprintElement != null) { - String certificateThumbprintInstance; - certificateThumbprintInstance = certificateThumbprintElement.getTextContent(); - listenerInstance.setCertificateThumbprint(certificateThumbprintInstance); + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + certificateSettingInstance.setThumbprint(thumbprintInstance); } } } - } - - NodeList elements82 = configurationSetsElement.getElementsByTagName("AdminUsername"); - Element adminUsernameElement = elements82.getLength() > 0 ? ((Element) elements82.item(0)) : null; - if (adminUsernameElement != null) - { - String adminUsernameInstance; - adminUsernameInstance = adminUsernameElement.getTextContent(); - configurationSetInstance.setAdminUserName(adminUsernameInstance); - } - - NodeList elements83 = configurationSetsElement.getElementsByTagName("HostName"); - Element hostNameElement2 = elements83.getLength() > 0 ? ((Element) elements83.item(0)) : null; - if (hostNameElement2 != null) - { - String hostNameInstance2; - hostNameInstance2 = hostNameElement2.getTextContent(); - configurationSetInstance.setHostName(hostNameInstance2); - } - - NodeList elements84 = configurationSetsElement.getElementsByTagName("UserName"); - Element userNameElement = elements84.getLength() > 0 ? ((Element) elements84.item(0)) : null; - if (userNameElement != null) - { - String userNameInstance; - userNameInstance = userNameElement.getTextContent(); - configurationSetInstance.setUserName(userNameInstance); - } - - NodeList elements85 = configurationSetsElement.getElementsByTagName("UserPassword"); - Element userPasswordElement = elements85.getLength() > 0 ? ((Element) elements85.item(0)) : null; - if (userPasswordElement != null) - { - String userPasswordInstance; - userPasswordInstance = userPasswordElement.getTextContent(); - configurationSetInstance.setUserPassword(userPasswordInstance); - } - - NodeList elements86 = configurationSetsElement.getElementsByTagName("DisableSshPasswordAuthentication"); - Element disableSshPasswordAuthenticationElement = elements86.getLength() > 0 ? ((Element) elements86.item(0)) : null; - if (disableSshPasswordAuthenticationElement != null && (disableSshPasswordAuthenticationElement.getTextContent() != null && disableSshPasswordAuthenticationElement.getTextContent().isEmpty() != true) == false) - { - boolean disableSshPasswordAuthenticationInstance; - disableSshPasswordAuthenticationInstance = Boolean.parseBoolean(disableSshPasswordAuthenticationElement.getTextContent()); - configurationSetInstance.setDisableSshPasswordAuthentication(disableSshPasswordAuthenticationInstance); - } - - NodeList elements87 = configurationSetsElement.getElementsByTagName("SSH"); - Element sSHElement = elements87.getLength() > 0 ? ((Element) elements87.item(0)) : null; - if (sSHElement != null) - { - SshSettings sSHInstance = new SshSettings(); - configurationSetInstance.setSshSettings(sSHInstance); - NodeList elements88 = sSHElement.getElementsByTagName("PublicKeys"); - Element publicKeysSequenceElement = elements88.getLength() > 0 ? ((Element) elements88.item(0)) : null; - if (publicKeysSequenceElement != null) + NodeList elements79 = configurationSetsElement.getElementsByTagName("WinRM"); + Element winRMElement = elements79.getLength() > 0 ? ((Element) elements79.item(0)) : null; + if (winRMElement != null) { - for (int i10 = 0; i10 < publicKeysSequenceElement.getElementsByTagName("PublicKey").getLength(); i10 = i10 + 1) + WindowsRemoteManagementSettings winRMInstance = new WindowsRemoteManagementSettings(); + configurationSetInstance.setWindowsRemoteManagement(winRMInstance); + + NodeList elements80 = winRMElement.getElementsByTagName("Listeners"); + Element listenersSequenceElement = elements80.getLength() > 0 ? ((Element) elements80.item(0)) : null; + if (listenersSequenceElement != null) { - org.w3c.dom.Element publicKeysElement = ((org.w3c.dom.Element) publicKeysSequenceElement.getElementsByTagName("PublicKey").item(i10)); - SshSettingPublicKey publicKeyInstance = new SshSettingPublicKey(); - sSHInstance.getPublicKeys().add(publicKeyInstance); - - NodeList elements89 = publicKeysElement.getElementsByTagName("Fingerprint"); - Element fingerprintElement = elements89.getLength() > 0 ? ((Element) elements89.item(0)) : null; - if (fingerprintElement != null) + for (int i9 = 0; i9 < listenersSequenceElement.getElementsByTagName("Listener").getLength(); i9 = i9 + 1) { - String fingerprintInstance; - fingerprintInstance = fingerprintElement.getTextContent(); - publicKeyInstance.setFingerprint(fingerprintInstance); - } - - NodeList elements90 = publicKeysElement.getElementsByTagName("Path"); - Element pathElement2 = elements90.getLength() > 0 ? ((Element) elements90.item(0)) : null; - if (pathElement2 != null) - { - String pathInstance2; - pathInstance2 = pathElement2.getTextContent(); - publicKeyInstance.setPath(pathInstance2); + org.w3c.dom.Element listenersElement = ((org.w3c.dom.Element) listenersSequenceElement.getElementsByTagName("Listener").item(i9)); + WindowsRemoteManagementListener listenerInstance = new WindowsRemoteManagementListener(); + winRMInstance.getListeners().add(listenerInstance); + + NodeList elements81 = listenersElement.getElementsByTagName("Protocol"); + Element protocolElement4 = elements81.getLength() > 0 ? ((Element) elements81.item(0)) : null; + if (protocolElement4 != null) + { + VirtualMachineWindowsRemoteManagementListenerType protocolInstance4; + protocolInstance4 = VirtualMachineWindowsRemoteManagementListenerType.valueOf(protocolElement4.getTextContent()); + listenerInstance.setListenerType(protocolInstance4); + } + + NodeList elements82 = listenersElement.getElementsByTagName("CertificateThumbprint"); + Element certificateThumbprintElement = elements82.getLength() > 0 ? ((Element) elements82.item(0)) : null; + if (certificateThumbprintElement != null) + { + String certificateThumbprintInstance; + certificateThumbprintInstance = certificateThumbprintElement.getTextContent(); + listenerInstance.setCertificateThumbprint(certificateThumbprintInstance); + } } } } - NodeList elements91 = sSHElement.getElementsByTagName("KeyPairs"); - Element keyPairsSequenceElement = elements91.getLength() > 0 ? ((Element) elements91.item(0)) : null; - if (keyPairsSequenceElement != null) + NodeList elements83 = configurationSetsElement.getElementsByTagName("AdminUsername"); + Element adminUsernameElement = elements83.getLength() > 0 ? ((Element) elements83.item(0)) : null; + if (adminUsernameElement != null) + { + String adminUsernameInstance; + adminUsernameInstance = adminUsernameElement.getTextContent(); + configurationSetInstance.setAdminUserName(adminUsernameInstance); + } + + NodeList elements84 = configurationSetsElement.getElementsByTagName("HostName"); + Element hostNameElement2 = elements84.getLength() > 0 ? ((Element) elements84.item(0)) : null; + if (hostNameElement2 != null) + { + String hostNameInstance2; + hostNameInstance2 = hostNameElement2.getTextContent(); + configurationSetInstance.setHostName(hostNameInstance2); + } + + NodeList elements85 = configurationSetsElement.getElementsByTagName("UserName"); + Element userNameElement = elements85.getLength() > 0 ? ((Element) elements85.item(0)) : null; + if (userNameElement != null) + { + String userNameInstance; + userNameInstance = userNameElement.getTextContent(); + configurationSetInstance.setUserName(userNameInstance); + } + + NodeList elements86 = configurationSetsElement.getElementsByTagName("UserPassword"); + Element userPasswordElement = elements86.getLength() > 0 ? ((Element) elements86.item(0)) : null; + if (userPasswordElement != null) + { + String userPasswordInstance; + userPasswordInstance = userPasswordElement.getTextContent(); + configurationSetInstance.setUserPassword(userPasswordInstance); + } + + NodeList elements87 = configurationSetsElement.getElementsByTagName("DisableSshPasswordAuthentication"); + Element disableSshPasswordAuthenticationElement = elements87.getLength() > 0 ? ((Element) elements87.item(0)) : null; + if (disableSshPasswordAuthenticationElement != null && (disableSshPasswordAuthenticationElement.getTextContent() != null && disableSshPasswordAuthenticationElement.getTextContent().isEmpty() != true) == false) + { + boolean disableSshPasswordAuthenticationInstance; + disableSshPasswordAuthenticationInstance = Boolean.parseBoolean(disableSshPasswordAuthenticationElement.getTextContent()); + configurationSetInstance.setDisableSshPasswordAuthentication(disableSshPasswordAuthenticationInstance); + } + + NodeList elements88 = configurationSetsElement.getElementsByTagName("SSH"); + Element sSHElement = elements88.getLength() > 0 ? ((Element) elements88.item(0)) : null; + if (sSHElement != null) { - for (int i11 = 0; i11 < keyPairsSequenceElement.getElementsByTagName("KeyPair").getLength(); i11 = i11 + 1) + SshSettings sSHInstance = new SshSettings(); + configurationSetInstance.setSshSettings(sSHInstance); + + NodeList elements89 = sSHElement.getElementsByTagName("PublicKeys"); + Element publicKeysSequenceElement = elements89.getLength() > 0 ? ((Element) elements89.item(0)) : null; + if (publicKeysSequenceElement != null) { - org.w3c.dom.Element keyPairsElement = ((org.w3c.dom.Element) keyPairsSequenceElement.getElementsByTagName("KeyPair").item(i11)); - SshSettingKeyPair keyPairInstance = new SshSettingKeyPair(); - sSHInstance.getKeyPairs().add(keyPairInstance); - - NodeList elements92 = keyPairsElement.getElementsByTagName("Fingerprint"); - Element fingerprintElement2 = elements92.getLength() > 0 ? ((Element) elements92.item(0)) : null; - if (fingerprintElement2 != null) + for (int i10 = 0; i10 < publicKeysSequenceElement.getElementsByTagName("PublicKey").getLength(); i10 = i10 + 1) { - String fingerprintInstance2; - fingerprintInstance2 = fingerprintElement2.getTextContent(); - keyPairInstance.setFingerprint(fingerprintInstance2); + org.w3c.dom.Element publicKeysElement = ((org.w3c.dom.Element) publicKeysSequenceElement.getElementsByTagName("PublicKey").item(i10)); + SshSettingPublicKey publicKeyInstance = new SshSettingPublicKey(); + sSHInstance.getPublicKeys().add(publicKeyInstance); + + NodeList elements90 = publicKeysElement.getElementsByTagName("Fingerprint"); + Element fingerprintElement = elements90.getLength() > 0 ? ((Element) elements90.item(0)) : null; + if (fingerprintElement != null) + { + String fingerprintInstance; + fingerprintInstance = fingerprintElement.getTextContent(); + publicKeyInstance.setFingerprint(fingerprintInstance); + } + + NodeList elements91 = publicKeysElement.getElementsByTagName("Path"); + Element pathElement2 = elements91.getLength() > 0 ? ((Element) elements91.item(0)) : null; + if (pathElement2 != null) + { + String pathInstance2; + pathInstance2 = pathElement2.getTextContent(); + publicKeyInstance.setPath(pathInstance2); + } } - - NodeList elements93 = keyPairsElement.getElementsByTagName("Path"); - Element pathElement3 = elements93.getLength() > 0 ? ((Element) elements93.item(0)) : null; - if (pathElement3 != null) + } + + NodeList elements92 = sSHElement.getElementsByTagName("KeyPairs"); + Element keyPairsSequenceElement = elements92.getLength() > 0 ? ((Element) elements92.item(0)) : null; + if (keyPairsSequenceElement != null) + { + for (int i11 = 0; i11 < keyPairsSequenceElement.getElementsByTagName("KeyPair").getLength(); i11 = i11 + 1) { - String pathInstance3; - pathInstance3 = pathElement3.getTextContent(); - keyPairInstance.setPath(pathInstance3); + org.w3c.dom.Element keyPairsElement = ((org.w3c.dom.Element) keyPairsSequenceElement.getElementsByTagName("KeyPair").item(i11)); + SshSettingKeyPair keyPairInstance = new SshSettingKeyPair(); + sSHInstance.getKeyPairs().add(keyPairInstance); + + NodeList elements93 = keyPairsElement.getElementsByTagName("Fingerprint"); + Element fingerprintElement2 = elements93.getLength() > 0 ? ((Element) elements93.item(0)) : null; + if (fingerprintElement2 != null) + { + String fingerprintInstance2; + fingerprintInstance2 = fingerprintElement2.getTextContent(); + keyPairInstance.setFingerprint(fingerprintInstance2); + } + + NodeList elements94 = keyPairsElement.getElementsByTagName("Path"); + Element pathElement3 = elements94.getLength() > 0 ? ((Element) elements94.item(0)) : null; + if (pathElement3 != null) + { + String pathInstance3; + pathInstance3 = pathElement3.getTextContent(); + keyPairInstance.setPath(pathInstance3); + } } } } } } - } - - NodeList elements94 = roleListElement.getElementsByTagName("AvailabilitySetName"); - Element availabilitySetNameElement = elements94.getLength() > 0 ? ((Element) elements94.item(0)) : null; - if (availabilitySetNameElement != null) - { - String availabilitySetNameInstance; - availabilitySetNameInstance = availabilitySetNameElement.getTextContent(); - roleInstance.setAvailabilitySetName(availabilitySetNameInstance); - } - - NodeList elements95 = roleListElement.getElementsByTagName("DataVirtualHardDisks"); - Element dataVirtualHardDisksSequenceElement = elements95.getLength() > 0 ? ((Element) elements95.item(0)) : null; - if (dataVirtualHardDisksSequenceElement != null) - { - for (int i12 = 0; i12 < dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").getLength(); i12 = i12 + 1) + + NodeList elements95 = roleListElement.getElementsByTagName("AvailabilitySetName"); + Element availabilitySetNameElement = elements95.getLength() > 0 ? ((Element) elements95.item(0)) : null; + if (availabilitySetNameElement != null) + { + String availabilitySetNameInstance; + availabilitySetNameInstance = availabilitySetNameElement.getTextContent(); + roleInstance.setAvailabilitySetName(availabilitySetNameInstance); + } + + NodeList elements96 = roleListElement.getElementsByTagName("DataVirtualHardDisks"); + Element dataVirtualHardDisksSequenceElement = elements96.getLength() > 0 ? ((Element) elements96.item(0)) : null; + if (dataVirtualHardDisksSequenceElement != null) + { + for (int i12 = 0; i12 < dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").getLength(); i12 = i12 + 1) + { + org.w3c.dom.Element dataVirtualHardDisksElement = ((org.w3c.dom.Element) dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").item(i12)); + DataVirtualHardDisk dataVirtualHardDiskInstance = new DataVirtualHardDisk(); + roleInstance.getDataVirtualHardDisks().add(dataVirtualHardDiskInstance); + + NodeList elements97 = dataVirtualHardDisksElement.getElementsByTagName("HostCaching"); + Element hostCachingElement = elements97.getLength() > 0 ? ((Element) elements97.item(0)) : null; + if (hostCachingElement != null && (hostCachingElement.getTextContent() != null && hostCachingElement.getTextContent().isEmpty() != true) == false) + { + VirtualHardDiskHostCaching hostCachingInstance; + hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); + dataVirtualHardDiskInstance.setHostCaching(hostCachingInstance); + } + + NodeList elements98 = dataVirtualHardDisksElement.getElementsByTagName("DiskLabel"); + Element diskLabelElement = elements98.getLength() > 0 ? ((Element) elements98.item(0)) : null; + if (diskLabelElement != null) + { + String diskLabelInstance; + diskLabelInstance = diskLabelElement.getTextContent(); + dataVirtualHardDiskInstance.setDiskLabel(diskLabelInstance); + } + + NodeList elements99 = dataVirtualHardDisksElement.getElementsByTagName("DiskName"); + Element diskNameElement = elements99.getLength() > 0 ? ((Element) elements99.item(0)) : null; + if (diskNameElement != null) + { + String diskNameInstance; + diskNameInstance = diskNameElement.getTextContent(); + dataVirtualHardDiskInstance.setDiskName(diskNameInstance); + } + + NodeList elements100 = dataVirtualHardDisksElement.getElementsByTagName("Lun"); + Element lunElement = elements100.getLength() > 0 ? ((Element) elements100.item(0)) : null; + if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + { + int lunInstance; + lunInstance = Integer.parseInt(lunElement.getTextContent()); + dataVirtualHardDiskInstance.setLogicalUnitNumber(lunInstance); + } + + NodeList elements101 = dataVirtualHardDisksElement.getElementsByTagName("LogicalDiskSizeInGB"); + Element logicalDiskSizeInGBElement = elements101.getLength() > 0 ? ((Element) elements101.item(0)) : null; + if (logicalDiskSizeInGBElement != null) + { + int logicalDiskSizeInGBInstance; + logicalDiskSizeInGBInstance = Integer.parseInt(logicalDiskSizeInGBElement.getTextContent()); + dataVirtualHardDiskInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + } + + NodeList elements102 = dataVirtualHardDisksElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement = elements102.getLength() > 0 ? ((Element) elements102.item(0)) : null; + if (mediaLinkElement != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); + dataVirtualHardDiskInstance.setMediaLink(mediaLinkInstance); + } + } + } + + NodeList elements103 = roleListElement.getElementsByTagName("Label"); + Element labelElement2 = elements103.getLength() > 0 ? ((Element) elements103.item(0)) : null; + if (labelElement2 != null) + { + String labelInstance2; + labelInstance2 = labelElement2.getTextContent(); + roleInstance.setLabel(labelInstance2); + } + + NodeList elements104 = roleListElement.getElementsByTagName("OSVirtualHardDisk"); + Element oSVirtualHardDiskElement = elements104.getLength() > 0 ? ((Element) elements104.item(0)) : null; + if (oSVirtualHardDiskElement != null) { - org.w3c.dom.Element dataVirtualHardDisksElement = ((org.w3c.dom.Element) dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").item(i12)); - DataVirtualHardDisk dataVirtualHardDiskInstance = new DataVirtualHardDisk(); - roleInstance.getDataVirtualHardDisks().add(dataVirtualHardDiskInstance); + OSVirtualHardDisk oSVirtualHardDiskInstance = new OSVirtualHardDisk(); + roleInstance.setOSVirtualHardDisk(oSVirtualHardDiskInstance); - NodeList elements96 = dataVirtualHardDisksElement.getElementsByTagName("HostCaching"); - Element hostCachingElement = elements96.getLength() > 0 ? ((Element) elements96.item(0)) : null; - if (hostCachingElement != null && (hostCachingElement.getTextContent() != null && hostCachingElement.getTextContent().isEmpty() != true) == false) + NodeList elements105 = oSVirtualHardDiskElement.getElementsByTagName("HostCaching"); + Element hostCachingElement2 = elements105.getLength() > 0 ? ((Element) elements105.item(0)) : null; + if (hostCachingElement2 != null && (hostCachingElement2.getTextContent() != null && hostCachingElement2.getTextContent().isEmpty() != true) == false) { - VirtualHardDiskHostCaching hostCachingInstance; - hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); - dataVirtualHardDiskInstance.setHostCaching(hostCachingInstance); + VirtualHardDiskHostCaching hostCachingInstance2; + hostCachingInstance2 = VirtualHardDiskHostCaching.valueOf(hostCachingElement2.getTextContent()); + oSVirtualHardDiskInstance.setHostCaching(hostCachingInstance2); } - NodeList elements97 = dataVirtualHardDisksElement.getElementsByTagName("DiskLabel"); - Element diskLabelElement = elements97.getLength() > 0 ? ((Element) elements97.item(0)) : null; - if (diskLabelElement != null) + NodeList elements106 = oSVirtualHardDiskElement.getElementsByTagName("DiskLabel"); + Element diskLabelElement2 = elements106.getLength() > 0 ? ((Element) elements106.item(0)) : null; + if (diskLabelElement2 != null) { - String diskLabelInstance; - diskLabelInstance = diskLabelElement.getTextContent(); - dataVirtualHardDiskInstance.setDiskLabel(diskLabelInstance); + String diskLabelInstance2; + diskLabelInstance2 = diskLabelElement2.getTextContent(); + oSVirtualHardDiskInstance.setDiskLabel(diskLabelInstance2); } - NodeList elements98 = dataVirtualHardDisksElement.getElementsByTagName("DiskName"); - Element diskNameElement = elements98.getLength() > 0 ? ((Element) elements98.item(0)) : null; - if (diskNameElement != null) + NodeList elements107 = oSVirtualHardDiskElement.getElementsByTagName("DiskName"); + Element diskNameElement2 = elements107.getLength() > 0 ? ((Element) elements107.item(0)) : null; + if (diskNameElement2 != null) { - String diskNameInstance; - diskNameInstance = diskNameElement.getTextContent(); - dataVirtualHardDiskInstance.setDiskName(diskNameInstance); + String diskNameInstance2; + diskNameInstance2 = diskNameElement2.getTextContent(); + oSVirtualHardDiskInstance.setDiskName(diskNameInstance2); } - NodeList elements99 = dataVirtualHardDisksElement.getElementsByTagName("Lun"); - Element lunElement = elements99.getLength() > 0 ? ((Element) elements99.item(0)) : null; - if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + NodeList elements108 = oSVirtualHardDiskElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement2 = elements108.getLength() > 0 ? ((Element) elements108.item(0)) : null; + if (mediaLinkElement2 != null) { - int lunInstance; - lunInstance = Integer.parseInt(lunElement.getTextContent()); - dataVirtualHardDiskInstance.setLogicalUnitNumber(lunInstance); + URI mediaLinkInstance2; + mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent()); + oSVirtualHardDiskInstance.setMediaLink(mediaLinkInstance2); } - NodeList elements100 = dataVirtualHardDisksElement.getElementsByTagName("LogicalDiskSizeInGB"); - Element logicalDiskSizeInGBElement = elements100.getLength() > 0 ? ((Element) elements100.item(0)) : null; - if (logicalDiskSizeInGBElement != null) + NodeList elements109 = oSVirtualHardDiskElement.getElementsByTagName("SourceImageName"); + Element sourceImageNameElement = elements109.getLength() > 0 ? ((Element) elements109.item(0)) : null; + if (sourceImageNameElement != null) { - int logicalDiskSizeInGBInstance; - logicalDiskSizeInGBInstance = Integer.parseInt(logicalDiskSizeInGBElement.getTextContent()); - dataVirtualHardDiskInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + String sourceImageNameInstance; + sourceImageNameInstance = sourceImageNameElement.getTextContent(); + oSVirtualHardDiskInstance.setSourceImageName(sourceImageNameInstance); } - NodeList elements101 = dataVirtualHardDisksElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement = elements101.getLength() > 0 ? ((Element) elements101.item(0)) : null; - if (mediaLinkElement != null) + NodeList elements110 = oSVirtualHardDiskElement.getElementsByTagName("OS"); + Element osElement = elements110.getLength() > 0 ? ((Element) elements110.item(0)) : null; + if (osElement != null) { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - dataVirtualHardDiskInstance.setMediaLink(mediaLinkInstance); + String osInstance; + osInstance = osElement.getTextContent(); + oSVirtualHardDiskInstance.setOperatingSystem(osInstance); } } - } - - NodeList elements102 = roleListElement.getElementsByTagName("Label"); - Element labelElement2 = elements102.getLength() > 0 ? ((Element) elements102.item(0)) : null; - if (labelElement2 != null) - { - String labelInstance2; - labelInstance2 = labelElement2.getTextContent(); - roleInstance.setLabel(labelInstance2); - } - - NodeList elements103 = roleListElement.getElementsByTagName("OSVirtualHardDisk"); - Element oSVirtualHardDiskElement = elements103.getLength() > 0 ? ((Element) elements103.item(0)) : null; - if (oSVirtualHardDiskElement != null) - { - OSVirtualHardDisk oSVirtualHardDiskInstance = new OSVirtualHardDisk(); - roleInstance.setOSVirtualHardDisk(oSVirtualHardDiskInstance); - - NodeList elements104 = oSVirtualHardDiskElement.getElementsByTagName("HostCaching"); - Element hostCachingElement2 = elements104.getLength() > 0 ? ((Element) elements104.item(0)) : null; - if (hostCachingElement2 != null && (hostCachingElement2.getTextContent() != null && hostCachingElement2.getTextContent().isEmpty() != true) == false) - { - VirtualHardDiskHostCaching hostCachingInstance2; - hostCachingInstance2 = VirtualHardDiskHostCaching.valueOf(hostCachingElement2.getTextContent()); - oSVirtualHardDiskInstance.setHostCaching(hostCachingInstance2); - } - - NodeList elements105 = oSVirtualHardDiskElement.getElementsByTagName("DiskLabel"); - Element diskLabelElement2 = elements105.getLength() > 0 ? ((Element) elements105.item(0)) : null; - if (diskLabelElement2 != null) - { - String diskLabelInstance2; - diskLabelInstance2 = diskLabelElement2.getTextContent(); - oSVirtualHardDiskInstance.setDiskLabel(diskLabelInstance2); - } - - NodeList elements106 = oSVirtualHardDiskElement.getElementsByTagName("DiskName"); - Element diskNameElement2 = elements106.getLength() > 0 ? ((Element) elements106.item(0)) : null; - if (diskNameElement2 != null) - { - String diskNameInstance2; - diskNameInstance2 = diskNameElement2.getTextContent(); - oSVirtualHardDiskInstance.setDiskName(diskNameInstance2); - } - NodeList elements107 = oSVirtualHardDiskElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement2 = elements107.getLength() > 0 ? ((Element) elements107.item(0)) : null; - if (mediaLinkElement2 != null) + NodeList elements111 = roleListElement.getElementsByTagName("RoleSize"); + Element roleSizeElement = elements111.getLength() > 0 ? ((Element) elements111.item(0)) : null; + if (roleSizeElement != null) { - URI mediaLinkInstance2; - mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent()); - oSVirtualHardDiskInstance.setMediaLink(mediaLinkInstance2); + String roleSizeInstance; + roleSizeInstance = roleSizeElement.getTextContent(); + roleInstance.setRoleSize(roleSizeInstance); } - NodeList elements108 = oSVirtualHardDiskElement.getElementsByTagName("SourceImageName"); - Element sourceImageNameElement = elements108.getLength() > 0 ? ((Element) elements108.item(0)) : null; - if (sourceImageNameElement != null) + NodeList elements112 = roleListElement.getElementsByTagName("DefaultWinRmCertificateThumbprint"); + Element defaultWinRmCertificateThumbprintElement = elements112.getLength() > 0 ? ((Element) elements112.item(0)) : null; + if (defaultWinRmCertificateThumbprintElement != null) { - String sourceImageNameInstance; - sourceImageNameInstance = sourceImageNameElement.getTextContent(); - oSVirtualHardDiskInstance.setSourceImageName(sourceImageNameInstance); + String defaultWinRmCertificateThumbprintInstance; + defaultWinRmCertificateThumbprintInstance = defaultWinRmCertificateThumbprintElement.getTextContent(); + roleInstance.setDefaultWinRmCertificateThumbprint(defaultWinRmCertificateThumbprintInstance); } - - NodeList elements109 = oSVirtualHardDiskElement.getElementsByTagName("OS"); - Element osElement = elements109.getLength() > 0 ? ((Element) elements109.item(0)) : null; - if (osElement != null) - { - String osInstance; - osInstance = osElement.getTextContent(); - oSVirtualHardDiskInstance.setOperatingSystem(osInstance); - } - } - - NodeList elements110 = roleListElement.getElementsByTagName("RoleSize"); - Element roleSizeElement = elements110.getLength() > 0 ? ((Element) elements110.item(0)) : null; - if (roleSizeElement != null && (roleSizeElement.getTextContent() != null && roleSizeElement.getTextContent().isEmpty() != true) == false) - { - VirtualMachineRoleSize roleSizeInstance; - roleSizeInstance = VirtualMachineRoleSize.valueOf(roleSizeElement.getTextContent()); - roleInstance.setRoleSize(roleSizeInstance); - } - - NodeList elements111 = roleListElement.getElementsByTagName("DefaultWinRmCertificateThumbprint"); - Element defaultWinRmCertificateThumbprintElement = elements111.getLength() > 0 ? ((Element) elements111.item(0)) : null; - if (defaultWinRmCertificateThumbprintElement != null) - { - String defaultWinRmCertificateThumbprintInstance; - defaultWinRmCertificateThumbprintInstance = defaultWinRmCertificateThumbprintElement.getTextContent(); - roleInstance.setDefaultWinRmCertificateThumbprint(defaultWinRmCertificateThumbprintInstance); } } - } - - NodeList elements112 = deploymentElement.getElementsByTagName("SdkVersion"); - Element sdkVersionElement = elements112.getLength() > 0 ? ((Element) elements112.item(0)) : null; - if (sdkVersionElement != null) - { - String sdkVersionInstance; - sdkVersionInstance = sdkVersionElement.getTextContent(); - result.setSdkVersion(sdkVersionInstance); - } - - NodeList elements113 = deploymentElement.getElementsByTagName("Locked"); - Element lockedElement = elements113.getLength() > 0 ? ((Element) elements113.item(0)) : null; - if (lockedElement != null) - { - boolean lockedInstance; - lockedInstance = Boolean.parseBoolean(lockedElement.getTextContent()); - result.setLocked(lockedInstance); - } - - NodeList elements114 = deploymentElement.getElementsByTagName("RollbackAllowed"); - Element rollbackAllowedElement = elements114.getLength() > 0 ? ((Element) elements114.item(0)) : null; - if (rollbackAllowedElement != null) - { - String rollbackAllowedInstance; - rollbackAllowedInstance = rollbackAllowedElement.getTextContent(); - result.setRollbackAllowed(rollbackAllowedInstance); - } - - NodeList elements115 = deploymentElement.getElementsByTagName("CreatedTime"); - Element createdTimeElement = elements115.getLength() > 0 ? ((Element) elements115.item(0)) : null; - if (createdTimeElement != null) - { - Calendar createdTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(createdTimeElement.getTextContent())); - createdTimeInstance = calendar; - result.setCreatedTime(createdTimeInstance); - } - - NodeList elements116 = deploymentElement.getElementsByTagName("LastModifiedTime"); - Element lastModifiedTimeElement = elements116.getLength() > 0 ? ((Element) elements116.item(0)) : null; - if (lastModifiedTimeElement != null) - { - Calendar lastModifiedTimeInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(lastModifiedTimeElement.getTextContent())); - lastModifiedTimeInstance = calendar2; - result.setLastModifiedTime(lastModifiedTimeInstance); - } - - NodeList elements117 = deploymentElement.getElementsByTagName("VirtualNetworkName"); - Element virtualNetworkNameElement = elements117.getLength() > 0 ? ((Element) elements117.item(0)) : null; - if (virtualNetworkNameElement != null) - { - String virtualNetworkNameInstance; - virtualNetworkNameInstance = virtualNetworkNameElement.getTextContent(); - result.setVirtualNetworkName(virtualNetworkNameInstance); - } - - NodeList elements118 = deploymentElement.getElementsByTagName("ExtendedProperties"); - Element extendedPropertiesSequenceElement = elements118.getLength() > 0 ? ((Element) elements118.item(0)) : null; - if (extendedPropertiesSequenceElement != null) - { - for (int i13 = 0; i13 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i13 = i13 + 1) + + NodeList elements113 = deploymentElement.getElementsByTagName("SdkVersion"); + Element sdkVersionElement = elements113.getLength() > 0 ? ((Element) elements113.item(0)) : null; + if (sdkVersionElement != null) { - org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i13)); - NodeList elements119 = extendedPropertiesElement.getElementsByTagName("Name"); - String extendedPropertiesKey = elements119.getLength() > 0 ? ((org.w3c.dom.Element) elements119.item(0)).getTextContent() : null; - NodeList elements120 = extendedPropertiesElement.getElementsByTagName("Value"); - String extendedPropertiesValue = elements120.getLength() > 0 ? ((org.w3c.dom.Element) elements120.item(0)).getTextContent() : null; - result.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + String sdkVersionInstance; + sdkVersionInstance = sdkVersionElement.getTextContent(); + result.setSdkVersion(sdkVersionInstance); } - } - - NodeList elements121 = deploymentElement.getElementsByTagName("PersistentVMDowntime"); - Element persistentVMDowntimeElement = elements121.getLength() > 0 ? ((Element) elements121.item(0)) : null; - if (persistentVMDowntimeElement != null) - { - PersistentVMDowntime persistentVMDowntimeInstance = new PersistentVMDowntime(); - result.setPersistentVMDowntime(persistentVMDowntimeInstance); - NodeList elements122 = persistentVMDowntimeElement.getElementsByTagName("StartTime"); - Element startTimeElement = elements122.getLength() > 0 ? ((Element) elements122.item(0)) : null; - if (startTimeElement != null) + NodeList elements114 = deploymentElement.getElementsByTagName("Locked"); + Element lockedElement = elements114.getLength() > 0 ? ((Element) elements114.item(0)) : null; + if (lockedElement != null) { - Calendar startTimeInstance; - SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar3 = Calendar.getInstance(); - calendar3.setTime(simpleDateFormat3.parse(startTimeElement.getTextContent())); - startTimeInstance = calendar3; - persistentVMDowntimeInstance.setStartTime(startTimeInstance); + boolean lockedInstance; + lockedInstance = Boolean.parseBoolean(lockedElement.getTextContent()); + result.setLocked(lockedInstance); } - NodeList elements123 = persistentVMDowntimeElement.getElementsByTagName("EndTime"); - Element endTimeElement = elements123.getLength() > 0 ? ((Element) elements123.item(0)) : null; - if (endTimeElement != null) + NodeList elements115 = deploymentElement.getElementsByTagName("RollbackAllowed"); + Element rollbackAllowedElement = elements115.getLength() > 0 ? ((Element) elements115.item(0)) : null; + if (rollbackAllowedElement != null) { - Calendar endTimeInstance; - SimpleDateFormat simpleDateFormat4 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar4 = Calendar.getInstance(); - calendar4.setTime(simpleDateFormat4.parse(endTimeElement.getTextContent())); - endTimeInstance = calendar4; - persistentVMDowntimeInstance.setEndTime(endTimeInstance); + String rollbackAllowedInstance; + rollbackAllowedInstance = rollbackAllowedElement.getTextContent(); + result.setRollbackAllowed(rollbackAllowedInstance); } - NodeList elements124 = persistentVMDowntimeElement.getElementsByTagName("Status"); - Element statusElement2 = elements124.getLength() > 0 ? ((Element) elements124.item(0)) : null; - if (statusElement2 != null) + NodeList elements116 = deploymentElement.getElementsByTagName("CreatedTime"); + Element createdTimeElement = elements116.getLength() > 0 ? ((Element) elements116.item(0)) : null; + if (createdTimeElement != null) { - String statusInstance2; - statusInstance2 = statusElement2.getTextContent(); - persistentVMDowntimeInstance.setStatus(statusInstance2); + Calendar createdTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(createdTimeElement.getTextContent())); + createdTimeInstance = calendar; + result.setCreatedTime(createdTimeInstance); } - } - - NodeList elements125 = deploymentElement.getElementsByTagName("VirtualIPs"); - Element virtualIPsSequenceElement = elements125.getLength() > 0 ? ((Element) elements125.item(0)) : null; - if (virtualIPsSequenceElement != null) - { - for (int i14 = 0; i14 < virtualIPsSequenceElement.getElementsByTagName("VirtualIP").getLength(); i14 = i14 + 1) + + NodeList elements117 = deploymentElement.getElementsByTagName("LastModifiedTime"); + Element lastModifiedTimeElement = elements117.getLength() > 0 ? ((Element) elements117.item(0)) : null; + if (lastModifiedTimeElement != null) + { + Calendar lastModifiedTimeInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(lastModifiedTimeElement.getTextContent())); + lastModifiedTimeInstance = calendar2; + result.setLastModifiedTime(lastModifiedTimeInstance); + } + + NodeList elements118 = deploymentElement.getElementsByTagName("VirtualNetworkName"); + Element virtualNetworkNameElement = elements118.getLength() > 0 ? ((Element) elements118.item(0)) : null; + if (virtualNetworkNameElement != null) + { + String virtualNetworkNameInstance; + virtualNetworkNameInstance = virtualNetworkNameElement.getTextContent(); + result.setVirtualNetworkName(virtualNetworkNameInstance); + } + + NodeList elements119 = deploymentElement.getElementsByTagName("ExtendedProperties"); + Element extendedPropertiesSequenceElement = elements119.getLength() > 0 ? ((Element) elements119.item(0)) : null; + if (extendedPropertiesSequenceElement != null) + { + for (int i13 = 0; i13 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i13 = i13 + 1) + { + org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i13)); + NodeList elements120 = extendedPropertiesElement.getElementsByTagName("Name"); + String extendedPropertiesKey = elements120.getLength() > 0 ? ((org.w3c.dom.Element) elements120.item(0)).getTextContent() : null; + NodeList elements121 = extendedPropertiesElement.getElementsByTagName("Value"); + String extendedPropertiesValue = elements121.getLength() > 0 ? ((org.w3c.dom.Element) elements121.item(0)).getTextContent() : null; + result.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + } + } + + NodeList elements122 = deploymentElement.getElementsByTagName("PersistentVMDowntime"); + Element persistentVMDowntimeElement = elements122.getLength() > 0 ? ((Element) elements122.item(0)) : null; + if (persistentVMDowntimeElement != null) { - org.w3c.dom.Element virtualIPsElement = ((org.w3c.dom.Element) virtualIPsSequenceElement.getElementsByTagName("VirtualIP").item(i14)); - VirtualIPAddress virtualIPInstance = new VirtualIPAddress(); - result.getVirtualIPAddresses().add(virtualIPInstance); + PersistentVMDowntime persistentVMDowntimeInstance = new PersistentVMDowntime(); + result.setPersistentVMDowntime(persistentVMDowntimeInstance); - NodeList elements126 = virtualIPsElement.getElementsByTagName("Address"); - Element addressElement = elements126.getLength() > 0 ? ((Element) elements126.item(0)) : null; - if (addressElement != null) + NodeList elements123 = persistentVMDowntimeElement.getElementsByTagName("StartTime"); + Element startTimeElement = elements123.getLength() > 0 ? ((Element) elements123.item(0)) : null; + if (startTimeElement != null) { - InetAddress addressInstance; - addressInstance = InetAddress.getByName(addressElement.getTextContent()); - virtualIPInstance.setAddress(addressInstance); + Calendar startTimeInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(startTimeElement.getTextContent())); + startTimeInstance = calendar3; + persistentVMDowntimeInstance.setStartTime(startTimeInstance); } - NodeList elements127 = virtualIPsElement.getElementsByTagName("Name"); - Element nameElement4 = elements127.getLength() > 0 ? ((Element) elements127.item(0)) : null; - if (nameElement4 != null) + NodeList elements124 = persistentVMDowntimeElement.getElementsByTagName("EndTime"); + Element endTimeElement = elements124.getLength() > 0 ? ((Element) elements124.item(0)) : null; + if (endTimeElement != null) { - String nameInstance4; - nameInstance4 = nameElement4.getTextContent(); - virtualIPInstance.setName(nameInstance4); + Calendar endTimeInstance; + SimpleDateFormat simpleDateFormat4 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar4 = Calendar.getInstance(); + calendar4.setTime(simpleDateFormat4.parse(endTimeElement.getTextContent())); + endTimeInstance = calendar4; + persistentVMDowntimeInstance.setEndTime(endTimeInstance); } - NodeList elements128 = virtualIPsElement.getElementsByTagName("IsDnsProgrammed"); - Element isDnsProgrammedElement = elements128.getLength() > 0 ? ((Element) elements128.item(0)) : null; - if (isDnsProgrammedElement != null && (isDnsProgrammedElement.getTextContent() != null && isDnsProgrammedElement.getTextContent().isEmpty() != true) == false) + NodeList elements125 = persistentVMDowntimeElement.getElementsByTagName("Status"); + Element statusElement2 = elements125.getLength() > 0 ? ((Element) elements125.item(0)) : null; + if (statusElement2 != null) { - boolean isDnsProgrammedInstance; - isDnsProgrammedInstance = Boolean.parseBoolean(isDnsProgrammedElement.getTextContent()); - virtualIPInstance.setIsDnsProgrammed(isDnsProgrammedInstance); + String statusInstance2; + statusInstance2 = statusElement2.getTextContent(); + persistentVMDowntimeInstance.setStatus(statusInstance2); } } - } - - NodeList elements129 = deploymentElement.getElementsByTagName("ReservedIPName"); - Element reservedIPNameElement = elements129.getLength() > 0 ? ((Element) elements129.item(0)) : null; - if (reservedIPNameElement != null) - { - String reservedIPNameInstance; - reservedIPNameInstance = reservedIPNameElement.getTextContent(); - result.setReservedIPName(reservedIPNameInstance); - } - - NodeList elements130 = deploymentElement.getElementsByTagName("Dns"); - Element dnsElement = elements130.getLength() > 0 ? ((Element) elements130.item(0)) : null; - if (dnsElement != null) - { - DnsSettings dnsInstance = new DnsSettings(); - result.setDnsSettings(dnsInstance); - NodeList elements131 = dnsElement.getElementsByTagName("DnsServers"); - Element dnsServersSequenceElement = elements131.getLength() > 0 ? ((Element) elements131.item(0)) : null; - if (dnsServersSequenceElement != null) + NodeList elements126 = deploymentElement.getElementsByTagName("VirtualIPs"); + Element virtualIPsSequenceElement = elements126.getLength() > 0 ? ((Element) elements126.item(0)) : null; + if (virtualIPsSequenceElement != null) { - for (int i15 = 0; i15 < dnsServersSequenceElement.getElementsByTagName("DnsServer").getLength(); i15 = i15 + 1) + for (int i14 = 0; i14 < virtualIPsSequenceElement.getElementsByTagName("VirtualIP").getLength(); i14 = i14 + 1) { - org.w3c.dom.Element dnsServersElement = ((org.w3c.dom.Element) dnsServersSequenceElement.getElementsByTagName("DnsServer").item(i15)); - DnsServer dnsServerInstance = new DnsServer(); - dnsInstance.getDnsServers().add(dnsServerInstance); + org.w3c.dom.Element virtualIPsElement = ((org.w3c.dom.Element) virtualIPsSequenceElement.getElementsByTagName("VirtualIP").item(i14)); + VirtualIPAddress virtualIPInstance = new VirtualIPAddress(); + result.getVirtualIPAddresses().add(virtualIPInstance); + + NodeList elements127 = virtualIPsElement.getElementsByTagName("Address"); + Element addressElement = elements127.getLength() > 0 ? ((Element) elements127.item(0)) : null; + if (addressElement != null) + { + InetAddress addressInstance; + addressInstance = InetAddress.getByName(addressElement.getTextContent()); + virtualIPInstance.setAddress(addressInstance); + } - NodeList elements132 = dnsServersElement.getElementsByTagName("Name"); - Element nameElement5 = elements132.getLength() > 0 ? ((Element) elements132.item(0)) : null; - if (nameElement5 != null) + NodeList elements128 = virtualIPsElement.getElementsByTagName("Name"); + Element nameElement4 = elements128.getLength() > 0 ? ((Element) elements128.item(0)) : null; + if (nameElement4 != null) { - String nameInstance5; - nameInstance5 = nameElement5.getTextContent(); - dnsServerInstance.setName(nameInstance5); + String nameInstance4; + nameInstance4 = nameElement4.getTextContent(); + virtualIPInstance.setName(nameInstance4); } - NodeList elements133 = dnsServersElement.getElementsByTagName("Address"); - Element addressElement2 = elements133.getLength() > 0 ? ((Element) elements133.item(0)) : null; - if (addressElement2 != null) + NodeList elements129 = virtualIPsElement.getElementsByTagName("IsDnsProgrammed"); + Element isDnsProgrammedElement = elements129.getLength() > 0 ? ((Element) elements129.item(0)) : null; + if (isDnsProgrammedElement != null && (isDnsProgrammedElement.getTextContent() != null && isDnsProgrammedElement.getTextContent().isEmpty() != true) == false) { - InetAddress addressInstance2; - addressInstance2 = InetAddress.getByName(addressElement2.getTextContent()); - dnsServerInstance.setAddress(addressInstance2); + boolean isDnsProgrammedInstance; + isDnsProgrammedInstance = Boolean.parseBoolean(isDnsProgrammedElement.getTextContent()); + virtualIPInstance.setIsDnsProgrammed(isDnsProgrammedInstance); } } } - } - - NodeList elements134 = deploymentElement.getElementsByTagName("ExtensionConfiguration"); - Element extensionConfigurationElement = elements134.getLength() > 0 ? ((Element) elements134.item(0)) : null; - if (extensionConfigurationElement != null) - { - ExtensionConfiguration extensionConfigurationInstance = new ExtensionConfiguration(); - result.setExtensionConfiguration(extensionConfigurationInstance); - NodeList elements135 = extensionConfigurationElement.getElementsByTagName("AllRoles"); - Element allRolesSequenceElement = elements135.getLength() > 0 ? ((Element) elements135.item(0)) : null; - if (allRolesSequenceElement != null) + NodeList elements130 = deploymentElement.getElementsByTagName("ReservedIPName"); + Element reservedIPNameElement = elements130.getLength() > 0 ? ((Element) elements130.item(0)) : null; + if (reservedIPNameElement != null) + { + String reservedIPNameInstance; + reservedIPNameInstance = reservedIPNameElement.getTextContent(); + result.setReservedIPName(reservedIPNameInstance); + } + + NodeList elements131 = deploymentElement.getElementsByTagName("Dns"); + Element dnsElement = elements131.getLength() > 0 ? ((Element) elements131.item(0)) : null; + if (dnsElement != null) { - for (int i16 = 0; i16 < allRolesSequenceElement.getElementsByTagName("Extension").getLength(); i16 = i16 + 1) + DnsSettings dnsInstance = new DnsSettings(); + result.setDnsSettings(dnsInstance); + + NodeList elements132 = dnsElement.getElementsByTagName("DnsServers"); + Element dnsServersSequenceElement = elements132.getLength() > 0 ? ((Element) elements132.item(0)) : null; + if (dnsServersSequenceElement != null) { - org.w3c.dom.Element allRolesElement = ((org.w3c.dom.Element) allRolesSequenceElement.getElementsByTagName("Extension").item(i16)); - ExtensionConfiguration.Extension extensionInstance = new ExtensionConfiguration.Extension(); - extensionConfigurationInstance.getAllRoles().add(extensionInstance); - - NodeList elements136 = allRolesElement.getElementsByTagName("Id"); - Element idElement = elements136.getLength() > 0 ? ((Element) elements136.item(0)) : null; - if (idElement != null) + for (int i15 = 0; i15 < dnsServersSequenceElement.getElementsByTagName("DnsServer").getLength(); i15 = i15 + 1) { - String idInstance; - idInstance = idElement.getTextContent(); - extensionInstance.setId(idInstance); + org.w3c.dom.Element dnsServersElement = ((org.w3c.dom.Element) dnsServersSequenceElement.getElementsByTagName("DnsServer").item(i15)); + DnsServer dnsServerInstance = new DnsServer(); + dnsInstance.getDnsServers().add(dnsServerInstance); + + NodeList elements133 = dnsServersElement.getElementsByTagName("Name"); + Element nameElement5 = elements133.getLength() > 0 ? ((Element) elements133.item(0)) : null; + if (nameElement5 != null) + { + String nameInstance5; + nameInstance5 = nameElement5.getTextContent(); + dnsServerInstance.setName(nameInstance5); + } + + NodeList elements134 = dnsServersElement.getElementsByTagName("Address"); + Element addressElement2 = elements134.getLength() > 0 ? ((Element) elements134.item(0)) : null; + if (addressElement2 != null) + { + InetAddress addressInstance2; + addressInstance2 = InetAddress.getByName(addressElement2.getTextContent()); + dnsServerInstance.setAddress(addressInstance2); + } } } } - NodeList elements137 = extensionConfigurationElement.getElementsByTagName("NamedRoles"); - Element namedRolesSequenceElement = elements137.getLength() > 0 ? ((Element) elements137.item(0)) : null; - if (namedRolesSequenceElement != null) + NodeList elements135 = deploymentElement.getElementsByTagName("ExtensionConfiguration"); + Element extensionConfigurationElement = elements135.getLength() > 0 ? ((Element) elements135.item(0)) : null; + if (extensionConfigurationElement != null) { - for (int i17 = 0; i17 < namedRolesSequenceElement.getElementsByTagName("Role").getLength(); i17 = i17 + 1) + ExtensionConfiguration extensionConfigurationInstance = new ExtensionConfiguration(); + result.setExtensionConfiguration(extensionConfigurationInstance); + + NodeList elements136 = extensionConfigurationElement.getElementsByTagName("AllRoles"); + Element allRolesSequenceElement = elements136.getLength() > 0 ? ((Element) elements136.item(0)) : null; + if (allRolesSequenceElement != null) { - org.w3c.dom.Element namedRolesElement = ((org.w3c.dom.Element) namedRolesSequenceElement.getElementsByTagName("Role").item(i17)); - ExtensionConfiguration.NamedRole roleInstance2 = new ExtensionConfiguration.NamedRole(); - extensionConfigurationInstance.getNamedRoles().add(roleInstance2); - - NodeList elements138 = namedRolesElement.getElementsByTagName("RoleName"); - Element roleNameElement3 = elements138.getLength() > 0 ? ((Element) elements138.item(0)) : null; - if (roleNameElement3 != null) + for (int i16 = 0; i16 < allRolesSequenceElement.getElementsByTagName("Extension").getLength(); i16 = i16 + 1) { - String roleNameInstance3; - roleNameInstance3 = roleNameElement3.getTextContent(); - roleInstance2.setRoleName(roleNameInstance3); + org.w3c.dom.Element allRolesElement = ((org.w3c.dom.Element) allRolesSequenceElement.getElementsByTagName("Extension").item(i16)); + ExtensionConfiguration.Extension extensionInstance = new ExtensionConfiguration.Extension(); + extensionConfigurationInstance.getAllRoles().add(extensionInstance); + + NodeList elements137 = allRolesElement.getElementsByTagName("Id"); + Element idElement = elements137.getLength() > 0 ? ((Element) elements137.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + extensionInstance.setId(idInstance); + } } - - NodeList elements139 = namedRolesElement.getElementsByTagName("Extensions"); - Element extensionsSequenceElement = elements139.getLength() > 0 ? ((Element) elements139.item(0)) : null; - if (extensionsSequenceElement != null) + } + + NodeList elements138 = extensionConfigurationElement.getElementsByTagName("NamedRoles"); + Element namedRolesSequenceElement = elements138.getLength() > 0 ? ((Element) elements138.item(0)) : null; + if (namedRolesSequenceElement != null) + { + for (int i17 = 0; i17 < namedRolesSequenceElement.getElementsByTagName("Role").getLength(); i17 = i17 + 1) { - for (int i18 = 0; i18 < extensionsSequenceElement.getElementsByTagName("Extension").getLength(); i18 = i18 + 1) + org.w3c.dom.Element namedRolesElement = ((org.w3c.dom.Element) namedRolesSequenceElement.getElementsByTagName("Role").item(i17)); + ExtensionConfiguration.NamedRole roleInstance2 = new ExtensionConfiguration.NamedRole(); + extensionConfigurationInstance.getNamedRoles().add(roleInstance2); + + NodeList elements139 = namedRolesElement.getElementsByTagName("RoleName"); + Element roleNameElement3 = elements139.getLength() > 0 ? ((Element) elements139.item(0)) : null; + if (roleNameElement3 != null) { - org.w3c.dom.Element extensionsElement = ((org.w3c.dom.Element) extensionsSequenceElement.getElementsByTagName("Extension").item(i18)); - ExtensionConfiguration.Extension extensionInstance2 = new ExtensionConfiguration.Extension(); - roleInstance2.getExtensions().add(extensionInstance2); - - NodeList elements140 = extensionsElement.getElementsByTagName("Id"); - Element idElement2 = elements140.getLength() > 0 ? ((Element) elements140.item(0)) : null; - if (idElement2 != null) + String roleNameInstance3; + roleNameInstance3 = roleNameElement3.getTextContent(); + roleInstance2.setRoleName(roleNameInstance3); + } + + NodeList elements140 = namedRolesElement.getElementsByTagName("Extensions"); + Element extensionsSequenceElement = elements140.getLength() > 0 ? ((Element) elements140.item(0)) : null; + if (extensionsSequenceElement != null) + { + for (int i18 = 0; i18 < extensionsSequenceElement.getElementsByTagName("Extension").getLength(); i18 = i18 + 1) { - String idInstance2; - idInstance2 = idElement2.getTextContent(); - extensionInstance2.setId(idInstance2); + org.w3c.dom.Element extensionsElement = ((org.w3c.dom.Element) extensionsSequenceElement.getElementsByTagName("Extension").item(i18)); + ExtensionConfiguration.Extension extensionInstance2 = new ExtensionConfiguration.Extension(); + roleInstance2.getExtensions().add(extensionInstance2); + + NodeList elements141 = extensionsElement.getElementsByTagName("Id"); + Element idElement2 = elements141.getLength() > 0 ? ((Element) elements141.item(0)) : null; + if (idElement2 != null) + { + String idInstance2; + idInstance2 = idElement2.getTextContent(); + extensionInstance2.setId(idInstance2); + } } } } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -5264,6 +5643,18 @@ public DeploymentGetResponse call() throws Exception * * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A deployment that exists in the cloud service. */ @Override @@ -5298,1337 +5689,1356 @@ public DeploymentGetResponse getBySlot(String serviceName, DeploymentSlot deploy // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - DeploymentGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DeploymentGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Deployment"); - Element deploymentElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (deploymentElement != null) - { - NodeList elements2 = deploymentElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = deploymentElement.getElementsByTagName("DeploymentSlot"); - Element deploymentSlotElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (deploymentSlotElement != null) - { - DeploymentSlot deploymentSlotInstance; - deploymentSlotInstance = DeploymentSlot.valueOf(deploymentSlotElement.getTextContent()); - result.setDeploymentSlot(deploymentSlotInstance); - } - - NodeList elements4 = deploymentElement.getElementsByTagName("PrivateID"); - Element privateIDElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (privateIDElement != null) - { - String privateIDInstance; - privateIDInstance = privateIDElement.getTextContent(); - result.setPrivateId(privateIDInstance); - } - - NodeList elements5 = deploymentElement.getElementsByTagName("Status"); - Element statusElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (statusElement != null) - { - DeploymentStatus statusInstance; - statusInstance = DeploymentStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements6 = deploymentElement.getElementsByTagName("Label"); - Element labelElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (labelElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - result.setLabel(labelInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements7 = deploymentElement.getElementsByTagName("Url"); - Element urlElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (urlElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - URI urlInstance; - urlInstance = new URI(urlElement.getTextContent()); - result.setUri(urlInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements8 = deploymentElement.getElementsByTagName("Configuration"); - Element configurationElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (configurationElement != null) - { - String configurationInstance; - configurationInstance = configurationElement.getTextContent() != null ? new String(Base64.decodeBase64(configurationElement.getTextContent().getBytes())) : null; - result.setConfiguration(configurationInstance); - } + // Create Result + DeploymentGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DeploymentGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements9 = deploymentElement.getElementsByTagName("RoleInstanceList"); - Element roleInstanceListSequenceElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (roleInstanceListSequenceElement != null) + NodeList elements = responseDoc.getElementsByTagName("Deployment"); + Element deploymentElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (deploymentElement != null) { - for (int i1 = 0; i1 < roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").getLength(); i1 = i1 + 1) + NodeList elements2 = deploymentElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) { - org.w3c.dom.Element roleInstanceListElement = ((org.w3c.dom.Element) roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").item(i1)); - RoleInstance roleInstanceInstance = new RoleInstance(); - result.getRoleInstances().add(roleInstanceInstance); - - NodeList elements10 = roleInstanceListElement.getElementsByTagName("RoleName"); - Element roleNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (roleNameElement != null) - { - String roleNameInstance; - roleNameInstance = roleNameElement.getTextContent(); - roleInstanceInstance.setRoleName(roleNameInstance); - } - - NodeList elements11 = roleInstanceListElement.getElementsByTagName("InstanceName"); - Element instanceNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (instanceNameElement != null) - { - String instanceNameInstance; - instanceNameInstance = instanceNameElement.getTextContent(); - roleInstanceInstance.setInstanceName(instanceNameInstance); - } - - NodeList elements12 = roleInstanceListElement.getElementsByTagName("InstanceStatus"); - Element instanceStatusElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (instanceStatusElement != null) - { - String instanceStatusInstance; - instanceStatusInstance = instanceStatusElement.getTextContent(); - roleInstanceInstance.setInstanceStatus(instanceStatusInstance); - } - - NodeList elements13 = roleInstanceListElement.getElementsByTagName("InstanceUpgradeDomain"); - Element instanceUpgradeDomainElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (instanceUpgradeDomainElement != null && (instanceUpgradeDomainElement.getTextContent() != null && instanceUpgradeDomainElement.getTextContent().isEmpty() != true) == false) - { - int instanceUpgradeDomainInstance; - instanceUpgradeDomainInstance = Integer.parseInt(instanceUpgradeDomainElement.getTextContent()); - roleInstanceInstance.setInstanceUpgradeDomain(instanceUpgradeDomainInstance); - } - - NodeList elements14 = roleInstanceListElement.getElementsByTagName("InstanceFaultDomain"); - Element instanceFaultDomainElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (instanceFaultDomainElement != null && (instanceFaultDomainElement.getTextContent() != null && instanceFaultDomainElement.getTextContent().isEmpty() != true) == false) - { - int instanceFaultDomainInstance; - instanceFaultDomainInstance = Integer.parseInt(instanceFaultDomainElement.getTextContent()); - roleInstanceInstance.setInstanceFaultDomain(instanceFaultDomainInstance); - } - - NodeList elements15 = roleInstanceListElement.getElementsByTagName("InstanceSize"); - Element instanceSizeElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (instanceSizeElement != null && (instanceSizeElement.getTextContent() != null && instanceSizeElement.getTextContent().isEmpty() != true) == false) - { - VirtualMachineRoleSize instanceSizeInstance; - instanceSizeInstance = VirtualMachineRoleSize.valueOf(instanceSizeElement.getTextContent()); - roleInstanceInstance.setInstanceSize(instanceSizeInstance); - } - - NodeList elements16 = roleInstanceListElement.getElementsByTagName("InstanceStateDetails"); - Element instanceStateDetailsElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (instanceStateDetailsElement != null) - { - String instanceStateDetailsInstance; - instanceStateDetailsInstance = instanceStateDetailsElement.getTextContent(); - roleInstanceInstance.setInstanceStateDetails(instanceStateDetailsInstance); - } - - NodeList elements17 = roleInstanceListElement.getElementsByTagName("InstanceErrorCode"); - Element instanceErrorCodeElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (instanceErrorCodeElement != null) - { - String instanceErrorCodeInstance; - instanceErrorCodeInstance = instanceErrorCodeElement.getTextContent(); - roleInstanceInstance.setInstanceErrorCode(instanceErrorCodeInstance); - } - - NodeList elements18 = roleInstanceListElement.getElementsByTagName("IpAddress"); - Element ipAddressElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (ipAddressElement != null) - { - InetAddress ipAddressInstance; - ipAddressInstance = InetAddress.getByName(ipAddressElement.getTextContent()); - roleInstanceInstance.setIPAddress(ipAddressInstance); - } - - NodeList elements19 = roleInstanceListElement.getElementsByTagName("InstanceEndpoints"); - Element instanceEndpointsSequenceElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (instanceEndpointsSequenceElement != null) + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = deploymentElement.getElementsByTagName("DeploymentSlot"); + Element deploymentSlotElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (deploymentSlotElement != null) + { + DeploymentSlot deploymentSlotInstance; + deploymentSlotInstance = DeploymentSlot.valueOf(deploymentSlotElement.getTextContent()); + result.setDeploymentSlot(deploymentSlotInstance); + } + + NodeList elements4 = deploymentElement.getElementsByTagName("PrivateID"); + Element privateIDElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (privateIDElement != null) + { + String privateIDInstance; + privateIDInstance = privateIDElement.getTextContent(); + result.setPrivateId(privateIDInstance); + } + + NodeList elements5 = deploymentElement.getElementsByTagName("Status"); + Element statusElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (statusElement != null) + { + DeploymentStatus statusInstance; + statusInstance = DeploymentStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); + } + + NodeList elements6 = deploymentElement.getElementsByTagName("Label"); + Element labelElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + result.setLabel(labelInstance); + } + + NodeList elements7 = deploymentElement.getElementsByTagName("Url"); + Element urlElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (urlElement != null) + { + URI urlInstance; + urlInstance = new URI(urlElement.getTextContent()); + result.setUri(urlInstance); + } + + NodeList elements8 = deploymentElement.getElementsByTagName("Configuration"); + Element configurationElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (configurationElement != null) + { + String configurationInstance; + configurationInstance = configurationElement.getTextContent() != null ? new String(Base64.decodeBase64(configurationElement.getTextContent().getBytes())) : null; + result.setConfiguration(configurationInstance); + } + + NodeList elements9 = deploymentElement.getElementsByTagName("RoleInstanceList"); + Element roleInstanceListSequenceElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (roleInstanceListSequenceElement != null) + { + for (int i1 = 0; i1 < roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").getLength(); i1 = i1 + 1) { - for (int i2 = 0; i2 < instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").getLength(); i2 = i2 + 1) + org.w3c.dom.Element roleInstanceListElement = ((org.w3c.dom.Element) roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").item(i1)); + RoleInstance roleInstanceInstance = new RoleInstance(); + result.getRoleInstances().add(roleInstanceInstance); + + NodeList elements10 = roleInstanceListElement.getElementsByTagName("RoleName"); + Element roleNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (roleNameElement != null) { - org.w3c.dom.Element instanceEndpointsElement = ((org.w3c.dom.Element) instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").item(i2)); - InstanceEndpoint instanceEndpointInstance = new InstanceEndpoint(); - roleInstanceInstance.getInstanceEndpoints().add(instanceEndpointInstance); - - NodeList elements20 = instanceEndpointsElement.getElementsByTagName("LocalPort"); - Element localPortElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (localPortElement != null && (localPortElement.getTextContent() != null && localPortElement.getTextContent().isEmpty() != true) == false) - { - int localPortInstance; - localPortInstance = Integer.parseInt(localPortElement.getTextContent()); - instanceEndpointInstance.setLocalPort(localPortInstance); - } - - NodeList elements21 = instanceEndpointsElement.getElementsByTagName("Name"); - Element nameElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance2; - nameInstance2 = nameElement2.getTextContent(); - instanceEndpointInstance.setName(nameInstance2); - } - - NodeList elements22 = instanceEndpointsElement.getElementsByTagName("PublicPort"); - Element publicPortElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (publicPortElement != null) - { - int publicPortInstance; - publicPortInstance = Integer.parseInt(publicPortElement.getTextContent()); - instanceEndpointInstance.setPort(publicPortInstance); - } - - NodeList elements23 = instanceEndpointsElement.getElementsByTagName("Protocol"); - Element protocolElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (protocolElement != null) - { - String protocolInstance; - protocolInstance = protocolElement.getTextContent(); - instanceEndpointInstance.setProtocol(protocolInstance); - } - - NodeList elements24 = instanceEndpointsElement.getElementsByTagName("Vip"); - Element vipElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (vipElement != null) + String roleNameInstance; + roleNameInstance = roleNameElement.getTextContent(); + roleInstanceInstance.setRoleName(roleNameInstance); + } + + NodeList elements11 = roleInstanceListElement.getElementsByTagName("InstanceName"); + Element instanceNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (instanceNameElement != null) + { + String instanceNameInstance; + instanceNameInstance = instanceNameElement.getTextContent(); + roleInstanceInstance.setInstanceName(instanceNameInstance); + } + + NodeList elements12 = roleInstanceListElement.getElementsByTagName("InstanceStatus"); + Element instanceStatusElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (instanceStatusElement != null) + { + String instanceStatusInstance; + instanceStatusInstance = instanceStatusElement.getTextContent(); + roleInstanceInstance.setInstanceStatus(instanceStatusInstance); + } + + NodeList elements13 = roleInstanceListElement.getElementsByTagName("InstanceUpgradeDomain"); + Element instanceUpgradeDomainElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (instanceUpgradeDomainElement != null && (instanceUpgradeDomainElement.getTextContent() != null && instanceUpgradeDomainElement.getTextContent().isEmpty() != true) == false) + { + int instanceUpgradeDomainInstance; + instanceUpgradeDomainInstance = Integer.parseInt(instanceUpgradeDomainElement.getTextContent()); + roleInstanceInstance.setInstanceUpgradeDomain(instanceUpgradeDomainInstance); + } + + NodeList elements14 = roleInstanceListElement.getElementsByTagName("InstanceFaultDomain"); + Element instanceFaultDomainElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (instanceFaultDomainElement != null && (instanceFaultDomainElement.getTextContent() != null && instanceFaultDomainElement.getTextContent().isEmpty() != true) == false) + { + int instanceFaultDomainInstance; + instanceFaultDomainInstance = Integer.parseInt(instanceFaultDomainElement.getTextContent()); + roleInstanceInstance.setInstanceFaultDomain(instanceFaultDomainInstance); + } + + NodeList elements15 = roleInstanceListElement.getElementsByTagName("InstanceSize"); + Element instanceSizeElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (instanceSizeElement != null) + { + String instanceSizeInstance; + instanceSizeInstance = instanceSizeElement.getTextContent(); + roleInstanceInstance.setInstanceSize(instanceSizeInstance); + } + + NodeList elements16 = roleInstanceListElement.getElementsByTagName("InstanceStateDetails"); + Element instanceStateDetailsElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (instanceStateDetailsElement != null) + { + String instanceStateDetailsInstance; + instanceStateDetailsInstance = instanceStateDetailsElement.getTextContent(); + roleInstanceInstance.setInstanceStateDetails(instanceStateDetailsInstance); + } + + NodeList elements17 = roleInstanceListElement.getElementsByTagName("InstanceErrorCode"); + Element instanceErrorCodeElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (instanceErrorCodeElement != null) + { + String instanceErrorCodeInstance; + instanceErrorCodeInstance = instanceErrorCodeElement.getTextContent(); + roleInstanceInstance.setInstanceErrorCode(instanceErrorCodeInstance); + } + + NodeList elements18 = roleInstanceListElement.getElementsByTagName("IpAddress"); + Element ipAddressElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (ipAddressElement != null) + { + InetAddress ipAddressInstance; + ipAddressInstance = InetAddress.getByName(ipAddressElement.getTextContent()); + roleInstanceInstance.setIPAddress(ipAddressInstance); + } + + NodeList elements19 = roleInstanceListElement.getElementsByTagName("InstanceEndpoints"); + Element instanceEndpointsSequenceElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (instanceEndpointsSequenceElement != null) + { + for (int i2 = 0; i2 < instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").getLength(); i2 = i2 + 1) { - InetAddress vipInstance; - vipInstance = InetAddress.getByName(vipElement.getTextContent()); - instanceEndpointInstance.setVirtualIPAddress(vipInstance); + org.w3c.dom.Element instanceEndpointsElement = ((org.w3c.dom.Element) instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").item(i2)); + InstanceEndpoint instanceEndpointInstance = new InstanceEndpoint(); + roleInstanceInstance.getInstanceEndpoints().add(instanceEndpointInstance); + + NodeList elements20 = instanceEndpointsElement.getElementsByTagName("LocalPort"); + Element localPortElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (localPortElement != null && (localPortElement.getTextContent() != null && localPortElement.getTextContent().isEmpty() != true) == false) + { + int localPortInstance; + localPortInstance = Integer.parseInt(localPortElement.getTextContent()); + instanceEndpointInstance.setLocalPort(localPortInstance); + } + + NodeList elements21 = instanceEndpointsElement.getElementsByTagName("Name"); + Element nameElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + instanceEndpointInstance.setName(nameInstance2); + } + + NodeList elements22 = instanceEndpointsElement.getElementsByTagName("PublicPort"); + Element publicPortElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (publicPortElement != null) + { + int publicPortInstance; + publicPortInstance = Integer.parseInt(publicPortElement.getTextContent()); + instanceEndpointInstance.setPort(publicPortInstance); + } + + NodeList elements23 = instanceEndpointsElement.getElementsByTagName("Protocol"); + Element protocolElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (protocolElement != null) + { + String protocolInstance; + protocolInstance = protocolElement.getTextContent(); + instanceEndpointInstance.setProtocol(protocolInstance); + } + + NodeList elements24 = instanceEndpointsElement.getElementsByTagName("Vip"); + Element vipElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (vipElement != null) + { + InetAddress vipInstance; + vipInstance = InetAddress.getByName(vipElement.getTextContent()); + instanceEndpointInstance.setVirtualIPAddress(vipInstance); + } } } + + NodeList elements25 = roleInstanceListElement.getElementsByTagName("PowerState"); + Element powerStateElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (powerStateElement != null) + { + RoleInstancePowerState powerStateInstance; + powerStateInstance = RoleInstancePowerState.valueOf(powerStateElement.getTextContent()); + roleInstanceInstance.setPowerState(powerStateInstance); + } + + NodeList elements26 = roleInstanceListElement.getElementsByTagName("HostName"); + Element hostNameElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (hostNameElement != null) + { + String hostNameInstance; + hostNameInstance = hostNameElement.getTextContent(); + roleInstanceInstance.setHostName(hostNameInstance); + } + + NodeList elements27 = roleInstanceListElement.getElementsByTagName("RemoteAccessCertificateThumbprint"); + Element remoteAccessCertificateThumbprintElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; + if (remoteAccessCertificateThumbprintElement != null) + { + String remoteAccessCertificateThumbprintInstance; + remoteAccessCertificateThumbprintInstance = remoteAccessCertificateThumbprintElement.getTextContent(); + roleInstanceInstance.setRemoteAccessCertificateThumbprint(remoteAccessCertificateThumbprintInstance); + } } + } + + NodeList elements28 = deploymentElement.getElementsByTagName("UpgradeStatus"); + Element upgradeStatusElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; + if (upgradeStatusElement != null) + { + UpgradeStatus upgradeStatusInstance = new UpgradeStatus(); + result.setUpgradeStatus(upgradeStatusInstance); - NodeList elements25 = roleInstanceListElement.getElementsByTagName("PowerState"); - Element powerStateElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (powerStateElement != null) + NodeList elements29 = upgradeStatusElement.getElementsByTagName("UpgradeType"); + Element upgradeTypeElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; + if (upgradeTypeElement != null) { - RoleInstancePowerState powerStateInstance; - powerStateInstance = RoleInstancePowerState.valueOf(powerStateElement.getTextContent()); - roleInstanceInstance.setPowerState(powerStateInstance); + DeploymentUpgradeType upgradeTypeInstance; + upgradeTypeInstance = DeploymentUpgradeType.valueOf(upgradeTypeElement.getTextContent()); + upgradeStatusInstance.setUpgradeType(upgradeTypeInstance); } - NodeList elements26 = roleInstanceListElement.getElementsByTagName("HostName"); - Element hostNameElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (hostNameElement != null) + NodeList elements30 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomainState"); + Element currentUpgradeDomainStateElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; + if (currentUpgradeDomainStateElement != null) { - String hostNameInstance; - hostNameInstance = hostNameElement.getTextContent(); - roleInstanceInstance.setHostName(hostNameInstance); + UpgradeDomainState currentUpgradeDomainStateInstance; + currentUpgradeDomainStateInstance = UpgradeDomainState.valueOf(currentUpgradeDomainStateElement.getTextContent()); + upgradeStatusInstance.setCurrentUpgradeDomainState(currentUpgradeDomainStateInstance); } - NodeList elements27 = roleInstanceListElement.getElementsByTagName("RemoteAccessCertificateThumbprint"); - Element remoteAccessCertificateThumbprintElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; - if (remoteAccessCertificateThumbprintElement != null) + NodeList elements31 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomain"); + Element currentUpgradeDomainElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; + if (currentUpgradeDomainElement != null) { - String remoteAccessCertificateThumbprintInstance; - remoteAccessCertificateThumbprintInstance = remoteAccessCertificateThumbprintElement.getTextContent(); - roleInstanceInstance.setRemoteAccessCertificateThumbprint(remoteAccessCertificateThumbprintInstance); + int currentUpgradeDomainInstance; + currentUpgradeDomainInstance = Integer.parseInt(currentUpgradeDomainElement.getTextContent()); + upgradeStatusInstance.setCurrentUpgradeDomain(currentUpgradeDomainInstance); } } - } - - NodeList elements28 = deploymentElement.getElementsByTagName("UpgradeStatus"); - Element upgradeStatusElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; - if (upgradeStatusElement != null) - { - UpgradeStatus upgradeStatusInstance = new UpgradeStatus(); - result.setUpgradeStatus(upgradeStatusInstance); - - NodeList elements29 = upgradeStatusElement.getElementsByTagName("UpgradeType"); - Element upgradeTypeElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; - if (upgradeTypeElement != null) - { - DeploymentUpgradeType upgradeTypeInstance; - upgradeTypeInstance = DeploymentUpgradeType.valueOf(upgradeTypeElement.getTextContent()); - upgradeStatusInstance.setUpgradeType(upgradeTypeInstance); - } - NodeList elements30 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomainState"); - Element currentUpgradeDomainStateElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; - if (currentUpgradeDomainStateElement != null) + NodeList elements32 = deploymentElement.getElementsByTagName("UpgradeDomainCount"); + Element upgradeDomainCountElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; + if (upgradeDomainCountElement != null) { - UpgradeDomainState currentUpgradeDomainStateInstance; - currentUpgradeDomainStateInstance = UpgradeDomainState.valueOf(currentUpgradeDomainStateElement.getTextContent()); - upgradeStatusInstance.setCurrentUpgradeDomainState(currentUpgradeDomainStateInstance); + int upgradeDomainCountInstance; + upgradeDomainCountInstance = Integer.parseInt(upgradeDomainCountElement.getTextContent()); + result.setUpgradeDomainCount(upgradeDomainCountInstance); } - NodeList elements31 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomain"); - Element currentUpgradeDomainElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; - if (currentUpgradeDomainElement != null) - { - int currentUpgradeDomainInstance; - currentUpgradeDomainInstance = Integer.parseInt(currentUpgradeDomainElement.getTextContent()); - upgradeStatusInstance.setCurrentUpgradeDomain(currentUpgradeDomainInstance); - } - } - - NodeList elements32 = deploymentElement.getElementsByTagName("UpgradeDomainCount"); - Element upgradeDomainCountElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; - if (upgradeDomainCountElement != null) - { - int upgradeDomainCountInstance; - upgradeDomainCountInstance = Integer.parseInt(upgradeDomainCountElement.getTextContent()); - result.setUpgradeDomainCount(upgradeDomainCountInstance); - } - - NodeList elements33 = deploymentElement.getElementsByTagName("RoleList"); - Element roleListSequenceElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; - if (roleListSequenceElement != null) - { - for (int i3 = 0; i3 < roleListSequenceElement.getElementsByTagName("Role").getLength(); i3 = i3 + 1) + NodeList elements33 = deploymentElement.getElementsByTagName("RoleList"); + Element roleListSequenceElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; + if (roleListSequenceElement != null) { - org.w3c.dom.Element roleListElement = ((org.w3c.dom.Element) roleListSequenceElement.getElementsByTagName("Role").item(i3)); - Role roleInstance = new Role(); - result.getRoles().add(roleInstance); - - NodeList elements34 = roleListElement.getElementsByTagName("RoleName"); - Element roleNameElement2 = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; - if (roleNameElement2 != null) - { - String roleNameInstance2; - roleNameInstance2 = roleNameElement2.getTextContent(); - roleInstance.setRoleName(roleNameInstance2); - } - - NodeList elements35 = roleListElement.getElementsByTagName("OsVersion"); - Element osVersionElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; - if (osVersionElement != null) + for (int i3 = 0; i3 < roleListSequenceElement.getElementsByTagName("Role").getLength(); i3 = i3 + 1) { - String osVersionInstance; - osVersionInstance = osVersionElement.getTextContent(); - roleInstance.setOSVersion(osVersionInstance); - } - - NodeList elements36 = roleListElement.getElementsByTagName("RoleType"); - Element roleTypeElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; - if (roleTypeElement != null) - { - String roleTypeInstance; - roleTypeInstance = roleTypeElement.getTextContent(); - roleInstance.setRoleType(roleTypeInstance); - } - - NodeList elements37 = roleListElement.getElementsByTagName("ConfigurationSets"); - Element configurationSetsSequenceElement = elements37.getLength() > 0 ? ((Element) elements37.item(0)) : null; - if (configurationSetsSequenceElement != null) - { - for (int i4 = 0; i4 < configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").getLength(); i4 = i4 + 1) + org.w3c.dom.Element roleListElement = ((org.w3c.dom.Element) roleListSequenceElement.getElementsByTagName("Role").item(i3)); + Role roleInstance = new Role(); + result.getRoles().add(roleInstance); + + NodeList elements34 = roleListElement.getElementsByTagName("RoleName"); + Element roleNameElement2 = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; + if (roleNameElement2 != null) { - org.w3c.dom.Element configurationSetsElement = ((org.w3c.dom.Element) configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").item(i4)); - ConfigurationSet configurationSetInstance = new ConfigurationSet(); - roleInstance.getConfigurationSets().add(configurationSetInstance); - - NodeList elements38 = configurationSetsElement.getElementsByTagName("ConfigurationSetType"); - Element configurationSetTypeElement = elements38.getLength() > 0 ? ((Element) elements38.item(0)) : null; - if (configurationSetTypeElement != null) - { - String configurationSetTypeInstance; - configurationSetTypeInstance = configurationSetTypeElement.getTextContent(); - configurationSetInstance.setConfigurationSetType(configurationSetTypeInstance); - } - - NodeList elements39 = configurationSetsElement.getElementsByTagName("InputEndpoints"); - Element inputEndpointsSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; - if (inputEndpointsSequenceElement != null) + String roleNameInstance2; + roleNameInstance2 = roleNameElement2.getTextContent(); + roleInstance.setRoleName(roleNameInstance2); + } + + NodeList elements35 = roleListElement.getElementsByTagName("OsVersion"); + Element osVersionElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; + if (osVersionElement != null) + { + String osVersionInstance; + osVersionInstance = osVersionElement.getTextContent(); + roleInstance.setOSVersion(osVersionInstance); + } + + NodeList elements36 = roleListElement.getElementsByTagName("RoleType"); + Element roleTypeElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; + if (roleTypeElement != null) + { + String roleTypeInstance; + roleTypeInstance = roleTypeElement.getTextContent(); + roleInstance.setRoleType(roleTypeInstance); + } + + NodeList elements37 = roleListElement.getElementsByTagName("ConfigurationSets"); + Element configurationSetsSequenceElement = elements37.getLength() > 0 ? ((Element) elements37.item(0)) : null; + if (configurationSetsSequenceElement != null) + { + for (int i4 = 0; i4 < configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").getLength(); i4 = i4 + 1) { - for (int i5 = 0; i5 < inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").getLength(); i5 = i5 + 1) + org.w3c.dom.Element configurationSetsElement = ((org.w3c.dom.Element) configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").item(i4)); + ConfigurationSet configurationSetInstance = new ConfigurationSet(); + roleInstance.getConfigurationSets().add(configurationSetInstance); + + NodeList elements38 = configurationSetsElement.getElementsByTagName("ConfigurationSetType"); + Element configurationSetTypeElement = elements38.getLength() > 0 ? ((Element) elements38.item(0)) : null; + if (configurationSetTypeElement != null) { - org.w3c.dom.Element inputEndpointsElement = ((org.w3c.dom.Element) inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").item(i5)); - InputEndpoint inputEndpointInstance = new InputEndpoint(); - configurationSetInstance.getInputEndpoints().add(inputEndpointInstance); - - NodeList elements40 = inputEndpointsElement.getElementsByTagName("LoadBalancedEndpointSetName"); - Element loadBalancedEndpointSetNameElement = elements40.getLength() > 0 ? ((Element) elements40.item(0)) : null; - if (loadBalancedEndpointSetNameElement != null) - { - String loadBalancedEndpointSetNameInstance; - loadBalancedEndpointSetNameInstance = loadBalancedEndpointSetNameElement.getTextContent(); - inputEndpointInstance.setLoadBalancedEndpointSetName(loadBalancedEndpointSetNameInstance); - } - - NodeList elements41 = inputEndpointsElement.getElementsByTagName("LocalPort"); - Element localPortElement2 = elements41.getLength() > 0 ? ((Element) elements41.item(0)) : null; - if (localPortElement2 != null && (localPortElement2.getTextContent() != null && localPortElement2.getTextContent().isEmpty() != true) == false) - { - int localPortInstance2; - localPortInstance2 = Integer.parseInt(localPortElement2.getTextContent()); - inputEndpointInstance.setLocalPort(localPortInstance2); - } - - NodeList elements42 = inputEndpointsElement.getElementsByTagName("Name"); - Element nameElement3 = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; - if (nameElement3 != null) - { - String nameInstance3; - nameInstance3 = nameElement3.getTextContent(); - inputEndpointInstance.setName(nameInstance3); - } - - NodeList elements43 = inputEndpointsElement.getElementsByTagName("Port"); - Element portElement = elements43.getLength() > 0 ? ((Element) elements43.item(0)) : null; - if (portElement != null && (portElement.getTextContent() != null && portElement.getTextContent().isEmpty() != true) == false) - { - int portInstance; - portInstance = Integer.parseInt(portElement.getTextContent()); - inputEndpointInstance.setPort(portInstance); - } - - NodeList elements44 = inputEndpointsElement.getElementsByTagName("LoadBalancerProbe"); - Element loadBalancerProbeElement = elements44.getLength() > 0 ? ((Element) elements44.item(0)) : null; - if (loadBalancerProbeElement != null) + String configurationSetTypeInstance; + configurationSetTypeInstance = configurationSetTypeElement.getTextContent(); + configurationSetInstance.setConfigurationSetType(configurationSetTypeInstance); + } + + NodeList elements39 = configurationSetsElement.getElementsByTagName("InputEndpoints"); + Element inputEndpointsSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; + if (inputEndpointsSequenceElement != null) + { + for (int i5 = 0; i5 < inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").getLength(); i5 = i5 + 1) { - LoadBalancerProbe loadBalancerProbeInstance = new LoadBalancerProbe(); - inputEndpointInstance.setLoadBalancerProbe(loadBalancerProbeInstance); + org.w3c.dom.Element inputEndpointsElement = ((org.w3c.dom.Element) inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").item(i5)); + InputEndpoint inputEndpointInstance = new InputEndpoint(); + configurationSetInstance.getInputEndpoints().add(inputEndpointInstance); - NodeList elements45 = loadBalancerProbeElement.getElementsByTagName("Path"); - Element pathElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; - if (pathElement != null) + NodeList elements40 = inputEndpointsElement.getElementsByTagName("LoadBalancedEndpointSetName"); + Element loadBalancedEndpointSetNameElement = elements40.getLength() > 0 ? ((Element) elements40.item(0)) : null; + if (loadBalancedEndpointSetNameElement != null) { - String pathInstance; - pathInstance = pathElement.getTextContent(); - loadBalancerProbeInstance.setPath(pathInstance); + String loadBalancedEndpointSetNameInstance; + loadBalancedEndpointSetNameInstance = loadBalancedEndpointSetNameElement.getTextContent(); + inputEndpointInstance.setLoadBalancedEndpointSetName(loadBalancedEndpointSetNameInstance); } - NodeList elements46 = loadBalancerProbeElement.getElementsByTagName("Port"); - Element portElement2 = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; - if (portElement2 != null) + NodeList elements41 = inputEndpointsElement.getElementsByTagName("LocalPort"); + Element localPortElement2 = elements41.getLength() > 0 ? ((Element) elements41.item(0)) : null; + if (localPortElement2 != null && (localPortElement2.getTextContent() != null && localPortElement2.getTextContent().isEmpty() != true) == false) { - int portInstance2; - portInstance2 = Integer.parseInt(portElement2.getTextContent()); - loadBalancerProbeInstance.setPort(portInstance2); + int localPortInstance2; + localPortInstance2 = Integer.parseInt(localPortElement2.getTextContent()); + inputEndpointInstance.setLocalPort(localPortInstance2); } - NodeList elements47 = loadBalancerProbeElement.getElementsByTagName("Protocol"); - Element protocolElement2 = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; - if (protocolElement2 != null) + NodeList elements42 = inputEndpointsElement.getElementsByTagName("Name"); + Element nameElement3 = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; + if (nameElement3 != null) { - LoadBalancerProbeTransportProtocol protocolInstance2; - protocolInstance2 = com.microsoft.windowsazure.management.compute.ComputeManagementClientImpl.parseLoadBalancerProbeTransportProtocol(protocolElement2.getTextContent()); - loadBalancerProbeInstance.setProtocol(protocolInstance2); + String nameInstance3; + nameInstance3 = nameElement3.getTextContent(); + inputEndpointInstance.setName(nameInstance3); } - NodeList elements48 = loadBalancerProbeElement.getElementsByTagName("IntervalInSeconds"); - Element intervalInSecondsElement = elements48.getLength() > 0 ? ((Element) elements48.item(0)) : null; - if (intervalInSecondsElement != null && (intervalInSecondsElement.getTextContent() != null && intervalInSecondsElement.getTextContent().isEmpty() != true) == false) + NodeList elements43 = inputEndpointsElement.getElementsByTagName("Port"); + Element portElement = elements43.getLength() > 0 ? ((Element) elements43.item(0)) : null; + if (portElement != null && (portElement.getTextContent() != null && portElement.getTextContent().isEmpty() != true) == false) { - int intervalInSecondsInstance; - intervalInSecondsInstance = Integer.parseInt(intervalInSecondsElement.getTextContent()); - loadBalancerProbeInstance.setIntervalInSeconds(intervalInSecondsInstance); + int portInstance; + portInstance = Integer.parseInt(portElement.getTextContent()); + inputEndpointInstance.setPort(portInstance); } - NodeList elements49 = loadBalancerProbeElement.getElementsByTagName("TimeoutInSeconds"); - Element timeoutInSecondsElement = elements49.getLength() > 0 ? ((Element) elements49.item(0)) : null; - if (timeoutInSecondsElement != null && (timeoutInSecondsElement.getTextContent() != null && timeoutInSecondsElement.getTextContent().isEmpty() != true) == false) + NodeList elements44 = inputEndpointsElement.getElementsByTagName("LoadBalancerProbe"); + Element loadBalancerProbeElement = elements44.getLength() > 0 ? ((Element) elements44.item(0)) : null; + if (loadBalancerProbeElement != null) { - int timeoutInSecondsInstance; - timeoutInSecondsInstance = Integer.parseInt(timeoutInSecondsElement.getTextContent()); - loadBalancerProbeInstance.setTimeoutInSeconds(timeoutInSecondsInstance); + LoadBalancerProbe loadBalancerProbeInstance = new LoadBalancerProbe(); + inputEndpointInstance.setLoadBalancerProbe(loadBalancerProbeInstance); + + NodeList elements45 = loadBalancerProbeElement.getElementsByTagName("Path"); + Element pathElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; + if (pathElement != null) + { + String pathInstance; + pathInstance = pathElement.getTextContent(); + loadBalancerProbeInstance.setPath(pathInstance); + } + + NodeList elements46 = loadBalancerProbeElement.getElementsByTagName("Port"); + Element portElement2 = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; + if (portElement2 != null) + { + int portInstance2; + portInstance2 = Integer.parseInt(portElement2.getTextContent()); + loadBalancerProbeInstance.setPort(portInstance2); + } + + NodeList elements47 = loadBalancerProbeElement.getElementsByTagName("Protocol"); + Element protocolElement2 = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; + if (protocolElement2 != null) + { + LoadBalancerProbeTransportProtocol protocolInstance2; + protocolInstance2 = com.microsoft.windowsazure.management.compute.ComputeManagementClientImpl.parseLoadBalancerProbeTransportProtocol(protocolElement2.getTextContent()); + loadBalancerProbeInstance.setProtocol(protocolInstance2); + } + + NodeList elements48 = loadBalancerProbeElement.getElementsByTagName("IntervalInSeconds"); + Element intervalInSecondsElement = elements48.getLength() > 0 ? ((Element) elements48.item(0)) : null; + if (intervalInSecondsElement != null && (intervalInSecondsElement.getTextContent() != null && intervalInSecondsElement.getTextContent().isEmpty() != true) == false) + { + int intervalInSecondsInstance; + intervalInSecondsInstance = Integer.parseInt(intervalInSecondsElement.getTextContent()); + loadBalancerProbeInstance.setIntervalInSeconds(intervalInSecondsInstance); + } + + NodeList elements49 = loadBalancerProbeElement.getElementsByTagName("TimeoutInSeconds"); + Element timeoutInSecondsElement = elements49.getLength() > 0 ? ((Element) elements49.item(0)) : null; + if (timeoutInSecondsElement != null && (timeoutInSecondsElement.getTextContent() != null && timeoutInSecondsElement.getTextContent().isEmpty() != true) == false) + { + int timeoutInSecondsInstance; + timeoutInSecondsInstance = Integer.parseInt(timeoutInSecondsElement.getTextContent()); + loadBalancerProbeInstance.setTimeoutInSeconds(timeoutInSecondsInstance); + } + } + + NodeList elements50 = inputEndpointsElement.getElementsByTagName("Protocol"); + Element protocolElement3 = elements50.getLength() > 0 ? ((Element) elements50.item(0)) : null; + if (protocolElement3 != null) + { + String protocolInstance3; + protocolInstance3 = protocolElement3.getTextContent(); + inputEndpointInstance.setProtocol(protocolInstance3); + } + + NodeList elements51 = inputEndpointsElement.getElementsByTagName("Vip"); + Element vipElement2 = elements51.getLength() > 0 ? ((Element) elements51.item(0)) : null; + if (vipElement2 != null) + { + InetAddress vipInstance2; + vipInstance2 = InetAddress.getByName(vipElement2.getTextContent()); + inputEndpointInstance.setVirtualIPAddress(vipInstance2); + } + + NodeList elements52 = inputEndpointsElement.getElementsByTagName("EnableDirectServerReturn"); + Element enableDirectServerReturnElement = elements52.getLength() > 0 ? ((Element) elements52.item(0)) : null; + if (enableDirectServerReturnElement != null && (enableDirectServerReturnElement.getTextContent() != null && enableDirectServerReturnElement.getTextContent().isEmpty() != true) == false) + { + boolean enableDirectServerReturnInstance; + enableDirectServerReturnInstance = Boolean.parseBoolean(enableDirectServerReturnElement.getTextContent()); + inputEndpointInstance.setEnableDirectServerReturn(enableDirectServerReturnInstance); } - } - - NodeList elements50 = inputEndpointsElement.getElementsByTagName("Protocol"); - Element protocolElement3 = elements50.getLength() > 0 ? ((Element) elements50.item(0)) : null; - if (protocolElement3 != null) - { - String protocolInstance3; - protocolInstance3 = protocolElement3.getTextContent(); - inputEndpointInstance.setProtocol(protocolInstance3); - } - - NodeList elements51 = inputEndpointsElement.getElementsByTagName("Vip"); - Element vipElement2 = elements51.getLength() > 0 ? ((Element) elements51.item(0)) : null; - if (vipElement2 != null) - { - InetAddress vipInstance2; - vipInstance2 = InetAddress.getByName(vipElement2.getTextContent()); - inputEndpointInstance.setVirtualIPAddress(vipInstance2); - } - - NodeList elements52 = inputEndpointsElement.getElementsByTagName("EnableDirectServerReturn"); - Element enableDirectServerReturnElement = elements52.getLength() > 0 ? ((Element) elements52.item(0)) : null; - if (enableDirectServerReturnElement != null && (enableDirectServerReturnElement.getTextContent() != null && enableDirectServerReturnElement.getTextContent().isEmpty() != true) == false) - { - boolean enableDirectServerReturnInstance; - enableDirectServerReturnInstance = Boolean.parseBoolean(enableDirectServerReturnElement.getTextContent()); - inputEndpointInstance.setEnableDirectServerReturn(enableDirectServerReturnInstance); - } - - NodeList elements53 = inputEndpointsElement.getElementsByTagName("EndpointAcl"); - Element endpointAclElement = elements53.getLength() > 0 ? ((Element) elements53.item(0)) : null; - if (endpointAclElement != null) - { - EndpointAcl endpointAclInstance = new EndpointAcl(); - inputEndpointInstance.setEndpointAcl(endpointAclInstance); - NodeList elements54 = endpointAclElement.getElementsByTagName("Rules"); - Element rulesSequenceElement = elements54.getLength() > 0 ? ((Element) elements54.item(0)) : null; - if (rulesSequenceElement != null) + NodeList elements53 = inputEndpointsElement.getElementsByTagName("EndpointAcl"); + Element endpointAclElement = elements53.getLength() > 0 ? ((Element) elements53.item(0)) : null; + if (endpointAclElement != null) { - for (int i6 = 0; i6 < rulesSequenceElement.getElementsByTagName("Rule").getLength(); i6 = i6 + 1) + EndpointAcl endpointAclInstance = new EndpointAcl(); + inputEndpointInstance.setEndpointAcl(endpointAclInstance); + + NodeList elements54 = endpointAclElement.getElementsByTagName("Rules"); + Element rulesSequenceElement = elements54.getLength() > 0 ? ((Element) elements54.item(0)) : null; + if (rulesSequenceElement != null) { - org.w3c.dom.Element rulesElement = ((org.w3c.dom.Element) rulesSequenceElement.getElementsByTagName("Rule").item(i6)); - AccessControlListRule ruleInstance = new AccessControlListRule(); - endpointAclInstance.getRules().add(ruleInstance); - - NodeList elements55 = rulesElement.getElementsByTagName("Order"); - Element orderElement = elements55.getLength() > 0 ? ((Element) elements55.item(0)) : null; - if (orderElement != null && (orderElement.getTextContent() != null && orderElement.getTextContent().isEmpty() != true) == false) - { - int orderInstance; - orderInstance = Integer.parseInt(orderElement.getTextContent()); - ruleInstance.setOrder(orderInstance); - } - - NodeList elements56 = rulesElement.getElementsByTagName("Action"); - Element actionElement = elements56.getLength() > 0 ? ((Element) elements56.item(0)) : null; - if (actionElement != null) - { - String actionInstance; - actionInstance = actionElement.getTextContent(); - ruleInstance.setAction(actionInstance); - } - - NodeList elements57 = rulesElement.getElementsByTagName("RemoteSubnet"); - Element remoteSubnetElement = elements57.getLength() > 0 ? ((Element) elements57.item(0)) : null; - if (remoteSubnetElement != null) + for (int i6 = 0; i6 < rulesSequenceElement.getElementsByTagName("Rule").getLength(); i6 = i6 + 1) { - String remoteSubnetInstance; - remoteSubnetInstance = remoteSubnetElement.getTextContent(); - ruleInstance.setRemoteSubnet(remoteSubnetInstance); - } - - NodeList elements58 = rulesElement.getElementsByTagName("Description"); - Element descriptionElement = elements58.getLength() > 0 ? ((Element) elements58.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - ruleInstance.setDescription(descriptionInstance); + org.w3c.dom.Element rulesElement = ((org.w3c.dom.Element) rulesSequenceElement.getElementsByTagName("Rule").item(i6)); + AccessControlListRule ruleInstance = new AccessControlListRule(); + endpointAclInstance.getRules().add(ruleInstance); + + NodeList elements55 = rulesElement.getElementsByTagName("Order"); + Element orderElement = elements55.getLength() > 0 ? ((Element) elements55.item(0)) : null; + if (orderElement != null && (orderElement.getTextContent() != null && orderElement.getTextContent().isEmpty() != true) == false) + { + int orderInstance; + orderInstance = Integer.parseInt(orderElement.getTextContent()); + ruleInstance.setOrder(orderInstance); + } + + NodeList elements56 = rulesElement.getElementsByTagName("Action"); + Element actionElement = elements56.getLength() > 0 ? ((Element) elements56.item(0)) : null; + if (actionElement != null) + { + String actionInstance; + actionInstance = actionElement.getTextContent(); + ruleInstance.setAction(actionInstance); + } + + NodeList elements57 = rulesElement.getElementsByTagName("RemoteSubnet"); + Element remoteSubnetElement = elements57.getLength() > 0 ? ((Element) elements57.item(0)) : null; + if (remoteSubnetElement != null) + { + String remoteSubnetInstance; + remoteSubnetInstance = remoteSubnetElement.getTextContent(); + ruleInstance.setRemoteSubnet(remoteSubnetInstance); + } + + NodeList elements58 = rulesElement.getElementsByTagName("Description"); + Element descriptionElement = elements58.getLength() > 0 ? ((Element) elements58.item(0)) : null; + if (descriptionElement != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + ruleInstance.setDescription(descriptionInstance); + } } } } } } - } - - NodeList elements59 = configurationSetsElement.getElementsByTagName("SubnetNames"); - Element subnetNamesSequenceElement = elements59.getLength() > 0 ? ((Element) elements59.item(0)) : null; - if (subnetNamesSequenceElement != null) - { - for (int i7 = 0; i7 < subnetNamesSequenceElement.getElementsByTagName("SubnetName").getLength(); i7 = i7 + 1) - { - org.w3c.dom.Element subnetNamesElement = ((org.w3c.dom.Element) subnetNamesSequenceElement.getElementsByTagName("SubnetName").item(i7)); - configurationSetInstance.getSubnetNames().add(subnetNamesElement.getTextContent()); - } - } - - NodeList elements60 = configurationSetsElement.getElementsByTagName("ComputerName"); - Element computerNameElement = elements60.getLength() > 0 ? ((Element) elements60.item(0)) : null; - if (computerNameElement != null) - { - String computerNameInstance; - computerNameInstance = computerNameElement.getTextContent(); - configurationSetInstance.setComputerName(computerNameInstance); - } - - NodeList elements61 = configurationSetsElement.getElementsByTagName("AdminPassword"); - Element adminPasswordElement = elements61.getLength() > 0 ? ((Element) elements61.item(0)) : null; - if (adminPasswordElement != null) - { - String adminPasswordInstance; - adminPasswordInstance = adminPasswordElement.getTextContent(); - configurationSetInstance.setAdminPassword(adminPasswordInstance); - } - - NodeList elements62 = configurationSetsElement.getElementsByTagName("ResetPasswordOnFirstLogon"); - Element resetPasswordOnFirstLogonElement = elements62.getLength() > 0 ? ((Element) elements62.item(0)) : null; - if (resetPasswordOnFirstLogonElement != null && (resetPasswordOnFirstLogonElement.getTextContent() != null && resetPasswordOnFirstLogonElement.getTextContent().isEmpty() != true) == false) - { - boolean resetPasswordOnFirstLogonInstance; - resetPasswordOnFirstLogonInstance = Boolean.parseBoolean(resetPasswordOnFirstLogonElement.getTextContent()); - configurationSetInstance.setResetPasswordOnFirstLogon(resetPasswordOnFirstLogonInstance); - } - - NodeList elements63 = configurationSetsElement.getElementsByTagName("EnableAutomaticUpdates"); - Element enableAutomaticUpdatesElement = elements63.getLength() > 0 ? ((Element) elements63.item(0)) : null; - if (enableAutomaticUpdatesElement != null && (enableAutomaticUpdatesElement.getTextContent() != null && enableAutomaticUpdatesElement.getTextContent().isEmpty() != true) == false) - { - boolean enableAutomaticUpdatesInstance; - enableAutomaticUpdatesInstance = Boolean.parseBoolean(enableAutomaticUpdatesElement.getTextContent()); - configurationSetInstance.setEnableAutomaticUpdates(enableAutomaticUpdatesInstance); - } - - NodeList elements64 = configurationSetsElement.getElementsByTagName("TimeZone"); - Element timeZoneElement = elements64.getLength() > 0 ? ((Element) elements64.item(0)) : null; - if (timeZoneElement != null) - { - String timeZoneInstance; - timeZoneInstance = timeZoneElement.getTextContent(); - configurationSetInstance.setTimeZone(timeZoneInstance); - } - - NodeList elements65 = configurationSetsElement.getElementsByTagName("DomainJoin"); - Element domainJoinElement = elements65.getLength() > 0 ? ((Element) elements65.item(0)) : null; - if (domainJoinElement != null) - { - DomainJoinSettings domainJoinInstance = new DomainJoinSettings(); - configurationSetInstance.setDomainJoin(domainJoinInstance); - NodeList elements66 = domainJoinElement.getElementsByTagName("Credentials"); - Element credentialsElement = elements66.getLength() > 0 ? ((Element) elements66.item(0)) : null; - if (credentialsElement != null) + NodeList elements59 = configurationSetsElement.getElementsByTagName("SubnetNames"); + Element subnetNamesSequenceElement = elements59.getLength() > 0 ? ((Element) elements59.item(0)) : null; + if (subnetNamesSequenceElement != null) { - DomainJoinCredentials credentialsInstance = new DomainJoinCredentials(); - domainJoinInstance.setCredentials(credentialsInstance); - - NodeList elements67 = credentialsElement.getElementsByTagName("Domain"); - Element domainElement = elements67.getLength() > 0 ? ((Element) elements67.item(0)) : null; - if (domainElement != null) - { - String domainInstance; - domainInstance = domainElement.getTextContent(); - credentialsInstance.setDomain(domainInstance); - } - - NodeList elements68 = credentialsElement.getElementsByTagName("Username"); - Element usernameElement = elements68.getLength() > 0 ? ((Element) elements68.item(0)) : null; - if (usernameElement != null) - { - String usernameInstance; - usernameInstance = usernameElement.getTextContent(); - credentialsInstance.setUserName(usernameInstance); - } - - NodeList elements69 = credentialsElement.getElementsByTagName("Password"); - Element passwordElement = elements69.getLength() > 0 ? ((Element) elements69.item(0)) : null; - if (passwordElement != null) + for (int i7 = 0; i7 < subnetNamesSequenceElement.getElementsByTagName("SubnetName").getLength(); i7 = i7 + 1) { - String passwordInstance; - passwordInstance = passwordElement.getTextContent(); - credentialsInstance.setPassword(passwordInstance); + org.w3c.dom.Element subnetNamesElement = ((org.w3c.dom.Element) subnetNamesSequenceElement.getElementsByTagName("SubnetName").item(i7)); + configurationSetInstance.getSubnetNames().add(subnetNamesElement.getTextContent()); } } - NodeList elements70 = domainJoinElement.getElementsByTagName("JoinDomain"); - Element joinDomainElement = elements70.getLength() > 0 ? ((Element) elements70.item(0)) : null; - if (joinDomainElement != null) + NodeList elements60 = configurationSetsElement.getElementsByTagName("StaticVirtualNetworkIPAddress"); + Element staticVirtualNetworkIPAddressElement = elements60.getLength() > 0 ? ((Element) elements60.item(0)) : null; + if (staticVirtualNetworkIPAddressElement != null) + { + String staticVirtualNetworkIPAddressInstance; + staticVirtualNetworkIPAddressInstance = staticVirtualNetworkIPAddressElement.getTextContent(); + configurationSetInstance.setStaticVirtualNetworkIPAddress(staticVirtualNetworkIPAddressInstance); + } + + NodeList elements61 = configurationSetsElement.getElementsByTagName("ComputerName"); + Element computerNameElement = elements61.getLength() > 0 ? ((Element) elements61.item(0)) : null; + if (computerNameElement != null) + { + String computerNameInstance; + computerNameInstance = computerNameElement.getTextContent(); + configurationSetInstance.setComputerName(computerNameInstance); + } + + NodeList elements62 = configurationSetsElement.getElementsByTagName("AdminPassword"); + Element adminPasswordElement = elements62.getLength() > 0 ? ((Element) elements62.item(0)) : null; + if (adminPasswordElement != null) + { + String adminPasswordInstance; + adminPasswordInstance = adminPasswordElement.getTextContent(); + configurationSetInstance.setAdminPassword(adminPasswordInstance); + } + + NodeList elements63 = configurationSetsElement.getElementsByTagName("ResetPasswordOnFirstLogon"); + Element resetPasswordOnFirstLogonElement = elements63.getLength() > 0 ? ((Element) elements63.item(0)) : null; + if (resetPasswordOnFirstLogonElement != null && (resetPasswordOnFirstLogonElement.getTextContent() != null && resetPasswordOnFirstLogonElement.getTextContent().isEmpty() != true) == false) + { + boolean resetPasswordOnFirstLogonInstance; + resetPasswordOnFirstLogonInstance = Boolean.parseBoolean(resetPasswordOnFirstLogonElement.getTextContent()); + configurationSetInstance.setResetPasswordOnFirstLogon(resetPasswordOnFirstLogonInstance); + } + + NodeList elements64 = configurationSetsElement.getElementsByTagName("EnableAutomaticUpdates"); + Element enableAutomaticUpdatesElement = elements64.getLength() > 0 ? ((Element) elements64.item(0)) : null; + if (enableAutomaticUpdatesElement != null && (enableAutomaticUpdatesElement.getTextContent() != null && enableAutomaticUpdatesElement.getTextContent().isEmpty() != true) == false) { - String joinDomainInstance; - joinDomainInstance = joinDomainElement.getTextContent(); - domainJoinInstance.setDomainToJoin(joinDomainInstance); + boolean enableAutomaticUpdatesInstance; + enableAutomaticUpdatesInstance = Boolean.parseBoolean(enableAutomaticUpdatesElement.getTextContent()); + configurationSetInstance.setEnableAutomaticUpdates(enableAutomaticUpdatesInstance); } - NodeList elements71 = domainJoinElement.getElementsByTagName("MachineObjectOU"); - Element machineObjectOUElement = elements71.getLength() > 0 ? ((Element) elements71.item(0)) : null; - if (machineObjectOUElement != null) + NodeList elements65 = configurationSetsElement.getElementsByTagName("TimeZone"); + Element timeZoneElement = elements65.getLength() > 0 ? ((Element) elements65.item(0)) : null; + if (timeZoneElement != null) { - String machineObjectOUInstance; - machineObjectOUInstance = machineObjectOUElement.getTextContent(); - domainJoinInstance.setLdapMachineObjectOU(machineObjectOUInstance); + String timeZoneInstance; + timeZoneInstance = timeZoneElement.getTextContent(); + configurationSetInstance.setTimeZone(timeZoneInstance); } - NodeList elements72 = domainJoinElement.getElementsByTagName("Provisioning"); - Element provisioningElement = elements72.getLength() > 0 ? ((Element) elements72.item(0)) : null; - if (provisioningElement != null) + NodeList elements66 = configurationSetsElement.getElementsByTagName("DomainJoin"); + Element domainJoinElement = elements66.getLength() > 0 ? ((Element) elements66.item(0)) : null; + if (domainJoinElement != null) { - DomainJoinProvisioning provisioningInstance = new DomainJoinProvisioning(); - domainJoinInstance.setProvisioning(provisioningInstance); + DomainJoinSettings domainJoinInstance = new DomainJoinSettings(); + configurationSetInstance.setDomainJoin(domainJoinInstance); - NodeList elements73 = provisioningElement.getElementsByTagName("AccountData"); - Element accountDataElement = elements73.getLength() > 0 ? ((Element) elements73.item(0)) : null; - if (accountDataElement != null) + NodeList elements67 = domainJoinElement.getElementsByTagName("Credentials"); + Element credentialsElement = elements67.getLength() > 0 ? ((Element) elements67.item(0)) : null; + if (credentialsElement != null) { - String accountDataInstance; - accountDataInstance = accountDataElement.getTextContent(); - provisioningInstance.setAccountData(accountDataInstance); + DomainJoinCredentials credentialsInstance = new DomainJoinCredentials(); + domainJoinInstance.setCredentials(credentialsInstance); + + NodeList elements68 = credentialsElement.getElementsByTagName("Domain"); + Element domainElement = elements68.getLength() > 0 ? ((Element) elements68.item(0)) : null; + if (domainElement != null) + { + String domainInstance; + domainInstance = domainElement.getTextContent(); + credentialsInstance.setDomain(domainInstance); + } + + NodeList elements69 = credentialsElement.getElementsByTagName("Username"); + Element usernameElement = elements69.getLength() > 0 ? ((Element) elements69.item(0)) : null; + if (usernameElement != null) + { + String usernameInstance; + usernameInstance = usernameElement.getTextContent(); + credentialsInstance.setUserName(usernameInstance); + } + + NodeList elements70 = credentialsElement.getElementsByTagName("Password"); + Element passwordElement = elements70.getLength() > 0 ? ((Element) elements70.item(0)) : null; + if (passwordElement != null) + { + String passwordInstance; + passwordInstance = passwordElement.getTextContent(); + credentialsInstance.setPassword(passwordInstance); + } } - } - } - - NodeList elements74 = configurationSetsElement.getElementsByTagName("StoredCertificateSettings"); - Element storedCertificateSettingsSequenceElement = elements74.getLength() > 0 ? ((Element) elements74.item(0)) : null; - if (storedCertificateSettingsSequenceElement != null) - { - for (int i8 = 0; i8 < storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").getLength(); i8 = i8 + 1) - { - org.w3c.dom.Element storedCertificateSettingsElement = ((org.w3c.dom.Element) storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").item(i8)); - StoredCertificateSettings certificateSettingInstance = new StoredCertificateSettings(); - configurationSetInstance.getStoredCertificateSettings().add(certificateSettingInstance); - NodeList elements75 = storedCertificateSettingsElement.getElementsByTagName("StoreLocation"); - Element storeLocationElement = elements75.getLength() > 0 ? ((Element) elements75.item(0)) : null; - if (storeLocationElement != null) + NodeList elements71 = domainJoinElement.getElementsByTagName("JoinDomain"); + Element joinDomainElement = elements71.getLength() > 0 ? ((Element) elements71.item(0)) : null; + if (joinDomainElement != null) { + String joinDomainInstance; + joinDomainInstance = joinDomainElement.getTextContent(); + domainJoinInstance.setDomainToJoin(joinDomainInstance); } - NodeList elements76 = storedCertificateSettingsElement.getElementsByTagName("StoreName"); - Element storeNameElement = elements76.getLength() > 0 ? ((Element) elements76.item(0)) : null; - if (storeNameElement != null) + NodeList elements72 = domainJoinElement.getElementsByTagName("MachineObjectOU"); + Element machineObjectOUElement = elements72.getLength() > 0 ? ((Element) elements72.item(0)) : null; + if (machineObjectOUElement != null) { - String storeNameInstance; - storeNameInstance = storeNameElement.getTextContent(); - certificateSettingInstance.setStoreName(storeNameInstance); + String machineObjectOUInstance; + machineObjectOUInstance = machineObjectOUElement.getTextContent(); + domainJoinInstance.setLdapMachineObjectOU(machineObjectOUInstance); } - NodeList elements77 = storedCertificateSettingsElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements77.getLength() > 0 ? ((Element) elements77.item(0)) : null; - if (thumbprintElement != null) + NodeList elements73 = domainJoinElement.getElementsByTagName("Provisioning"); + Element provisioningElement = elements73.getLength() > 0 ? ((Element) elements73.item(0)) : null; + if (provisioningElement != null) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - certificateSettingInstance.setThumbprint(thumbprintInstance); + DomainJoinProvisioning provisioningInstance = new DomainJoinProvisioning(); + domainJoinInstance.setProvisioning(provisioningInstance); + + NodeList elements74 = provisioningElement.getElementsByTagName("AccountData"); + Element accountDataElement = elements74.getLength() > 0 ? ((Element) elements74.item(0)) : null; + if (accountDataElement != null) + { + String accountDataInstance; + accountDataInstance = accountDataElement.getTextContent(); + provisioningInstance.setAccountData(accountDataInstance); + } } } - } - - NodeList elements78 = configurationSetsElement.getElementsByTagName("WinRM"); - Element winRMElement = elements78.getLength() > 0 ? ((Element) elements78.item(0)) : null; - if (winRMElement != null) - { - WindowsRemoteManagementSettings winRMInstance = new WindowsRemoteManagementSettings(); - configurationSetInstance.setWindowsRemoteManagement(winRMInstance); - NodeList elements79 = winRMElement.getElementsByTagName("Listeners"); - Element listenersSequenceElement = elements79.getLength() > 0 ? ((Element) elements79.item(0)) : null; - if (listenersSequenceElement != null) + NodeList elements75 = configurationSetsElement.getElementsByTagName("StoredCertificateSettings"); + Element storedCertificateSettingsSequenceElement = elements75.getLength() > 0 ? ((Element) elements75.item(0)) : null; + if (storedCertificateSettingsSequenceElement != null) { - for (int i9 = 0; i9 < listenersSequenceElement.getElementsByTagName("Listener").getLength(); i9 = i9 + 1) + for (int i8 = 0; i8 < storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").getLength(); i8 = i8 + 1) { - org.w3c.dom.Element listenersElement = ((org.w3c.dom.Element) listenersSequenceElement.getElementsByTagName("Listener").item(i9)); - WindowsRemoteManagementListener listenerInstance = new WindowsRemoteManagementListener(); - winRMInstance.getListeners().add(listenerInstance); + org.w3c.dom.Element storedCertificateSettingsElement = ((org.w3c.dom.Element) storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").item(i8)); + StoredCertificateSettings certificateSettingInstance = new StoredCertificateSettings(); + configurationSetInstance.getStoredCertificateSettings().add(certificateSettingInstance); - NodeList elements80 = listenersElement.getElementsByTagName("Protocol"); - Element protocolElement4 = elements80.getLength() > 0 ? ((Element) elements80.item(0)) : null; - if (protocolElement4 != null) + NodeList elements76 = storedCertificateSettingsElement.getElementsByTagName("StoreLocation"); + Element storeLocationElement = elements76.getLength() > 0 ? ((Element) elements76.item(0)) : null; + if (storeLocationElement != null) { - VirtualMachineWindowsRemoteManagementListenerType protocolInstance4; - protocolInstance4 = VirtualMachineWindowsRemoteManagementListenerType.valueOf(protocolElement4.getTextContent()); - listenerInstance.setListenerType(protocolInstance4); } - NodeList elements81 = listenersElement.getElementsByTagName("CertificateThumbprint"); - Element certificateThumbprintElement = elements81.getLength() > 0 ? ((Element) elements81.item(0)) : null; - if (certificateThumbprintElement != null) + NodeList elements77 = storedCertificateSettingsElement.getElementsByTagName("StoreName"); + Element storeNameElement = elements77.getLength() > 0 ? ((Element) elements77.item(0)) : null; + if (storeNameElement != null) { - String certificateThumbprintInstance; - certificateThumbprintInstance = certificateThumbprintElement.getTextContent(); - listenerInstance.setCertificateThumbprint(certificateThumbprintInstance); + String storeNameInstance; + storeNameInstance = storeNameElement.getTextContent(); + certificateSettingInstance.setStoreName(storeNameInstance); + } + + NodeList elements78 = storedCertificateSettingsElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements78.getLength() > 0 ? ((Element) elements78.item(0)) : null; + if (thumbprintElement != null) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + certificateSettingInstance.setThumbprint(thumbprintInstance); } } } - } - - NodeList elements82 = configurationSetsElement.getElementsByTagName("AdminUsername"); - Element adminUsernameElement = elements82.getLength() > 0 ? ((Element) elements82.item(0)) : null; - if (adminUsernameElement != null) - { - String adminUsernameInstance; - adminUsernameInstance = adminUsernameElement.getTextContent(); - configurationSetInstance.setAdminUserName(adminUsernameInstance); - } - - NodeList elements83 = configurationSetsElement.getElementsByTagName("HostName"); - Element hostNameElement2 = elements83.getLength() > 0 ? ((Element) elements83.item(0)) : null; - if (hostNameElement2 != null) - { - String hostNameInstance2; - hostNameInstance2 = hostNameElement2.getTextContent(); - configurationSetInstance.setHostName(hostNameInstance2); - } - - NodeList elements84 = configurationSetsElement.getElementsByTagName("UserName"); - Element userNameElement = elements84.getLength() > 0 ? ((Element) elements84.item(0)) : null; - if (userNameElement != null) - { - String userNameInstance; - userNameInstance = userNameElement.getTextContent(); - configurationSetInstance.setUserName(userNameInstance); - } - - NodeList elements85 = configurationSetsElement.getElementsByTagName("UserPassword"); - Element userPasswordElement = elements85.getLength() > 0 ? ((Element) elements85.item(0)) : null; - if (userPasswordElement != null) - { - String userPasswordInstance; - userPasswordInstance = userPasswordElement.getTextContent(); - configurationSetInstance.setUserPassword(userPasswordInstance); - } - - NodeList elements86 = configurationSetsElement.getElementsByTagName("DisableSshPasswordAuthentication"); - Element disableSshPasswordAuthenticationElement = elements86.getLength() > 0 ? ((Element) elements86.item(0)) : null; - if (disableSshPasswordAuthenticationElement != null && (disableSshPasswordAuthenticationElement.getTextContent() != null && disableSshPasswordAuthenticationElement.getTextContent().isEmpty() != true) == false) - { - boolean disableSshPasswordAuthenticationInstance; - disableSshPasswordAuthenticationInstance = Boolean.parseBoolean(disableSshPasswordAuthenticationElement.getTextContent()); - configurationSetInstance.setDisableSshPasswordAuthentication(disableSshPasswordAuthenticationInstance); - } - - NodeList elements87 = configurationSetsElement.getElementsByTagName("SSH"); - Element sSHElement = elements87.getLength() > 0 ? ((Element) elements87.item(0)) : null; - if (sSHElement != null) - { - SshSettings sSHInstance = new SshSettings(); - configurationSetInstance.setSshSettings(sSHInstance); - NodeList elements88 = sSHElement.getElementsByTagName("PublicKeys"); - Element publicKeysSequenceElement = elements88.getLength() > 0 ? ((Element) elements88.item(0)) : null; - if (publicKeysSequenceElement != null) + NodeList elements79 = configurationSetsElement.getElementsByTagName("WinRM"); + Element winRMElement = elements79.getLength() > 0 ? ((Element) elements79.item(0)) : null; + if (winRMElement != null) { - for (int i10 = 0; i10 < publicKeysSequenceElement.getElementsByTagName("PublicKey").getLength(); i10 = i10 + 1) + WindowsRemoteManagementSettings winRMInstance = new WindowsRemoteManagementSettings(); + configurationSetInstance.setWindowsRemoteManagement(winRMInstance); + + NodeList elements80 = winRMElement.getElementsByTagName("Listeners"); + Element listenersSequenceElement = elements80.getLength() > 0 ? ((Element) elements80.item(0)) : null; + if (listenersSequenceElement != null) { - org.w3c.dom.Element publicKeysElement = ((org.w3c.dom.Element) publicKeysSequenceElement.getElementsByTagName("PublicKey").item(i10)); - SshSettingPublicKey publicKeyInstance = new SshSettingPublicKey(); - sSHInstance.getPublicKeys().add(publicKeyInstance); - - NodeList elements89 = publicKeysElement.getElementsByTagName("Fingerprint"); - Element fingerprintElement = elements89.getLength() > 0 ? ((Element) elements89.item(0)) : null; - if (fingerprintElement != null) - { - String fingerprintInstance; - fingerprintInstance = fingerprintElement.getTextContent(); - publicKeyInstance.setFingerprint(fingerprintInstance); - } - - NodeList elements90 = publicKeysElement.getElementsByTagName("Path"); - Element pathElement2 = elements90.getLength() > 0 ? ((Element) elements90.item(0)) : null; - if (pathElement2 != null) + for (int i9 = 0; i9 < listenersSequenceElement.getElementsByTagName("Listener").getLength(); i9 = i9 + 1) { - String pathInstance2; - pathInstance2 = pathElement2.getTextContent(); - publicKeyInstance.setPath(pathInstance2); + org.w3c.dom.Element listenersElement = ((org.w3c.dom.Element) listenersSequenceElement.getElementsByTagName("Listener").item(i9)); + WindowsRemoteManagementListener listenerInstance = new WindowsRemoteManagementListener(); + winRMInstance.getListeners().add(listenerInstance); + + NodeList elements81 = listenersElement.getElementsByTagName("Protocol"); + Element protocolElement4 = elements81.getLength() > 0 ? ((Element) elements81.item(0)) : null; + if (protocolElement4 != null) + { + VirtualMachineWindowsRemoteManagementListenerType protocolInstance4; + protocolInstance4 = VirtualMachineWindowsRemoteManagementListenerType.valueOf(protocolElement4.getTextContent()); + listenerInstance.setListenerType(protocolInstance4); + } + + NodeList elements82 = listenersElement.getElementsByTagName("CertificateThumbprint"); + Element certificateThumbprintElement = elements82.getLength() > 0 ? ((Element) elements82.item(0)) : null; + if (certificateThumbprintElement != null) + { + String certificateThumbprintInstance; + certificateThumbprintInstance = certificateThumbprintElement.getTextContent(); + listenerInstance.setCertificateThumbprint(certificateThumbprintInstance); + } } } } - NodeList elements91 = sSHElement.getElementsByTagName("KeyPairs"); - Element keyPairsSequenceElement = elements91.getLength() > 0 ? ((Element) elements91.item(0)) : null; - if (keyPairsSequenceElement != null) + NodeList elements83 = configurationSetsElement.getElementsByTagName("AdminUsername"); + Element adminUsernameElement = elements83.getLength() > 0 ? ((Element) elements83.item(0)) : null; + if (adminUsernameElement != null) + { + String adminUsernameInstance; + adminUsernameInstance = adminUsernameElement.getTextContent(); + configurationSetInstance.setAdminUserName(adminUsernameInstance); + } + + NodeList elements84 = configurationSetsElement.getElementsByTagName("HostName"); + Element hostNameElement2 = elements84.getLength() > 0 ? ((Element) elements84.item(0)) : null; + if (hostNameElement2 != null) + { + String hostNameInstance2; + hostNameInstance2 = hostNameElement2.getTextContent(); + configurationSetInstance.setHostName(hostNameInstance2); + } + + NodeList elements85 = configurationSetsElement.getElementsByTagName("UserName"); + Element userNameElement = elements85.getLength() > 0 ? ((Element) elements85.item(0)) : null; + if (userNameElement != null) + { + String userNameInstance; + userNameInstance = userNameElement.getTextContent(); + configurationSetInstance.setUserName(userNameInstance); + } + + NodeList elements86 = configurationSetsElement.getElementsByTagName("UserPassword"); + Element userPasswordElement = elements86.getLength() > 0 ? ((Element) elements86.item(0)) : null; + if (userPasswordElement != null) + { + String userPasswordInstance; + userPasswordInstance = userPasswordElement.getTextContent(); + configurationSetInstance.setUserPassword(userPasswordInstance); + } + + NodeList elements87 = configurationSetsElement.getElementsByTagName("DisableSshPasswordAuthentication"); + Element disableSshPasswordAuthenticationElement = elements87.getLength() > 0 ? ((Element) elements87.item(0)) : null; + if (disableSshPasswordAuthenticationElement != null && (disableSshPasswordAuthenticationElement.getTextContent() != null && disableSshPasswordAuthenticationElement.getTextContent().isEmpty() != true) == false) + { + boolean disableSshPasswordAuthenticationInstance; + disableSshPasswordAuthenticationInstance = Boolean.parseBoolean(disableSshPasswordAuthenticationElement.getTextContent()); + configurationSetInstance.setDisableSshPasswordAuthentication(disableSshPasswordAuthenticationInstance); + } + + NodeList elements88 = configurationSetsElement.getElementsByTagName("SSH"); + Element sSHElement = elements88.getLength() > 0 ? ((Element) elements88.item(0)) : null; + if (sSHElement != null) { - for (int i11 = 0; i11 < keyPairsSequenceElement.getElementsByTagName("KeyPair").getLength(); i11 = i11 + 1) + SshSettings sSHInstance = new SshSettings(); + configurationSetInstance.setSshSettings(sSHInstance); + + NodeList elements89 = sSHElement.getElementsByTagName("PublicKeys"); + Element publicKeysSequenceElement = elements89.getLength() > 0 ? ((Element) elements89.item(0)) : null; + if (publicKeysSequenceElement != null) { - org.w3c.dom.Element keyPairsElement = ((org.w3c.dom.Element) keyPairsSequenceElement.getElementsByTagName("KeyPair").item(i11)); - SshSettingKeyPair keyPairInstance = new SshSettingKeyPair(); - sSHInstance.getKeyPairs().add(keyPairInstance); - - NodeList elements92 = keyPairsElement.getElementsByTagName("Fingerprint"); - Element fingerprintElement2 = elements92.getLength() > 0 ? ((Element) elements92.item(0)) : null; - if (fingerprintElement2 != null) + for (int i10 = 0; i10 < publicKeysSequenceElement.getElementsByTagName("PublicKey").getLength(); i10 = i10 + 1) { - String fingerprintInstance2; - fingerprintInstance2 = fingerprintElement2.getTextContent(); - keyPairInstance.setFingerprint(fingerprintInstance2); + org.w3c.dom.Element publicKeysElement = ((org.w3c.dom.Element) publicKeysSequenceElement.getElementsByTagName("PublicKey").item(i10)); + SshSettingPublicKey publicKeyInstance = new SshSettingPublicKey(); + sSHInstance.getPublicKeys().add(publicKeyInstance); + + NodeList elements90 = publicKeysElement.getElementsByTagName("Fingerprint"); + Element fingerprintElement = elements90.getLength() > 0 ? ((Element) elements90.item(0)) : null; + if (fingerprintElement != null) + { + String fingerprintInstance; + fingerprintInstance = fingerprintElement.getTextContent(); + publicKeyInstance.setFingerprint(fingerprintInstance); + } + + NodeList elements91 = publicKeysElement.getElementsByTagName("Path"); + Element pathElement2 = elements91.getLength() > 0 ? ((Element) elements91.item(0)) : null; + if (pathElement2 != null) + { + String pathInstance2; + pathInstance2 = pathElement2.getTextContent(); + publicKeyInstance.setPath(pathInstance2); + } } - - NodeList elements93 = keyPairsElement.getElementsByTagName("Path"); - Element pathElement3 = elements93.getLength() > 0 ? ((Element) elements93.item(0)) : null; - if (pathElement3 != null) + } + + NodeList elements92 = sSHElement.getElementsByTagName("KeyPairs"); + Element keyPairsSequenceElement = elements92.getLength() > 0 ? ((Element) elements92.item(0)) : null; + if (keyPairsSequenceElement != null) + { + for (int i11 = 0; i11 < keyPairsSequenceElement.getElementsByTagName("KeyPair").getLength(); i11 = i11 + 1) { - String pathInstance3; - pathInstance3 = pathElement3.getTextContent(); - keyPairInstance.setPath(pathInstance3); + org.w3c.dom.Element keyPairsElement = ((org.w3c.dom.Element) keyPairsSequenceElement.getElementsByTagName("KeyPair").item(i11)); + SshSettingKeyPair keyPairInstance = new SshSettingKeyPair(); + sSHInstance.getKeyPairs().add(keyPairInstance); + + NodeList elements93 = keyPairsElement.getElementsByTagName("Fingerprint"); + Element fingerprintElement2 = elements93.getLength() > 0 ? ((Element) elements93.item(0)) : null; + if (fingerprintElement2 != null) + { + String fingerprintInstance2; + fingerprintInstance2 = fingerprintElement2.getTextContent(); + keyPairInstance.setFingerprint(fingerprintInstance2); + } + + NodeList elements94 = keyPairsElement.getElementsByTagName("Path"); + Element pathElement3 = elements94.getLength() > 0 ? ((Element) elements94.item(0)) : null; + if (pathElement3 != null) + { + String pathInstance3; + pathInstance3 = pathElement3.getTextContent(); + keyPairInstance.setPath(pathInstance3); + } } } } } } - } - - NodeList elements94 = roleListElement.getElementsByTagName("AvailabilitySetName"); - Element availabilitySetNameElement = elements94.getLength() > 0 ? ((Element) elements94.item(0)) : null; - if (availabilitySetNameElement != null) - { - String availabilitySetNameInstance; - availabilitySetNameInstance = availabilitySetNameElement.getTextContent(); - roleInstance.setAvailabilitySetName(availabilitySetNameInstance); - } - - NodeList elements95 = roleListElement.getElementsByTagName("DataVirtualHardDisks"); - Element dataVirtualHardDisksSequenceElement = elements95.getLength() > 0 ? ((Element) elements95.item(0)) : null; - if (dataVirtualHardDisksSequenceElement != null) - { - for (int i12 = 0; i12 < dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").getLength(); i12 = i12 + 1) + + NodeList elements95 = roleListElement.getElementsByTagName("AvailabilitySetName"); + Element availabilitySetNameElement = elements95.getLength() > 0 ? ((Element) elements95.item(0)) : null; + if (availabilitySetNameElement != null) + { + String availabilitySetNameInstance; + availabilitySetNameInstance = availabilitySetNameElement.getTextContent(); + roleInstance.setAvailabilitySetName(availabilitySetNameInstance); + } + + NodeList elements96 = roleListElement.getElementsByTagName("DataVirtualHardDisks"); + Element dataVirtualHardDisksSequenceElement = elements96.getLength() > 0 ? ((Element) elements96.item(0)) : null; + if (dataVirtualHardDisksSequenceElement != null) + { + for (int i12 = 0; i12 < dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").getLength(); i12 = i12 + 1) + { + org.w3c.dom.Element dataVirtualHardDisksElement = ((org.w3c.dom.Element) dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").item(i12)); + DataVirtualHardDisk dataVirtualHardDiskInstance = new DataVirtualHardDisk(); + roleInstance.getDataVirtualHardDisks().add(dataVirtualHardDiskInstance); + + NodeList elements97 = dataVirtualHardDisksElement.getElementsByTagName("HostCaching"); + Element hostCachingElement = elements97.getLength() > 0 ? ((Element) elements97.item(0)) : null; + if (hostCachingElement != null && (hostCachingElement.getTextContent() != null && hostCachingElement.getTextContent().isEmpty() != true) == false) + { + VirtualHardDiskHostCaching hostCachingInstance; + hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); + dataVirtualHardDiskInstance.setHostCaching(hostCachingInstance); + } + + NodeList elements98 = dataVirtualHardDisksElement.getElementsByTagName("DiskLabel"); + Element diskLabelElement = elements98.getLength() > 0 ? ((Element) elements98.item(0)) : null; + if (diskLabelElement != null) + { + String diskLabelInstance; + diskLabelInstance = diskLabelElement.getTextContent(); + dataVirtualHardDiskInstance.setDiskLabel(diskLabelInstance); + } + + NodeList elements99 = dataVirtualHardDisksElement.getElementsByTagName("DiskName"); + Element diskNameElement = elements99.getLength() > 0 ? ((Element) elements99.item(0)) : null; + if (diskNameElement != null) + { + String diskNameInstance; + diskNameInstance = diskNameElement.getTextContent(); + dataVirtualHardDiskInstance.setDiskName(diskNameInstance); + } + + NodeList elements100 = dataVirtualHardDisksElement.getElementsByTagName("Lun"); + Element lunElement = elements100.getLength() > 0 ? ((Element) elements100.item(0)) : null; + if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + { + int lunInstance; + lunInstance = Integer.parseInt(lunElement.getTextContent()); + dataVirtualHardDiskInstance.setLogicalUnitNumber(lunInstance); + } + + NodeList elements101 = dataVirtualHardDisksElement.getElementsByTagName("LogicalDiskSizeInGB"); + Element logicalDiskSizeInGBElement = elements101.getLength() > 0 ? ((Element) elements101.item(0)) : null; + if (logicalDiskSizeInGBElement != null) + { + int logicalDiskSizeInGBInstance; + logicalDiskSizeInGBInstance = Integer.parseInt(logicalDiskSizeInGBElement.getTextContent()); + dataVirtualHardDiskInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + } + + NodeList elements102 = dataVirtualHardDisksElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement = elements102.getLength() > 0 ? ((Element) elements102.item(0)) : null; + if (mediaLinkElement != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); + dataVirtualHardDiskInstance.setMediaLink(mediaLinkInstance); + } + } + } + + NodeList elements103 = roleListElement.getElementsByTagName("Label"); + Element labelElement2 = elements103.getLength() > 0 ? ((Element) elements103.item(0)) : null; + if (labelElement2 != null) + { + String labelInstance2; + labelInstance2 = labelElement2.getTextContent(); + roleInstance.setLabel(labelInstance2); + } + + NodeList elements104 = roleListElement.getElementsByTagName("OSVirtualHardDisk"); + Element oSVirtualHardDiskElement = elements104.getLength() > 0 ? ((Element) elements104.item(0)) : null; + if (oSVirtualHardDiskElement != null) { - org.w3c.dom.Element dataVirtualHardDisksElement = ((org.w3c.dom.Element) dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").item(i12)); - DataVirtualHardDisk dataVirtualHardDiskInstance = new DataVirtualHardDisk(); - roleInstance.getDataVirtualHardDisks().add(dataVirtualHardDiskInstance); + OSVirtualHardDisk oSVirtualHardDiskInstance = new OSVirtualHardDisk(); + roleInstance.setOSVirtualHardDisk(oSVirtualHardDiskInstance); - NodeList elements96 = dataVirtualHardDisksElement.getElementsByTagName("HostCaching"); - Element hostCachingElement = elements96.getLength() > 0 ? ((Element) elements96.item(0)) : null; - if (hostCachingElement != null && (hostCachingElement.getTextContent() != null && hostCachingElement.getTextContent().isEmpty() != true) == false) + NodeList elements105 = oSVirtualHardDiskElement.getElementsByTagName("HostCaching"); + Element hostCachingElement2 = elements105.getLength() > 0 ? ((Element) elements105.item(0)) : null; + if (hostCachingElement2 != null && (hostCachingElement2.getTextContent() != null && hostCachingElement2.getTextContent().isEmpty() != true) == false) { - VirtualHardDiskHostCaching hostCachingInstance; - hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); - dataVirtualHardDiskInstance.setHostCaching(hostCachingInstance); + VirtualHardDiskHostCaching hostCachingInstance2; + hostCachingInstance2 = VirtualHardDiskHostCaching.valueOf(hostCachingElement2.getTextContent()); + oSVirtualHardDiskInstance.setHostCaching(hostCachingInstance2); } - NodeList elements97 = dataVirtualHardDisksElement.getElementsByTagName("DiskLabel"); - Element diskLabelElement = elements97.getLength() > 0 ? ((Element) elements97.item(0)) : null; - if (diskLabelElement != null) + NodeList elements106 = oSVirtualHardDiskElement.getElementsByTagName("DiskLabel"); + Element diskLabelElement2 = elements106.getLength() > 0 ? ((Element) elements106.item(0)) : null; + if (diskLabelElement2 != null) { - String diskLabelInstance; - diskLabelInstance = diskLabelElement.getTextContent(); - dataVirtualHardDiskInstance.setDiskLabel(diskLabelInstance); + String diskLabelInstance2; + diskLabelInstance2 = diskLabelElement2.getTextContent(); + oSVirtualHardDiskInstance.setDiskLabel(diskLabelInstance2); } - NodeList elements98 = dataVirtualHardDisksElement.getElementsByTagName("DiskName"); - Element diskNameElement = elements98.getLength() > 0 ? ((Element) elements98.item(0)) : null; - if (diskNameElement != null) + NodeList elements107 = oSVirtualHardDiskElement.getElementsByTagName("DiskName"); + Element diskNameElement2 = elements107.getLength() > 0 ? ((Element) elements107.item(0)) : null; + if (diskNameElement2 != null) { - String diskNameInstance; - diskNameInstance = diskNameElement.getTextContent(); - dataVirtualHardDiskInstance.setDiskName(diskNameInstance); + String diskNameInstance2; + diskNameInstance2 = diskNameElement2.getTextContent(); + oSVirtualHardDiskInstance.setDiskName(diskNameInstance2); } - NodeList elements99 = dataVirtualHardDisksElement.getElementsByTagName("Lun"); - Element lunElement = elements99.getLength() > 0 ? ((Element) elements99.item(0)) : null; - if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + NodeList elements108 = oSVirtualHardDiskElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement2 = elements108.getLength() > 0 ? ((Element) elements108.item(0)) : null; + if (mediaLinkElement2 != null) { - int lunInstance; - lunInstance = Integer.parseInt(lunElement.getTextContent()); - dataVirtualHardDiskInstance.setLogicalUnitNumber(lunInstance); + URI mediaLinkInstance2; + mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent()); + oSVirtualHardDiskInstance.setMediaLink(mediaLinkInstance2); } - NodeList elements100 = dataVirtualHardDisksElement.getElementsByTagName("LogicalDiskSizeInGB"); - Element logicalDiskSizeInGBElement = elements100.getLength() > 0 ? ((Element) elements100.item(0)) : null; - if (logicalDiskSizeInGBElement != null) + NodeList elements109 = oSVirtualHardDiskElement.getElementsByTagName("SourceImageName"); + Element sourceImageNameElement = elements109.getLength() > 0 ? ((Element) elements109.item(0)) : null; + if (sourceImageNameElement != null) { - int logicalDiskSizeInGBInstance; - logicalDiskSizeInGBInstance = Integer.parseInt(logicalDiskSizeInGBElement.getTextContent()); - dataVirtualHardDiskInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + String sourceImageNameInstance; + sourceImageNameInstance = sourceImageNameElement.getTextContent(); + oSVirtualHardDiskInstance.setSourceImageName(sourceImageNameInstance); } - NodeList elements101 = dataVirtualHardDisksElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement = elements101.getLength() > 0 ? ((Element) elements101.item(0)) : null; - if (mediaLinkElement != null) + NodeList elements110 = oSVirtualHardDiskElement.getElementsByTagName("OS"); + Element osElement = elements110.getLength() > 0 ? ((Element) elements110.item(0)) : null; + if (osElement != null) { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - dataVirtualHardDiskInstance.setMediaLink(mediaLinkInstance); + String osInstance; + osInstance = osElement.getTextContent(); + oSVirtualHardDiskInstance.setOperatingSystem(osInstance); } } - } - - NodeList elements102 = roleListElement.getElementsByTagName("Label"); - Element labelElement2 = elements102.getLength() > 0 ? ((Element) elements102.item(0)) : null; - if (labelElement2 != null) - { - String labelInstance2; - labelInstance2 = labelElement2.getTextContent(); - roleInstance.setLabel(labelInstance2); - } - - NodeList elements103 = roleListElement.getElementsByTagName("OSVirtualHardDisk"); - Element oSVirtualHardDiskElement = elements103.getLength() > 0 ? ((Element) elements103.item(0)) : null; - if (oSVirtualHardDiskElement != null) - { - OSVirtualHardDisk oSVirtualHardDiskInstance = new OSVirtualHardDisk(); - roleInstance.setOSVirtualHardDisk(oSVirtualHardDiskInstance); - - NodeList elements104 = oSVirtualHardDiskElement.getElementsByTagName("HostCaching"); - Element hostCachingElement2 = elements104.getLength() > 0 ? ((Element) elements104.item(0)) : null; - if (hostCachingElement2 != null && (hostCachingElement2.getTextContent() != null && hostCachingElement2.getTextContent().isEmpty() != true) == false) - { - VirtualHardDiskHostCaching hostCachingInstance2; - hostCachingInstance2 = VirtualHardDiskHostCaching.valueOf(hostCachingElement2.getTextContent()); - oSVirtualHardDiskInstance.setHostCaching(hostCachingInstance2); - } - NodeList elements105 = oSVirtualHardDiskElement.getElementsByTagName("DiskLabel"); - Element diskLabelElement2 = elements105.getLength() > 0 ? ((Element) elements105.item(0)) : null; - if (diskLabelElement2 != null) + NodeList elements111 = roleListElement.getElementsByTagName("RoleSize"); + Element roleSizeElement = elements111.getLength() > 0 ? ((Element) elements111.item(0)) : null; + if (roleSizeElement != null) { - String diskLabelInstance2; - diskLabelInstance2 = diskLabelElement2.getTextContent(); - oSVirtualHardDiskInstance.setDiskLabel(diskLabelInstance2); + String roleSizeInstance; + roleSizeInstance = roleSizeElement.getTextContent(); + roleInstance.setRoleSize(roleSizeInstance); } - NodeList elements106 = oSVirtualHardDiskElement.getElementsByTagName("DiskName"); - Element diskNameElement2 = elements106.getLength() > 0 ? ((Element) elements106.item(0)) : null; - if (diskNameElement2 != null) + NodeList elements112 = roleListElement.getElementsByTagName("DefaultWinRmCertificateThumbprint"); + Element defaultWinRmCertificateThumbprintElement = elements112.getLength() > 0 ? ((Element) elements112.item(0)) : null; + if (defaultWinRmCertificateThumbprintElement != null) { - String diskNameInstance2; - diskNameInstance2 = diskNameElement2.getTextContent(); - oSVirtualHardDiskInstance.setDiskName(diskNameInstance2); + String defaultWinRmCertificateThumbprintInstance; + defaultWinRmCertificateThumbprintInstance = defaultWinRmCertificateThumbprintElement.getTextContent(); + roleInstance.setDefaultWinRmCertificateThumbprint(defaultWinRmCertificateThumbprintInstance); } - - NodeList elements107 = oSVirtualHardDiskElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement2 = elements107.getLength() > 0 ? ((Element) elements107.item(0)) : null; - if (mediaLinkElement2 != null) - { - URI mediaLinkInstance2; - mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent()); - oSVirtualHardDiskInstance.setMediaLink(mediaLinkInstance2); - } - - NodeList elements108 = oSVirtualHardDiskElement.getElementsByTagName("SourceImageName"); - Element sourceImageNameElement = elements108.getLength() > 0 ? ((Element) elements108.item(0)) : null; - if (sourceImageNameElement != null) - { - String sourceImageNameInstance; - sourceImageNameInstance = sourceImageNameElement.getTextContent(); - oSVirtualHardDiskInstance.setSourceImageName(sourceImageNameInstance); - } - - NodeList elements109 = oSVirtualHardDiskElement.getElementsByTagName("OS"); - Element osElement = elements109.getLength() > 0 ? ((Element) elements109.item(0)) : null; - if (osElement != null) - { - String osInstance; - osInstance = osElement.getTextContent(); - oSVirtualHardDiskInstance.setOperatingSystem(osInstance); - } - } - - NodeList elements110 = roleListElement.getElementsByTagName("RoleSize"); - Element roleSizeElement = elements110.getLength() > 0 ? ((Element) elements110.item(0)) : null; - if (roleSizeElement != null && (roleSizeElement.getTextContent() != null && roleSizeElement.getTextContent().isEmpty() != true) == false) - { - VirtualMachineRoleSize roleSizeInstance; - roleSizeInstance = VirtualMachineRoleSize.valueOf(roleSizeElement.getTextContent()); - roleInstance.setRoleSize(roleSizeInstance); - } - - NodeList elements111 = roleListElement.getElementsByTagName("DefaultWinRmCertificateThumbprint"); - Element defaultWinRmCertificateThumbprintElement = elements111.getLength() > 0 ? ((Element) elements111.item(0)) : null; - if (defaultWinRmCertificateThumbprintElement != null) - { - String defaultWinRmCertificateThumbprintInstance; - defaultWinRmCertificateThumbprintInstance = defaultWinRmCertificateThumbprintElement.getTextContent(); - roleInstance.setDefaultWinRmCertificateThumbprint(defaultWinRmCertificateThumbprintInstance); } } - } - - NodeList elements112 = deploymentElement.getElementsByTagName("SdkVersion"); - Element sdkVersionElement = elements112.getLength() > 0 ? ((Element) elements112.item(0)) : null; - if (sdkVersionElement != null) - { - String sdkVersionInstance; - sdkVersionInstance = sdkVersionElement.getTextContent(); - result.setSdkVersion(sdkVersionInstance); - } - - NodeList elements113 = deploymentElement.getElementsByTagName("Locked"); - Element lockedElement = elements113.getLength() > 0 ? ((Element) elements113.item(0)) : null; - if (lockedElement != null) - { - boolean lockedInstance; - lockedInstance = Boolean.parseBoolean(lockedElement.getTextContent()); - result.setLocked(lockedInstance); - } - - NodeList elements114 = deploymentElement.getElementsByTagName("RollbackAllowed"); - Element rollbackAllowedElement = elements114.getLength() > 0 ? ((Element) elements114.item(0)) : null; - if (rollbackAllowedElement != null) - { - String rollbackAllowedInstance; - rollbackAllowedInstance = rollbackAllowedElement.getTextContent(); - result.setRollbackAllowed(rollbackAllowedInstance); - } - - NodeList elements115 = deploymentElement.getElementsByTagName("CreatedTime"); - Element createdTimeElement = elements115.getLength() > 0 ? ((Element) elements115.item(0)) : null; - if (createdTimeElement != null) - { - Calendar createdTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(createdTimeElement.getTextContent())); - createdTimeInstance = calendar; - result.setCreatedTime(createdTimeInstance); - } - - NodeList elements116 = deploymentElement.getElementsByTagName("LastModifiedTime"); - Element lastModifiedTimeElement = elements116.getLength() > 0 ? ((Element) elements116.item(0)) : null; - if (lastModifiedTimeElement != null) - { - Calendar lastModifiedTimeInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(lastModifiedTimeElement.getTextContent())); - lastModifiedTimeInstance = calendar2; - result.setLastModifiedTime(lastModifiedTimeInstance); - } - - NodeList elements117 = deploymentElement.getElementsByTagName("VirtualNetworkName"); - Element virtualNetworkNameElement = elements117.getLength() > 0 ? ((Element) elements117.item(0)) : null; - if (virtualNetworkNameElement != null) - { - String virtualNetworkNameInstance; - virtualNetworkNameInstance = virtualNetworkNameElement.getTextContent(); - result.setVirtualNetworkName(virtualNetworkNameInstance); - } - - NodeList elements118 = deploymentElement.getElementsByTagName("ExtendedProperties"); - Element extendedPropertiesSequenceElement = elements118.getLength() > 0 ? ((Element) elements118.item(0)) : null; - if (extendedPropertiesSequenceElement != null) - { - for (int i13 = 0; i13 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i13 = i13 + 1) + + NodeList elements113 = deploymentElement.getElementsByTagName("SdkVersion"); + Element sdkVersionElement = elements113.getLength() > 0 ? ((Element) elements113.item(0)) : null; + if (sdkVersionElement != null) { - org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i13)); - NodeList elements119 = extendedPropertiesElement.getElementsByTagName("Name"); - String extendedPropertiesKey = elements119.getLength() > 0 ? ((org.w3c.dom.Element) elements119.item(0)).getTextContent() : null; - NodeList elements120 = extendedPropertiesElement.getElementsByTagName("Value"); - String extendedPropertiesValue = elements120.getLength() > 0 ? ((org.w3c.dom.Element) elements120.item(0)).getTextContent() : null; - result.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + String sdkVersionInstance; + sdkVersionInstance = sdkVersionElement.getTextContent(); + result.setSdkVersion(sdkVersionInstance); } - } - - NodeList elements121 = deploymentElement.getElementsByTagName("PersistentVMDowntime"); - Element persistentVMDowntimeElement = elements121.getLength() > 0 ? ((Element) elements121.item(0)) : null; - if (persistentVMDowntimeElement != null) - { - PersistentVMDowntime persistentVMDowntimeInstance = new PersistentVMDowntime(); - result.setPersistentVMDowntime(persistentVMDowntimeInstance); - NodeList elements122 = persistentVMDowntimeElement.getElementsByTagName("StartTime"); - Element startTimeElement = elements122.getLength() > 0 ? ((Element) elements122.item(0)) : null; - if (startTimeElement != null) + NodeList elements114 = deploymentElement.getElementsByTagName("Locked"); + Element lockedElement = elements114.getLength() > 0 ? ((Element) elements114.item(0)) : null; + if (lockedElement != null) { - Calendar startTimeInstance; - SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar3 = Calendar.getInstance(); - calendar3.setTime(simpleDateFormat3.parse(startTimeElement.getTextContent())); - startTimeInstance = calendar3; - persistentVMDowntimeInstance.setStartTime(startTimeInstance); + boolean lockedInstance; + lockedInstance = Boolean.parseBoolean(lockedElement.getTextContent()); + result.setLocked(lockedInstance); } - NodeList elements123 = persistentVMDowntimeElement.getElementsByTagName("EndTime"); - Element endTimeElement = elements123.getLength() > 0 ? ((Element) elements123.item(0)) : null; - if (endTimeElement != null) + NodeList elements115 = deploymentElement.getElementsByTagName("RollbackAllowed"); + Element rollbackAllowedElement = elements115.getLength() > 0 ? ((Element) elements115.item(0)) : null; + if (rollbackAllowedElement != null) { - Calendar endTimeInstance; - SimpleDateFormat simpleDateFormat4 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar4 = Calendar.getInstance(); - calendar4.setTime(simpleDateFormat4.parse(endTimeElement.getTextContent())); - endTimeInstance = calendar4; - persistentVMDowntimeInstance.setEndTime(endTimeInstance); + String rollbackAllowedInstance; + rollbackAllowedInstance = rollbackAllowedElement.getTextContent(); + result.setRollbackAllowed(rollbackAllowedInstance); } - NodeList elements124 = persistentVMDowntimeElement.getElementsByTagName("Status"); - Element statusElement2 = elements124.getLength() > 0 ? ((Element) elements124.item(0)) : null; - if (statusElement2 != null) + NodeList elements116 = deploymentElement.getElementsByTagName("CreatedTime"); + Element createdTimeElement = elements116.getLength() > 0 ? ((Element) elements116.item(0)) : null; + if (createdTimeElement != null) { - String statusInstance2; - statusInstance2 = statusElement2.getTextContent(); - persistentVMDowntimeInstance.setStatus(statusInstance2); + Calendar createdTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(createdTimeElement.getTextContent())); + createdTimeInstance = calendar; + result.setCreatedTime(createdTimeInstance); } - } - - NodeList elements125 = deploymentElement.getElementsByTagName("VirtualIPs"); - Element virtualIPsSequenceElement = elements125.getLength() > 0 ? ((Element) elements125.item(0)) : null; - if (virtualIPsSequenceElement != null) - { - for (int i14 = 0; i14 < virtualIPsSequenceElement.getElementsByTagName("VirtualIP").getLength(); i14 = i14 + 1) + + NodeList elements117 = deploymentElement.getElementsByTagName("LastModifiedTime"); + Element lastModifiedTimeElement = elements117.getLength() > 0 ? ((Element) elements117.item(0)) : null; + if (lastModifiedTimeElement != null) + { + Calendar lastModifiedTimeInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(lastModifiedTimeElement.getTextContent())); + lastModifiedTimeInstance = calendar2; + result.setLastModifiedTime(lastModifiedTimeInstance); + } + + NodeList elements118 = deploymentElement.getElementsByTagName("VirtualNetworkName"); + Element virtualNetworkNameElement = elements118.getLength() > 0 ? ((Element) elements118.item(0)) : null; + if (virtualNetworkNameElement != null) + { + String virtualNetworkNameInstance; + virtualNetworkNameInstance = virtualNetworkNameElement.getTextContent(); + result.setVirtualNetworkName(virtualNetworkNameInstance); + } + + NodeList elements119 = deploymentElement.getElementsByTagName("ExtendedProperties"); + Element extendedPropertiesSequenceElement = elements119.getLength() > 0 ? ((Element) elements119.item(0)) : null; + if (extendedPropertiesSequenceElement != null) + { + for (int i13 = 0; i13 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i13 = i13 + 1) + { + org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i13)); + NodeList elements120 = extendedPropertiesElement.getElementsByTagName("Name"); + String extendedPropertiesKey = elements120.getLength() > 0 ? ((org.w3c.dom.Element) elements120.item(0)).getTextContent() : null; + NodeList elements121 = extendedPropertiesElement.getElementsByTagName("Value"); + String extendedPropertiesValue = elements121.getLength() > 0 ? ((org.w3c.dom.Element) elements121.item(0)).getTextContent() : null; + result.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + } + } + + NodeList elements122 = deploymentElement.getElementsByTagName("PersistentVMDowntime"); + Element persistentVMDowntimeElement = elements122.getLength() > 0 ? ((Element) elements122.item(0)) : null; + if (persistentVMDowntimeElement != null) { - org.w3c.dom.Element virtualIPsElement = ((org.w3c.dom.Element) virtualIPsSequenceElement.getElementsByTagName("VirtualIP").item(i14)); - VirtualIPAddress virtualIPInstance = new VirtualIPAddress(); - result.getVirtualIPAddresses().add(virtualIPInstance); + PersistentVMDowntime persistentVMDowntimeInstance = new PersistentVMDowntime(); + result.setPersistentVMDowntime(persistentVMDowntimeInstance); - NodeList elements126 = virtualIPsElement.getElementsByTagName("Address"); - Element addressElement = elements126.getLength() > 0 ? ((Element) elements126.item(0)) : null; - if (addressElement != null) + NodeList elements123 = persistentVMDowntimeElement.getElementsByTagName("StartTime"); + Element startTimeElement = elements123.getLength() > 0 ? ((Element) elements123.item(0)) : null; + if (startTimeElement != null) { - InetAddress addressInstance; - addressInstance = InetAddress.getByName(addressElement.getTextContent()); - virtualIPInstance.setAddress(addressInstance); + Calendar startTimeInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(startTimeElement.getTextContent())); + startTimeInstance = calendar3; + persistentVMDowntimeInstance.setStartTime(startTimeInstance); } - NodeList elements127 = virtualIPsElement.getElementsByTagName("Name"); - Element nameElement4 = elements127.getLength() > 0 ? ((Element) elements127.item(0)) : null; - if (nameElement4 != null) + NodeList elements124 = persistentVMDowntimeElement.getElementsByTagName("EndTime"); + Element endTimeElement = elements124.getLength() > 0 ? ((Element) elements124.item(0)) : null; + if (endTimeElement != null) { - String nameInstance4; - nameInstance4 = nameElement4.getTextContent(); - virtualIPInstance.setName(nameInstance4); + Calendar endTimeInstance; + SimpleDateFormat simpleDateFormat4 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar4 = Calendar.getInstance(); + calendar4.setTime(simpleDateFormat4.parse(endTimeElement.getTextContent())); + endTimeInstance = calendar4; + persistentVMDowntimeInstance.setEndTime(endTimeInstance); } - NodeList elements128 = virtualIPsElement.getElementsByTagName("IsDnsProgrammed"); - Element isDnsProgrammedElement = elements128.getLength() > 0 ? ((Element) elements128.item(0)) : null; - if (isDnsProgrammedElement != null && (isDnsProgrammedElement.getTextContent() != null && isDnsProgrammedElement.getTextContent().isEmpty() != true) == false) + NodeList elements125 = persistentVMDowntimeElement.getElementsByTagName("Status"); + Element statusElement2 = elements125.getLength() > 0 ? ((Element) elements125.item(0)) : null; + if (statusElement2 != null) { - boolean isDnsProgrammedInstance; - isDnsProgrammedInstance = Boolean.parseBoolean(isDnsProgrammedElement.getTextContent()); - virtualIPInstance.setIsDnsProgrammed(isDnsProgrammedInstance); + String statusInstance2; + statusInstance2 = statusElement2.getTextContent(); + persistentVMDowntimeInstance.setStatus(statusInstance2); } } - } - - NodeList elements129 = deploymentElement.getElementsByTagName("ReservedIPName"); - Element reservedIPNameElement = elements129.getLength() > 0 ? ((Element) elements129.item(0)) : null; - if (reservedIPNameElement != null) - { - String reservedIPNameInstance; - reservedIPNameInstance = reservedIPNameElement.getTextContent(); - result.setReservedIPName(reservedIPNameInstance); - } - - NodeList elements130 = deploymentElement.getElementsByTagName("Dns"); - Element dnsElement = elements130.getLength() > 0 ? ((Element) elements130.item(0)) : null; - if (dnsElement != null) - { - DnsSettings dnsInstance = new DnsSettings(); - result.setDnsSettings(dnsInstance); - NodeList elements131 = dnsElement.getElementsByTagName("DnsServers"); - Element dnsServersSequenceElement = elements131.getLength() > 0 ? ((Element) elements131.item(0)) : null; - if (dnsServersSequenceElement != null) + NodeList elements126 = deploymentElement.getElementsByTagName("VirtualIPs"); + Element virtualIPsSequenceElement = elements126.getLength() > 0 ? ((Element) elements126.item(0)) : null; + if (virtualIPsSequenceElement != null) { - for (int i15 = 0; i15 < dnsServersSequenceElement.getElementsByTagName("DnsServer").getLength(); i15 = i15 + 1) + for (int i14 = 0; i14 < virtualIPsSequenceElement.getElementsByTagName("VirtualIP").getLength(); i14 = i14 + 1) { - org.w3c.dom.Element dnsServersElement = ((org.w3c.dom.Element) dnsServersSequenceElement.getElementsByTagName("DnsServer").item(i15)); - DnsServer dnsServerInstance = new DnsServer(); - dnsInstance.getDnsServers().add(dnsServerInstance); + org.w3c.dom.Element virtualIPsElement = ((org.w3c.dom.Element) virtualIPsSequenceElement.getElementsByTagName("VirtualIP").item(i14)); + VirtualIPAddress virtualIPInstance = new VirtualIPAddress(); + result.getVirtualIPAddresses().add(virtualIPInstance); + + NodeList elements127 = virtualIPsElement.getElementsByTagName("Address"); + Element addressElement = elements127.getLength() > 0 ? ((Element) elements127.item(0)) : null; + if (addressElement != null) + { + InetAddress addressInstance; + addressInstance = InetAddress.getByName(addressElement.getTextContent()); + virtualIPInstance.setAddress(addressInstance); + } - NodeList elements132 = dnsServersElement.getElementsByTagName("Name"); - Element nameElement5 = elements132.getLength() > 0 ? ((Element) elements132.item(0)) : null; - if (nameElement5 != null) + NodeList elements128 = virtualIPsElement.getElementsByTagName("Name"); + Element nameElement4 = elements128.getLength() > 0 ? ((Element) elements128.item(0)) : null; + if (nameElement4 != null) { - String nameInstance5; - nameInstance5 = nameElement5.getTextContent(); - dnsServerInstance.setName(nameInstance5); + String nameInstance4; + nameInstance4 = nameElement4.getTextContent(); + virtualIPInstance.setName(nameInstance4); } - NodeList elements133 = dnsServersElement.getElementsByTagName("Address"); - Element addressElement2 = elements133.getLength() > 0 ? ((Element) elements133.item(0)) : null; - if (addressElement2 != null) + NodeList elements129 = virtualIPsElement.getElementsByTagName("IsDnsProgrammed"); + Element isDnsProgrammedElement = elements129.getLength() > 0 ? ((Element) elements129.item(0)) : null; + if (isDnsProgrammedElement != null && (isDnsProgrammedElement.getTextContent() != null && isDnsProgrammedElement.getTextContent().isEmpty() != true) == false) { - InetAddress addressInstance2; - addressInstance2 = InetAddress.getByName(addressElement2.getTextContent()); - dnsServerInstance.setAddress(addressInstance2); + boolean isDnsProgrammedInstance; + isDnsProgrammedInstance = Boolean.parseBoolean(isDnsProgrammedElement.getTextContent()); + virtualIPInstance.setIsDnsProgrammed(isDnsProgrammedInstance); } } } - } - - NodeList elements134 = deploymentElement.getElementsByTagName("ExtensionConfiguration"); - Element extensionConfigurationElement = elements134.getLength() > 0 ? ((Element) elements134.item(0)) : null; - if (extensionConfigurationElement != null) - { - ExtensionConfiguration extensionConfigurationInstance = new ExtensionConfiguration(); - result.setExtensionConfiguration(extensionConfigurationInstance); - NodeList elements135 = extensionConfigurationElement.getElementsByTagName("AllRoles"); - Element allRolesSequenceElement = elements135.getLength() > 0 ? ((Element) elements135.item(0)) : null; - if (allRolesSequenceElement != null) + NodeList elements130 = deploymentElement.getElementsByTagName("ReservedIPName"); + Element reservedIPNameElement = elements130.getLength() > 0 ? ((Element) elements130.item(0)) : null; + if (reservedIPNameElement != null) + { + String reservedIPNameInstance; + reservedIPNameInstance = reservedIPNameElement.getTextContent(); + result.setReservedIPName(reservedIPNameInstance); + } + + NodeList elements131 = deploymentElement.getElementsByTagName("Dns"); + Element dnsElement = elements131.getLength() > 0 ? ((Element) elements131.item(0)) : null; + if (dnsElement != null) { - for (int i16 = 0; i16 < allRolesSequenceElement.getElementsByTagName("Extension").getLength(); i16 = i16 + 1) + DnsSettings dnsInstance = new DnsSettings(); + result.setDnsSettings(dnsInstance); + + NodeList elements132 = dnsElement.getElementsByTagName("DnsServers"); + Element dnsServersSequenceElement = elements132.getLength() > 0 ? ((Element) elements132.item(0)) : null; + if (dnsServersSequenceElement != null) { - org.w3c.dom.Element allRolesElement = ((org.w3c.dom.Element) allRolesSequenceElement.getElementsByTagName("Extension").item(i16)); - ExtensionConfiguration.Extension extensionInstance = new ExtensionConfiguration.Extension(); - extensionConfigurationInstance.getAllRoles().add(extensionInstance); - - NodeList elements136 = allRolesElement.getElementsByTagName("Id"); - Element idElement = elements136.getLength() > 0 ? ((Element) elements136.item(0)) : null; - if (idElement != null) + for (int i15 = 0; i15 < dnsServersSequenceElement.getElementsByTagName("DnsServer").getLength(); i15 = i15 + 1) { - String idInstance; - idInstance = idElement.getTextContent(); - extensionInstance.setId(idInstance); + org.w3c.dom.Element dnsServersElement = ((org.w3c.dom.Element) dnsServersSequenceElement.getElementsByTagName("DnsServer").item(i15)); + DnsServer dnsServerInstance = new DnsServer(); + dnsInstance.getDnsServers().add(dnsServerInstance); + + NodeList elements133 = dnsServersElement.getElementsByTagName("Name"); + Element nameElement5 = elements133.getLength() > 0 ? ((Element) elements133.item(0)) : null; + if (nameElement5 != null) + { + String nameInstance5; + nameInstance5 = nameElement5.getTextContent(); + dnsServerInstance.setName(nameInstance5); + } + + NodeList elements134 = dnsServersElement.getElementsByTagName("Address"); + Element addressElement2 = elements134.getLength() > 0 ? ((Element) elements134.item(0)) : null; + if (addressElement2 != null) + { + InetAddress addressInstance2; + addressInstance2 = InetAddress.getByName(addressElement2.getTextContent()); + dnsServerInstance.setAddress(addressInstance2); + } } } } - NodeList elements137 = extensionConfigurationElement.getElementsByTagName("NamedRoles"); - Element namedRolesSequenceElement = elements137.getLength() > 0 ? ((Element) elements137.item(0)) : null; - if (namedRolesSequenceElement != null) + NodeList elements135 = deploymentElement.getElementsByTagName("ExtensionConfiguration"); + Element extensionConfigurationElement = elements135.getLength() > 0 ? ((Element) elements135.item(0)) : null; + if (extensionConfigurationElement != null) { - for (int i17 = 0; i17 < namedRolesSequenceElement.getElementsByTagName("Role").getLength(); i17 = i17 + 1) + ExtensionConfiguration extensionConfigurationInstance = new ExtensionConfiguration(); + result.setExtensionConfiguration(extensionConfigurationInstance); + + NodeList elements136 = extensionConfigurationElement.getElementsByTagName("AllRoles"); + Element allRolesSequenceElement = elements136.getLength() > 0 ? ((Element) elements136.item(0)) : null; + if (allRolesSequenceElement != null) { - org.w3c.dom.Element namedRolesElement = ((org.w3c.dom.Element) namedRolesSequenceElement.getElementsByTagName("Role").item(i17)); - ExtensionConfiguration.NamedRole roleInstance2 = new ExtensionConfiguration.NamedRole(); - extensionConfigurationInstance.getNamedRoles().add(roleInstance2); - - NodeList elements138 = namedRolesElement.getElementsByTagName("RoleName"); - Element roleNameElement3 = elements138.getLength() > 0 ? ((Element) elements138.item(0)) : null; - if (roleNameElement3 != null) + for (int i16 = 0; i16 < allRolesSequenceElement.getElementsByTagName("Extension").getLength(); i16 = i16 + 1) { - String roleNameInstance3; - roleNameInstance3 = roleNameElement3.getTextContent(); - roleInstance2.setRoleName(roleNameInstance3); + org.w3c.dom.Element allRolesElement = ((org.w3c.dom.Element) allRolesSequenceElement.getElementsByTagName("Extension").item(i16)); + ExtensionConfiguration.Extension extensionInstance = new ExtensionConfiguration.Extension(); + extensionConfigurationInstance.getAllRoles().add(extensionInstance); + + NodeList elements137 = allRolesElement.getElementsByTagName("Id"); + Element idElement = elements137.getLength() > 0 ? ((Element) elements137.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + extensionInstance.setId(idInstance); + } } - - NodeList elements139 = namedRolesElement.getElementsByTagName("Extensions"); - Element extensionsSequenceElement = elements139.getLength() > 0 ? ((Element) elements139.item(0)) : null; - if (extensionsSequenceElement != null) + } + + NodeList elements138 = extensionConfigurationElement.getElementsByTagName("NamedRoles"); + Element namedRolesSequenceElement = elements138.getLength() > 0 ? ((Element) elements138.item(0)) : null; + if (namedRolesSequenceElement != null) + { + for (int i17 = 0; i17 < namedRolesSequenceElement.getElementsByTagName("Role").getLength(); i17 = i17 + 1) { - for (int i18 = 0; i18 < extensionsSequenceElement.getElementsByTagName("Extension").getLength(); i18 = i18 + 1) + org.w3c.dom.Element namedRolesElement = ((org.w3c.dom.Element) namedRolesSequenceElement.getElementsByTagName("Role").item(i17)); + ExtensionConfiguration.NamedRole roleInstance2 = new ExtensionConfiguration.NamedRole(); + extensionConfigurationInstance.getNamedRoles().add(roleInstance2); + + NodeList elements139 = namedRolesElement.getElementsByTagName("RoleName"); + Element roleNameElement3 = elements139.getLength() > 0 ? ((Element) elements139.item(0)) : null; + if (roleNameElement3 != null) { - org.w3c.dom.Element extensionsElement = ((org.w3c.dom.Element) extensionsSequenceElement.getElementsByTagName("Extension").item(i18)); - ExtensionConfiguration.Extension extensionInstance2 = new ExtensionConfiguration.Extension(); - roleInstance2.getExtensions().add(extensionInstance2); - - NodeList elements140 = extensionsElement.getElementsByTagName("Id"); - Element idElement2 = elements140.getLength() > 0 ? ((Element) elements140.item(0)) : null; - if (idElement2 != null) + String roleNameInstance3; + roleNameInstance3 = roleNameElement3.getTextContent(); + roleInstance2.setRoleName(roleNameInstance3); + } + + NodeList elements140 = namedRolesElement.getElementsByTagName("Extensions"); + Element extensionsSequenceElement = elements140.getLength() > 0 ? ((Element) elements140.item(0)) : null; + if (extensionsSequenceElement != null) + { + for (int i18 = 0; i18 < extensionsSequenceElement.getElementsByTagName("Extension").getLength(); i18 = i18 + 1) { - String idInstance2; - idInstance2 = idElement2.getTextContent(); - extensionInstance2.setId(idInstance2); + org.w3c.dom.Element extensionsElement = ((org.w3c.dom.Element) extensionsSequenceElement.getElementsByTagName("Extension").item(i18)); + ExtensionConfiguration.Extension extensionInstance2 = new ExtensionConfiguration.Extension(); + roleInstance2.getExtensions().add(extensionInstance2); + + NodeList elements141 = extensionsElement.getElementsByTagName("Id"); + Element idElement2 = elements141.getLength() > 0 ? ((Element) elements141.item(0)) : null; + if (idElement2 != null) + { + String idInstance2; + idInstance2 = idElement2.getTextContent(); + extensionInstance2.setId(idInstance2); + } } } } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -6676,6 +7086,10 @@ public OperationResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Get Package operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -6714,11 +7128,7 @@ public OperationResponse getPackageByName(String serviceName, String deploymentN } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/package?containerUri=" + parameters.getContainerUri() + " +"; - if (parameters.getOverwriteExisting() != null) - { - url = url + "&overwriteExisting=" + URLEncoder.encode(Boolean.toString(parameters.getOverwriteExisting()).toLowerCase(), "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/package?containerUri=" + parameters.getContainerUri() + " +&overwriteExisting=" + parameters.isOverwriteExisting(); // Create HTTP transport objects HttpGet httpRequest = new HttpGet(url); @@ -6728,40 +7138,50 @@ public OperationResponse getPackageByName(String serviceName, String deploymentN // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -6809,6 +7229,10 @@ public OperationResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Get Package operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -6843,11 +7267,7 @@ public OperationResponse getPackageBySlot(String serviceName, DeploymentSlot dep } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deploymentslots/" + deploymentSlot + "/package?containerUri=" + parameters.getContainerUri() + " +"; - if (parameters.getOverwriteExisting() != null) - { - url = url + "&overwriteExisting=" + URLEncoder.encode(Boolean.toString(parameters.getOverwriteExisting()).toLowerCase(), "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deploymentslots/" + deploymentSlot + "/package?containerUri=" + parameters.getContainerUri() + " +&overwriteExisting=" + parameters.isOverwriteExisting(); // Create HTTP transport objects HttpGet httpRequest = new HttpGet(url); @@ -6857,40 +7277,50 @@ public OperationResponse getPackageBySlot(String serviceName, DeploymentSlot dep // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -6941,6 +7371,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param roleInstanceName The name of your role instance. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -7071,6 +7513,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param roleInstanceName The name of your role instance. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -7201,6 +7655,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentName The name of your deployment. * @param roleInstanceName The name of your role instance. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -7331,6 +7797,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The name of the cloud service. * @param deploymentSlot The deployment slot. * @param roleInstanceName The name of your role instance. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -7460,11 +7938,21 @@ public OperationResponse call() throws Exception * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Rollback Update Or Upgrade * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse rollbackUpdateOrUpgradeByDeploymentName(String serviceName, String deploymentName, DeploymentRollbackUpdateOrUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse rollbackUpdateOrUpgradeByDeploymentName(String serviceName, String deploymentName, DeploymentRollbackUpdateOrUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -7518,7 +8006,7 @@ public OperationResponse rollbackUpdateOrUpgradeByDeploymentName(String serviceN rollbackUpdateOrUpgradeElement.appendChild(modeElement); Element forceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Force"); - forceElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getForce()).toLowerCase())); + forceElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.isForce()).toLowerCase())); rollbackUpdateOrUpgradeElement.appendChild(forceElement); DOMSource domSource = new DOMSource(requestDoc); @@ -7534,40 +8022,50 @@ public OperationResponse rollbackUpdateOrUpgradeByDeploymentName(String serviceN // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -7617,11 +8115,21 @@ public OperationResponse call() throws Exception * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Rollback Update Or Upgrade * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse rollbackUpdateOrUpgradeByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentRollbackUpdateOrUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse rollbackUpdateOrUpgradeByDeploymentSlot(String serviceName, DeploymentSlot deploymentSlot, DeploymentRollbackUpdateOrUpgradeParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -7671,7 +8179,7 @@ public OperationResponse rollbackUpdateOrUpgradeByDeploymentSlot(String serviceN rollbackUpdateOrUpgradeElement.appendChild(modeElement); Element forceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Force"); - forceElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getForce()).toLowerCase())); + forceElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.isForce()).toLowerCase())); rollbackUpdateOrUpgradeElement.appendChild(forceElement); DOMSource domSource = new DOMSource(requestDoc); @@ -7687,40 +8195,50 @@ public OperationResponse rollbackUpdateOrUpgradeByDeploymentSlot(String serviceN // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -7771,6 +8289,18 @@ public ComputeOperationStatusResponse call() throws Exception * * @param serviceName The cloud service to swap deployments for. * @param parameters Parameters supplied to the Swap Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -7904,6 +8434,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Update Deployment Status * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -8038,6 +8580,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Update Deployment Status * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -8210,6 +8764,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The cloud service to upgrade. * @param deploymentName The deployment to upgrade. * @param parameters Parameters supplied to the Upgrade Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -8382,6 +8948,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The cloud service to upgrade. * @param deploymentSlot The slot to upgrade. * @param parameters Parameters supplied to the Upgrade Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -8554,6 +9132,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Walk Upgrade Domain * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -8726,6 +9316,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentSlot The deployment slot. * @param parameters Parameters supplied to the Walk Upgrade Domain * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/HostedServiceOperations.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/HostedServiceOperations.java index 5aae7298d45a9..8ecb6da405a15 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/HostedServiceOperations.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/HostedServiceOperations.java @@ -37,13 +37,11 @@ import com.microsoft.windowsazure.management.compute.models.HostedServiceListResponse; import com.microsoft.windowsazure.management.compute.models.HostedServiceUpdateParameters; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -67,6 +65,18 @@ public interface HostedServiceOperations * * @param serviceName The name of the cloud service. * @param parameters Parameters supplied to the Add Extension operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -115,10 +125,20 @@ public interface HostedServiceOperations * * @param serviceName The name of the cloud service. * @param parameters Parameters supplied to the Add Extension operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginAddingExtension(String serviceName, HostedServiceAddExtensionParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginAddingExtension(String serviceName, HostedServiceAddExtensionParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Add Extension operation adds an available extension to your cloud @@ -144,6 +164,10 @@ public interface HostedServiceOperations * more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -170,6 +194,10 @@ public interface HostedServiceOperations * @param serviceName The name of the cloud service. * @param extensionId The identifier that was assigned to the extension when * it was added to the cloud service + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -196,6 +224,14 @@ public interface HostedServiceOperations * more information) * * @param serviceName The cloud service name that you would like to use. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Check Hosted Service Name Availability operation response. */ HostedServiceCheckNameAvailabilityResponse checkNameAvailability(String serviceName) throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -219,10 +255,33 @@ public interface HostedServiceOperations * * @param parameters Parameters supplied to the Create Hosted Service * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse create(HostedServiceCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, ServiceException, URISyntaxException, ParseException; + OperationResponse create(HostedServiceCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerException, ServiceException, URISyntaxException, ParseException; /** * The Create Hosted Service operation creates a new cloud service in @@ -244,6 +303,20 @@ public interface HostedServiceOperations * more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return A standard service response including an HTTP status code and * request ID. */ @@ -268,6 +341,18 @@ public interface HostedServiceOperations * more information) * * @param serviceName The name of the cloud service. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -308,6 +393,18 @@ public interface HostedServiceOperations * @param serviceName The name of the cloud service. * @param extensionId The identifier that was assigned to the extension when * it was added to the cloud service + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -350,6 +447,18 @@ public interface HostedServiceOperations * for more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Hosted Service operation response. */ HostedServiceGetResponse get(String serviceName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -377,6 +486,18 @@ public interface HostedServiceOperations * more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The detailed Get Hosted Service operation response. */ HostedServiceGetDetailedResponse getDetailed(String serviceName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -404,6 +525,14 @@ public interface HostedServiceOperations * @param serviceName The name of the cloud service. * @param extensionId The identifier that was assigned to the extension when * it was added to the cloud service + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Get Extension operation response. */ HostedServiceGetExtensionResponse getExtension(String serviceName, String extensionId) throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -427,6 +556,18 @@ public interface HostedServiceOperations * http://msdn.microsoft.com/en-us/library/windowsazure/ee460781.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Hosted Service operation response. */ HostedServiceListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -450,6 +591,14 @@ public interface HostedServiceOperations * http://msdn.microsoft.com/en-us/library/windowsazure/dn169559.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Available Extensions operation response. */ HostedServiceListAvailableExtensionsResponse listAvailableExtensions() throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -474,6 +623,14 @@ public interface HostedServiceOperations * more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Extensions operation response. */ HostedServiceListExtensionsResponse listExtensions(String serviceName) throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -498,10 +655,34 @@ public interface HostedServiceOperations * @param serviceName The name of the cloud service. * @param parameters Parameters supplied to the Update Hosted Service * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse update(String serviceName, HostedServiceUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException; + OperationResponse update(String serviceName, HostedServiceUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException; /** * The Update Hosted Service operation can update the label or description diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/HostedServiceOperationsImpl.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/HostedServiceOperationsImpl.java index c6cb449e1717a..b8232dea344ee 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/HostedServiceOperationsImpl.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/HostedServiceOperationsImpl.java @@ -71,7 +71,6 @@ import com.microsoft.windowsazure.management.compute.models.UpgradeStatus; import com.microsoft.windowsazure.management.compute.models.VirtualHardDiskHostCaching; import com.microsoft.windowsazure.management.compute.models.VirtualIPAddress; -import com.microsoft.windowsazure.management.compute.models.VirtualMachineRoleSize; import com.microsoft.windowsazure.management.compute.models.VirtualMachineWindowsRemoteManagementListenerType; import com.microsoft.windowsazure.management.compute.models.WindowsRemoteManagementListener; import com.microsoft.windowsazure.management.compute.models.WindowsRemoteManagementSettings; @@ -80,7 +79,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; @@ -96,7 +94,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -136,6 +133,7 @@ public class HostedServiceOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -485,6 +515,10 @@ public OperationResponse call() throws Exception * more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -519,40 +553,50 @@ public OperationResponse beginDeletingAll(String serviceName) throws IOException // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -588,6 +632,10 @@ public OperationResponse call() throws Exception * @param serviceName The name of the cloud service. * @param extensionId The identifier that was assigned to the extension when * it was added to the cloud service + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -628,40 +676,50 @@ public OperationResponse beginDeletingExtension(String serviceName, String exten // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -692,6 +750,14 @@ public HostedServiceCheckNameAvailabilityResponse call() throws Exception * more information) * * @param serviceName The cloud service name that you would like to use. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Check Hosted Service Name Availability operation response. */ @Override @@ -726,69 +792,79 @@ public HostedServiceCheckNameAvailabilityResponse checkNameAvailability(String s // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - HostedServiceCheckNameAvailabilityResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new HostedServiceCheckNameAvailabilityResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("AvailabilityResponse"); - Element availabilityResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (availabilityResponseElement != null) - { - NodeList elements2 = availabilityResponseElement.getElementsByTagName("Result"); - Element resultElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (resultElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + HostedServiceCheckNameAvailabilityResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new HostedServiceCheckNameAvailabilityResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("AvailabilityResponse"); + Element availabilityResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (availabilityResponseElement != null) + { + NodeList elements2 = availabilityResponseElement.getElementsByTagName("Result"); + Element resultElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (resultElement != null) + { + boolean resultInstance; + resultInstance = Boolean.parseBoolean(resultElement.getTextContent()); + result.setIsAvailable(resultInstance); + } + + NodeList elements3 = availabilityResponseElement.getElementsByTagName("Reason"); + Element reasonElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (reasonElement != null) + { + String reasonInstance; + reasonInstance = reasonElement.getTextContent(); + result.setReason(reasonInstance); + } + } + + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - boolean resultInstance; - resultInstance = Boolean.parseBoolean(resultElement.getTextContent()); - result.setIsAvailable(resultInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements3 = availabilityResponseElement.getElementsByTagName("Reason"); - Element reasonElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (reasonElement != null) + if (shouldTrace) { - String reasonInstance; - reasonInstance = reasonElement.getTextContent(); - result.setReason(reasonInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -822,11 +898,34 @@ public OperationResponse call() throws Exception * * @param parameters Parameters supplied to the Create Hosted Service * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse create(HostedServiceCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, ServiceException, URISyntaxException, ParseException + public OperationResponse create(HostedServiceCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerException, ServiceException, URISyntaxException, ParseException { // Validate if (parameters == null) @@ -945,40 +1044,50 @@ public OperationResponse create(HostedServiceCreateParameters parameters) throws // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_CREATED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_CREATED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1010,6 +1119,20 @@ public OperationResponse call() throws Exception * more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1044,40 +1167,50 @@ public OperationResponse delete(String serviceName) throws IOException, ServiceE // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1116,6 +1249,18 @@ public ComputeOperationStatusResponse call() throws Exception * more information) * * @param serviceName The name of the cloud service. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1236,6 +1381,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The name of the cloud service. * @param extensionId The identifier that was assigned to the extension when * it was added to the cloud service + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1349,6 +1506,18 @@ public HostedServiceGetResponse call() throws Exception * for more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Hosted Service operation response. */ @Override @@ -1382,161 +1551,171 @@ public HostedServiceGetResponse get(String serviceName) throws IOException, Serv // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - HostedServiceGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new HostedServiceGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("HostedService"); - Element hostedServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (hostedServiceElement != null) - { - NodeList elements2 = hostedServiceElement.getElementsByTagName("Url"); - Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (urlElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - URI urlInstance; - urlInstance = new URI(urlElement.getTextContent()); - result.setUri(urlInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = hostedServiceElement.getElementsByTagName("ServiceName"); - Element serviceNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (serviceNameElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String serviceNameInstance; - serviceNameInstance = serviceNameElement.getTextContent(); - result.setServiceName(serviceNameInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = hostedServiceElement.getElementsByTagName("HostedServiceProperties"); - Element hostedServicePropertiesElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (hostedServicePropertiesElement != null) + // Create Result + HostedServiceGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new HostedServiceGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("HostedService"); + Element hostedServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (hostedServiceElement != null) { - HostedServiceProperties hostedServicePropertiesInstance = new HostedServiceProperties(); - result.setProperties(hostedServicePropertiesInstance); - - NodeList elements5 = hostedServicePropertiesElement.getElementsByTagName("Description"); - Element descriptionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - hostedServicePropertiesInstance.setDescription(descriptionInstance); - } - - NodeList elements6 = hostedServicePropertiesElement.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - hostedServicePropertiesInstance.setAffinityGroup(affinityGroupInstance); - } - - NodeList elements7 = hostedServicePropertiesElement.getElementsByTagName("Location"); - Element locationElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (locationElement != null) - { - String locationInstance; - locationInstance = locationElement.getTextContent(); - hostedServicePropertiesInstance.setLocation(locationInstance); - } - - NodeList elements8 = hostedServicePropertiesElement.getElementsByTagName("Label"); - Element labelElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - hostedServicePropertiesInstance.setLabel(labelInstance); - } - - NodeList elements9 = hostedServicePropertiesElement.getElementsByTagName("Status"); - Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (statusElement != null) - { - HostedServiceStatus statusInstance; - statusInstance = HostedServiceStatus.valueOf(statusElement.getTextContent()); - hostedServicePropertiesInstance.setStatus(statusInstance); - } - - NodeList elements10 = hostedServicePropertiesElement.getElementsByTagName("DateCreated"); - Element dateCreatedElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (dateCreatedElement != null) + NodeList elements2 = hostedServiceElement.getElementsByTagName("Url"); + Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (urlElement != null) { - Calendar dateCreatedInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(dateCreatedElement.getTextContent())); - dateCreatedInstance = calendar; - hostedServicePropertiesInstance.setDateCreated(dateCreatedInstance); + URI urlInstance; + urlInstance = new URI(urlElement.getTextContent()); + result.setUri(urlInstance); } - NodeList elements11 = hostedServicePropertiesElement.getElementsByTagName("DateLastModified"); - Element dateLastModifiedElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (dateLastModifiedElement != null) + NodeList elements3 = hostedServiceElement.getElementsByTagName("ServiceName"); + Element serviceNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (serviceNameElement != null) { - Calendar dateLastModifiedInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(dateLastModifiedElement.getTextContent())); - dateLastModifiedInstance = calendar2; - hostedServicePropertiesInstance.setDateLastModified(dateLastModifiedInstance); + String serviceNameInstance; + serviceNameInstance = serviceNameElement.getTextContent(); + result.setServiceName(serviceNameInstance); } - NodeList elements12 = hostedServicePropertiesElement.getElementsByTagName("ExtendedProperties"); - Element extendedPropertiesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (extendedPropertiesSequenceElement != null) + NodeList elements4 = hostedServiceElement.getElementsByTagName("HostedServiceProperties"); + Element hostedServicePropertiesElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (hostedServicePropertiesElement != null) { - for (int i1 = 0; i1 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i1 = i1 + 1) + HostedServiceProperties hostedServicePropertiesInstance = new HostedServiceProperties(); + result.setProperties(hostedServicePropertiesInstance); + + NodeList elements5 = hostedServicePropertiesElement.getElementsByTagName("Description"); + Element descriptionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (descriptionElement != null) { - org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i1)); - NodeList elements13 = extendedPropertiesElement.getElementsByTagName("Name"); - String extendedPropertiesKey = elements13.getLength() > 0 ? ((org.w3c.dom.Element) elements13.item(0)).getTextContent() : null; - NodeList elements14 = extendedPropertiesElement.getElementsByTagName("Value"); - String extendedPropertiesValue = elements14.getLength() > 0 ? ((org.w3c.dom.Element) elements14.item(0)).getTextContent() : null; - hostedServicePropertiesInstance.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + hostedServicePropertiesInstance.setDescription(descriptionInstance); } - } - } - } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + + NodeList elements6 = hostedServicePropertiesElement.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + hostedServicePropertiesInstance.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements7 = hostedServicePropertiesElement.getElementsByTagName("Location"); + Element locationElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + hostedServicePropertiesInstance.setLocation(locationInstance); + } + + NodeList elements8 = hostedServicePropertiesElement.getElementsByTagName("Label"); + Element labelElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + hostedServicePropertiesInstance.setLabel(labelInstance); + } + + NodeList elements9 = hostedServicePropertiesElement.getElementsByTagName("Status"); + Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (statusElement != null) + { + HostedServiceStatus statusInstance; + statusInstance = HostedServiceStatus.valueOf(statusElement.getTextContent()); + hostedServicePropertiesInstance.setStatus(statusInstance); + } + + NodeList elements10 = hostedServicePropertiesElement.getElementsByTagName("DateCreated"); + Element dateCreatedElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (dateCreatedElement != null) + { + Calendar dateCreatedInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(dateCreatedElement.getTextContent())); + dateCreatedInstance = calendar; + hostedServicePropertiesInstance.setDateCreated(dateCreatedInstance); + } + + NodeList elements11 = hostedServicePropertiesElement.getElementsByTagName("DateLastModified"); + Element dateLastModifiedElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (dateLastModifiedElement != null) + { + Calendar dateLastModifiedInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(dateLastModifiedElement.getTextContent())); + dateLastModifiedInstance = calendar2; + hostedServicePropertiesInstance.setDateLastModified(dateLastModifiedInstance); + } + + NodeList elements12 = hostedServicePropertiesElement.getElementsByTagName("ExtendedProperties"); + Element extendedPropertiesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (extendedPropertiesSequenceElement != null) + { + for (int i1 = 0; i1 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i1)); + NodeList elements13 = extendedPropertiesElement.getElementsByTagName("Name"); + String extendedPropertiesKey = elements13.getLength() > 0 ? ((org.w3c.dom.Element) elements13.item(0)).getTextContent() : null; + NodeList elements14 = extendedPropertiesElement.getElementsByTagName("Value"); + String extendedPropertiesValue = elements14.getLength() > 0 ? ((org.w3c.dom.Element) elements14.item(0)).getTextContent() : null; + hostedServicePropertiesInstance.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + } + } + } + } + + 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); + } + return result; + } + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1573,6 +1752,18 @@ public HostedServiceGetDetailedResponse call() throws Exception * more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The detailed Get Hosted Service operation response. */ @Override @@ -1606,1376 +1797,1395 @@ public HostedServiceGetDetailedResponse getDetailed(String serviceName) throws I // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - HostedServiceGetDetailedResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new HostedServiceGetDetailedResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("HostedService"); - Element hostedServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (hostedServiceElement != null) - { - NodeList elements2 = hostedServiceElement.getElementsByTagName("Deployments"); - Element deploymentsSequenceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (deploymentsSequenceElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - for (int i1 = 0; i1 < deploymentsSequenceElement.getElementsByTagName("Deployment").getLength(); i1 = i1 + 1) + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - org.w3c.dom.Element deploymentsElement = ((org.w3c.dom.Element) deploymentsSequenceElement.getElementsByTagName("Deployment").item(i1)); - HostedServiceGetDetailedResponse.Deployment deploymentInstance = new HostedServiceGetDetailedResponse.Deployment(); - result.getDeployments().add(deploymentInstance); - - NodeList elements3 = deploymentsElement.getElementsByTagName("Name"); - Element nameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - deploymentInstance.setName(nameInstance); - } - - NodeList elements4 = deploymentsElement.getElementsByTagName("DeploymentSlot"); - Element deploymentSlotElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (deploymentSlotElement != null) - { - DeploymentSlot deploymentSlotInstance; - deploymentSlotInstance = DeploymentSlot.valueOf(deploymentSlotElement.getTextContent()); - deploymentInstance.setDeploymentSlot(deploymentSlotInstance); - } - - NodeList elements5 = deploymentsElement.getElementsByTagName("PrivateID"); - Element privateIDElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (privateIDElement != null) - { - String privateIDInstance; - privateIDInstance = privateIDElement.getTextContent(); - deploymentInstance.setPrivateId(privateIDInstance); - } - - NodeList elements6 = deploymentsElement.getElementsByTagName("Status"); - Element statusElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (statusElement != null) - { - DeploymentStatus statusInstance; - statusInstance = DeploymentStatus.valueOf(statusElement.getTextContent()); - deploymentInstance.setStatus(statusInstance); - } - - NodeList elements7 = deploymentsElement.getElementsByTagName("Label"); - Element labelElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - deploymentInstance.setLabel(labelInstance); - } - - NodeList elements8 = deploymentsElement.getElementsByTagName("Url"); - Element urlElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (urlElement != null) - { - URI urlInstance; - urlInstance = new URI(urlElement.getTextContent()); - deploymentInstance.setUri(urlInstance); - } - - NodeList elements9 = deploymentsElement.getElementsByTagName("Configuration"); - Element configurationElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (configurationElement != null) - { - String configurationInstance; - configurationInstance = configurationElement.getTextContent() != null ? new String(Base64.decodeBase64(configurationElement.getTextContent().getBytes())) : null; - deploymentInstance.setConfiguration(configurationInstance); - } - - NodeList elements10 = deploymentsElement.getElementsByTagName("RoleInstanceList"); - Element roleInstanceListSequenceElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (roleInstanceListSequenceElement != null) + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + HostedServiceGetDetailedResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new HostedServiceGetDetailedResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("HostedService"); + Element hostedServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (hostedServiceElement != null) + { + NodeList elements2 = hostedServiceElement.getElementsByTagName("Deployments"); + Element deploymentsSequenceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (deploymentsSequenceElement != null) + { + for (int i1 = 0; i1 < deploymentsSequenceElement.getElementsByTagName("Deployment").getLength(); i1 = i1 + 1) { - for (int i2 = 0; i2 < roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").getLength(); i2 = i2 + 1) + org.w3c.dom.Element deploymentsElement = ((org.w3c.dom.Element) deploymentsSequenceElement.getElementsByTagName("Deployment").item(i1)); + HostedServiceGetDetailedResponse.Deployment deploymentInstance = new HostedServiceGetDetailedResponse.Deployment(); + result.getDeployments().add(deploymentInstance); + + NodeList elements3 = deploymentsElement.getElementsByTagName("Name"); + Element nameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (nameElement != null) { - org.w3c.dom.Element roleInstanceListElement = ((org.w3c.dom.Element) roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").item(i2)); - RoleInstance roleInstanceInstance = new RoleInstance(); - deploymentInstance.getRoleInstances().add(roleInstanceInstance); - - NodeList elements11 = roleInstanceListElement.getElementsByTagName("RoleName"); - Element roleNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (roleNameElement != null) - { - String roleNameInstance; - roleNameInstance = roleNameElement.getTextContent(); - roleInstanceInstance.setRoleName(roleNameInstance); - } - - NodeList elements12 = roleInstanceListElement.getElementsByTagName("InstanceName"); - Element instanceNameElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (instanceNameElement != null) - { - String instanceNameInstance; - instanceNameInstance = instanceNameElement.getTextContent(); - roleInstanceInstance.setInstanceName(instanceNameInstance); - } - - NodeList elements13 = roleInstanceListElement.getElementsByTagName("InstanceStatus"); - Element instanceStatusElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (instanceStatusElement != null) - { - String instanceStatusInstance; - instanceStatusInstance = instanceStatusElement.getTextContent(); - roleInstanceInstance.setInstanceStatus(instanceStatusInstance); - } - - NodeList elements14 = roleInstanceListElement.getElementsByTagName("InstanceUpgradeDomain"); - Element instanceUpgradeDomainElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (instanceUpgradeDomainElement != null && (instanceUpgradeDomainElement.getTextContent() != null && instanceUpgradeDomainElement.getTextContent().isEmpty() != true) == false) - { - int instanceUpgradeDomainInstance; - instanceUpgradeDomainInstance = Integer.parseInt(instanceUpgradeDomainElement.getTextContent()); - roleInstanceInstance.setInstanceUpgradeDomain(instanceUpgradeDomainInstance); - } - - NodeList elements15 = roleInstanceListElement.getElementsByTagName("InstanceFaultDomain"); - Element instanceFaultDomainElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (instanceFaultDomainElement != null && (instanceFaultDomainElement.getTextContent() != null && instanceFaultDomainElement.getTextContent().isEmpty() != true) == false) - { - int instanceFaultDomainInstance; - instanceFaultDomainInstance = Integer.parseInt(instanceFaultDomainElement.getTextContent()); - roleInstanceInstance.setInstanceFaultDomain(instanceFaultDomainInstance); - } - - NodeList elements16 = roleInstanceListElement.getElementsByTagName("InstanceSize"); - Element instanceSizeElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (instanceSizeElement != null && (instanceSizeElement.getTextContent() != null && instanceSizeElement.getTextContent().isEmpty() != true) == false) - { - VirtualMachineRoleSize instanceSizeInstance; - instanceSizeInstance = VirtualMachineRoleSize.valueOf(instanceSizeElement.getTextContent()); - roleInstanceInstance.setInstanceSize(instanceSizeInstance); - } - - NodeList elements17 = roleInstanceListElement.getElementsByTagName("InstanceStateDetails"); - Element instanceStateDetailsElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (instanceStateDetailsElement != null) - { - String instanceStateDetailsInstance; - instanceStateDetailsInstance = instanceStateDetailsElement.getTextContent(); - roleInstanceInstance.setInstanceStateDetails(instanceStateDetailsInstance); - } - - NodeList elements18 = roleInstanceListElement.getElementsByTagName("InstanceErrorCode"); - Element instanceErrorCodeElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (instanceErrorCodeElement != null) - { - String instanceErrorCodeInstance; - instanceErrorCodeInstance = instanceErrorCodeElement.getTextContent(); - roleInstanceInstance.setInstanceErrorCode(instanceErrorCodeInstance); - } - - NodeList elements19 = roleInstanceListElement.getElementsByTagName("IpAddress"); - Element ipAddressElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (ipAddressElement != null) - { - InetAddress ipAddressInstance; - ipAddressInstance = InetAddress.getByName(ipAddressElement.getTextContent()); - roleInstanceInstance.setIPAddress(ipAddressInstance); - } - - NodeList elements20 = roleInstanceListElement.getElementsByTagName("InstanceEndpoints"); - Element instanceEndpointsSequenceElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (instanceEndpointsSequenceElement != null) + String nameInstance; + nameInstance = nameElement.getTextContent(); + deploymentInstance.setName(nameInstance); + } + + NodeList elements4 = deploymentsElement.getElementsByTagName("DeploymentSlot"); + Element deploymentSlotElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (deploymentSlotElement != null) + { + DeploymentSlot deploymentSlotInstance; + deploymentSlotInstance = DeploymentSlot.valueOf(deploymentSlotElement.getTextContent()); + deploymentInstance.setDeploymentSlot(deploymentSlotInstance); + } + + NodeList elements5 = deploymentsElement.getElementsByTagName("PrivateID"); + Element privateIDElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (privateIDElement != null) + { + String privateIDInstance; + privateIDInstance = privateIDElement.getTextContent(); + deploymentInstance.setPrivateId(privateIDInstance); + } + + NodeList elements6 = deploymentsElement.getElementsByTagName("Status"); + Element statusElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (statusElement != null) + { + DeploymentStatus statusInstance; + statusInstance = DeploymentStatus.valueOf(statusElement.getTextContent()); + deploymentInstance.setStatus(statusInstance); + } + + NodeList elements7 = deploymentsElement.getElementsByTagName("Label"); + Element labelElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + deploymentInstance.setLabel(labelInstance); + } + + NodeList elements8 = deploymentsElement.getElementsByTagName("Url"); + Element urlElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (urlElement != null) + { + URI urlInstance; + urlInstance = new URI(urlElement.getTextContent()); + deploymentInstance.setUri(urlInstance); + } + + NodeList elements9 = deploymentsElement.getElementsByTagName("Configuration"); + Element configurationElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (configurationElement != null) + { + String configurationInstance; + configurationInstance = configurationElement.getTextContent() != null ? new String(Base64.decodeBase64(configurationElement.getTextContent().getBytes())) : null; + deploymentInstance.setConfiguration(configurationInstance); + } + + NodeList elements10 = deploymentsElement.getElementsByTagName("RoleInstanceList"); + Element roleInstanceListSequenceElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (roleInstanceListSequenceElement != null) + { + for (int i2 = 0; i2 < roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").getLength(); i2 = i2 + 1) { - for (int i3 = 0; i3 < instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").getLength(); i3 = i3 + 1) + org.w3c.dom.Element roleInstanceListElement = ((org.w3c.dom.Element) roleInstanceListSequenceElement.getElementsByTagName("RoleInstance").item(i2)); + RoleInstance roleInstanceInstance = new RoleInstance(); + deploymentInstance.getRoleInstances().add(roleInstanceInstance); + + NodeList elements11 = roleInstanceListElement.getElementsByTagName("RoleName"); + Element roleNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (roleNameElement != null) { - org.w3c.dom.Element instanceEndpointsElement = ((org.w3c.dom.Element) instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").item(i3)); - InstanceEndpoint instanceEndpointInstance = new InstanceEndpoint(); - roleInstanceInstance.getInstanceEndpoints().add(instanceEndpointInstance); - - NodeList elements21 = instanceEndpointsElement.getElementsByTagName("LocalPort"); - Element localPortElement = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (localPortElement != null && (localPortElement.getTextContent() != null && localPortElement.getTextContent().isEmpty() != true) == false) - { - int localPortInstance; - localPortInstance = Integer.parseInt(localPortElement.getTextContent()); - instanceEndpointInstance.setLocalPort(localPortInstance); - } - - NodeList elements22 = instanceEndpointsElement.getElementsByTagName("Name"); - Element nameElement2 = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance2; - nameInstance2 = nameElement2.getTextContent(); - instanceEndpointInstance.setName(nameInstance2); - } - - NodeList elements23 = instanceEndpointsElement.getElementsByTagName("PublicPort"); - Element publicPortElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (publicPortElement != null) - { - int publicPortInstance; - publicPortInstance = Integer.parseInt(publicPortElement.getTextContent()); - instanceEndpointInstance.setPort(publicPortInstance); - } - - NodeList elements24 = instanceEndpointsElement.getElementsByTagName("Protocol"); - Element protocolElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (protocolElement != null) - { - String protocolInstance; - protocolInstance = protocolElement.getTextContent(); - instanceEndpointInstance.setProtocol(protocolInstance); - } - - NodeList elements25 = instanceEndpointsElement.getElementsByTagName("Vip"); - Element vipElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (vipElement != null) + String roleNameInstance; + roleNameInstance = roleNameElement.getTextContent(); + roleInstanceInstance.setRoleName(roleNameInstance); + } + + NodeList elements12 = roleInstanceListElement.getElementsByTagName("InstanceName"); + Element instanceNameElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (instanceNameElement != null) + { + String instanceNameInstance; + instanceNameInstance = instanceNameElement.getTextContent(); + roleInstanceInstance.setInstanceName(instanceNameInstance); + } + + NodeList elements13 = roleInstanceListElement.getElementsByTagName("InstanceStatus"); + Element instanceStatusElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (instanceStatusElement != null) + { + String instanceStatusInstance; + instanceStatusInstance = instanceStatusElement.getTextContent(); + roleInstanceInstance.setInstanceStatus(instanceStatusInstance); + } + + NodeList elements14 = roleInstanceListElement.getElementsByTagName("InstanceUpgradeDomain"); + Element instanceUpgradeDomainElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (instanceUpgradeDomainElement != null && (instanceUpgradeDomainElement.getTextContent() != null && instanceUpgradeDomainElement.getTextContent().isEmpty() != true) == false) + { + int instanceUpgradeDomainInstance; + instanceUpgradeDomainInstance = Integer.parseInt(instanceUpgradeDomainElement.getTextContent()); + roleInstanceInstance.setInstanceUpgradeDomain(instanceUpgradeDomainInstance); + } + + NodeList elements15 = roleInstanceListElement.getElementsByTagName("InstanceFaultDomain"); + Element instanceFaultDomainElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (instanceFaultDomainElement != null && (instanceFaultDomainElement.getTextContent() != null && instanceFaultDomainElement.getTextContent().isEmpty() != true) == false) + { + int instanceFaultDomainInstance; + instanceFaultDomainInstance = Integer.parseInt(instanceFaultDomainElement.getTextContent()); + roleInstanceInstance.setInstanceFaultDomain(instanceFaultDomainInstance); + } + + NodeList elements16 = roleInstanceListElement.getElementsByTagName("InstanceSize"); + Element instanceSizeElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (instanceSizeElement != null) + { + String instanceSizeInstance; + instanceSizeInstance = instanceSizeElement.getTextContent(); + roleInstanceInstance.setInstanceSize(instanceSizeInstance); + } + + NodeList elements17 = roleInstanceListElement.getElementsByTagName("InstanceStateDetails"); + Element instanceStateDetailsElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (instanceStateDetailsElement != null) + { + String instanceStateDetailsInstance; + instanceStateDetailsInstance = instanceStateDetailsElement.getTextContent(); + roleInstanceInstance.setInstanceStateDetails(instanceStateDetailsInstance); + } + + NodeList elements18 = roleInstanceListElement.getElementsByTagName("InstanceErrorCode"); + Element instanceErrorCodeElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (instanceErrorCodeElement != null) + { + String instanceErrorCodeInstance; + instanceErrorCodeInstance = instanceErrorCodeElement.getTextContent(); + roleInstanceInstance.setInstanceErrorCode(instanceErrorCodeInstance); + } + + NodeList elements19 = roleInstanceListElement.getElementsByTagName("IpAddress"); + Element ipAddressElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (ipAddressElement != null) + { + InetAddress ipAddressInstance; + ipAddressInstance = InetAddress.getByName(ipAddressElement.getTextContent()); + roleInstanceInstance.setIPAddress(ipAddressInstance); + } + + NodeList elements20 = roleInstanceListElement.getElementsByTagName("InstanceEndpoints"); + Element instanceEndpointsSequenceElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (instanceEndpointsSequenceElement != null) + { + for (int i3 = 0; i3 < instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").getLength(); i3 = i3 + 1) { - InetAddress vipInstance; - vipInstance = InetAddress.getByName(vipElement.getTextContent()); - instanceEndpointInstance.setVirtualIPAddress(vipInstance); + org.w3c.dom.Element instanceEndpointsElement = ((org.w3c.dom.Element) instanceEndpointsSequenceElement.getElementsByTagName("InstanceEndpoint").item(i3)); + InstanceEndpoint instanceEndpointInstance = new InstanceEndpoint(); + roleInstanceInstance.getInstanceEndpoints().add(instanceEndpointInstance); + + NodeList elements21 = instanceEndpointsElement.getElementsByTagName("LocalPort"); + Element localPortElement = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (localPortElement != null && (localPortElement.getTextContent() != null && localPortElement.getTextContent().isEmpty() != true) == false) + { + int localPortInstance; + localPortInstance = Integer.parseInt(localPortElement.getTextContent()); + instanceEndpointInstance.setLocalPort(localPortInstance); + } + + NodeList elements22 = instanceEndpointsElement.getElementsByTagName("Name"); + Element nameElement2 = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + instanceEndpointInstance.setName(nameInstance2); + } + + NodeList elements23 = instanceEndpointsElement.getElementsByTagName("PublicPort"); + Element publicPortElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (publicPortElement != null) + { + int publicPortInstance; + publicPortInstance = Integer.parseInt(publicPortElement.getTextContent()); + instanceEndpointInstance.setPort(publicPortInstance); + } + + NodeList elements24 = instanceEndpointsElement.getElementsByTagName("Protocol"); + Element protocolElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (protocolElement != null) + { + String protocolInstance; + protocolInstance = protocolElement.getTextContent(); + instanceEndpointInstance.setProtocol(protocolInstance); + } + + NodeList elements25 = instanceEndpointsElement.getElementsByTagName("Vip"); + Element vipElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (vipElement != null) + { + InetAddress vipInstance; + vipInstance = InetAddress.getByName(vipElement.getTextContent()); + instanceEndpointInstance.setVirtualIPAddress(vipInstance); + } } } + + NodeList elements26 = roleInstanceListElement.getElementsByTagName("PowerState"); + Element powerStateElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (powerStateElement != null) + { + RoleInstancePowerState powerStateInstance; + powerStateInstance = RoleInstancePowerState.valueOf(powerStateElement.getTextContent()); + roleInstanceInstance.setPowerState(powerStateInstance); + } + + NodeList elements27 = roleInstanceListElement.getElementsByTagName("HostName"); + Element hostNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; + if (hostNameElement != null) + { + String hostNameInstance; + hostNameInstance = hostNameElement.getTextContent(); + roleInstanceInstance.setHostName(hostNameInstance); + } + + NodeList elements28 = roleInstanceListElement.getElementsByTagName("RemoteAccessCertificateThumbprint"); + Element remoteAccessCertificateThumbprintElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; + if (remoteAccessCertificateThumbprintElement != null) + { + String remoteAccessCertificateThumbprintInstance; + remoteAccessCertificateThumbprintInstance = remoteAccessCertificateThumbprintElement.getTextContent(); + roleInstanceInstance.setRemoteAccessCertificateThumbprint(remoteAccessCertificateThumbprintInstance); + } } + } + + NodeList elements29 = deploymentsElement.getElementsByTagName("UpgradeStatus"); + Element upgradeStatusElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; + if (upgradeStatusElement != null) + { + UpgradeStatus upgradeStatusInstance = new UpgradeStatus(); + deploymentInstance.setUpgradeStatus(upgradeStatusInstance); - NodeList elements26 = roleInstanceListElement.getElementsByTagName("PowerState"); - Element powerStateElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (powerStateElement != null) + NodeList elements30 = upgradeStatusElement.getElementsByTagName("UpgradeType"); + Element upgradeTypeElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; + if (upgradeTypeElement != null) { - RoleInstancePowerState powerStateInstance; - powerStateInstance = RoleInstancePowerState.valueOf(powerStateElement.getTextContent()); - roleInstanceInstance.setPowerState(powerStateInstance); + DeploymentUpgradeType upgradeTypeInstance; + upgradeTypeInstance = DeploymentUpgradeType.valueOf(upgradeTypeElement.getTextContent()); + upgradeStatusInstance.setUpgradeType(upgradeTypeInstance); } - NodeList elements27 = roleInstanceListElement.getElementsByTagName("HostName"); - Element hostNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; - if (hostNameElement != null) + NodeList elements31 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomainState"); + Element currentUpgradeDomainStateElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; + if (currentUpgradeDomainStateElement != null) { - String hostNameInstance; - hostNameInstance = hostNameElement.getTextContent(); - roleInstanceInstance.setHostName(hostNameInstance); + UpgradeDomainState currentUpgradeDomainStateInstance; + currentUpgradeDomainStateInstance = UpgradeDomainState.valueOf(currentUpgradeDomainStateElement.getTextContent()); + upgradeStatusInstance.setCurrentUpgradeDomainState(currentUpgradeDomainStateInstance); } - NodeList elements28 = roleInstanceListElement.getElementsByTagName("RemoteAccessCertificateThumbprint"); - Element remoteAccessCertificateThumbprintElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; - if (remoteAccessCertificateThumbprintElement != null) + NodeList elements32 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomain"); + Element currentUpgradeDomainElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; + if (currentUpgradeDomainElement != null) { - String remoteAccessCertificateThumbprintInstance; - remoteAccessCertificateThumbprintInstance = remoteAccessCertificateThumbprintElement.getTextContent(); - roleInstanceInstance.setRemoteAccessCertificateThumbprint(remoteAccessCertificateThumbprintInstance); + int currentUpgradeDomainInstance; + currentUpgradeDomainInstance = Integer.parseInt(currentUpgradeDomainElement.getTextContent()); + upgradeStatusInstance.setCurrentUpgradeDomain(currentUpgradeDomainInstance); } } - } - - NodeList elements29 = deploymentsElement.getElementsByTagName("UpgradeStatus"); - Element upgradeStatusElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; - if (upgradeStatusElement != null) - { - UpgradeStatus upgradeStatusInstance = new UpgradeStatus(); - deploymentInstance.setUpgradeStatus(upgradeStatusInstance); - - NodeList elements30 = upgradeStatusElement.getElementsByTagName("UpgradeType"); - Element upgradeTypeElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; - if (upgradeTypeElement != null) - { - DeploymentUpgradeType upgradeTypeInstance; - upgradeTypeInstance = DeploymentUpgradeType.valueOf(upgradeTypeElement.getTextContent()); - upgradeStatusInstance.setUpgradeType(upgradeTypeInstance); - } - NodeList elements31 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomainState"); - Element currentUpgradeDomainStateElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; - if (currentUpgradeDomainStateElement != null) + NodeList elements33 = deploymentsElement.getElementsByTagName("UpgradeDomainCount"); + Element upgradeDomainCountElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; + if (upgradeDomainCountElement != null) { - UpgradeDomainState currentUpgradeDomainStateInstance; - currentUpgradeDomainStateInstance = UpgradeDomainState.valueOf(currentUpgradeDomainStateElement.getTextContent()); - upgradeStatusInstance.setCurrentUpgradeDomainState(currentUpgradeDomainStateInstance); + int upgradeDomainCountInstance; + upgradeDomainCountInstance = Integer.parseInt(upgradeDomainCountElement.getTextContent()); + deploymentInstance.setUpgradeDomainCount(upgradeDomainCountInstance); } - NodeList elements32 = upgradeStatusElement.getElementsByTagName("CurrentUpgradeDomain"); - Element currentUpgradeDomainElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; - if (currentUpgradeDomainElement != null) - { - int currentUpgradeDomainInstance; - currentUpgradeDomainInstance = Integer.parseInt(currentUpgradeDomainElement.getTextContent()); - upgradeStatusInstance.setCurrentUpgradeDomain(currentUpgradeDomainInstance); - } - } - - NodeList elements33 = deploymentsElement.getElementsByTagName("UpgradeDomainCount"); - Element upgradeDomainCountElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; - if (upgradeDomainCountElement != null) - { - int upgradeDomainCountInstance; - upgradeDomainCountInstance = Integer.parseInt(upgradeDomainCountElement.getTextContent()); - deploymentInstance.setUpgradeDomainCount(upgradeDomainCountInstance); - } - - NodeList elements34 = deploymentsElement.getElementsByTagName("RoleList"); - Element roleListSequenceElement = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; - if (roleListSequenceElement != null) - { - for (int i4 = 0; i4 < roleListSequenceElement.getElementsByTagName("Role").getLength(); i4 = i4 + 1) + NodeList elements34 = deploymentsElement.getElementsByTagName("RoleList"); + Element roleListSequenceElement = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; + if (roleListSequenceElement != null) { - org.w3c.dom.Element roleListElement = ((org.w3c.dom.Element) roleListSequenceElement.getElementsByTagName("Role").item(i4)); - Role roleInstance = new Role(); - deploymentInstance.getRoles().add(roleInstance); - - NodeList elements35 = roleListElement.getElementsByTagName("RoleName"); - Element roleNameElement2 = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; - if (roleNameElement2 != null) - { - String roleNameInstance2; - roleNameInstance2 = roleNameElement2.getTextContent(); - roleInstance.setRoleName(roleNameInstance2); - } - - NodeList elements36 = roleListElement.getElementsByTagName("OsVersion"); - Element osVersionElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; - if (osVersionElement != null) - { - String osVersionInstance; - osVersionInstance = osVersionElement.getTextContent(); - roleInstance.setOSVersion(osVersionInstance); - } - - NodeList elements37 = roleListElement.getElementsByTagName("RoleType"); - Element roleTypeElement = elements37.getLength() > 0 ? ((Element) elements37.item(0)) : null; - if (roleTypeElement != null) - { - String roleTypeInstance; - roleTypeInstance = roleTypeElement.getTextContent(); - roleInstance.setRoleType(roleTypeInstance); - } - - NodeList elements38 = roleListElement.getElementsByTagName("ConfigurationSets"); - Element configurationSetsSequenceElement = elements38.getLength() > 0 ? ((Element) elements38.item(0)) : null; - if (configurationSetsSequenceElement != null) + for (int i4 = 0; i4 < roleListSequenceElement.getElementsByTagName("Role").getLength(); i4 = i4 + 1) { - for (int i5 = 0; i5 < configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").getLength(); i5 = i5 + 1) + org.w3c.dom.Element roleListElement = ((org.w3c.dom.Element) roleListSequenceElement.getElementsByTagName("Role").item(i4)); + Role roleInstance = new Role(); + deploymentInstance.getRoles().add(roleInstance); + + NodeList elements35 = roleListElement.getElementsByTagName("RoleName"); + Element roleNameElement2 = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; + if (roleNameElement2 != null) { - org.w3c.dom.Element configurationSetsElement = ((org.w3c.dom.Element) configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").item(i5)); - ConfigurationSet configurationSetInstance = new ConfigurationSet(); - roleInstance.getConfigurationSets().add(configurationSetInstance); - - NodeList elements39 = configurationSetsElement.getElementsByTagName("ConfigurationSetType"); - Element configurationSetTypeElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; - if (configurationSetTypeElement != null) - { - String configurationSetTypeInstance; - configurationSetTypeInstance = configurationSetTypeElement.getTextContent(); - configurationSetInstance.setConfigurationSetType(configurationSetTypeInstance); - } - - NodeList elements40 = configurationSetsElement.getElementsByTagName("InputEndpoints"); - Element inputEndpointsSequenceElement = elements40.getLength() > 0 ? ((Element) elements40.item(0)) : null; - if (inputEndpointsSequenceElement != null) + String roleNameInstance2; + roleNameInstance2 = roleNameElement2.getTextContent(); + roleInstance.setRoleName(roleNameInstance2); + } + + NodeList elements36 = roleListElement.getElementsByTagName("OsVersion"); + Element osVersionElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; + if (osVersionElement != null) + { + String osVersionInstance; + osVersionInstance = osVersionElement.getTextContent(); + roleInstance.setOSVersion(osVersionInstance); + } + + NodeList elements37 = roleListElement.getElementsByTagName("RoleType"); + Element roleTypeElement = elements37.getLength() > 0 ? ((Element) elements37.item(0)) : null; + if (roleTypeElement != null) + { + String roleTypeInstance; + roleTypeInstance = roleTypeElement.getTextContent(); + roleInstance.setRoleType(roleTypeInstance); + } + + NodeList elements38 = roleListElement.getElementsByTagName("ConfigurationSets"); + Element configurationSetsSequenceElement = elements38.getLength() > 0 ? ((Element) elements38.item(0)) : null; + if (configurationSetsSequenceElement != null) + { + for (int i5 = 0; i5 < configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").getLength(); i5 = i5 + 1) { - for (int i6 = 0; i6 < inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").getLength(); i6 = i6 + 1) + org.w3c.dom.Element configurationSetsElement = ((org.w3c.dom.Element) configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").item(i5)); + ConfigurationSet configurationSetInstance = new ConfigurationSet(); + roleInstance.getConfigurationSets().add(configurationSetInstance); + + NodeList elements39 = configurationSetsElement.getElementsByTagName("ConfigurationSetType"); + Element configurationSetTypeElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; + if (configurationSetTypeElement != null) { - org.w3c.dom.Element inputEndpointsElement = ((org.w3c.dom.Element) inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").item(i6)); - InputEndpoint inputEndpointInstance = new InputEndpoint(); - configurationSetInstance.getInputEndpoints().add(inputEndpointInstance); - - NodeList elements41 = inputEndpointsElement.getElementsByTagName("LoadBalancedEndpointSetName"); - Element loadBalancedEndpointSetNameElement = elements41.getLength() > 0 ? ((Element) elements41.item(0)) : null; - if (loadBalancedEndpointSetNameElement != null) - { - String loadBalancedEndpointSetNameInstance; - loadBalancedEndpointSetNameInstance = loadBalancedEndpointSetNameElement.getTextContent(); - inputEndpointInstance.setLoadBalancedEndpointSetName(loadBalancedEndpointSetNameInstance); - } - - NodeList elements42 = inputEndpointsElement.getElementsByTagName("LocalPort"); - Element localPortElement2 = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; - if (localPortElement2 != null && (localPortElement2.getTextContent() != null && localPortElement2.getTextContent().isEmpty() != true) == false) - { - int localPortInstance2; - localPortInstance2 = Integer.parseInt(localPortElement2.getTextContent()); - inputEndpointInstance.setLocalPort(localPortInstance2); - } - - NodeList elements43 = inputEndpointsElement.getElementsByTagName("Name"); - Element nameElement3 = elements43.getLength() > 0 ? ((Element) elements43.item(0)) : null; - if (nameElement3 != null) - { - String nameInstance3; - nameInstance3 = nameElement3.getTextContent(); - inputEndpointInstance.setName(nameInstance3); - } - - NodeList elements44 = inputEndpointsElement.getElementsByTagName("Port"); - Element portElement = elements44.getLength() > 0 ? ((Element) elements44.item(0)) : null; - if (portElement != null && (portElement.getTextContent() != null && portElement.getTextContent().isEmpty() != true) == false) - { - int portInstance; - portInstance = Integer.parseInt(portElement.getTextContent()); - inputEndpointInstance.setPort(portInstance); - } - - NodeList elements45 = inputEndpointsElement.getElementsByTagName("LoadBalancerProbe"); - Element loadBalancerProbeElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; - if (loadBalancerProbeElement != null) + String configurationSetTypeInstance; + configurationSetTypeInstance = configurationSetTypeElement.getTextContent(); + configurationSetInstance.setConfigurationSetType(configurationSetTypeInstance); + } + + NodeList elements40 = configurationSetsElement.getElementsByTagName("InputEndpoints"); + Element inputEndpointsSequenceElement = elements40.getLength() > 0 ? ((Element) elements40.item(0)) : null; + if (inputEndpointsSequenceElement != null) + { + for (int i6 = 0; i6 < inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").getLength(); i6 = i6 + 1) { - LoadBalancerProbe loadBalancerProbeInstance = new LoadBalancerProbe(); - inputEndpointInstance.setLoadBalancerProbe(loadBalancerProbeInstance); + org.w3c.dom.Element inputEndpointsElement = ((org.w3c.dom.Element) inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").item(i6)); + InputEndpoint inputEndpointInstance = new InputEndpoint(); + configurationSetInstance.getInputEndpoints().add(inputEndpointInstance); + + NodeList elements41 = inputEndpointsElement.getElementsByTagName("LoadBalancedEndpointSetName"); + Element loadBalancedEndpointSetNameElement = elements41.getLength() > 0 ? ((Element) elements41.item(0)) : null; + if (loadBalancedEndpointSetNameElement != null) + { + String loadBalancedEndpointSetNameInstance; + loadBalancedEndpointSetNameInstance = loadBalancedEndpointSetNameElement.getTextContent(); + inputEndpointInstance.setLoadBalancedEndpointSetName(loadBalancedEndpointSetNameInstance); + } - NodeList elements46 = loadBalancerProbeElement.getElementsByTagName("Path"); - Element pathElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; - if (pathElement != null) + NodeList elements42 = inputEndpointsElement.getElementsByTagName("LocalPort"); + Element localPortElement2 = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; + if (localPortElement2 != null && (localPortElement2.getTextContent() != null && localPortElement2.getTextContent().isEmpty() != true) == false) { - String pathInstance; - pathInstance = pathElement.getTextContent(); - loadBalancerProbeInstance.setPath(pathInstance); + int localPortInstance2; + localPortInstance2 = Integer.parseInt(localPortElement2.getTextContent()); + inputEndpointInstance.setLocalPort(localPortInstance2); } - NodeList elements47 = loadBalancerProbeElement.getElementsByTagName("Port"); - Element portElement2 = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; - if (portElement2 != null) + NodeList elements43 = inputEndpointsElement.getElementsByTagName("Name"); + Element nameElement3 = elements43.getLength() > 0 ? ((Element) elements43.item(0)) : null; + if (nameElement3 != null) { - int portInstance2; - portInstance2 = Integer.parseInt(portElement2.getTextContent()); - loadBalancerProbeInstance.setPort(portInstance2); + String nameInstance3; + nameInstance3 = nameElement3.getTextContent(); + inputEndpointInstance.setName(nameInstance3); } - NodeList elements48 = loadBalancerProbeElement.getElementsByTagName("Protocol"); - Element protocolElement2 = elements48.getLength() > 0 ? ((Element) elements48.item(0)) : null; - if (protocolElement2 != null) + NodeList elements44 = inputEndpointsElement.getElementsByTagName("Port"); + Element portElement = elements44.getLength() > 0 ? ((Element) elements44.item(0)) : null; + if (portElement != null && (portElement.getTextContent() != null && portElement.getTextContent().isEmpty() != true) == false) { - LoadBalancerProbeTransportProtocol protocolInstance2; - protocolInstance2 = com.microsoft.windowsazure.management.compute.ComputeManagementClientImpl.parseLoadBalancerProbeTransportProtocol(protocolElement2.getTextContent()); - loadBalancerProbeInstance.setProtocol(protocolInstance2); + int portInstance; + portInstance = Integer.parseInt(portElement.getTextContent()); + inputEndpointInstance.setPort(portInstance); } - NodeList elements49 = loadBalancerProbeElement.getElementsByTagName("IntervalInSeconds"); - Element intervalInSecondsElement = elements49.getLength() > 0 ? ((Element) elements49.item(0)) : null; - if (intervalInSecondsElement != null && (intervalInSecondsElement.getTextContent() != null && intervalInSecondsElement.getTextContent().isEmpty() != true) == false) + NodeList elements45 = inputEndpointsElement.getElementsByTagName("LoadBalancerProbe"); + Element loadBalancerProbeElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; + if (loadBalancerProbeElement != null) { - int intervalInSecondsInstance; - intervalInSecondsInstance = Integer.parseInt(intervalInSecondsElement.getTextContent()); - loadBalancerProbeInstance.setIntervalInSeconds(intervalInSecondsInstance); + LoadBalancerProbe loadBalancerProbeInstance = new LoadBalancerProbe(); + inputEndpointInstance.setLoadBalancerProbe(loadBalancerProbeInstance); + + NodeList elements46 = loadBalancerProbeElement.getElementsByTagName("Path"); + Element pathElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; + if (pathElement != null) + { + String pathInstance; + pathInstance = pathElement.getTextContent(); + loadBalancerProbeInstance.setPath(pathInstance); + } + + NodeList elements47 = loadBalancerProbeElement.getElementsByTagName("Port"); + Element portElement2 = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; + if (portElement2 != null) + { + int portInstance2; + portInstance2 = Integer.parseInt(portElement2.getTextContent()); + loadBalancerProbeInstance.setPort(portInstance2); + } + + NodeList elements48 = loadBalancerProbeElement.getElementsByTagName("Protocol"); + Element protocolElement2 = elements48.getLength() > 0 ? ((Element) elements48.item(0)) : null; + if (protocolElement2 != null) + { + LoadBalancerProbeTransportProtocol protocolInstance2; + protocolInstance2 = com.microsoft.windowsazure.management.compute.ComputeManagementClientImpl.parseLoadBalancerProbeTransportProtocol(protocolElement2.getTextContent()); + loadBalancerProbeInstance.setProtocol(protocolInstance2); + } + + NodeList elements49 = loadBalancerProbeElement.getElementsByTagName("IntervalInSeconds"); + Element intervalInSecondsElement = elements49.getLength() > 0 ? ((Element) elements49.item(0)) : null; + if (intervalInSecondsElement != null && (intervalInSecondsElement.getTextContent() != null && intervalInSecondsElement.getTextContent().isEmpty() != true) == false) + { + int intervalInSecondsInstance; + intervalInSecondsInstance = Integer.parseInt(intervalInSecondsElement.getTextContent()); + loadBalancerProbeInstance.setIntervalInSeconds(intervalInSecondsInstance); + } + + NodeList elements50 = loadBalancerProbeElement.getElementsByTagName("TimeoutInSeconds"); + Element timeoutInSecondsElement = elements50.getLength() > 0 ? ((Element) elements50.item(0)) : null; + if (timeoutInSecondsElement != null && (timeoutInSecondsElement.getTextContent() != null && timeoutInSecondsElement.getTextContent().isEmpty() != true) == false) + { + int timeoutInSecondsInstance; + timeoutInSecondsInstance = Integer.parseInt(timeoutInSecondsElement.getTextContent()); + loadBalancerProbeInstance.setTimeoutInSeconds(timeoutInSecondsInstance); + } } - NodeList elements50 = loadBalancerProbeElement.getElementsByTagName("TimeoutInSeconds"); - Element timeoutInSecondsElement = elements50.getLength() > 0 ? ((Element) elements50.item(0)) : null; - if (timeoutInSecondsElement != null && (timeoutInSecondsElement.getTextContent() != null && timeoutInSecondsElement.getTextContent().isEmpty() != true) == false) + NodeList elements51 = inputEndpointsElement.getElementsByTagName("Protocol"); + Element protocolElement3 = elements51.getLength() > 0 ? ((Element) elements51.item(0)) : null; + if (protocolElement3 != null) { - int timeoutInSecondsInstance; - timeoutInSecondsInstance = Integer.parseInt(timeoutInSecondsElement.getTextContent()); - loadBalancerProbeInstance.setTimeoutInSeconds(timeoutInSecondsInstance); + String protocolInstance3; + protocolInstance3 = protocolElement3.getTextContent(); + inputEndpointInstance.setProtocol(protocolInstance3); + } + + NodeList elements52 = inputEndpointsElement.getElementsByTagName("Vip"); + Element vipElement2 = elements52.getLength() > 0 ? ((Element) elements52.item(0)) : null; + if (vipElement2 != null) + { + InetAddress vipInstance2; + vipInstance2 = InetAddress.getByName(vipElement2.getTextContent()); + inputEndpointInstance.setVirtualIPAddress(vipInstance2); + } + + NodeList elements53 = inputEndpointsElement.getElementsByTagName("EnableDirectServerReturn"); + Element enableDirectServerReturnElement = elements53.getLength() > 0 ? ((Element) elements53.item(0)) : null; + if (enableDirectServerReturnElement != null && (enableDirectServerReturnElement.getTextContent() != null && enableDirectServerReturnElement.getTextContent().isEmpty() != true) == false) + { + boolean enableDirectServerReturnInstance; + enableDirectServerReturnInstance = Boolean.parseBoolean(enableDirectServerReturnElement.getTextContent()); + inputEndpointInstance.setEnableDirectServerReturn(enableDirectServerReturnInstance); } - } - - NodeList elements51 = inputEndpointsElement.getElementsByTagName("Protocol"); - Element protocolElement3 = elements51.getLength() > 0 ? ((Element) elements51.item(0)) : null; - if (protocolElement3 != null) - { - String protocolInstance3; - protocolInstance3 = protocolElement3.getTextContent(); - inputEndpointInstance.setProtocol(protocolInstance3); - } - - NodeList elements52 = inputEndpointsElement.getElementsByTagName("Vip"); - Element vipElement2 = elements52.getLength() > 0 ? ((Element) elements52.item(0)) : null; - if (vipElement2 != null) - { - InetAddress vipInstance2; - vipInstance2 = InetAddress.getByName(vipElement2.getTextContent()); - inputEndpointInstance.setVirtualIPAddress(vipInstance2); - } - - NodeList elements53 = inputEndpointsElement.getElementsByTagName("EnableDirectServerReturn"); - Element enableDirectServerReturnElement = elements53.getLength() > 0 ? ((Element) elements53.item(0)) : null; - if (enableDirectServerReturnElement != null && (enableDirectServerReturnElement.getTextContent() != null && enableDirectServerReturnElement.getTextContent().isEmpty() != true) == false) - { - boolean enableDirectServerReturnInstance; - enableDirectServerReturnInstance = Boolean.parseBoolean(enableDirectServerReturnElement.getTextContent()); - inputEndpointInstance.setEnableDirectServerReturn(enableDirectServerReturnInstance); - } - - NodeList elements54 = inputEndpointsElement.getElementsByTagName("EndpointAcl"); - Element endpointAclElement = elements54.getLength() > 0 ? ((Element) elements54.item(0)) : null; - if (endpointAclElement != null) - { - EndpointAcl endpointAclInstance = new EndpointAcl(); - inputEndpointInstance.setEndpointAcl(endpointAclInstance); - NodeList elements55 = endpointAclElement.getElementsByTagName("Rules"); - Element rulesSequenceElement = elements55.getLength() > 0 ? ((Element) elements55.item(0)) : null; - if (rulesSequenceElement != null) + NodeList elements54 = inputEndpointsElement.getElementsByTagName("EndpointAcl"); + Element endpointAclElement = elements54.getLength() > 0 ? ((Element) elements54.item(0)) : null; + if (endpointAclElement != null) { - for (int i7 = 0; i7 < rulesSequenceElement.getElementsByTagName("Rule").getLength(); i7 = i7 + 1) + EndpointAcl endpointAclInstance = new EndpointAcl(); + inputEndpointInstance.setEndpointAcl(endpointAclInstance); + + NodeList elements55 = endpointAclElement.getElementsByTagName("Rules"); + Element rulesSequenceElement = elements55.getLength() > 0 ? ((Element) elements55.item(0)) : null; + if (rulesSequenceElement != null) { - org.w3c.dom.Element rulesElement = ((org.w3c.dom.Element) rulesSequenceElement.getElementsByTagName("Rule").item(i7)); - AccessControlListRule ruleInstance = new AccessControlListRule(); - endpointAclInstance.getRules().add(ruleInstance); - - NodeList elements56 = rulesElement.getElementsByTagName("Order"); - Element orderElement = elements56.getLength() > 0 ? ((Element) elements56.item(0)) : null; - if (orderElement != null && (orderElement.getTextContent() != null && orderElement.getTextContent().isEmpty() != true) == false) - { - int orderInstance; - orderInstance = Integer.parseInt(orderElement.getTextContent()); - ruleInstance.setOrder(orderInstance); - } - - NodeList elements57 = rulesElement.getElementsByTagName("Action"); - Element actionElement = elements57.getLength() > 0 ? ((Element) elements57.item(0)) : null; - if (actionElement != null) + for (int i7 = 0; i7 < rulesSequenceElement.getElementsByTagName("Rule").getLength(); i7 = i7 + 1) { - String actionInstance; - actionInstance = actionElement.getTextContent(); - ruleInstance.setAction(actionInstance); - } - - NodeList elements58 = rulesElement.getElementsByTagName("RemoteSubnet"); - Element remoteSubnetElement = elements58.getLength() > 0 ? ((Element) elements58.item(0)) : null; - if (remoteSubnetElement != null) - { - String remoteSubnetInstance; - remoteSubnetInstance = remoteSubnetElement.getTextContent(); - ruleInstance.setRemoteSubnet(remoteSubnetInstance); - } - - NodeList elements59 = rulesElement.getElementsByTagName("Description"); - Element descriptionElement = elements59.getLength() > 0 ? ((Element) elements59.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - ruleInstance.setDescription(descriptionInstance); + org.w3c.dom.Element rulesElement = ((org.w3c.dom.Element) rulesSequenceElement.getElementsByTagName("Rule").item(i7)); + AccessControlListRule ruleInstance = new AccessControlListRule(); + endpointAclInstance.getRules().add(ruleInstance); + + NodeList elements56 = rulesElement.getElementsByTagName("Order"); + Element orderElement = elements56.getLength() > 0 ? ((Element) elements56.item(0)) : null; + if (orderElement != null && (orderElement.getTextContent() != null && orderElement.getTextContent().isEmpty() != true) == false) + { + int orderInstance; + orderInstance = Integer.parseInt(orderElement.getTextContent()); + ruleInstance.setOrder(orderInstance); + } + + NodeList elements57 = rulesElement.getElementsByTagName("Action"); + Element actionElement = elements57.getLength() > 0 ? ((Element) elements57.item(0)) : null; + if (actionElement != null) + { + String actionInstance; + actionInstance = actionElement.getTextContent(); + ruleInstance.setAction(actionInstance); + } + + NodeList elements58 = rulesElement.getElementsByTagName("RemoteSubnet"); + Element remoteSubnetElement = elements58.getLength() > 0 ? ((Element) elements58.item(0)) : null; + if (remoteSubnetElement != null) + { + String remoteSubnetInstance; + remoteSubnetInstance = remoteSubnetElement.getTextContent(); + ruleInstance.setRemoteSubnet(remoteSubnetInstance); + } + + NodeList elements59 = rulesElement.getElementsByTagName("Description"); + Element descriptionElement = elements59.getLength() > 0 ? ((Element) elements59.item(0)) : null; + if (descriptionElement != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + ruleInstance.setDescription(descriptionInstance); + } } } } } } - } - - NodeList elements60 = configurationSetsElement.getElementsByTagName("SubnetNames"); - Element subnetNamesSequenceElement = elements60.getLength() > 0 ? ((Element) elements60.item(0)) : null; - if (subnetNamesSequenceElement != null) - { - for (int i8 = 0; i8 < subnetNamesSequenceElement.getElementsByTagName("SubnetName").getLength(); i8 = i8 + 1) - { - org.w3c.dom.Element subnetNamesElement = ((org.w3c.dom.Element) subnetNamesSequenceElement.getElementsByTagName("SubnetName").item(i8)); - configurationSetInstance.getSubnetNames().add(subnetNamesElement.getTextContent()); - } - } - - NodeList elements61 = configurationSetsElement.getElementsByTagName("ComputerName"); - Element computerNameElement = elements61.getLength() > 0 ? ((Element) elements61.item(0)) : null; - if (computerNameElement != null) - { - String computerNameInstance; - computerNameInstance = computerNameElement.getTextContent(); - configurationSetInstance.setComputerName(computerNameInstance); - } - - NodeList elements62 = configurationSetsElement.getElementsByTagName("AdminPassword"); - Element adminPasswordElement = elements62.getLength() > 0 ? ((Element) elements62.item(0)) : null; - if (adminPasswordElement != null) - { - String adminPasswordInstance; - adminPasswordInstance = adminPasswordElement.getTextContent(); - configurationSetInstance.setAdminPassword(adminPasswordInstance); - } - - NodeList elements63 = configurationSetsElement.getElementsByTagName("ResetPasswordOnFirstLogon"); - Element resetPasswordOnFirstLogonElement = elements63.getLength() > 0 ? ((Element) elements63.item(0)) : null; - if (resetPasswordOnFirstLogonElement != null && (resetPasswordOnFirstLogonElement.getTextContent() != null && resetPasswordOnFirstLogonElement.getTextContent().isEmpty() != true) == false) - { - boolean resetPasswordOnFirstLogonInstance; - resetPasswordOnFirstLogonInstance = Boolean.parseBoolean(resetPasswordOnFirstLogonElement.getTextContent()); - configurationSetInstance.setResetPasswordOnFirstLogon(resetPasswordOnFirstLogonInstance); - } - - NodeList elements64 = configurationSetsElement.getElementsByTagName("EnableAutomaticUpdates"); - Element enableAutomaticUpdatesElement = elements64.getLength() > 0 ? ((Element) elements64.item(0)) : null; - if (enableAutomaticUpdatesElement != null && (enableAutomaticUpdatesElement.getTextContent() != null && enableAutomaticUpdatesElement.getTextContent().isEmpty() != true) == false) - { - boolean enableAutomaticUpdatesInstance; - enableAutomaticUpdatesInstance = Boolean.parseBoolean(enableAutomaticUpdatesElement.getTextContent()); - configurationSetInstance.setEnableAutomaticUpdates(enableAutomaticUpdatesInstance); - } - - NodeList elements65 = configurationSetsElement.getElementsByTagName("TimeZone"); - Element timeZoneElement = elements65.getLength() > 0 ? ((Element) elements65.item(0)) : null; - if (timeZoneElement != null) - { - String timeZoneInstance; - timeZoneInstance = timeZoneElement.getTextContent(); - configurationSetInstance.setTimeZone(timeZoneInstance); - } - - NodeList elements66 = configurationSetsElement.getElementsByTagName("DomainJoin"); - Element domainJoinElement = elements66.getLength() > 0 ? ((Element) elements66.item(0)) : null; - if (domainJoinElement != null) - { - DomainJoinSettings domainJoinInstance = new DomainJoinSettings(); - configurationSetInstance.setDomainJoin(domainJoinInstance); - NodeList elements67 = domainJoinElement.getElementsByTagName("Credentials"); - Element credentialsElement = elements67.getLength() > 0 ? ((Element) elements67.item(0)) : null; - if (credentialsElement != null) + NodeList elements60 = configurationSetsElement.getElementsByTagName("SubnetNames"); + Element subnetNamesSequenceElement = elements60.getLength() > 0 ? ((Element) elements60.item(0)) : null; + if (subnetNamesSequenceElement != null) { - DomainJoinCredentials credentialsInstance = new DomainJoinCredentials(); - domainJoinInstance.setCredentials(credentialsInstance); - - NodeList elements68 = credentialsElement.getElementsByTagName("Domain"); - Element domainElement = elements68.getLength() > 0 ? ((Element) elements68.item(0)) : null; - if (domainElement != null) - { - String domainInstance; - domainInstance = domainElement.getTextContent(); - credentialsInstance.setDomain(domainInstance); - } - - NodeList elements69 = credentialsElement.getElementsByTagName("Username"); - Element usernameElement = elements69.getLength() > 0 ? ((Element) elements69.item(0)) : null; - if (usernameElement != null) - { - String usernameInstance; - usernameInstance = usernameElement.getTextContent(); - credentialsInstance.setUserName(usernameInstance); - } - - NodeList elements70 = credentialsElement.getElementsByTagName("Password"); - Element passwordElement = elements70.getLength() > 0 ? ((Element) elements70.item(0)) : null; - if (passwordElement != null) + for (int i8 = 0; i8 < subnetNamesSequenceElement.getElementsByTagName("SubnetName").getLength(); i8 = i8 + 1) { - String passwordInstance; - passwordInstance = passwordElement.getTextContent(); - credentialsInstance.setPassword(passwordInstance); + org.w3c.dom.Element subnetNamesElement = ((org.w3c.dom.Element) subnetNamesSequenceElement.getElementsByTagName("SubnetName").item(i8)); + configurationSetInstance.getSubnetNames().add(subnetNamesElement.getTextContent()); } } - NodeList elements71 = domainJoinElement.getElementsByTagName("JoinDomain"); - Element joinDomainElement = elements71.getLength() > 0 ? ((Element) elements71.item(0)) : null; - if (joinDomainElement != null) + NodeList elements61 = configurationSetsElement.getElementsByTagName("StaticVirtualNetworkIPAddress"); + Element staticVirtualNetworkIPAddressElement = elements61.getLength() > 0 ? ((Element) elements61.item(0)) : null; + if (staticVirtualNetworkIPAddressElement != null) + { + String staticVirtualNetworkIPAddressInstance; + staticVirtualNetworkIPAddressInstance = staticVirtualNetworkIPAddressElement.getTextContent(); + configurationSetInstance.setStaticVirtualNetworkIPAddress(staticVirtualNetworkIPAddressInstance); + } + + NodeList elements62 = configurationSetsElement.getElementsByTagName("ComputerName"); + Element computerNameElement = elements62.getLength() > 0 ? ((Element) elements62.item(0)) : null; + if (computerNameElement != null) + { + String computerNameInstance; + computerNameInstance = computerNameElement.getTextContent(); + configurationSetInstance.setComputerName(computerNameInstance); + } + + NodeList elements63 = configurationSetsElement.getElementsByTagName("AdminPassword"); + Element adminPasswordElement = elements63.getLength() > 0 ? ((Element) elements63.item(0)) : null; + if (adminPasswordElement != null) + { + String adminPasswordInstance; + adminPasswordInstance = adminPasswordElement.getTextContent(); + configurationSetInstance.setAdminPassword(adminPasswordInstance); + } + + NodeList elements64 = configurationSetsElement.getElementsByTagName("ResetPasswordOnFirstLogon"); + Element resetPasswordOnFirstLogonElement = elements64.getLength() > 0 ? ((Element) elements64.item(0)) : null; + if (resetPasswordOnFirstLogonElement != null && (resetPasswordOnFirstLogonElement.getTextContent() != null && resetPasswordOnFirstLogonElement.getTextContent().isEmpty() != true) == false) + { + boolean resetPasswordOnFirstLogonInstance; + resetPasswordOnFirstLogonInstance = Boolean.parseBoolean(resetPasswordOnFirstLogonElement.getTextContent()); + configurationSetInstance.setResetPasswordOnFirstLogon(resetPasswordOnFirstLogonInstance); + } + + NodeList elements65 = configurationSetsElement.getElementsByTagName("EnableAutomaticUpdates"); + Element enableAutomaticUpdatesElement = elements65.getLength() > 0 ? ((Element) elements65.item(0)) : null; + if (enableAutomaticUpdatesElement != null && (enableAutomaticUpdatesElement.getTextContent() != null && enableAutomaticUpdatesElement.getTextContent().isEmpty() != true) == false) { - String joinDomainInstance; - joinDomainInstance = joinDomainElement.getTextContent(); - domainJoinInstance.setDomainToJoin(joinDomainInstance); + boolean enableAutomaticUpdatesInstance; + enableAutomaticUpdatesInstance = Boolean.parseBoolean(enableAutomaticUpdatesElement.getTextContent()); + configurationSetInstance.setEnableAutomaticUpdates(enableAutomaticUpdatesInstance); } - NodeList elements72 = domainJoinElement.getElementsByTagName("MachineObjectOU"); - Element machineObjectOUElement = elements72.getLength() > 0 ? ((Element) elements72.item(0)) : null; - if (machineObjectOUElement != null) + NodeList elements66 = configurationSetsElement.getElementsByTagName("TimeZone"); + Element timeZoneElement = elements66.getLength() > 0 ? ((Element) elements66.item(0)) : null; + if (timeZoneElement != null) { - String machineObjectOUInstance; - machineObjectOUInstance = machineObjectOUElement.getTextContent(); - domainJoinInstance.setLdapMachineObjectOU(machineObjectOUInstance); + String timeZoneInstance; + timeZoneInstance = timeZoneElement.getTextContent(); + configurationSetInstance.setTimeZone(timeZoneInstance); } - NodeList elements73 = domainJoinElement.getElementsByTagName("Provisioning"); - Element provisioningElement = elements73.getLength() > 0 ? ((Element) elements73.item(0)) : null; - if (provisioningElement != null) + NodeList elements67 = configurationSetsElement.getElementsByTagName("DomainJoin"); + Element domainJoinElement = elements67.getLength() > 0 ? ((Element) elements67.item(0)) : null; + if (domainJoinElement != null) { - DomainJoinProvisioning provisioningInstance = new DomainJoinProvisioning(); - domainJoinInstance.setProvisioning(provisioningInstance); + DomainJoinSettings domainJoinInstance = new DomainJoinSettings(); + configurationSetInstance.setDomainJoin(domainJoinInstance); - NodeList elements74 = provisioningElement.getElementsByTagName("AccountData"); - Element accountDataElement = elements74.getLength() > 0 ? ((Element) elements74.item(0)) : null; - if (accountDataElement != null) + NodeList elements68 = domainJoinElement.getElementsByTagName("Credentials"); + Element credentialsElement = elements68.getLength() > 0 ? ((Element) elements68.item(0)) : null; + if (credentialsElement != null) { - String accountDataInstance; - accountDataInstance = accountDataElement.getTextContent(); - provisioningInstance.setAccountData(accountDataInstance); + DomainJoinCredentials credentialsInstance = new DomainJoinCredentials(); + domainJoinInstance.setCredentials(credentialsInstance); + + NodeList elements69 = credentialsElement.getElementsByTagName("Domain"); + Element domainElement = elements69.getLength() > 0 ? ((Element) elements69.item(0)) : null; + if (domainElement != null) + { + String domainInstance; + domainInstance = domainElement.getTextContent(); + credentialsInstance.setDomain(domainInstance); + } + + NodeList elements70 = credentialsElement.getElementsByTagName("Username"); + Element usernameElement = elements70.getLength() > 0 ? ((Element) elements70.item(0)) : null; + if (usernameElement != null) + { + String usernameInstance; + usernameInstance = usernameElement.getTextContent(); + credentialsInstance.setUserName(usernameInstance); + } + + NodeList elements71 = credentialsElement.getElementsByTagName("Password"); + Element passwordElement = elements71.getLength() > 0 ? ((Element) elements71.item(0)) : null; + if (passwordElement != null) + { + String passwordInstance; + passwordInstance = passwordElement.getTextContent(); + credentialsInstance.setPassword(passwordInstance); + } } - } - } - - NodeList elements75 = configurationSetsElement.getElementsByTagName("StoredCertificateSettings"); - Element storedCertificateSettingsSequenceElement = elements75.getLength() > 0 ? ((Element) elements75.item(0)) : null; - if (storedCertificateSettingsSequenceElement != null) - { - for (int i9 = 0; i9 < storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").getLength(); i9 = i9 + 1) - { - org.w3c.dom.Element storedCertificateSettingsElement = ((org.w3c.dom.Element) storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").item(i9)); - StoredCertificateSettings certificateSettingInstance = new StoredCertificateSettings(); - configurationSetInstance.getStoredCertificateSettings().add(certificateSettingInstance); - NodeList elements76 = storedCertificateSettingsElement.getElementsByTagName("StoreLocation"); - Element storeLocationElement = elements76.getLength() > 0 ? ((Element) elements76.item(0)) : null; - if (storeLocationElement != null) + NodeList elements72 = domainJoinElement.getElementsByTagName("JoinDomain"); + Element joinDomainElement = elements72.getLength() > 0 ? ((Element) elements72.item(0)) : null; + if (joinDomainElement != null) { + String joinDomainInstance; + joinDomainInstance = joinDomainElement.getTextContent(); + domainJoinInstance.setDomainToJoin(joinDomainInstance); } - NodeList elements77 = storedCertificateSettingsElement.getElementsByTagName("StoreName"); - Element storeNameElement = elements77.getLength() > 0 ? ((Element) elements77.item(0)) : null; - if (storeNameElement != null) + NodeList elements73 = domainJoinElement.getElementsByTagName("MachineObjectOU"); + Element machineObjectOUElement = elements73.getLength() > 0 ? ((Element) elements73.item(0)) : null; + if (machineObjectOUElement != null) { - String storeNameInstance; - storeNameInstance = storeNameElement.getTextContent(); - certificateSettingInstance.setStoreName(storeNameInstance); + String machineObjectOUInstance; + machineObjectOUInstance = machineObjectOUElement.getTextContent(); + domainJoinInstance.setLdapMachineObjectOU(machineObjectOUInstance); } - NodeList elements78 = storedCertificateSettingsElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements78.getLength() > 0 ? ((Element) elements78.item(0)) : null; - if (thumbprintElement != null) + NodeList elements74 = domainJoinElement.getElementsByTagName("Provisioning"); + Element provisioningElement = elements74.getLength() > 0 ? ((Element) elements74.item(0)) : null; + if (provisioningElement != null) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - certificateSettingInstance.setThumbprint(thumbprintInstance); + DomainJoinProvisioning provisioningInstance = new DomainJoinProvisioning(); + domainJoinInstance.setProvisioning(provisioningInstance); + + NodeList elements75 = provisioningElement.getElementsByTagName("AccountData"); + Element accountDataElement = elements75.getLength() > 0 ? ((Element) elements75.item(0)) : null; + if (accountDataElement != null) + { + String accountDataInstance; + accountDataInstance = accountDataElement.getTextContent(); + provisioningInstance.setAccountData(accountDataInstance); + } } } - } - - NodeList elements79 = configurationSetsElement.getElementsByTagName("WinRM"); - Element winRMElement = elements79.getLength() > 0 ? ((Element) elements79.item(0)) : null; - if (winRMElement != null) - { - WindowsRemoteManagementSettings winRMInstance = new WindowsRemoteManagementSettings(); - configurationSetInstance.setWindowsRemoteManagement(winRMInstance); - NodeList elements80 = winRMElement.getElementsByTagName("Listeners"); - Element listenersSequenceElement = elements80.getLength() > 0 ? ((Element) elements80.item(0)) : null; - if (listenersSequenceElement != null) + NodeList elements76 = configurationSetsElement.getElementsByTagName("StoredCertificateSettings"); + Element storedCertificateSettingsSequenceElement = elements76.getLength() > 0 ? ((Element) elements76.item(0)) : null; + if (storedCertificateSettingsSequenceElement != null) { - for (int i10 = 0; i10 < listenersSequenceElement.getElementsByTagName("Listener").getLength(); i10 = i10 + 1) + for (int i9 = 0; i9 < storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").getLength(); i9 = i9 + 1) { - org.w3c.dom.Element listenersElement = ((org.w3c.dom.Element) listenersSequenceElement.getElementsByTagName("Listener").item(i10)); - WindowsRemoteManagementListener listenerInstance = new WindowsRemoteManagementListener(); - winRMInstance.getListeners().add(listenerInstance); + org.w3c.dom.Element storedCertificateSettingsElement = ((org.w3c.dom.Element) storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").item(i9)); + StoredCertificateSettings certificateSettingInstance = new StoredCertificateSettings(); + configurationSetInstance.getStoredCertificateSettings().add(certificateSettingInstance); - NodeList elements81 = listenersElement.getElementsByTagName("Protocol"); - Element protocolElement4 = elements81.getLength() > 0 ? ((Element) elements81.item(0)) : null; - if (protocolElement4 != null) + NodeList elements77 = storedCertificateSettingsElement.getElementsByTagName("StoreLocation"); + Element storeLocationElement = elements77.getLength() > 0 ? ((Element) elements77.item(0)) : null; + if (storeLocationElement != null) { - VirtualMachineWindowsRemoteManagementListenerType protocolInstance4; - protocolInstance4 = VirtualMachineWindowsRemoteManagementListenerType.valueOf(protocolElement4.getTextContent()); - listenerInstance.setListenerType(protocolInstance4); } - NodeList elements82 = listenersElement.getElementsByTagName("CertificateThumbprint"); - Element certificateThumbprintElement = elements82.getLength() > 0 ? ((Element) elements82.item(0)) : null; - if (certificateThumbprintElement != null) + NodeList elements78 = storedCertificateSettingsElement.getElementsByTagName("StoreName"); + Element storeNameElement = elements78.getLength() > 0 ? ((Element) elements78.item(0)) : null; + if (storeNameElement != null) { - String certificateThumbprintInstance; - certificateThumbprintInstance = certificateThumbprintElement.getTextContent(); - listenerInstance.setCertificateThumbprint(certificateThumbprintInstance); + String storeNameInstance; + storeNameInstance = storeNameElement.getTextContent(); + certificateSettingInstance.setStoreName(storeNameInstance); + } + + NodeList elements79 = storedCertificateSettingsElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements79.getLength() > 0 ? ((Element) elements79.item(0)) : null; + if (thumbprintElement != null) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + certificateSettingInstance.setThumbprint(thumbprintInstance); } } } - } - - NodeList elements83 = configurationSetsElement.getElementsByTagName("AdminUsername"); - Element adminUsernameElement = elements83.getLength() > 0 ? ((Element) elements83.item(0)) : null; - if (adminUsernameElement != null) - { - String adminUsernameInstance; - adminUsernameInstance = adminUsernameElement.getTextContent(); - configurationSetInstance.setAdminUserName(adminUsernameInstance); - } - - NodeList elements84 = configurationSetsElement.getElementsByTagName("HostName"); - Element hostNameElement2 = elements84.getLength() > 0 ? ((Element) elements84.item(0)) : null; - if (hostNameElement2 != null) - { - String hostNameInstance2; - hostNameInstance2 = hostNameElement2.getTextContent(); - configurationSetInstance.setHostName(hostNameInstance2); - } - - NodeList elements85 = configurationSetsElement.getElementsByTagName("UserName"); - Element userNameElement = elements85.getLength() > 0 ? ((Element) elements85.item(0)) : null; - if (userNameElement != null) - { - String userNameInstance; - userNameInstance = userNameElement.getTextContent(); - configurationSetInstance.setUserName(userNameInstance); - } - - NodeList elements86 = configurationSetsElement.getElementsByTagName("UserPassword"); - Element userPasswordElement = elements86.getLength() > 0 ? ((Element) elements86.item(0)) : null; - if (userPasswordElement != null) - { - String userPasswordInstance; - userPasswordInstance = userPasswordElement.getTextContent(); - configurationSetInstance.setUserPassword(userPasswordInstance); - } - - NodeList elements87 = configurationSetsElement.getElementsByTagName("DisableSshPasswordAuthentication"); - Element disableSshPasswordAuthenticationElement = elements87.getLength() > 0 ? ((Element) elements87.item(0)) : null; - if (disableSshPasswordAuthenticationElement != null && (disableSshPasswordAuthenticationElement.getTextContent() != null && disableSshPasswordAuthenticationElement.getTextContent().isEmpty() != true) == false) - { - boolean disableSshPasswordAuthenticationInstance; - disableSshPasswordAuthenticationInstance = Boolean.parseBoolean(disableSshPasswordAuthenticationElement.getTextContent()); - configurationSetInstance.setDisableSshPasswordAuthentication(disableSshPasswordAuthenticationInstance); - } - - NodeList elements88 = configurationSetsElement.getElementsByTagName("SSH"); - Element sSHElement = elements88.getLength() > 0 ? ((Element) elements88.item(0)) : null; - if (sSHElement != null) - { - SshSettings sSHInstance = new SshSettings(); - configurationSetInstance.setSshSettings(sSHInstance); - NodeList elements89 = sSHElement.getElementsByTagName("PublicKeys"); - Element publicKeysSequenceElement = elements89.getLength() > 0 ? ((Element) elements89.item(0)) : null; - if (publicKeysSequenceElement != null) + NodeList elements80 = configurationSetsElement.getElementsByTagName("WinRM"); + Element winRMElement = elements80.getLength() > 0 ? ((Element) elements80.item(0)) : null; + if (winRMElement != null) { - for (int i11 = 0; i11 < publicKeysSequenceElement.getElementsByTagName("PublicKey").getLength(); i11 = i11 + 1) + WindowsRemoteManagementSettings winRMInstance = new WindowsRemoteManagementSettings(); + configurationSetInstance.setWindowsRemoteManagement(winRMInstance); + + NodeList elements81 = winRMElement.getElementsByTagName("Listeners"); + Element listenersSequenceElement = elements81.getLength() > 0 ? ((Element) elements81.item(0)) : null; + if (listenersSequenceElement != null) { - org.w3c.dom.Element publicKeysElement = ((org.w3c.dom.Element) publicKeysSequenceElement.getElementsByTagName("PublicKey").item(i11)); - SshSettingPublicKey publicKeyInstance = new SshSettingPublicKey(); - sSHInstance.getPublicKeys().add(publicKeyInstance); - - NodeList elements90 = publicKeysElement.getElementsByTagName("Fingerprint"); - Element fingerprintElement = elements90.getLength() > 0 ? ((Element) elements90.item(0)) : null; - if (fingerprintElement != null) - { - String fingerprintInstance; - fingerprintInstance = fingerprintElement.getTextContent(); - publicKeyInstance.setFingerprint(fingerprintInstance); - } - - NodeList elements91 = publicKeysElement.getElementsByTagName("Path"); - Element pathElement2 = elements91.getLength() > 0 ? ((Element) elements91.item(0)) : null; - if (pathElement2 != null) + for (int i10 = 0; i10 < listenersSequenceElement.getElementsByTagName("Listener").getLength(); i10 = i10 + 1) { - String pathInstance2; - pathInstance2 = pathElement2.getTextContent(); - publicKeyInstance.setPath(pathInstance2); + org.w3c.dom.Element listenersElement = ((org.w3c.dom.Element) listenersSequenceElement.getElementsByTagName("Listener").item(i10)); + WindowsRemoteManagementListener listenerInstance = new WindowsRemoteManagementListener(); + winRMInstance.getListeners().add(listenerInstance); + + NodeList elements82 = listenersElement.getElementsByTagName("Protocol"); + Element protocolElement4 = elements82.getLength() > 0 ? ((Element) elements82.item(0)) : null; + if (protocolElement4 != null) + { + VirtualMachineWindowsRemoteManagementListenerType protocolInstance4; + protocolInstance4 = VirtualMachineWindowsRemoteManagementListenerType.valueOf(protocolElement4.getTextContent()); + listenerInstance.setListenerType(protocolInstance4); + } + + NodeList elements83 = listenersElement.getElementsByTagName("CertificateThumbprint"); + Element certificateThumbprintElement = elements83.getLength() > 0 ? ((Element) elements83.item(0)) : null; + if (certificateThumbprintElement != null) + { + String certificateThumbprintInstance; + certificateThumbprintInstance = certificateThumbprintElement.getTextContent(); + listenerInstance.setCertificateThumbprint(certificateThumbprintInstance); + } } } } - NodeList elements92 = sSHElement.getElementsByTagName("KeyPairs"); - Element keyPairsSequenceElement = elements92.getLength() > 0 ? ((Element) elements92.item(0)) : null; - if (keyPairsSequenceElement != null) + NodeList elements84 = configurationSetsElement.getElementsByTagName("AdminUsername"); + Element adminUsernameElement = elements84.getLength() > 0 ? ((Element) elements84.item(0)) : null; + if (adminUsernameElement != null) + { + String adminUsernameInstance; + adminUsernameInstance = adminUsernameElement.getTextContent(); + configurationSetInstance.setAdminUserName(adminUsernameInstance); + } + + NodeList elements85 = configurationSetsElement.getElementsByTagName("HostName"); + Element hostNameElement2 = elements85.getLength() > 0 ? ((Element) elements85.item(0)) : null; + if (hostNameElement2 != null) + { + String hostNameInstance2; + hostNameInstance2 = hostNameElement2.getTextContent(); + configurationSetInstance.setHostName(hostNameInstance2); + } + + NodeList elements86 = configurationSetsElement.getElementsByTagName("UserName"); + Element userNameElement = elements86.getLength() > 0 ? ((Element) elements86.item(0)) : null; + if (userNameElement != null) + { + String userNameInstance; + userNameInstance = userNameElement.getTextContent(); + configurationSetInstance.setUserName(userNameInstance); + } + + NodeList elements87 = configurationSetsElement.getElementsByTagName("UserPassword"); + Element userPasswordElement = elements87.getLength() > 0 ? ((Element) elements87.item(0)) : null; + if (userPasswordElement != null) + { + String userPasswordInstance; + userPasswordInstance = userPasswordElement.getTextContent(); + configurationSetInstance.setUserPassword(userPasswordInstance); + } + + NodeList elements88 = configurationSetsElement.getElementsByTagName("DisableSshPasswordAuthentication"); + Element disableSshPasswordAuthenticationElement = elements88.getLength() > 0 ? ((Element) elements88.item(0)) : null; + if (disableSshPasswordAuthenticationElement != null && (disableSshPasswordAuthenticationElement.getTextContent() != null && disableSshPasswordAuthenticationElement.getTextContent().isEmpty() != true) == false) + { + boolean disableSshPasswordAuthenticationInstance; + disableSshPasswordAuthenticationInstance = Boolean.parseBoolean(disableSshPasswordAuthenticationElement.getTextContent()); + configurationSetInstance.setDisableSshPasswordAuthentication(disableSshPasswordAuthenticationInstance); + } + + NodeList elements89 = configurationSetsElement.getElementsByTagName("SSH"); + Element sSHElement = elements89.getLength() > 0 ? ((Element) elements89.item(0)) : null; + if (sSHElement != null) { - for (int i12 = 0; i12 < keyPairsSequenceElement.getElementsByTagName("KeyPair").getLength(); i12 = i12 + 1) + SshSettings sSHInstance = new SshSettings(); + configurationSetInstance.setSshSettings(sSHInstance); + + NodeList elements90 = sSHElement.getElementsByTagName("PublicKeys"); + Element publicKeysSequenceElement = elements90.getLength() > 0 ? ((Element) elements90.item(0)) : null; + if (publicKeysSequenceElement != null) { - org.w3c.dom.Element keyPairsElement = ((org.w3c.dom.Element) keyPairsSequenceElement.getElementsByTagName("KeyPair").item(i12)); - SshSettingKeyPair keyPairInstance = new SshSettingKeyPair(); - sSHInstance.getKeyPairs().add(keyPairInstance); - - NodeList elements93 = keyPairsElement.getElementsByTagName("Fingerprint"); - Element fingerprintElement2 = elements93.getLength() > 0 ? ((Element) elements93.item(0)) : null; - if (fingerprintElement2 != null) + for (int i11 = 0; i11 < publicKeysSequenceElement.getElementsByTagName("PublicKey").getLength(); i11 = i11 + 1) { - String fingerprintInstance2; - fingerprintInstance2 = fingerprintElement2.getTextContent(); - keyPairInstance.setFingerprint(fingerprintInstance2); + org.w3c.dom.Element publicKeysElement = ((org.w3c.dom.Element) publicKeysSequenceElement.getElementsByTagName("PublicKey").item(i11)); + SshSettingPublicKey publicKeyInstance = new SshSettingPublicKey(); + sSHInstance.getPublicKeys().add(publicKeyInstance); + + NodeList elements91 = publicKeysElement.getElementsByTagName("Fingerprint"); + Element fingerprintElement = elements91.getLength() > 0 ? ((Element) elements91.item(0)) : null; + if (fingerprintElement != null) + { + String fingerprintInstance; + fingerprintInstance = fingerprintElement.getTextContent(); + publicKeyInstance.setFingerprint(fingerprintInstance); + } + + NodeList elements92 = publicKeysElement.getElementsByTagName("Path"); + Element pathElement2 = elements92.getLength() > 0 ? ((Element) elements92.item(0)) : null; + if (pathElement2 != null) + { + String pathInstance2; + pathInstance2 = pathElement2.getTextContent(); + publicKeyInstance.setPath(pathInstance2); + } } - - NodeList elements94 = keyPairsElement.getElementsByTagName("Path"); - Element pathElement3 = elements94.getLength() > 0 ? ((Element) elements94.item(0)) : null; - if (pathElement3 != null) + } + + NodeList elements93 = sSHElement.getElementsByTagName("KeyPairs"); + Element keyPairsSequenceElement = elements93.getLength() > 0 ? ((Element) elements93.item(0)) : null; + if (keyPairsSequenceElement != null) + { + for (int i12 = 0; i12 < keyPairsSequenceElement.getElementsByTagName("KeyPair").getLength(); i12 = i12 + 1) { - String pathInstance3; - pathInstance3 = pathElement3.getTextContent(); - keyPairInstance.setPath(pathInstance3); + org.w3c.dom.Element keyPairsElement = ((org.w3c.dom.Element) keyPairsSequenceElement.getElementsByTagName("KeyPair").item(i12)); + SshSettingKeyPair keyPairInstance = new SshSettingKeyPair(); + sSHInstance.getKeyPairs().add(keyPairInstance); + + NodeList elements94 = keyPairsElement.getElementsByTagName("Fingerprint"); + Element fingerprintElement2 = elements94.getLength() > 0 ? ((Element) elements94.item(0)) : null; + if (fingerprintElement2 != null) + { + String fingerprintInstance2; + fingerprintInstance2 = fingerprintElement2.getTextContent(); + keyPairInstance.setFingerprint(fingerprintInstance2); + } + + NodeList elements95 = keyPairsElement.getElementsByTagName("Path"); + Element pathElement3 = elements95.getLength() > 0 ? ((Element) elements95.item(0)) : null; + if (pathElement3 != null) + { + String pathInstance3; + pathInstance3 = pathElement3.getTextContent(); + keyPairInstance.setPath(pathInstance3); + } } } } } } - } - - NodeList elements95 = roleListElement.getElementsByTagName("AvailabilitySetName"); - Element availabilitySetNameElement = elements95.getLength() > 0 ? ((Element) elements95.item(0)) : null; - if (availabilitySetNameElement != null) - { - String availabilitySetNameInstance; - availabilitySetNameInstance = availabilitySetNameElement.getTextContent(); - roleInstance.setAvailabilitySetName(availabilitySetNameInstance); - } - - NodeList elements96 = roleListElement.getElementsByTagName("DataVirtualHardDisks"); - Element dataVirtualHardDisksSequenceElement = elements96.getLength() > 0 ? ((Element) elements96.item(0)) : null; - if (dataVirtualHardDisksSequenceElement != null) - { - for (int i13 = 0; i13 < dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").getLength(); i13 = i13 + 1) + + NodeList elements96 = roleListElement.getElementsByTagName("AvailabilitySetName"); + Element availabilitySetNameElement = elements96.getLength() > 0 ? ((Element) elements96.item(0)) : null; + if (availabilitySetNameElement != null) + { + String availabilitySetNameInstance; + availabilitySetNameInstance = availabilitySetNameElement.getTextContent(); + roleInstance.setAvailabilitySetName(availabilitySetNameInstance); + } + + NodeList elements97 = roleListElement.getElementsByTagName("DataVirtualHardDisks"); + Element dataVirtualHardDisksSequenceElement = elements97.getLength() > 0 ? ((Element) elements97.item(0)) : null; + if (dataVirtualHardDisksSequenceElement != null) + { + for (int i13 = 0; i13 < dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").getLength(); i13 = i13 + 1) + { + org.w3c.dom.Element dataVirtualHardDisksElement = ((org.w3c.dom.Element) dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").item(i13)); + DataVirtualHardDisk dataVirtualHardDiskInstance = new DataVirtualHardDisk(); + roleInstance.getDataVirtualHardDisks().add(dataVirtualHardDiskInstance); + + NodeList elements98 = dataVirtualHardDisksElement.getElementsByTagName("HostCaching"); + Element hostCachingElement = elements98.getLength() > 0 ? ((Element) elements98.item(0)) : null; + if (hostCachingElement != null && (hostCachingElement.getTextContent() != null && hostCachingElement.getTextContent().isEmpty() != true) == false) + { + VirtualHardDiskHostCaching hostCachingInstance; + hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); + dataVirtualHardDiskInstance.setHostCaching(hostCachingInstance); + } + + NodeList elements99 = dataVirtualHardDisksElement.getElementsByTagName("DiskLabel"); + Element diskLabelElement = elements99.getLength() > 0 ? ((Element) elements99.item(0)) : null; + if (diskLabelElement != null) + { + String diskLabelInstance; + diskLabelInstance = diskLabelElement.getTextContent(); + dataVirtualHardDiskInstance.setDiskLabel(diskLabelInstance); + } + + NodeList elements100 = dataVirtualHardDisksElement.getElementsByTagName("DiskName"); + Element diskNameElement = elements100.getLength() > 0 ? ((Element) elements100.item(0)) : null; + if (diskNameElement != null) + { + String diskNameInstance; + diskNameInstance = diskNameElement.getTextContent(); + dataVirtualHardDiskInstance.setDiskName(diskNameInstance); + } + + NodeList elements101 = dataVirtualHardDisksElement.getElementsByTagName("Lun"); + Element lunElement = elements101.getLength() > 0 ? ((Element) elements101.item(0)) : null; + if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + { + int lunInstance; + lunInstance = Integer.parseInt(lunElement.getTextContent()); + dataVirtualHardDiskInstance.setLogicalUnitNumber(lunInstance); + } + + NodeList elements102 = dataVirtualHardDisksElement.getElementsByTagName("LogicalDiskSizeInGB"); + Element logicalDiskSizeInGBElement = elements102.getLength() > 0 ? ((Element) elements102.item(0)) : null; + if (logicalDiskSizeInGBElement != null) + { + int logicalDiskSizeInGBInstance; + logicalDiskSizeInGBInstance = Integer.parseInt(logicalDiskSizeInGBElement.getTextContent()); + dataVirtualHardDiskInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + } + + NodeList elements103 = dataVirtualHardDisksElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement = elements103.getLength() > 0 ? ((Element) elements103.item(0)) : null; + if (mediaLinkElement != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); + dataVirtualHardDiskInstance.setMediaLink(mediaLinkInstance); + } + } + } + + NodeList elements104 = roleListElement.getElementsByTagName("Label"); + Element labelElement2 = elements104.getLength() > 0 ? ((Element) elements104.item(0)) : null; + if (labelElement2 != null) { - org.w3c.dom.Element dataVirtualHardDisksElement = ((org.w3c.dom.Element) dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").item(i13)); - DataVirtualHardDisk dataVirtualHardDiskInstance = new DataVirtualHardDisk(); - roleInstance.getDataVirtualHardDisks().add(dataVirtualHardDiskInstance); + String labelInstance2; + labelInstance2 = labelElement2.getTextContent(); + roleInstance.setLabel(labelInstance2); + } + + NodeList elements105 = roleListElement.getElementsByTagName("OSVirtualHardDisk"); + Element oSVirtualHardDiskElement = elements105.getLength() > 0 ? ((Element) elements105.item(0)) : null; + if (oSVirtualHardDiskElement != null) + { + OSVirtualHardDisk oSVirtualHardDiskInstance = new OSVirtualHardDisk(); + roleInstance.setOSVirtualHardDisk(oSVirtualHardDiskInstance); - NodeList elements97 = dataVirtualHardDisksElement.getElementsByTagName("HostCaching"); - Element hostCachingElement = elements97.getLength() > 0 ? ((Element) elements97.item(0)) : null; - if (hostCachingElement != null && (hostCachingElement.getTextContent() != null && hostCachingElement.getTextContent().isEmpty() != true) == false) + NodeList elements106 = oSVirtualHardDiskElement.getElementsByTagName("HostCaching"); + Element hostCachingElement2 = elements106.getLength() > 0 ? ((Element) elements106.item(0)) : null; + if (hostCachingElement2 != null && (hostCachingElement2.getTextContent() != null && hostCachingElement2.getTextContent().isEmpty() != true) == false) { - VirtualHardDiskHostCaching hostCachingInstance; - hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); - dataVirtualHardDiskInstance.setHostCaching(hostCachingInstance); + VirtualHardDiskHostCaching hostCachingInstance2; + hostCachingInstance2 = VirtualHardDiskHostCaching.valueOf(hostCachingElement2.getTextContent()); + oSVirtualHardDiskInstance.setHostCaching(hostCachingInstance2); } - NodeList elements98 = dataVirtualHardDisksElement.getElementsByTagName("DiskLabel"); - Element diskLabelElement = elements98.getLength() > 0 ? ((Element) elements98.item(0)) : null; - if (diskLabelElement != null) + NodeList elements107 = oSVirtualHardDiskElement.getElementsByTagName("DiskLabel"); + Element diskLabelElement2 = elements107.getLength() > 0 ? ((Element) elements107.item(0)) : null; + if (diskLabelElement2 != null) { - String diskLabelInstance; - diskLabelInstance = diskLabelElement.getTextContent(); - dataVirtualHardDiskInstance.setDiskLabel(diskLabelInstance); + String diskLabelInstance2; + diskLabelInstance2 = diskLabelElement2.getTextContent(); + oSVirtualHardDiskInstance.setDiskLabel(diskLabelInstance2); } - NodeList elements99 = dataVirtualHardDisksElement.getElementsByTagName("DiskName"); - Element diskNameElement = elements99.getLength() > 0 ? ((Element) elements99.item(0)) : null; - if (diskNameElement != null) + NodeList elements108 = oSVirtualHardDiskElement.getElementsByTagName("DiskName"); + Element diskNameElement2 = elements108.getLength() > 0 ? ((Element) elements108.item(0)) : null; + if (diskNameElement2 != null) { - String diskNameInstance; - diskNameInstance = diskNameElement.getTextContent(); - dataVirtualHardDiskInstance.setDiskName(diskNameInstance); + String diskNameInstance2; + diskNameInstance2 = diskNameElement2.getTextContent(); + oSVirtualHardDiskInstance.setDiskName(diskNameInstance2); } - NodeList elements100 = dataVirtualHardDisksElement.getElementsByTagName("Lun"); - Element lunElement = elements100.getLength() > 0 ? ((Element) elements100.item(0)) : null; - if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + NodeList elements109 = oSVirtualHardDiskElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement2 = elements109.getLength() > 0 ? ((Element) elements109.item(0)) : null; + if (mediaLinkElement2 != null) { - int lunInstance; - lunInstance = Integer.parseInt(lunElement.getTextContent()); - dataVirtualHardDiskInstance.setLogicalUnitNumber(lunInstance); + URI mediaLinkInstance2; + mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent()); + oSVirtualHardDiskInstance.setMediaLink(mediaLinkInstance2); } - NodeList elements101 = dataVirtualHardDisksElement.getElementsByTagName("LogicalDiskSizeInGB"); - Element logicalDiskSizeInGBElement = elements101.getLength() > 0 ? ((Element) elements101.item(0)) : null; - if (logicalDiskSizeInGBElement != null) + NodeList elements110 = oSVirtualHardDiskElement.getElementsByTagName("SourceImageName"); + Element sourceImageNameElement = elements110.getLength() > 0 ? ((Element) elements110.item(0)) : null; + if (sourceImageNameElement != null) { - int logicalDiskSizeInGBInstance; - logicalDiskSizeInGBInstance = Integer.parseInt(logicalDiskSizeInGBElement.getTextContent()); - dataVirtualHardDiskInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + String sourceImageNameInstance; + sourceImageNameInstance = sourceImageNameElement.getTextContent(); + oSVirtualHardDiskInstance.setSourceImageName(sourceImageNameInstance); } - NodeList elements102 = dataVirtualHardDisksElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement = elements102.getLength() > 0 ? ((Element) elements102.item(0)) : null; - if (mediaLinkElement != null) + NodeList elements111 = oSVirtualHardDiskElement.getElementsByTagName("OS"); + Element osElement = elements111.getLength() > 0 ? ((Element) elements111.item(0)) : null; + if (osElement != null) { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - dataVirtualHardDiskInstance.setMediaLink(mediaLinkInstance); + String osInstance; + osInstance = osElement.getTextContent(); + oSVirtualHardDiskInstance.setOperatingSystem(osInstance); } } - } - - NodeList elements103 = roleListElement.getElementsByTagName("Label"); - Element labelElement2 = elements103.getLength() > 0 ? ((Element) elements103.item(0)) : null; - if (labelElement2 != null) - { - String labelInstance2; - labelInstance2 = labelElement2.getTextContent(); - roleInstance.setLabel(labelInstance2); - } - - NodeList elements104 = roleListElement.getElementsByTagName("OSVirtualHardDisk"); - Element oSVirtualHardDiskElement = elements104.getLength() > 0 ? ((Element) elements104.item(0)) : null; - if (oSVirtualHardDiskElement != null) - { - OSVirtualHardDisk oSVirtualHardDiskInstance = new OSVirtualHardDisk(); - roleInstance.setOSVirtualHardDisk(oSVirtualHardDiskInstance); - - NodeList elements105 = oSVirtualHardDiskElement.getElementsByTagName("HostCaching"); - Element hostCachingElement2 = elements105.getLength() > 0 ? ((Element) elements105.item(0)) : null; - if (hostCachingElement2 != null && (hostCachingElement2.getTextContent() != null && hostCachingElement2.getTextContent().isEmpty() != true) == false) - { - VirtualHardDiskHostCaching hostCachingInstance2; - hostCachingInstance2 = VirtualHardDiskHostCaching.valueOf(hostCachingElement2.getTextContent()); - oSVirtualHardDiskInstance.setHostCaching(hostCachingInstance2); - } - NodeList elements106 = oSVirtualHardDiskElement.getElementsByTagName("DiskLabel"); - Element diskLabelElement2 = elements106.getLength() > 0 ? ((Element) elements106.item(0)) : null; - if (diskLabelElement2 != null) + NodeList elements112 = roleListElement.getElementsByTagName("RoleSize"); + Element roleSizeElement = elements112.getLength() > 0 ? ((Element) elements112.item(0)) : null; + if (roleSizeElement != null) { - String diskLabelInstance2; - diskLabelInstance2 = diskLabelElement2.getTextContent(); - oSVirtualHardDiskInstance.setDiskLabel(diskLabelInstance2); + String roleSizeInstance; + roleSizeInstance = roleSizeElement.getTextContent(); + roleInstance.setRoleSize(roleSizeInstance); } - NodeList elements107 = oSVirtualHardDiskElement.getElementsByTagName("DiskName"); - Element diskNameElement2 = elements107.getLength() > 0 ? ((Element) elements107.item(0)) : null; - if (diskNameElement2 != null) + NodeList elements113 = roleListElement.getElementsByTagName("DefaultWinRmCertificateThumbprint"); + Element defaultWinRmCertificateThumbprintElement = elements113.getLength() > 0 ? ((Element) elements113.item(0)) : null; + if (defaultWinRmCertificateThumbprintElement != null) { - String diskNameInstance2; - diskNameInstance2 = diskNameElement2.getTextContent(); - oSVirtualHardDiskInstance.setDiskName(diskNameInstance2); + String defaultWinRmCertificateThumbprintInstance; + defaultWinRmCertificateThumbprintInstance = defaultWinRmCertificateThumbprintElement.getTextContent(); + roleInstance.setDefaultWinRmCertificateThumbprint(defaultWinRmCertificateThumbprintInstance); } - - NodeList elements108 = oSVirtualHardDiskElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement2 = elements108.getLength() > 0 ? ((Element) elements108.item(0)) : null; - if (mediaLinkElement2 != null) - { - URI mediaLinkInstance2; - mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent()); - oSVirtualHardDiskInstance.setMediaLink(mediaLinkInstance2); - } - - NodeList elements109 = oSVirtualHardDiskElement.getElementsByTagName("SourceImageName"); - Element sourceImageNameElement = elements109.getLength() > 0 ? ((Element) elements109.item(0)) : null; - if (sourceImageNameElement != null) - { - String sourceImageNameInstance; - sourceImageNameInstance = sourceImageNameElement.getTextContent(); - oSVirtualHardDiskInstance.setSourceImageName(sourceImageNameInstance); - } - - NodeList elements110 = oSVirtualHardDiskElement.getElementsByTagName("OS"); - Element osElement = elements110.getLength() > 0 ? ((Element) elements110.item(0)) : null; - if (osElement != null) - { - String osInstance; - osInstance = osElement.getTextContent(); - oSVirtualHardDiskInstance.setOperatingSystem(osInstance); - } - } - - NodeList elements111 = roleListElement.getElementsByTagName("RoleSize"); - Element roleSizeElement = elements111.getLength() > 0 ? ((Element) elements111.item(0)) : null; - if (roleSizeElement != null && (roleSizeElement.getTextContent() != null && roleSizeElement.getTextContent().isEmpty() != true) == false) - { - VirtualMachineRoleSize roleSizeInstance; - roleSizeInstance = VirtualMachineRoleSize.valueOf(roleSizeElement.getTextContent()); - roleInstance.setRoleSize(roleSizeInstance); - } - - NodeList elements112 = roleListElement.getElementsByTagName("DefaultWinRmCertificateThumbprint"); - Element defaultWinRmCertificateThumbprintElement = elements112.getLength() > 0 ? ((Element) elements112.item(0)) : null; - if (defaultWinRmCertificateThumbprintElement != null) - { - String defaultWinRmCertificateThumbprintInstance; - defaultWinRmCertificateThumbprintInstance = defaultWinRmCertificateThumbprintElement.getTextContent(); - roleInstance.setDefaultWinRmCertificateThumbprint(defaultWinRmCertificateThumbprintInstance); } } - } - - NodeList elements113 = deploymentsElement.getElementsByTagName("SdkVersion"); - Element sdkVersionElement = elements113.getLength() > 0 ? ((Element) elements113.item(0)) : null; - if (sdkVersionElement != null) - { - String sdkVersionInstance; - sdkVersionInstance = sdkVersionElement.getTextContent(); - deploymentInstance.setSdkVersion(sdkVersionInstance); - } - - NodeList elements114 = deploymentsElement.getElementsByTagName("Locked"); - Element lockedElement = elements114.getLength() > 0 ? ((Element) elements114.item(0)) : null; - if (lockedElement != null) - { - boolean lockedInstance; - lockedInstance = Boolean.parseBoolean(lockedElement.getTextContent()); - deploymentInstance.setLocked(lockedInstance); - } - - NodeList elements115 = deploymentsElement.getElementsByTagName("RollbackAllowed"); - Element rollbackAllowedElement = elements115.getLength() > 0 ? ((Element) elements115.item(0)) : null; - if (rollbackAllowedElement != null) - { - String rollbackAllowedInstance; - rollbackAllowedInstance = rollbackAllowedElement.getTextContent(); - deploymentInstance.setRollbackAllowed(rollbackAllowedInstance); - } - - NodeList elements116 = deploymentsElement.getElementsByTagName("CreatedTime"); - Element createdTimeElement = elements116.getLength() > 0 ? ((Element) elements116.item(0)) : null; - if (createdTimeElement != null) - { - Calendar createdTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(createdTimeElement.getTextContent())); - createdTimeInstance = calendar; - deploymentInstance.setCreatedTime(createdTimeInstance); - } - - NodeList elements117 = deploymentsElement.getElementsByTagName("LastModifiedTime"); - Element lastModifiedTimeElement = elements117.getLength() > 0 ? ((Element) elements117.item(0)) : null; - if (lastModifiedTimeElement != null) - { - String lastModifiedTimeInstance; - lastModifiedTimeInstance = lastModifiedTimeElement.getTextContent(); - deploymentInstance.setLastModifiedTime(lastModifiedTimeInstance); - } - - NodeList elements118 = deploymentsElement.getElementsByTagName("VirtualNetworkName"); - Element virtualNetworkNameElement = elements118.getLength() > 0 ? ((Element) elements118.item(0)) : null; - if (virtualNetworkNameElement != null) - { - String virtualNetworkNameInstance; - virtualNetworkNameInstance = virtualNetworkNameElement.getTextContent(); - deploymentInstance.setVirtualNetworkName(virtualNetworkNameInstance); - } - - NodeList elements119 = deploymentsElement.getElementsByTagName("ExtendedProperties"); - Element extendedPropertiesSequenceElement = elements119.getLength() > 0 ? ((Element) elements119.item(0)) : null; - if (extendedPropertiesSequenceElement != null) - { - for (int i14 = 0; i14 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i14 = i14 + 1) + + NodeList elements114 = deploymentsElement.getElementsByTagName("SdkVersion"); + Element sdkVersionElement = elements114.getLength() > 0 ? ((Element) elements114.item(0)) : null; + if (sdkVersionElement != null) { - org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i14)); - NodeList elements120 = extendedPropertiesElement.getElementsByTagName("Name"); - String extendedPropertiesKey = elements120.getLength() > 0 ? ((org.w3c.dom.Element) elements120.item(0)).getTextContent() : null; - NodeList elements121 = extendedPropertiesElement.getElementsByTagName("Value"); - String extendedPropertiesValue = elements121.getLength() > 0 ? ((org.w3c.dom.Element) elements121.item(0)).getTextContent() : null; - deploymentInstance.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + String sdkVersionInstance; + sdkVersionInstance = sdkVersionElement.getTextContent(); + deploymentInstance.setSdkVersion(sdkVersionInstance); } - } - - NodeList elements122 = deploymentsElement.getElementsByTagName("PersistentVMDowntime"); - Element persistentVMDowntimeElement = elements122.getLength() > 0 ? ((Element) elements122.item(0)) : null; - if (persistentVMDowntimeElement != null) - { - PersistentVMDowntime persistentVMDowntimeInstance = new PersistentVMDowntime(); - deploymentInstance.setPersistentVMDowntime(persistentVMDowntimeInstance); - NodeList elements123 = persistentVMDowntimeElement.getElementsByTagName("StartTime"); - Element startTimeElement = elements123.getLength() > 0 ? ((Element) elements123.item(0)) : null; - if (startTimeElement != null) + NodeList elements115 = deploymentsElement.getElementsByTagName("Locked"); + Element lockedElement = elements115.getLength() > 0 ? ((Element) elements115.item(0)) : null; + if (lockedElement != null) { - Calendar startTimeInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(startTimeElement.getTextContent())); - startTimeInstance = calendar2; - persistentVMDowntimeInstance.setStartTime(startTimeInstance); + boolean lockedInstance; + lockedInstance = Boolean.parseBoolean(lockedElement.getTextContent()); + deploymentInstance.setLocked(lockedInstance); } - NodeList elements124 = persistentVMDowntimeElement.getElementsByTagName("EndTime"); - Element endTimeElement = elements124.getLength() > 0 ? ((Element) elements124.item(0)) : null; - if (endTimeElement != null) + NodeList elements116 = deploymentsElement.getElementsByTagName("RollbackAllowed"); + Element rollbackAllowedElement = elements116.getLength() > 0 ? ((Element) elements116.item(0)) : null; + if (rollbackAllowedElement != null) { - Calendar endTimeInstance; - SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar3 = Calendar.getInstance(); - calendar3.setTime(simpleDateFormat3.parse(endTimeElement.getTextContent())); - endTimeInstance = calendar3; - persistentVMDowntimeInstance.setEndTime(endTimeInstance); + String rollbackAllowedInstance; + rollbackAllowedInstance = rollbackAllowedElement.getTextContent(); + deploymentInstance.setRollbackAllowed(rollbackAllowedInstance); } - NodeList elements125 = persistentVMDowntimeElement.getElementsByTagName("Status"); - Element statusElement2 = elements125.getLength() > 0 ? ((Element) elements125.item(0)) : null; - if (statusElement2 != null) + NodeList elements117 = deploymentsElement.getElementsByTagName("CreatedTime"); + Element createdTimeElement = elements117.getLength() > 0 ? ((Element) elements117.item(0)) : null; + if (createdTimeElement != null) { - String statusInstance2; - statusInstance2 = statusElement2.getTextContent(); - persistentVMDowntimeInstance.setStatus(statusInstance2); + Calendar createdTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(createdTimeElement.getTextContent())); + createdTimeInstance = calendar; + deploymentInstance.setCreatedTime(createdTimeInstance); } - } - - NodeList elements126 = deploymentsElement.getElementsByTagName("VirtualIPs"); - Element virtualIPsSequenceElement = elements126.getLength() > 0 ? ((Element) elements126.item(0)) : null; - if (virtualIPsSequenceElement != null) - { - for (int i15 = 0; i15 < virtualIPsSequenceElement.getElementsByTagName("VirtualIP").getLength(); i15 = i15 + 1) + + NodeList elements118 = deploymentsElement.getElementsByTagName("LastModifiedTime"); + Element lastModifiedTimeElement = elements118.getLength() > 0 ? ((Element) elements118.item(0)) : null; + if (lastModifiedTimeElement != null) + { + String lastModifiedTimeInstance; + lastModifiedTimeInstance = lastModifiedTimeElement.getTextContent(); + deploymentInstance.setLastModifiedTime(lastModifiedTimeInstance); + } + + NodeList elements119 = deploymentsElement.getElementsByTagName("VirtualNetworkName"); + Element virtualNetworkNameElement = elements119.getLength() > 0 ? ((Element) elements119.item(0)) : null; + if (virtualNetworkNameElement != null) + { + String virtualNetworkNameInstance; + virtualNetworkNameInstance = virtualNetworkNameElement.getTextContent(); + deploymentInstance.setVirtualNetworkName(virtualNetworkNameInstance); + } + + NodeList elements120 = deploymentsElement.getElementsByTagName("ExtendedProperties"); + Element extendedPropertiesSequenceElement = elements120.getLength() > 0 ? ((Element) elements120.item(0)) : null; + if (extendedPropertiesSequenceElement != null) + { + for (int i14 = 0; i14 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i14 = i14 + 1) + { + org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i14)); + NodeList elements121 = extendedPropertiesElement.getElementsByTagName("Name"); + String extendedPropertiesKey = elements121.getLength() > 0 ? ((org.w3c.dom.Element) elements121.item(0)).getTextContent() : null; + NodeList elements122 = extendedPropertiesElement.getElementsByTagName("Value"); + String extendedPropertiesValue = elements122.getLength() > 0 ? ((org.w3c.dom.Element) elements122.item(0)).getTextContent() : null; + deploymentInstance.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + } + } + + NodeList elements123 = deploymentsElement.getElementsByTagName("PersistentVMDowntime"); + Element persistentVMDowntimeElement = elements123.getLength() > 0 ? ((Element) elements123.item(0)) : null; + if (persistentVMDowntimeElement != null) { - org.w3c.dom.Element virtualIPsElement = ((org.w3c.dom.Element) virtualIPsSequenceElement.getElementsByTagName("VirtualIP").item(i15)); - VirtualIPAddress virtualIPInstance = new VirtualIPAddress(); - deploymentInstance.getVirtualIPAddresses().add(virtualIPInstance); + PersistentVMDowntime persistentVMDowntimeInstance = new PersistentVMDowntime(); + deploymentInstance.setPersistentVMDowntime(persistentVMDowntimeInstance); - NodeList elements127 = virtualIPsElement.getElementsByTagName("Address"); - Element addressElement = elements127.getLength() > 0 ? ((Element) elements127.item(0)) : null; - if (addressElement != null) + NodeList elements124 = persistentVMDowntimeElement.getElementsByTagName("StartTime"); + Element startTimeElement = elements124.getLength() > 0 ? ((Element) elements124.item(0)) : null; + if (startTimeElement != null) { - InetAddress addressInstance; - addressInstance = InetAddress.getByName(addressElement.getTextContent()); - virtualIPInstance.setAddress(addressInstance); + Calendar startTimeInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(startTimeElement.getTextContent())); + startTimeInstance = calendar2; + persistentVMDowntimeInstance.setStartTime(startTimeInstance); } - NodeList elements128 = virtualIPsElement.getElementsByTagName("Name"); - Element nameElement4 = elements128.getLength() > 0 ? ((Element) elements128.item(0)) : null; - if (nameElement4 != null) + NodeList elements125 = persistentVMDowntimeElement.getElementsByTagName("EndTime"); + Element endTimeElement = elements125.getLength() > 0 ? ((Element) elements125.item(0)) : null; + if (endTimeElement != null) { - String nameInstance4; - nameInstance4 = nameElement4.getTextContent(); - virtualIPInstance.setName(nameInstance4); + Calendar endTimeInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(endTimeElement.getTextContent())); + endTimeInstance = calendar3; + persistentVMDowntimeInstance.setEndTime(endTimeInstance); } - NodeList elements129 = virtualIPsElement.getElementsByTagName("IsDnsProgrammed"); - Element isDnsProgrammedElement = elements129.getLength() > 0 ? ((Element) elements129.item(0)) : null; - if (isDnsProgrammedElement != null && (isDnsProgrammedElement.getTextContent() != null && isDnsProgrammedElement.getTextContent().isEmpty() != true) == false) + NodeList elements126 = persistentVMDowntimeElement.getElementsByTagName("Status"); + Element statusElement2 = elements126.getLength() > 0 ? ((Element) elements126.item(0)) : null; + if (statusElement2 != null) { - boolean isDnsProgrammedInstance; - isDnsProgrammedInstance = Boolean.parseBoolean(isDnsProgrammedElement.getTextContent()); - virtualIPInstance.setIsDnsProgrammed(isDnsProgrammedInstance); + String statusInstance2; + statusInstance2 = statusElement2.getTextContent(); + persistentVMDowntimeInstance.setStatus(statusInstance2); } } - } - - NodeList elements130 = deploymentsElement.getElementsByTagName("Dns"); - Element dnsElement = elements130.getLength() > 0 ? ((Element) elements130.item(0)) : null; - if (dnsElement != null) - { - DnsSettings dnsInstance = new DnsSettings(); - deploymentInstance.setDnsSettings(dnsInstance); - NodeList elements131 = dnsElement.getElementsByTagName("DnsServers"); - Element dnsServersSequenceElement = elements131.getLength() > 0 ? ((Element) elements131.item(0)) : null; - if (dnsServersSequenceElement != null) + NodeList elements127 = deploymentsElement.getElementsByTagName("VirtualIPs"); + Element virtualIPsSequenceElement = elements127.getLength() > 0 ? ((Element) elements127.item(0)) : null; + if (virtualIPsSequenceElement != null) { - for (int i16 = 0; i16 < dnsServersSequenceElement.getElementsByTagName("DnsServer").getLength(); i16 = i16 + 1) + for (int i15 = 0; i15 < virtualIPsSequenceElement.getElementsByTagName("VirtualIP").getLength(); i15 = i15 + 1) { - org.w3c.dom.Element dnsServersElement = ((org.w3c.dom.Element) dnsServersSequenceElement.getElementsByTagName("DnsServer").item(i16)); - DnsServer dnsServerInstance = new DnsServer(); - dnsInstance.getDnsServers().add(dnsServerInstance); + org.w3c.dom.Element virtualIPsElement = ((org.w3c.dom.Element) virtualIPsSequenceElement.getElementsByTagName("VirtualIP").item(i15)); + VirtualIPAddress virtualIPInstance = new VirtualIPAddress(); + deploymentInstance.getVirtualIPAddresses().add(virtualIPInstance); + + NodeList elements128 = virtualIPsElement.getElementsByTagName("Address"); + Element addressElement = elements128.getLength() > 0 ? ((Element) elements128.item(0)) : null; + if (addressElement != null) + { + InetAddress addressInstance; + addressInstance = InetAddress.getByName(addressElement.getTextContent()); + virtualIPInstance.setAddress(addressInstance); + } - NodeList elements132 = dnsServersElement.getElementsByTagName("Name"); - Element nameElement5 = elements132.getLength() > 0 ? ((Element) elements132.item(0)) : null; - if (nameElement5 != null) + NodeList elements129 = virtualIPsElement.getElementsByTagName("Name"); + Element nameElement4 = elements129.getLength() > 0 ? ((Element) elements129.item(0)) : null; + if (nameElement4 != null) { - String nameInstance5; - nameInstance5 = nameElement5.getTextContent(); - dnsServerInstance.setName(nameInstance5); + String nameInstance4; + nameInstance4 = nameElement4.getTextContent(); + virtualIPInstance.setName(nameInstance4); } - NodeList elements133 = dnsServersElement.getElementsByTagName("Address"); - Element addressElement2 = elements133.getLength() > 0 ? ((Element) elements133.item(0)) : null; - if (addressElement2 != null) + NodeList elements130 = virtualIPsElement.getElementsByTagName("IsDnsProgrammed"); + Element isDnsProgrammedElement = elements130.getLength() > 0 ? ((Element) elements130.item(0)) : null; + if (isDnsProgrammedElement != null && (isDnsProgrammedElement.getTextContent() != null && isDnsProgrammedElement.getTextContent().isEmpty() != true) == false) + { + boolean isDnsProgrammedInstance; + isDnsProgrammedInstance = Boolean.parseBoolean(isDnsProgrammedElement.getTextContent()); + virtualIPInstance.setIsDnsProgrammed(isDnsProgrammedInstance); + } + } + } + + NodeList elements131 = deploymentsElement.getElementsByTagName("Dns"); + Element dnsElement = elements131.getLength() > 0 ? ((Element) elements131.item(0)) : null; + if (dnsElement != null) + { + DnsSettings dnsInstance = new DnsSettings(); + deploymentInstance.setDnsSettings(dnsInstance); + + NodeList elements132 = dnsElement.getElementsByTagName("DnsServers"); + Element dnsServersSequenceElement = elements132.getLength() > 0 ? ((Element) elements132.item(0)) : null; + if (dnsServersSequenceElement != null) + { + for (int i16 = 0; i16 < dnsServersSequenceElement.getElementsByTagName("DnsServer").getLength(); i16 = i16 + 1) { - InetAddress addressInstance2; - addressInstance2 = InetAddress.getByName(addressElement2.getTextContent()); - dnsServerInstance.setAddress(addressInstance2); + org.w3c.dom.Element dnsServersElement = ((org.w3c.dom.Element) dnsServersSequenceElement.getElementsByTagName("DnsServer").item(i16)); + DnsServer dnsServerInstance = new DnsServer(); + dnsInstance.getDnsServers().add(dnsServerInstance); + + NodeList elements133 = dnsServersElement.getElementsByTagName("Name"); + Element nameElement5 = elements133.getLength() > 0 ? ((Element) elements133.item(0)) : null; + if (nameElement5 != null) + { + String nameInstance5; + nameInstance5 = nameElement5.getTextContent(); + dnsServerInstance.setName(nameInstance5); + } + + NodeList elements134 = dnsServersElement.getElementsByTagName("Address"); + Element addressElement2 = elements134.getLength() > 0 ? ((Element) elements134.item(0)) : null; + if (addressElement2 != null) + { + InetAddress addressInstance2; + addressInstance2 = InetAddress.getByName(addressElement2.getTextContent()); + dnsServerInstance.setAddress(addressInstance2); + } } } } } } - } - - NodeList elements134 = hostedServiceElement.getElementsByTagName("Url"); - Element urlElement2 = elements134.getLength() > 0 ? ((Element) elements134.item(0)) : null; - if (urlElement2 != null) - { - URI urlInstance2; - urlInstance2 = new URI(urlElement2.getTextContent()); - result.setUri(urlInstance2); - } - - NodeList elements135 = hostedServiceElement.getElementsByTagName("ServiceName"); - Element serviceNameElement = elements135.getLength() > 0 ? ((Element) elements135.item(0)) : null; - if (serviceNameElement != null) - { - String serviceNameInstance; - serviceNameInstance = serviceNameElement.getTextContent(); - result.setServiceName(serviceNameInstance); - } - - NodeList elements136 = hostedServiceElement.getElementsByTagName("HostedServiceProperties"); - Element hostedServicePropertiesElement = elements136.getLength() > 0 ? ((Element) elements136.item(0)) : null; - if (hostedServicePropertiesElement != null) - { - HostedServiceProperties hostedServicePropertiesInstance = new HostedServiceProperties(); - result.setProperties(hostedServicePropertiesInstance); - - NodeList elements137 = hostedServicePropertiesElement.getElementsByTagName("Description"); - Element descriptionElement2 = elements137.getLength() > 0 ? ((Element) elements137.item(0)) : null; - if (descriptionElement2 != null) - { - String descriptionInstance2; - descriptionInstance2 = descriptionElement2.getTextContent(); - hostedServicePropertiesInstance.setDescription(descriptionInstance2); - } - - NodeList elements138 = hostedServicePropertiesElement.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements138.getLength() > 0 ? ((Element) elements138.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - hostedServicePropertiesInstance.setAffinityGroup(affinityGroupInstance); - } - - NodeList elements139 = hostedServicePropertiesElement.getElementsByTagName("Location"); - Element locationElement = elements139.getLength() > 0 ? ((Element) elements139.item(0)) : null; - if (locationElement != null) - { - String locationInstance; - locationInstance = locationElement.getTextContent(); - hostedServicePropertiesInstance.setLocation(locationInstance); - } - - NodeList elements140 = hostedServicePropertiesElement.getElementsByTagName("Label"); - Element labelElement3 = elements140.getLength() > 0 ? ((Element) elements140.item(0)) : null; - if (labelElement3 != null) - { - String labelInstance3; - labelInstance3 = labelElement3.getTextContent() != null ? new String(Base64.decodeBase64(labelElement3.getTextContent().getBytes())) : null; - hostedServicePropertiesInstance.setLabel(labelInstance3); - } - - NodeList elements141 = hostedServicePropertiesElement.getElementsByTagName("Status"); - Element statusElement3 = elements141.getLength() > 0 ? ((Element) elements141.item(0)) : null; - if (statusElement3 != null) - { - HostedServiceStatus statusInstance3; - statusInstance3 = HostedServiceStatus.valueOf(statusElement3.getTextContent()); - hostedServicePropertiesInstance.setStatus(statusInstance3); - } - NodeList elements142 = hostedServicePropertiesElement.getElementsByTagName("DateCreated"); - Element dateCreatedElement = elements142.getLength() > 0 ? ((Element) elements142.item(0)) : null; - if (dateCreatedElement != null) + NodeList elements135 = hostedServiceElement.getElementsByTagName("Url"); + Element urlElement2 = elements135.getLength() > 0 ? ((Element) elements135.item(0)) : null; + if (urlElement2 != null) { - Calendar dateCreatedInstance; - SimpleDateFormat simpleDateFormat4 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar4 = Calendar.getInstance(); - calendar4.setTime(simpleDateFormat4.parse(dateCreatedElement.getTextContent())); - dateCreatedInstance = calendar4; - hostedServicePropertiesInstance.setDateCreated(dateCreatedInstance); + URI urlInstance2; + urlInstance2 = new URI(urlElement2.getTextContent()); + result.setUri(urlInstance2); } - NodeList elements143 = hostedServicePropertiesElement.getElementsByTagName("DateLastModified"); - Element dateLastModifiedElement = elements143.getLength() > 0 ? ((Element) elements143.item(0)) : null; - if (dateLastModifiedElement != null) + NodeList elements136 = hostedServiceElement.getElementsByTagName("ServiceName"); + Element serviceNameElement = elements136.getLength() > 0 ? ((Element) elements136.item(0)) : null; + if (serviceNameElement != null) { - Calendar dateLastModifiedInstance; - SimpleDateFormat simpleDateFormat5 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar5 = Calendar.getInstance(); - calendar5.setTime(simpleDateFormat5.parse(dateLastModifiedElement.getTextContent())); - dateLastModifiedInstance = calendar5; - hostedServicePropertiesInstance.setDateLastModified(dateLastModifiedInstance); + String serviceNameInstance; + serviceNameInstance = serviceNameElement.getTextContent(); + result.setServiceName(serviceNameInstance); } - NodeList elements144 = hostedServicePropertiesElement.getElementsByTagName("ExtendedProperties"); - Element extendedPropertiesSequenceElement2 = elements144.getLength() > 0 ? ((Element) elements144.item(0)) : null; - if (extendedPropertiesSequenceElement2 != null) + NodeList elements137 = hostedServiceElement.getElementsByTagName("HostedServiceProperties"); + Element hostedServicePropertiesElement = elements137.getLength() > 0 ? ((Element) elements137.item(0)) : null; + if (hostedServicePropertiesElement != null) { - for (int i17 = 0; i17 < extendedPropertiesSequenceElement2.getElementsByTagName("ExtendedProperty").getLength(); i17 = i17 + 1) + HostedServiceProperties hostedServicePropertiesInstance = new HostedServiceProperties(); + result.setProperties(hostedServicePropertiesInstance); + + NodeList elements138 = hostedServicePropertiesElement.getElementsByTagName("Description"); + Element descriptionElement2 = elements138.getLength() > 0 ? ((Element) elements138.item(0)) : null; + if (descriptionElement2 != null) + { + String descriptionInstance2; + descriptionInstance2 = descriptionElement2.getTextContent(); + hostedServicePropertiesInstance.setDescription(descriptionInstance2); + } + + NodeList elements139 = hostedServicePropertiesElement.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements139.getLength() > 0 ? ((Element) elements139.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + hostedServicePropertiesInstance.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements140 = hostedServicePropertiesElement.getElementsByTagName("Location"); + Element locationElement = elements140.getLength() > 0 ? ((Element) elements140.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + hostedServicePropertiesInstance.setLocation(locationInstance); + } + + NodeList elements141 = hostedServicePropertiesElement.getElementsByTagName("Label"); + Element labelElement3 = elements141.getLength() > 0 ? ((Element) elements141.item(0)) : null; + if (labelElement3 != null) + { + String labelInstance3; + labelInstance3 = labelElement3.getTextContent() != null ? new String(Base64.decodeBase64(labelElement3.getTextContent().getBytes())) : null; + hostedServicePropertiesInstance.setLabel(labelInstance3); + } + + NodeList elements142 = hostedServicePropertiesElement.getElementsByTagName("Status"); + Element statusElement3 = elements142.getLength() > 0 ? ((Element) elements142.item(0)) : null; + if (statusElement3 != null) + { + HostedServiceStatus statusInstance3; + statusInstance3 = HostedServiceStatus.valueOf(statusElement3.getTextContent()); + hostedServicePropertiesInstance.setStatus(statusInstance3); + } + + NodeList elements143 = hostedServicePropertiesElement.getElementsByTagName("DateCreated"); + Element dateCreatedElement = elements143.getLength() > 0 ? ((Element) elements143.item(0)) : null; + if (dateCreatedElement != null) + { + Calendar dateCreatedInstance; + SimpleDateFormat simpleDateFormat4 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar4 = Calendar.getInstance(); + calendar4.setTime(simpleDateFormat4.parse(dateCreatedElement.getTextContent())); + dateCreatedInstance = calendar4; + hostedServicePropertiesInstance.setDateCreated(dateCreatedInstance); + } + + NodeList elements144 = hostedServicePropertiesElement.getElementsByTagName("DateLastModified"); + Element dateLastModifiedElement = elements144.getLength() > 0 ? ((Element) elements144.item(0)) : null; + if (dateLastModifiedElement != null) + { + Calendar dateLastModifiedInstance; + SimpleDateFormat simpleDateFormat5 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar5 = Calendar.getInstance(); + calendar5.setTime(simpleDateFormat5.parse(dateLastModifiedElement.getTextContent())); + dateLastModifiedInstance = calendar5; + hostedServicePropertiesInstance.setDateLastModified(dateLastModifiedInstance); + } + + NodeList elements145 = hostedServicePropertiesElement.getElementsByTagName("ExtendedProperties"); + Element extendedPropertiesSequenceElement2 = elements145.getLength() > 0 ? ((Element) elements145.item(0)) : null; + if (extendedPropertiesSequenceElement2 != null) { - org.w3c.dom.Element extendedPropertiesElement2 = ((org.w3c.dom.Element) extendedPropertiesSequenceElement2.getElementsByTagName("ExtendedProperty").item(i17)); - NodeList elements145 = extendedPropertiesElement2.getElementsByTagName("Name"); - String extendedPropertiesKey2 = elements145.getLength() > 0 ? ((org.w3c.dom.Element) elements145.item(0)).getTextContent() : null; - NodeList elements146 = extendedPropertiesElement2.getElementsByTagName("Value"); - String extendedPropertiesValue2 = elements146.getLength() > 0 ? ((org.w3c.dom.Element) elements146.item(0)).getTextContent() : null; - hostedServicePropertiesInstance.getExtendedProperties().put(extendedPropertiesKey2, extendedPropertiesValue2); + for (int i17 = 0; i17 < extendedPropertiesSequenceElement2.getElementsByTagName("ExtendedProperty").getLength(); i17 = i17 + 1) + { + org.w3c.dom.Element extendedPropertiesElement2 = ((org.w3c.dom.Element) extendedPropertiesSequenceElement2.getElementsByTagName("ExtendedProperty").item(i17)); + NodeList elements146 = extendedPropertiesElement2.getElementsByTagName("Name"); + String extendedPropertiesKey2 = elements146.getLength() > 0 ? ((org.w3c.dom.Element) elements146.item(0)).getTextContent() : null; + NodeList elements147 = extendedPropertiesElement2.getElementsByTagName("Value"); + String extendedPropertiesValue2 = elements147.getLength() > 0 ? ((org.w3c.dom.Element) elements147.item(0)).getTextContent() : null; + hostedServicePropertiesInstance.getExtendedProperties().put(extendedPropertiesKey2, extendedPropertiesValue2); + } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -3010,6 +3220,14 @@ public HostedServiceGetExtensionResponse call() throws Exception * @param serviceName The name of the cloud service. * @param extensionId The identifier that was assigned to the extension when * it was added to the cloud service + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Get Extension operation response. */ @Override @@ -3049,114 +3267,124 @@ public HostedServiceGetExtensionResponse getExtension(String serviceName, String // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - HostedServiceGetExtensionResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new HostedServiceGetExtensionResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Extension"); - Element extensionElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (extensionElement != null) - { - NodeList elements2 = extensionElement.getElementsByTagName("ProviderNameSpace"); - Element providerNameSpaceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (providerNameSpaceElement != null) - { - String providerNameSpaceInstance; - providerNameSpaceInstance = providerNameSpaceElement.getTextContent(); - result.setProviderNamespace(providerNameSpaceInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements3 = extensionElement.getElementsByTagName("Type"); - Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (typeElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String typeInstance; - typeInstance = typeElement.getTextContent(); - result.setType(typeInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements4 = extensionElement.getElementsByTagName("Id"); - Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (idElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements5 = extensionElement.getElementsByTagName("Version"); - Element versionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (versionElement != null) - { - String versionInstance; - versionInstance = versionElement.getTextContent(); - result.setVersion(versionInstance); - } + // Create Result + HostedServiceGetExtensionResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new HostedServiceGetExtensionResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements6 = extensionElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (thumbprintElement != null) + NodeList elements = responseDoc.getElementsByTagName("Extension"); + Element extensionElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (extensionElement != null) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - result.setThumbprint(thumbprintInstance); + NodeList elements2 = extensionElement.getElementsByTagName("ProviderNameSpace"); + Element providerNameSpaceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (providerNameSpaceElement != null) + { + String providerNameSpaceInstance; + providerNameSpaceInstance = providerNameSpaceElement.getTextContent(); + result.setProviderNamespace(providerNameSpaceInstance); + } + + NodeList elements3 = extensionElement.getElementsByTagName("Type"); + Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + result.setType(typeInstance); + } + + NodeList elements4 = extensionElement.getElementsByTagName("Id"); + Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setId(idInstance); + } + + NodeList elements5 = extensionElement.getElementsByTagName("Version"); + Element versionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (versionElement != null) + { + String versionInstance; + versionInstance = versionElement.getTextContent(); + result.setVersion(versionInstance); + } + + NodeList elements6 = extensionElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (thumbprintElement != null) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + result.setThumbprint(thumbprintInstance); + } + + NodeList elements7 = extensionElement.getElementsByTagName("ThumbprintAlgorithm"); + Element thumbprintAlgorithmElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (thumbprintAlgorithmElement != null) + { + String thumbprintAlgorithmInstance; + thumbprintAlgorithmInstance = thumbprintAlgorithmElement.getTextContent(); + result.setThumbprintAlgorithm(thumbprintAlgorithmInstance); + } + + NodeList elements8 = extensionElement.getElementsByTagName("PublicConfiguration"); + Element publicConfigurationElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (publicConfigurationElement != null) + { + String publicConfigurationInstance; + publicConfigurationInstance = publicConfigurationElement.getTextContent() != null ? new String(Base64.decodeBase64(publicConfigurationElement.getTextContent().getBytes())) : null; + result.setPublicConfiguration(publicConfigurationInstance); + } } - NodeList elements7 = extensionElement.getElementsByTagName("ThumbprintAlgorithm"); - Element thumbprintAlgorithmElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (thumbprintAlgorithmElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - String thumbprintAlgorithmInstance; - thumbprintAlgorithmInstance = thumbprintAlgorithmElement.getTextContent(); - result.setThumbprintAlgorithm(thumbprintAlgorithmInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements8 = extensionElement.getElementsByTagName("PublicConfiguration"); - Element publicConfigurationElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (publicConfigurationElement != null) + if (shouldTrace) { - String publicConfigurationInstance; - publicConfigurationInstance = publicConfigurationElement.getTextContent() != null ? new String(Base64.decodeBase64(publicConfigurationElement.getTextContent().getBytes())) : null; - result.setPublicConfiguration(publicConfigurationInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -3185,6 +3413,18 @@ public HostedServiceListResponse call() throws Exception * http://msdn.microsoft.com/en-us/library/windowsazure/ee460781.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Hosted Service operation response. */ @Override @@ -3213,168 +3453,178 @@ public HostedServiceListResponse list() throws IOException, ServiceException, Pa // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - HostedServiceListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new HostedServiceListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("HostedServices"); - Element hostedServicesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (hostedServicesSequenceElement != null) - { - for (int i1 = 0; i1 < hostedServicesSequenceElement.getElementsByTagName("HostedService").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element hostedServicesElement = ((org.w3c.dom.Element) hostedServicesSequenceElement.getElementsByTagName("HostedService").item(i1)); - HostedServiceListResponse.HostedService hostedServiceInstance = new HostedServiceListResponse.HostedService(); - result.getHostedServices().add(hostedServiceInstance); - - NodeList elements2 = hostedServicesElement.getElementsByTagName("Url"); - Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (urlElement != null) - { - URI urlInstance; - urlInstance = new URI(urlElement.getTextContent()); - hostedServiceInstance.setUri(urlInstance); - } - - NodeList elements3 = hostedServicesElement.getElementsByTagName("ServiceName"); - Element serviceNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (serviceNameElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String serviceNameInstance; - serviceNameInstance = serviceNameElement.getTextContent(); - hostedServiceInstance.setServiceName(serviceNameInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements4 = hostedServicesElement.getElementsByTagName("HostedServiceProperties"); - Element hostedServicePropertiesElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (hostedServicePropertiesElement != null) + throw ex; + } + + // Create Result + HostedServiceListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new HostedServiceListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("HostedServices"); + Element hostedServicesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (hostedServicesSequenceElement != null) + { + for (int i1 = 0; i1 < hostedServicesSequenceElement.getElementsByTagName("HostedService").getLength(); i1 = i1 + 1) { - HostedServiceProperties hostedServicePropertiesInstance = new HostedServiceProperties(); - hostedServiceInstance.setProperties(hostedServicePropertiesInstance); - - NodeList elements5 = hostedServicePropertiesElement.getElementsByTagName("Description"); - Element descriptionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - hostedServicePropertiesInstance.setDescription(descriptionInstance); - } - - NodeList elements6 = hostedServicePropertiesElement.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - hostedServicePropertiesInstance.setAffinityGroup(affinityGroupInstance); - } - - NodeList elements7 = hostedServicePropertiesElement.getElementsByTagName("Location"); - Element locationElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (locationElement != null) - { - String locationInstance; - locationInstance = locationElement.getTextContent(); - hostedServicePropertiesInstance.setLocation(locationInstance); - } - - NodeList elements8 = hostedServicePropertiesElement.getElementsByTagName("Label"); - Element labelElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - hostedServicePropertiesInstance.setLabel(labelInstance); - } - - NodeList elements9 = hostedServicePropertiesElement.getElementsByTagName("Status"); - Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (statusElement != null) - { - HostedServiceStatus statusInstance; - statusInstance = HostedServiceStatus.valueOf(statusElement.getTextContent()); - hostedServicePropertiesInstance.setStatus(statusInstance); - } + org.w3c.dom.Element hostedServicesElement = ((org.w3c.dom.Element) hostedServicesSequenceElement.getElementsByTagName("HostedService").item(i1)); + HostedServiceListResponse.HostedService hostedServiceInstance = new HostedServiceListResponse.HostedService(); + result.getHostedServices().add(hostedServiceInstance); - NodeList elements10 = hostedServicePropertiesElement.getElementsByTagName("DateCreated"); - Element dateCreatedElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (dateCreatedElement != null) + NodeList elements2 = hostedServicesElement.getElementsByTagName("Url"); + Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (urlElement != null) { - Calendar dateCreatedInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(dateCreatedElement.getTextContent())); - dateCreatedInstance = calendar; - hostedServicePropertiesInstance.setDateCreated(dateCreatedInstance); + URI urlInstance; + urlInstance = new URI(urlElement.getTextContent()); + hostedServiceInstance.setUri(urlInstance); } - NodeList elements11 = hostedServicePropertiesElement.getElementsByTagName("DateLastModified"); - Element dateLastModifiedElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (dateLastModifiedElement != null) + NodeList elements3 = hostedServicesElement.getElementsByTagName("ServiceName"); + Element serviceNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (serviceNameElement != null) { - Calendar dateLastModifiedInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(dateLastModifiedElement.getTextContent())); - dateLastModifiedInstance = calendar2; - hostedServicePropertiesInstance.setDateLastModified(dateLastModifiedInstance); + String serviceNameInstance; + serviceNameInstance = serviceNameElement.getTextContent(); + hostedServiceInstance.setServiceName(serviceNameInstance); } - NodeList elements12 = hostedServicePropertiesElement.getElementsByTagName("ExtendedProperties"); - Element extendedPropertiesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (extendedPropertiesSequenceElement != null) + NodeList elements4 = hostedServicesElement.getElementsByTagName("HostedServiceProperties"); + Element hostedServicePropertiesElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (hostedServicePropertiesElement != null) { - for (int i2 = 0; i2 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i2 = i2 + 1) + HostedServiceProperties hostedServicePropertiesInstance = new HostedServiceProperties(); + hostedServiceInstance.setProperties(hostedServicePropertiesInstance); + + NodeList elements5 = hostedServicePropertiesElement.getElementsByTagName("Description"); + Element descriptionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (descriptionElement != null) { - org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i2)); - NodeList elements13 = extendedPropertiesElement.getElementsByTagName("Name"); - String extendedPropertiesKey = elements13.getLength() > 0 ? ((org.w3c.dom.Element) elements13.item(0)).getTextContent() : null; - NodeList elements14 = extendedPropertiesElement.getElementsByTagName("Value"); - String extendedPropertiesValue = elements14.getLength() > 0 ? ((org.w3c.dom.Element) elements14.item(0)).getTextContent() : null; - hostedServicePropertiesInstance.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + hostedServicePropertiesInstance.setDescription(descriptionInstance); + } + + NodeList elements6 = hostedServicePropertiesElement.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + hostedServicePropertiesInstance.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements7 = hostedServicePropertiesElement.getElementsByTagName("Location"); + Element locationElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + hostedServicePropertiesInstance.setLocation(locationInstance); + } + + NodeList elements8 = hostedServicePropertiesElement.getElementsByTagName("Label"); + Element labelElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + hostedServicePropertiesInstance.setLabel(labelInstance); + } + + NodeList elements9 = hostedServicePropertiesElement.getElementsByTagName("Status"); + Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (statusElement != null) + { + HostedServiceStatus statusInstance; + statusInstance = HostedServiceStatus.valueOf(statusElement.getTextContent()); + hostedServicePropertiesInstance.setStatus(statusInstance); + } + + NodeList elements10 = hostedServicePropertiesElement.getElementsByTagName("DateCreated"); + Element dateCreatedElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (dateCreatedElement != null) + { + Calendar dateCreatedInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(dateCreatedElement.getTextContent())); + dateCreatedInstance = calendar; + hostedServicePropertiesInstance.setDateCreated(dateCreatedInstance); + } + + NodeList elements11 = hostedServicePropertiesElement.getElementsByTagName("DateLastModified"); + Element dateLastModifiedElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (dateLastModifiedElement != null) + { + Calendar dateLastModifiedInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(dateLastModifiedElement.getTextContent())); + dateLastModifiedInstance = calendar2; + hostedServicePropertiesInstance.setDateLastModified(dateLastModifiedInstance); + } + + NodeList elements12 = hostedServicePropertiesElement.getElementsByTagName("ExtendedProperties"); + Element extendedPropertiesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (extendedPropertiesSequenceElement != null) + { + for (int i2 = 0; i2 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i2)); + NodeList elements13 = extendedPropertiesElement.getElementsByTagName("Name"); + String extendedPropertiesKey = elements13.getLength() > 0 ? ((org.w3c.dom.Element) elements13.item(0)).getTextContent() : null; + NodeList elements14 = extendedPropertiesElement.getElementsByTagName("Value"); + String extendedPropertiesValue = elements14.getLength() > 0 ? ((org.w3c.dom.Element) elements14.item(0)).getTextContent() : null; + hostedServicePropertiesInstance.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + } } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -3409,6 +3659,14 @@ public HostedServiceListAvailableExtensionsResponse call() throws Exception * http://msdn.microsoft.com/en-us/library/windowsazure/dn169559.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Available Extensions operation response. */ @Override @@ -3437,139 +3695,149 @@ public HostedServiceListAvailableExtensionsResponse listAvailableExtensions() th // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - HostedServiceListAvailableExtensionsResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new HostedServiceListAvailableExtensionsResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ExtensionImages"); - Element extensionImagesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (extensionImagesSequenceElement != null) - { - for (int i1 = 0; i1 < extensionImagesSequenceElement.getElementsByTagName("ExtensionImage").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element extensionImagesElement = ((org.w3c.dom.Element) extensionImagesSequenceElement.getElementsByTagName("ExtensionImage").item(i1)); - HostedServiceListAvailableExtensionsResponse.ExtensionImage extensionImageInstance = new HostedServiceListAvailableExtensionsResponse.ExtensionImage(); - result.getExtensionImages().add(extensionImageInstance); - - NodeList elements2 = extensionImagesElement.getElementsByTagName("ProviderNameSpace"); - Element providerNameSpaceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (providerNameSpaceElement != null) - { - String providerNameSpaceInstance; - providerNameSpaceInstance = providerNameSpaceElement.getTextContent(); - extensionImageInstance.setProviderNamespace(providerNameSpaceInstance); - } - - NodeList elements3 = extensionImagesElement.getElementsByTagName("Type"); - Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - extensionImageInstance.setType(typeInstance); - } - - NodeList elements4 = extensionImagesElement.getElementsByTagName("Label"); - Element labelElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent(); - extensionImageInstance.setLabel(labelInstance); - } - - NodeList elements5 = extensionImagesElement.getElementsByTagName("Version"); - Element versionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (versionElement != null) - { - String versionInstance; - versionInstance = versionElement.getTextContent(); - extensionImageInstance.setVersion(versionInstance); - } - - NodeList elements6 = extensionImagesElement.getElementsByTagName("Description"); - Element descriptionElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - extensionImageInstance.setDescription(descriptionInstance); - } - - NodeList elements7 = extensionImagesElement.getElementsByTagName("ThumbprintAlgorithm"); - Element thumbprintAlgorithmElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (thumbprintAlgorithmElement != null) - { - String thumbprintAlgorithmInstance; - thumbprintAlgorithmInstance = thumbprintAlgorithmElement.getTextContent(); - extensionImageInstance.setThumbprintAlgorithm(thumbprintAlgorithmInstance); - } - - NodeList elements8 = extensionImagesElement.getElementsByTagName("HostingResources"); - Element hostingResourcesElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (hostingResourcesElement != null) - { - HostingResources hostingResourcesInstance; - hostingResourcesInstance = ComputeManagementClientImpl.parseHostingResources(hostingResourcesElement.getTextContent()); - extensionImageInstance.setHostingResources(hostingResourcesInstance); - } - - NodeList elements9 = extensionImagesElement.getElementsByTagName("PublicConfigurationSchema"); - Element publicConfigurationSchemaElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (publicConfigurationSchemaElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String publicConfigurationSchemaInstance; - publicConfigurationSchemaInstance = publicConfigurationSchemaElement.getTextContent() != null ? new String(Base64.decodeBase64(publicConfigurationSchemaElement.getTextContent().getBytes())) : null; - extensionImageInstance.setPublicConfigurationSchema(publicConfigurationSchemaInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements10 = extensionImagesElement.getElementsByTagName("PrivateConfigurationSchema"); - Element privateConfigurationSchemaElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (privateConfigurationSchemaElement != null) + throw ex; + } + + // Create Result + HostedServiceListAvailableExtensionsResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new HostedServiceListAvailableExtensionsResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ExtensionImages"); + Element extensionImagesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (extensionImagesSequenceElement != null) + { + for (int i1 = 0; i1 < extensionImagesSequenceElement.getElementsByTagName("ExtensionImage").getLength(); i1 = i1 + 1) { - String privateConfigurationSchemaInstance; - privateConfigurationSchemaInstance = privateConfigurationSchemaElement.getTextContent() != null ? new String(Base64.decodeBase64(privateConfigurationSchemaElement.getTextContent().getBytes())) : null; - extensionImageInstance.setPrivateConfigurationSchema(privateConfigurationSchemaInstance); + org.w3c.dom.Element extensionImagesElement = ((org.w3c.dom.Element) extensionImagesSequenceElement.getElementsByTagName("ExtensionImage").item(i1)); + HostedServiceListAvailableExtensionsResponse.ExtensionImage extensionImageInstance = new HostedServiceListAvailableExtensionsResponse.ExtensionImage(); + result.getExtensionImages().add(extensionImageInstance); + + NodeList elements2 = extensionImagesElement.getElementsByTagName("ProviderNameSpace"); + Element providerNameSpaceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (providerNameSpaceElement != null) + { + String providerNameSpaceInstance; + providerNameSpaceInstance = providerNameSpaceElement.getTextContent(); + extensionImageInstance.setProviderNamespace(providerNameSpaceInstance); + } + + NodeList elements3 = extensionImagesElement.getElementsByTagName("Type"); + Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + extensionImageInstance.setType(typeInstance); + } + + NodeList elements4 = extensionImagesElement.getElementsByTagName("Label"); + Element labelElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent(); + extensionImageInstance.setLabel(labelInstance); + } + + NodeList elements5 = extensionImagesElement.getElementsByTagName("Version"); + Element versionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (versionElement != null) + { + String versionInstance; + versionInstance = versionElement.getTextContent(); + extensionImageInstance.setVersion(versionInstance); + } + + NodeList elements6 = extensionImagesElement.getElementsByTagName("Description"); + Element descriptionElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (descriptionElement != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + extensionImageInstance.setDescription(descriptionInstance); + } + + NodeList elements7 = extensionImagesElement.getElementsByTagName("ThumbprintAlgorithm"); + Element thumbprintAlgorithmElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (thumbprintAlgorithmElement != null) + { + String thumbprintAlgorithmInstance; + thumbprintAlgorithmInstance = thumbprintAlgorithmElement.getTextContent(); + extensionImageInstance.setThumbprintAlgorithm(thumbprintAlgorithmInstance); + } + + NodeList elements8 = extensionImagesElement.getElementsByTagName("HostingResources"); + Element hostingResourcesElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (hostingResourcesElement != null) + { + HostingResources hostingResourcesInstance; + hostingResourcesInstance = ComputeManagementClientImpl.parseHostingResources(hostingResourcesElement.getTextContent()); + extensionImageInstance.setHostingResources(hostingResourcesInstance); + } + + NodeList elements9 = extensionImagesElement.getElementsByTagName("PublicConfigurationSchema"); + Element publicConfigurationSchemaElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (publicConfigurationSchemaElement != null) + { + String publicConfigurationSchemaInstance; + publicConfigurationSchemaInstance = publicConfigurationSchemaElement.getTextContent() != null ? new String(Base64.decodeBase64(publicConfigurationSchemaElement.getTextContent().getBytes())) : null; + extensionImageInstance.setPublicConfigurationSchema(publicConfigurationSchemaInstance); + } + + NodeList elements10 = extensionImagesElement.getElementsByTagName("PrivateConfigurationSchema"); + Element privateConfigurationSchemaElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (privateConfigurationSchemaElement != null) + { + String privateConfigurationSchemaInstance; + privateConfigurationSchemaInstance = privateConfigurationSchemaElement.getTextContent() != null ? new String(Base64.decodeBase64(privateConfigurationSchemaElement.getTextContent().getBytes())) : null; + extensionImageInstance.setPrivateConfigurationSchema(privateConfigurationSchemaInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -3600,6 +3868,14 @@ public HostedServiceListExtensionsResponse call() throws Exception * more information) * * @param serviceName The name of the cloud service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Extensions operation response. */ @Override @@ -3634,121 +3910,131 @@ public HostedServiceListExtensionsResponse listExtensions(String serviceName) th // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - HostedServiceListExtensionsResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new HostedServiceListExtensionsResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Extensions"); - Element extensionsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (extensionsSequenceElement != null) - { - for (int i1 = 0; i1 < extensionsSequenceElement.getElementsByTagName("Extension").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element extensionsElement = ((org.w3c.dom.Element) extensionsSequenceElement.getElementsByTagName("Extension").item(i1)); - HostedServiceListExtensionsResponse.Extension extensionInstance = new HostedServiceListExtensionsResponse.Extension(); - result.getExtensions().add(extensionInstance); - - NodeList elements2 = extensionsElement.getElementsByTagName("ProviderNameSpace"); - Element providerNameSpaceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (providerNameSpaceElement != null) - { - String providerNameSpaceInstance; - providerNameSpaceInstance = providerNameSpaceElement.getTextContent(); - extensionInstance.setProviderNamespace(providerNameSpaceInstance); - } - - NodeList elements3 = extensionsElement.getElementsByTagName("Type"); - Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - extensionInstance.setType(typeInstance); - } - - NodeList elements4 = extensionsElement.getElementsByTagName("Id"); - Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (idElement != null) - { - String idInstance; - idInstance = idElement.getTextContent(); - extensionInstance.setId(idInstance); - } - - NodeList elements5 = extensionsElement.getElementsByTagName("Version"); - Element versionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (versionElement != null) - { - String versionInstance; - versionInstance = versionElement.getTextContent(); - extensionInstance.setVersion(versionInstance); - } - - NodeList elements6 = extensionsElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (thumbprintElement != null) - { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - extensionInstance.setThumbprint(thumbprintInstance); - } - - NodeList elements7 = extensionsElement.getElementsByTagName("ThumbprintAlgorithm"); - Element thumbprintAlgorithmElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (thumbprintAlgorithmElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String thumbprintAlgorithmInstance; - thumbprintAlgorithmInstance = thumbprintAlgorithmElement.getTextContent(); - extensionInstance.setThumbprintAlgorithm(thumbprintAlgorithmInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements8 = extensionsElement.getElementsByTagName("PublicConfiguration"); - Element publicConfigurationElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (publicConfigurationElement != null) + throw ex; + } + + // Create Result + HostedServiceListExtensionsResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new HostedServiceListExtensionsResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Extensions"); + Element extensionsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (extensionsSequenceElement != null) + { + for (int i1 = 0; i1 < extensionsSequenceElement.getElementsByTagName("Extension").getLength(); i1 = i1 + 1) { - String publicConfigurationInstance; - publicConfigurationInstance = publicConfigurationElement.getTextContent() != null ? new String(Base64.decodeBase64(publicConfigurationElement.getTextContent().getBytes())) : null; - extensionInstance.setPublicConfiguration(publicConfigurationInstance); + org.w3c.dom.Element extensionsElement = ((org.w3c.dom.Element) extensionsSequenceElement.getElementsByTagName("Extension").item(i1)); + HostedServiceListExtensionsResponse.Extension extensionInstance = new HostedServiceListExtensionsResponse.Extension(); + result.getExtensions().add(extensionInstance); + + NodeList elements2 = extensionsElement.getElementsByTagName("ProviderNameSpace"); + Element providerNameSpaceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (providerNameSpaceElement != null) + { + String providerNameSpaceInstance; + providerNameSpaceInstance = providerNameSpaceElement.getTextContent(); + extensionInstance.setProviderNamespace(providerNameSpaceInstance); + } + + NodeList elements3 = extensionsElement.getElementsByTagName("Type"); + Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + extensionInstance.setType(typeInstance); + } + + NodeList elements4 = extensionsElement.getElementsByTagName("Id"); + Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + extensionInstance.setId(idInstance); + } + + NodeList elements5 = extensionsElement.getElementsByTagName("Version"); + Element versionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (versionElement != null) + { + String versionInstance; + versionInstance = versionElement.getTextContent(); + extensionInstance.setVersion(versionInstance); + } + + NodeList elements6 = extensionsElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (thumbprintElement != null) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + extensionInstance.setThumbprint(thumbprintInstance); + } + + NodeList elements7 = extensionsElement.getElementsByTagName("ThumbprintAlgorithm"); + Element thumbprintAlgorithmElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (thumbprintAlgorithmElement != null) + { + String thumbprintAlgorithmInstance; + thumbprintAlgorithmInstance = thumbprintAlgorithmElement.getTextContent(); + extensionInstance.setThumbprintAlgorithm(thumbprintAlgorithmInstance); + } + + NodeList elements8 = extensionsElement.getElementsByTagName("PublicConfiguration"); + Element publicConfigurationElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (publicConfigurationElement != null) + { + String publicConfigurationInstance; + publicConfigurationInstance = publicConfigurationElement.getTextContent() != null ? new String(Base64.decodeBase64(publicConfigurationElement.getTextContent().getBytes())) : null; + extensionInstance.setPublicConfiguration(publicConfigurationInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -3784,11 +4070,35 @@ public OperationResponse call() throws Exception * @param serviceName The name of the cloud service. * @param parameters Parameters supplied to the Update Hosted Service * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse update(String serviceName, HostedServiceUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException + public OperationResponse update(String serviceName, HostedServiceUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException { // Validate if (serviceName == null) @@ -3889,39 +4199,49 @@ public OperationResponse update(String serviceName, HostedServiceUpdateParameter // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/OperatingSystemOperations.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/OperatingSystemOperations.java index 341e8e13f9fc9..a2964c96780e4 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/OperatingSystemOperations.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/OperatingSystemOperations.java @@ -53,6 +53,18 @@ public interface OperatingSystemOperations * http://msdn.microsoft.com/en-us/library/windowsazure/ff684168.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List Operating Systems operation response. */ OperatingSystemListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -84,6 +96,14 @@ public interface OperatingSystemOperations * http://msdn.microsoft.com/en-us/library/windowsazure/gg441291.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Operating System Families operation response. */ OperatingSystemListFamiliesResponse listFamilies() throws IOException, ServiceException, ParserConfigurationException, SAXException; diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/OperatingSystemOperationsImpl.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/OperatingSystemOperationsImpl.java index 4e0ff8f603f91..f2c1bbf316bb1 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/OperatingSystemOperationsImpl.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/OperatingSystemOperationsImpl.java @@ -70,6 +70,7 @@ public class OperatingSystemOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (operatingSystemsSequenceElement != null) - { - for (int i1 = 0; i1 < operatingSystemsSequenceElement.getElementsByTagName("OperatingSystem").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element operatingSystemsElement = ((org.w3c.dom.Element) operatingSystemsSequenceElement.getElementsByTagName("OperatingSystem").item(i1)); - OperatingSystemListResponse.OperatingSystem operatingSystemInstance = new OperatingSystemListResponse.OperatingSystem(); - result.getOperatingSystems().add(operatingSystemInstance); - - NodeList elements2 = operatingSystemsElement.getElementsByTagName("Version"); - Element versionElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (versionElement != null) - { - String versionInstance; - versionInstance = versionElement.getTextContent(); - operatingSystemInstance.setVersion(versionInstance); - } - - NodeList elements3 = operatingSystemsElement.getElementsByTagName("Label"); - Element labelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - operatingSystemInstance.setLabel(labelInstance); - } - - NodeList elements4 = operatingSystemsElement.getElementsByTagName("IsDefault"); - Element isDefaultElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (isDefaultElement != null) - { - boolean isDefaultInstance; - isDefaultInstance = Boolean.parseBoolean(isDefaultElement.getTextContent()); - operatingSystemInstance.setIsDefault(isDefaultInstance); - } - - NodeList elements5 = operatingSystemsElement.getElementsByTagName("IsActive"); - Element isActiveElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (isActiveElement != null) - { - boolean isActiveInstance; - isActiveInstance = Boolean.parseBoolean(isActiveElement.getTextContent()); - operatingSystemInstance.setIsActive(isActiveInstance); - } - - NodeList elements6 = operatingSystemsElement.getElementsByTagName("Family"); - Element familyElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (familyElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - int familyInstance; - familyInstance = Integer.parseInt(familyElement.getTextContent()); - operatingSystemInstance.setFamily(familyInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements7 = operatingSystemsElement.getElementsByTagName("FamilyLabel"); - Element familyLabelElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (familyLabelElement != null) + throw ex; + } + + // Create Result + OperatingSystemListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new OperatingSystemListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("OperatingSystems"); + Element operatingSystemsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operatingSystemsSequenceElement != null) + { + for (int i1 = 0; i1 < operatingSystemsSequenceElement.getElementsByTagName("OperatingSystem").getLength(); i1 = i1 + 1) { - String familyLabelInstance; - familyLabelInstance = familyLabelElement.getTextContent() != null ? new String(Base64.decodeBase64(familyLabelElement.getTextContent().getBytes())) : null; - operatingSystemInstance.setFamilyLabel(familyLabelInstance); + org.w3c.dom.Element operatingSystemsElement = ((org.w3c.dom.Element) operatingSystemsSequenceElement.getElementsByTagName("OperatingSystem").item(i1)); + OperatingSystemListResponse.OperatingSystem operatingSystemInstance = new OperatingSystemListResponse.OperatingSystem(); + result.getOperatingSystems().add(operatingSystemInstance); + + NodeList elements2 = operatingSystemsElement.getElementsByTagName("Version"); + Element versionElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (versionElement != null) + { + String versionInstance; + versionInstance = versionElement.getTextContent(); + operatingSystemInstance.setVersion(versionInstance); + } + + NodeList elements3 = operatingSystemsElement.getElementsByTagName("Label"); + Element labelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + operatingSystemInstance.setLabel(labelInstance); + } + + NodeList elements4 = operatingSystemsElement.getElementsByTagName("IsDefault"); + Element isDefaultElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (isDefaultElement != null) + { + boolean isDefaultInstance; + isDefaultInstance = Boolean.parseBoolean(isDefaultElement.getTextContent()); + operatingSystemInstance.setIsDefault(isDefaultInstance); + } + + NodeList elements5 = operatingSystemsElement.getElementsByTagName("IsActive"); + Element isActiveElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (isActiveElement != null) + { + boolean isActiveInstance; + isActiveInstance = Boolean.parseBoolean(isActiveElement.getTextContent()); + operatingSystemInstance.setIsActive(isActiveInstance); + } + + NodeList elements6 = operatingSystemsElement.getElementsByTagName("Family"); + Element familyElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (familyElement != null) + { + int familyInstance; + familyInstance = Integer.parseInt(familyElement.getTextContent()); + operatingSystemInstance.setFamily(familyInstance); + } + + NodeList elements7 = operatingSystemsElement.getElementsByTagName("FamilyLabel"); + Element familyLabelElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (familyLabelElement != null) + { + String familyLabelInstance; + familyLabelInstance = familyLabelElement.getTextContent() != null ? new String(Base64.decodeBase64(familyLabelElement.getTextContent().getBytes())) : null; + operatingSystemInstance.setFamilyLabel(familyLabelInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -286,6 +309,14 @@ public OperatingSystemListFamiliesResponse call() throws Exception * http://msdn.microsoft.com/en-us/library/windowsazure/gg441291.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Operating System Families operation response. */ @Override @@ -314,123 +345,133 @@ public OperatingSystemListFamiliesResponse listFamilies() throws IOException, Se // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperatingSystemListFamiliesResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new OperatingSystemListFamiliesResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("OperatingSystemFamilies"); - Element operatingSystemFamiliesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (operatingSystemFamiliesSequenceElement != null) - { - for (int i1 = 0; i1 < operatingSystemFamiliesSequenceElement.getElementsByTagName("OperatingSystemFamily").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element operatingSystemFamiliesElement = ((org.w3c.dom.Element) operatingSystemFamiliesSequenceElement.getElementsByTagName("OperatingSystemFamily").item(i1)); - OperatingSystemListFamiliesResponse.OperatingSystemFamily operatingSystemFamilyInstance = new OperatingSystemListFamiliesResponse.OperatingSystemFamily(); - result.getOperatingSystemFamilies().add(operatingSystemFamilyInstance); - - NodeList elements2 = operatingSystemFamiliesElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - int nameInstance; - nameInstance = Integer.parseInt(nameElement.getTextContent()); - operatingSystemFamilyInstance.setName(nameInstance); - } - - NodeList elements3 = operatingSystemFamiliesElement.getElementsByTagName("Label"); - Element labelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (labelElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - operatingSystemFamilyInstance.setLabel(labelInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements4 = operatingSystemFamiliesElement.getElementsByTagName("OperatingSystems"); - Element operatingSystemsSequenceElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (operatingSystemsSequenceElement != null) + throw ex; + } + + // Create Result + OperatingSystemListFamiliesResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new OperatingSystemListFamiliesResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("OperatingSystemFamilies"); + Element operatingSystemFamiliesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operatingSystemFamiliesSequenceElement != null) + { + for (int i1 = 0; i1 < operatingSystemFamiliesSequenceElement.getElementsByTagName("OperatingSystemFamily").getLength(); i1 = i1 + 1) { - for (int i2 = 0; i2 < operatingSystemsSequenceElement.getElementsByTagName("OperatingSystem").getLength(); i2 = i2 + 1) + org.w3c.dom.Element operatingSystemFamiliesElement = ((org.w3c.dom.Element) operatingSystemFamiliesSequenceElement.getElementsByTagName("OperatingSystemFamily").item(i1)); + OperatingSystemListFamiliesResponse.OperatingSystemFamily operatingSystemFamilyInstance = new OperatingSystemListFamiliesResponse.OperatingSystemFamily(); + result.getOperatingSystemFamilies().add(operatingSystemFamilyInstance); + + NodeList elements2 = operatingSystemFamiliesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) { - org.w3c.dom.Element operatingSystemsElement = ((org.w3c.dom.Element) operatingSystemsSequenceElement.getElementsByTagName("OperatingSystem").item(i2)); - OperatingSystemListFamiliesResponse.OperatingSystem operatingSystemInstance = new OperatingSystemListFamiliesResponse.OperatingSystem(); - operatingSystemFamilyInstance.getOperatingSystems().add(operatingSystemInstance); - - NodeList elements5 = operatingSystemsElement.getElementsByTagName("Version"); - Element versionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (versionElement != null) - { - String versionInstance; - versionInstance = versionElement.getTextContent(); - operatingSystemInstance.setVersion(versionInstance); - } - - NodeList elements6 = operatingSystemsElement.getElementsByTagName("Label"); - Element labelElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (labelElement2 != null) - { - String labelInstance2; - labelInstance2 = labelElement2.getTextContent() != null ? new String(Base64.decodeBase64(labelElement2.getTextContent().getBytes())) : null; - operatingSystemInstance.setLabel(labelInstance2); - } - - NodeList elements7 = operatingSystemsElement.getElementsByTagName("IsDefault"); - Element isDefaultElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (isDefaultElement != null) - { - boolean isDefaultInstance; - isDefaultInstance = Boolean.parseBoolean(isDefaultElement.getTextContent()); - operatingSystemInstance.setIsDefault(isDefaultInstance); - } - - NodeList elements8 = operatingSystemsElement.getElementsByTagName("IsActive"); - Element isActiveElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (isActiveElement != null) + int nameInstance; + nameInstance = Integer.parseInt(nameElement.getTextContent()); + operatingSystemFamilyInstance.setName(nameInstance); + } + + NodeList elements3 = operatingSystemFamiliesElement.getElementsByTagName("Label"); + Element labelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + operatingSystemFamilyInstance.setLabel(labelInstance); + } + + NodeList elements4 = operatingSystemFamiliesElement.getElementsByTagName("OperatingSystems"); + Element operatingSystemsSequenceElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (operatingSystemsSequenceElement != null) + { + for (int i2 = 0; i2 < operatingSystemsSequenceElement.getElementsByTagName("OperatingSystem").getLength(); i2 = i2 + 1) { - boolean isActiveInstance; - isActiveInstance = Boolean.parseBoolean(isActiveElement.getTextContent()); - operatingSystemInstance.setIsActive(isActiveInstance); + org.w3c.dom.Element operatingSystemsElement = ((org.w3c.dom.Element) operatingSystemsSequenceElement.getElementsByTagName("OperatingSystem").item(i2)); + OperatingSystemListFamiliesResponse.OperatingSystem operatingSystemInstance = new OperatingSystemListFamiliesResponse.OperatingSystem(); + operatingSystemFamilyInstance.getOperatingSystems().add(operatingSystemInstance); + + NodeList elements5 = operatingSystemsElement.getElementsByTagName("Version"); + Element versionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (versionElement != null) + { + String versionInstance; + versionInstance = versionElement.getTextContent(); + operatingSystemInstance.setVersion(versionInstance); + } + + NodeList elements6 = operatingSystemsElement.getElementsByTagName("Label"); + Element labelElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (labelElement2 != null) + { + String labelInstance2; + labelInstance2 = labelElement2.getTextContent() != null ? new String(Base64.decodeBase64(labelElement2.getTextContent().getBytes())) : null; + operatingSystemInstance.setLabel(labelInstance2); + } + + NodeList elements7 = operatingSystemsElement.getElementsByTagName("IsDefault"); + Element isDefaultElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (isDefaultElement != null) + { + boolean isDefaultInstance; + isDefaultInstance = Boolean.parseBoolean(isDefaultElement.getTextContent()); + operatingSystemInstance.setIsDefault(isDefaultInstance); + } + + NodeList elements8 = operatingSystemsElement.getElementsByTagName("IsActive"); + Element isActiveElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (isActiveElement != null) + { + boolean isActiveInstance; + isActiveInstance = Boolean.parseBoolean(isActiveElement.getTextContent()); + operatingSystemInstance.setIsActive(isActiveInstance); + } } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperations.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperations.java index 47ca2b7c56e37..d17b80435015c 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperations.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperations.java @@ -32,13 +32,11 @@ import com.microsoft.windowsazure.management.compute.models.ServiceCertificateGetResponse; import com.microsoft.windowsazure.management.compute.models.ServiceCertificateListResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -60,10 +58,20 @@ public interface ServiceCertificateOperations * @param serviceName The DNS prefix name of your service. * @param parameters Parameters supplied to the Create Service Certificate * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginCreating(String serviceName, ServiceCertificateCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginCreating(String serviceName, ServiceCertificateCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Add Service Certificate operation adds a certificate to a hosted @@ -92,6 +100,10 @@ public interface ServiceCertificateOperations * * @param parameters Parameters supplied to the Delete Service Certificate * operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -125,6 +137,29 @@ public interface ServiceCertificateOperations * @param serviceName The DNS prefix name of your service. * @param parameters Parameters supplied to the Create Service Certificate * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -135,7 +170,7 @@ public interface ServiceCertificateOperations * the failed request, and also includes error information regarding the * failure. */ - ComputeOperationStatusResponse create(String serviceName, ServiceCertificateCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, ServiceException, URISyntaxException, ParseException; + ComputeOperationStatusResponse create(String serviceName, ServiceCertificateCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerException, ServiceException, URISyntaxException, ParseException; /** * The Add Service Certificate operation adds a certificate to a hosted @@ -172,6 +207,20 @@ public interface ServiceCertificateOperations * * @param parameters Parameters supplied to the Delete Service Certificate * operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -215,6 +264,18 @@ public interface ServiceCertificateOperations * * @param parameters Parameters supplied to the Get Service Certificate * operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Service Certificate operation response. */ ServiceCertificateGetResponse get(ServiceCertificateGetParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -238,6 +299,18 @@ public interface ServiceCertificateOperations * more information) * * @param serviceName The DNS prefix name of your hosted service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List Service Certificates operation response. */ ServiceCertificateListResponse list(String serviceName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperationsImpl.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperationsImpl.java index f364ad40e0db6..adbee6b1bf391 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperationsImpl.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/ServiceCertificateOperationsImpl.java @@ -39,7 +39,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; import java.text.ParseException; @@ -51,7 +50,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -89,6 +87,7 @@ public class ServiceCertificateOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -285,6 +304,10 @@ public OperationResponse call() throws Exception * * @param parameters Parameters supplied to the Delete Service Certificate * operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -332,40 +355,50 @@ public OperationResponse beginDeleting(ServiceCertificateDeleteParameters parame // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -414,6 +447,29 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The DNS prefix name of your service. * @param parameters Parameters supplied to the Create Service Certificate * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -425,7 +481,7 @@ public ComputeOperationStatusResponse call() throws Exception * failure. */ @Override - public ComputeOperationStatusResponse create(String serviceName, ServiceCertificateCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, ServiceException, URISyntaxException, ParseException + public ComputeOperationStatusResponse create(String serviceName, ServiceCertificateCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerException, ServiceException, URISyntaxException, ParseException { ComputeManagementClient client2 = this.getClient(); boolean shouldTrace = CloudTracing.getIsEnabled(); @@ -539,6 +595,20 @@ public ComputeOperationStatusResponse call() throws Exception * * @param parameters Parameters supplied to the Delete Service Certificate * operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -649,6 +719,18 @@ public ServiceCertificateGetResponse call() throws Exception * * @param parameters Parameters supplied to the Get Service Certificate * operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Service Certificate operation response. */ @Override @@ -695,60 +777,70 @@ public ServiceCertificateGetResponse get(ServiceCertificateGetParameters paramet // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ServiceCertificateGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ServiceCertificateGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Certificate"); - Element certificateElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (certificateElement != null) - { - NodeList elements2 = certificateElement.getElementsByTagName("Data"); - Element dataElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (dataElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - byte[] dataInstance; - dataInstance = dataElement.getTextContent() != null ? Base64.decodeBase64(dataElement.getTextContent().getBytes()) : null; - result.setData(dataInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + ServiceCertificateGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServiceCertificateGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Certificate"); + Element certificateElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (certificateElement != null) + { + NodeList elements2 = certificateElement.getElementsByTagName("Data"); + Element dataElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (dataElement != null) + { + byte[] dataInstance; + dataInstance = dataElement.getTextContent() != null ? Base64.decodeBase64(dataElement.getTextContent().getBytes()) : null; + result.setData(dataInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -779,6 +871,18 @@ public ServiceCertificateListResponse call() throws Exception * more information) * * @param serviceName The DNS prefix name of your hosted service. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List Service Certificates operation response. */ @Override @@ -813,93 +917,103 @@ public ServiceCertificateListResponse list(String serviceName) throws IOExceptio // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ServiceCertificateListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ServiceCertificateListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Certificates"); - Element certificatesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (certificatesSequenceElement != null) - { - for (int i1 = 0; i1 < certificatesSequenceElement.getElementsByTagName("Certificate").getLength(); i1 = i1 + 1) - { - org.w3c.dom.Element certificatesElement = ((org.w3c.dom.Element) certificatesSequenceElement.getElementsByTagName("Certificate").item(i1)); - ServiceCertificateListResponse.Certificate certificateInstance = new ServiceCertificateListResponse.Certificate(); - result.getCertificates().add(certificateInstance); - - NodeList elements2 = certificatesElement.getElementsByTagName("CertificateUrl"); - Element certificateUrlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (certificateUrlElement != null) - { - URI certificateUrlInstance; - certificateUrlInstance = new URI(certificateUrlElement.getTextContent()); - certificateInstance.setCertificateUri(certificateUrlInstance); - } - - NodeList elements3 = certificatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (thumbprintElement != null) - { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - certificateInstance.setThumbprint(thumbprintInstance); - } - - NodeList elements4 = certificatesElement.getElementsByTagName("ThumbprintAlgorithm"); - Element thumbprintAlgorithmElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (thumbprintAlgorithmElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String thumbprintAlgorithmInstance; - thumbprintAlgorithmInstance = thumbprintAlgorithmElement.getTextContent(); - certificateInstance.setThumbprintAlgorithm(thumbprintAlgorithmInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements5 = certificatesElement.getElementsByTagName("Data"); - Element dataElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (dataElement != null) + throw ex; + } + + // Create Result + ServiceCertificateListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServiceCertificateListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Certificates"); + Element certificatesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (certificatesSequenceElement != null) + { + for (int i1 = 0; i1 < certificatesSequenceElement.getElementsByTagName("Certificate").getLength(); i1 = i1 + 1) { - byte[] dataInstance; - dataInstance = dataElement.getTextContent() != null ? Base64.decodeBase64(dataElement.getTextContent().getBytes()) : null; - certificateInstance.setData(dataInstance); + org.w3c.dom.Element certificatesElement = ((org.w3c.dom.Element) certificatesSequenceElement.getElementsByTagName("Certificate").item(i1)); + ServiceCertificateListResponse.Certificate certificateInstance = new ServiceCertificateListResponse.Certificate(); + result.getCertificates().add(certificateInstance); + + NodeList elements2 = certificatesElement.getElementsByTagName("CertificateUrl"); + Element certificateUrlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (certificateUrlElement != null) + { + URI certificateUrlInstance; + certificateUrlInstance = new URI(certificateUrlElement.getTextContent()); + certificateInstance.setCertificateUri(certificateUrlInstance); + } + + NodeList elements3 = certificatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (thumbprintElement != null) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + certificateInstance.setThumbprint(thumbprintInstance); + } + + NodeList elements4 = certificatesElement.getElementsByTagName("ThumbprintAlgorithm"); + Element thumbprintAlgorithmElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (thumbprintAlgorithmElement != null) + { + String thumbprintAlgorithmInstance; + thumbprintAlgorithmInstance = thumbprintAlgorithmElement.getTextContent(); + certificateInstance.setThumbprintAlgorithm(thumbprintAlgorithmInstance); + } + + NodeList elements5 = certificatesElement.getElementsByTagName("Data"); + Element dataElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (dataElement != null) + { + byte[] dataInstance; + dataInstance = dataElement.getTextContent() != null ? Base64.decodeBase64(dataElement.getTextContent().getBytes()) : null; + certificateInstance.setData(dataInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineDiskOperations.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineDiskOperations.java index 0c0ea69d89c84..47f436e9ccfb2 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineDiskOperations.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineDiskOperations.java @@ -36,12 +36,10 @@ import com.microsoft.windowsazure.management.compute.models.VirtualMachineDiskUpdateDiskParameters; import com.microsoft.windowsazure.management.compute.models.VirtualMachineDiskUpdateDiskResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -65,6 +63,10 @@ public interface VirtualMachineDiskOperations * @param logicalUnitNumber The logical unit number of the disk. * @param deleteFromStorage Optional. Specifies that the source blob for the * disk should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -113,10 +115,20 @@ public interface VirtualMachineDiskOperations * @param roleName The name of the role to add the data disk to. * @param parameters Parameters supplied to the Create Virtual Machine Data * Disk operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse createDataDisk(String serviceName, String deploymentName, String roleName, VirtualMachineDiskCreateDataDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse createDataDisk(String serviceName, String deploymentName, String roleName, VirtualMachineDiskCreateDataDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Add Data Disk operation adds a data disk to a virtual machine. There @@ -157,9 +169,21 @@ public interface VirtualMachineDiskOperations * * @param parameters Parameters supplied to the Create Virtual Machine Disk * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return A virtual machine disk associated with your subscription. */ - VirtualMachineDiskCreateDiskResponse createDisk(VirtualMachineDiskCreateDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException; + VirtualMachineDiskCreateDiskResponse createDisk(VirtualMachineDiskCreateDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException; /** * The Add Disk operation adds a disk to the user image repository. The disk @@ -185,6 +209,18 @@ public interface VirtualMachineDiskOperations * @param logicalUnitNumber The logical unit number of the disk. * @param deleteFromStorage Optional. Specifies that the source blob for the * disk should also be deleted from storage. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -230,6 +266,10 @@ public interface VirtualMachineDiskOperations * @param diskName The name of the disk to delete. * @param deleteFromStorage Optional. Specifies that the source blob for the * disk should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -259,6 +299,16 @@ public interface VirtualMachineDiskOperations * @param deploymentName The name of the deployment. * @param roleName The name of the role. * @param logicalUnitNumber The logical unit number of the disk. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Data Disk operation response. */ VirtualMachineDiskGetDataDiskResponse getDataDisk(String serviceName, String deploymentName, String roleName, int logicalUnitNumber) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException; @@ -284,6 +334,16 @@ public interface VirtualMachineDiskOperations * more information) * * @param diskName The name of the disk. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return A virtual machine disk associated with your subscription. */ VirtualMachineDiskGetDiskResponse getDisk(String diskName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException; @@ -305,6 +365,16 @@ public interface VirtualMachineDiskOperations * http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The List Disks operation response. */ VirtualMachineDiskListResponse listDisks() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException; @@ -331,10 +401,20 @@ public interface VirtualMachineDiskOperations * @param logicalUnitNumber The logical unit number of the disk. * @param parameters Parameters supplied to the Update Virtual Machine Data * Disk operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse updateDataDisk(String serviceName, String deploymentName, String roleName, int logicalUnitNumber, VirtualMachineDiskUpdateDataDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse updateDataDisk(String serviceName, String deploymentName, String roleName, int logicalUnitNumber, VirtualMachineDiskUpdateDataDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Update Data Disk operation updates the specified data disk attached @@ -362,9 +442,21 @@ public interface VirtualMachineDiskOperations * @param diskName The name of the disk being updated. * @param parameters Parameters supplied to the Update Virtual Machine Disk * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return A virtual machine disk associated with your subscription. */ - VirtualMachineDiskUpdateDiskResponse updateDisk(String diskName, VirtualMachineDiskUpdateDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException; + VirtualMachineDiskUpdateDiskResponse updateDisk(String diskName, VirtualMachineDiskUpdateDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException; /** * The Add Disk operation adds a disk to the user image repository. The disk diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineDiskOperationsImpl.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineDiskOperationsImpl.java index a5242276953df..c89db3873ee55 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineDiskOperationsImpl.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineDiskOperationsImpl.java @@ -44,10 +44,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URLEncoder; import java.util.HashMap; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -56,7 +54,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -95,6 +92,7 @@ public class VirtualMachineDiskOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -293,11 +301,21 @@ public OperationResponse call() throws Exception * @param roleName The name of the role to add the data disk to. * @param parameters Parameters supplied to the Create Virtual Machine Data * Disk operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse createDataDisk(String serviceName, String deploymentName, String roleName, VirtualMachineDiskCreateDataDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse createDataDisk(String serviceName, String deploymentName, String roleName, VirtualMachineDiskCreateDataDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -407,40 +425,50 @@ public OperationResponse createDataDisk(String serviceName, String deploymentNam // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_CREATED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_CREATED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -473,10 +501,22 @@ public VirtualMachineDiskCreateDiskResponse call() throws Exception * * @param parameters Parameters supplied to the Create Virtual Machine Disk * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return A virtual machine disk associated with your subscription. */ @Override - public VirtualMachineDiskCreateDiskResponse createDisk(VirtualMachineDiskCreateDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException + public VirtualMachineDiskCreateDiskResponse createDisk(VirtualMachineDiskCreateDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException { // Validate if (parameters == null) @@ -558,167 +598,177 @@ public VirtualMachineDiskCreateDiskResponse createDisk(VirtualMachineDiskCreateD // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - VirtualMachineDiskCreateDiskResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineDiskCreateDiskResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Disk"); - Element diskElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (diskElement2 != null) - { - NodeList elements2 = diskElement2.getElementsByTagName("OS"); - Element osElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (osElement2 != null) - { - String osInstance; - osInstance = osElement2.getTextContent(); - result.setOperatingSystem(osInstance); - } - - NodeList elements3 = diskElement2.getElementsByTagName("Label"); - Element labelElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (labelElement2 != null) - { - String labelInstance; - labelInstance = labelElement2.getTextContent(); - result.setLabel(labelInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements4 = diskElement2.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - result.setAffinityGroup(affinityGroupInstance); - } - - NodeList elements5 = diskElement2.getElementsByTagName("Location"); - Element locationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (locationElement != null) - { - String locationInstance; - locationInstance = locationElement.getTextContent(); - result.setLocation(locationInstance); - } - - NodeList elements6 = diskElement2.getElementsByTagName("LogicalDiskSizeInGB"); - Element logicalDiskSizeInGBElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (logicalDiskSizeInGBElement != null) - { - double logicalDiskSizeInGBInstance; - logicalDiskSizeInGBInstance = Double.parseDouble(logicalDiskSizeInGBElement.getTextContent()); - result.setLogicalSizeInGB(logicalDiskSizeInGBInstance); - } - - NodeList elements7 = diskElement2.getElementsByTagName("MediaLink"); - Element mediaLinkElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (mediaLinkElement2 != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement2.getTextContent()); - result.setMediaLinkUri(mediaLinkInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements8 = diskElement2.getElementsByTagName("Name"); - Element nameElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (nameElement2 != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements9 = diskElement2.getElementsByTagName("SourceImageName"); - Element sourceImageNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (sourceImageNameElement != null) - { - String sourceImageNameInstance; - sourceImageNameInstance = sourceImageNameElement.getTextContent(); - result.setSourceImageName(sourceImageNameInstance); - } + // Create Result + VirtualMachineDiskCreateDiskResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineDiskCreateDiskResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements10 = diskElement2.getElementsByTagName("AttachedTo"); - Element attachedToElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (attachedToElement != null) + NodeList elements = responseDoc.getElementsByTagName("Disk"); + Element diskElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (diskElement2 != null) { - VirtualMachineDiskCreateDiskResponse.VirtualMachineDiskUsageDetails attachedToInstance = new VirtualMachineDiskCreateDiskResponse.VirtualMachineDiskUsageDetails(); - result.setUsageDetails(attachedToInstance); + NodeList elements2 = diskElement2.getElementsByTagName("OS"); + Element osElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (osElement2 != null) + { + String osInstance; + osInstance = osElement2.getTextContent(); + result.setOperatingSystem(osInstance); + } + + NodeList elements3 = diskElement2.getElementsByTagName("Label"); + Element labelElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (labelElement2 != null) + { + String labelInstance; + labelInstance = labelElement2.getTextContent(); + result.setLabel(labelInstance); + } + + NodeList elements4 = diskElement2.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + result.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements5 = diskElement2.getElementsByTagName("Location"); + Element locationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + result.setLocation(locationInstance); + } + + NodeList elements6 = diskElement2.getElementsByTagName("LogicalDiskSizeInGB"); + Element logicalDiskSizeInGBElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (logicalDiskSizeInGBElement != null) + { + double logicalDiskSizeInGBInstance; + logicalDiskSizeInGBInstance = Double.parseDouble(logicalDiskSizeInGBElement.getTextContent()); + result.setLogicalSizeInGB(logicalDiskSizeInGBInstance); + } + + NodeList elements7 = diskElement2.getElementsByTagName("MediaLink"); + Element mediaLinkElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (mediaLinkElement2 != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement2.getTextContent()); + result.setMediaLinkUri(mediaLinkInstance); + } + + NodeList elements8 = diskElement2.getElementsByTagName("Name"); + Element nameElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } - NodeList elements11 = attachedToElement.getElementsByTagName("HostedServiceName"); - Element hostedServiceNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (hostedServiceNameElement != null) + NodeList elements9 = diskElement2.getElementsByTagName("SourceImageName"); + Element sourceImageNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (sourceImageNameElement != null) { - String hostedServiceNameInstance; - hostedServiceNameInstance = hostedServiceNameElement.getTextContent(); - attachedToInstance.setHostedServiceName(hostedServiceNameInstance); + String sourceImageNameInstance; + sourceImageNameInstance = sourceImageNameElement.getTextContent(); + result.setSourceImageName(sourceImageNameInstance); } - NodeList elements12 = attachedToElement.getElementsByTagName("DeploymentName"); - Element deploymentNameElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (deploymentNameElement != null) + NodeList elements10 = diskElement2.getElementsByTagName("AttachedTo"); + Element attachedToElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (attachedToElement != null) { - String deploymentNameInstance; - deploymentNameInstance = deploymentNameElement.getTextContent(); - attachedToInstance.setDeploymentName(deploymentNameInstance); + VirtualMachineDiskCreateDiskResponse.VirtualMachineDiskUsageDetails attachedToInstance = new VirtualMachineDiskCreateDiskResponse.VirtualMachineDiskUsageDetails(); + result.setUsageDetails(attachedToInstance); + + NodeList elements11 = attachedToElement.getElementsByTagName("HostedServiceName"); + Element hostedServiceNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (hostedServiceNameElement != null) + { + String hostedServiceNameInstance; + hostedServiceNameInstance = hostedServiceNameElement.getTextContent(); + attachedToInstance.setHostedServiceName(hostedServiceNameInstance); + } + + NodeList elements12 = attachedToElement.getElementsByTagName("DeploymentName"); + Element deploymentNameElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (deploymentNameElement != null) + { + String deploymentNameInstance; + deploymentNameInstance = deploymentNameElement.getTextContent(); + attachedToInstance.setDeploymentName(deploymentNameInstance); + } + + NodeList elements13 = attachedToElement.getElementsByTagName("RoleName"); + Element roleNameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (roleNameElement != null) + { + String roleNameInstance; + roleNameInstance = roleNameElement.getTextContent(); + attachedToInstance.setRoleName(roleNameInstance); + } } - NodeList elements13 = attachedToElement.getElementsByTagName("RoleName"); - Element roleNameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (roleNameElement != null) + NodeList elements14 = diskElement2.getElementsByTagName("IsPremium"); + Element isPremiumElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) { - String roleNameInstance; - roleNameInstance = roleNameElement.getTextContent(); - attachedToInstance.setRoleName(roleNameInstance); + boolean isPremiumInstance; + isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); + result.setIsPremium(isPremiumInstance); } } - NodeList elements14 = diskElement2.getElementsByTagName("IsPremium"); - Element isPremiumElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - boolean isPremiumInstance; - isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); - result.setIsPremium(isPremiumInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -767,6 +817,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param logicalUnitNumber The logical unit number of the disk. * @param deleteFromStorage Optional. Specifies that the source blob for the * disk should also be deleted from storage. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -884,6 +946,10 @@ public OperationResponse call() throws Exception * @param diskName The name of the disk to delete. * @param deleteFromStorage Optional. Specifies that the source blob for the * disk should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -909,11 +975,7 @@ public OperationResponse deleteDisk(String diskName, boolean deleteFromStorage) } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/disks/" + diskName + "?"; - if (deleteFromStorage == true) - { - url = url + "&comp=" + URLEncoder.encode("media", "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/disks/" + diskName + "?comp=" + deleteFromStorage; // Create HTTP transport objects CustomHttpDelete httpRequest = new CustomHttpDelete(url); @@ -923,40 +985,50 @@ public OperationResponse deleteDisk(String diskName, boolean deleteFromStorage) // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -993,6 +1065,16 @@ public VirtualMachineDiskGetDataDiskResponse call() throws Exception * @param deploymentName The name of the deployment. * @param roleName The name of the role. * @param logicalUnitNumber The logical unit number of the disk. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Data Disk operation response. */ @Override @@ -1037,105 +1119,115 @@ public VirtualMachineDiskGetDataDiskResponse getDataDisk(String serviceName, Str // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - VirtualMachineDiskGetDataDiskResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineDiskGetDataDiskResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("DataVirtualHardDisk"); - Element dataVirtualHardDiskElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (dataVirtualHardDiskElement != null) - { - NodeList elements2 = dataVirtualHardDiskElement.getElementsByTagName("HostCaching"); - Element hostCachingElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (hostCachingElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - VirtualHardDiskHostCaching hostCachingInstance; - hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); - result.setHostCaching(hostCachingInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = dataVirtualHardDiskElement.getElementsByTagName("DiskLabel"); - Element diskLabelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (diskLabelElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String diskLabelInstance; - diskLabelInstance = diskLabelElement.getTextContent(); - result.setDiskLabel(diskLabelInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = dataVirtualHardDiskElement.getElementsByTagName("DiskName"); - Element diskNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (diskNameElement != null) - { - String diskNameInstance; - diskNameInstance = diskNameElement.getTextContent(); - result.setDiskName(diskNameInstance); - } + // Create Result + VirtualMachineDiskGetDataDiskResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineDiskGetDataDiskResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements5 = dataVirtualHardDiskElement.getElementsByTagName("Lun"); - Element lunElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + NodeList elements = responseDoc.getElementsByTagName("DataVirtualHardDisk"); + Element dataVirtualHardDiskElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (dataVirtualHardDiskElement != null) { - int lunInstance; - lunInstance = Integer.parseInt(lunElement.getTextContent()); - result.setLogicalUnitNumber(lunInstance); + NodeList elements2 = dataVirtualHardDiskElement.getElementsByTagName("HostCaching"); + Element hostCachingElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (hostCachingElement != null) + { + VirtualHardDiskHostCaching hostCachingInstance; + hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); + result.setHostCaching(hostCachingInstance); + } + + NodeList elements3 = dataVirtualHardDiskElement.getElementsByTagName("DiskLabel"); + Element diskLabelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (diskLabelElement != null) + { + String diskLabelInstance; + diskLabelInstance = diskLabelElement.getTextContent(); + result.setDiskLabel(diskLabelInstance); + } + + NodeList elements4 = dataVirtualHardDiskElement.getElementsByTagName("DiskName"); + Element diskNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (diskNameElement != null) + { + String diskNameInstance; + diskNameInstance = diskNameElement.getTextContent(); + result.setDiskName(diskNameInstance); + } + + NodeList elements5 = dataVirtualHardDiskElement.getElementsByTagName("Lun"); + Element lunElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + { + int lunInstance; + lunInstance = Integer.parseInt(lunElement.getTextContent()); + result.setLogicalUnitNumber(lunInstance); + } + + NodeList elements6 = dataVirtualHardDiskElement.getElementsByTagName("LogicalDiskSizeInGB"); + Element logicalDiskSizeInGBElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (logicalDiskSizeInGBElement != null) + { + double logicalDiskSizeInGBInstance; + logicalDiskSizeInGBInstance = Double.parseDouble(logicalDiskSizeInGBElement.getTextContent()); + result.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + } + + NodeList elements7 = dataVirtualHardDiskElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (mediaLinkElement != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); + result.setMediaLinkUri(mediaLinkInstance); + } } - NodeList elements6 = dataVirtualHardDiskElement.getElementsByTagName("LogicalDiskSizeInGB"); - Element logicalDiskSizeInGBElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (logicalDiskSizeInGBElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - double logicalDiskSizeInGBInstance; - logicalDiskSizeInGBInstance = Double.parseDouble(logicalDiskSizeInGBElement.getTextContent()); - result.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements7 = dataVirtualHardDiskElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (mediaLinkElement != null) + if (shouldTrace) { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - result.setMediaLinkUri(mediaLinkInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1166,6 +1258,16 @@ public VirtualMachineDiskGetDiskResponse call() throws Exception * more information) * * @param diskName The name of the disk. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return A virtual machine disk associated with your subscription. */ @Override @@ -1199,349 +1301,119 @@ public VirtualMachineDiskGetDiskResponse getDisk(String diskName) throws IOExcep // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - VirtualMachineDiskGetDiskResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineDiskGetDiskResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Disk"); - Element diskElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (diskElement != null) - { - NodeList elements2 = diskElement.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - result.setAffinityGroup(affinityGroupInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements3 = diskElement.getElementsByTagName("Location"); - Element locationElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (locationElement != null) - { - String locationInstance; - locationInstance = locationElement.getTextContent(); - result.setLocation(locationInstance); - } - - NodeList elements4 = diskElement.getElementsByTagName("Label"); - Element labelElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent(); - result.setLabel(labelInstance); - } - - NodeList elements5 = diskElement.getElementsByTagName("LogicalDiskSizeInGB"); - Element logicalDiskSizeInGBElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (logicalDiskSizeInGBElement != null) - { - double logicalDiskSizeInGBInstance; - logicalDiskSizeInGBInstance = Double.parseDouble(logicalDiskSizeInGBElement.getTextContent()); - result.setLogicalSizeInGB(logicalDiskSizeInGBInstance); - } - - NodeList elements6 = diskElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (mediaLinkElement != null) - { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - result.setMediaLinkUri(mediaLinkInstance); - } - - NodeList elements7 = diskElement.getElementsByTagName("Name"); - Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements8 = diskElement.getElementsByTagName("OS"); - Element osElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (osElement != null) - { - String osInstance; - osInstance = osElement.getTextContent(); - result.setOperatingSystemType(osInstance); - } - - NodeList elements9 = diskElement.getElementsByTagName("SourceImageName"); - Element sourceImageNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (sourceImageNameElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String sourceImageNameInstance; - sourceImageNameInstance = sourceImageNameElement.getTextContent(); - result.setSourceImageName(sourceImageNameInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements10 = diskElement.getElementsByTagName("AttachedTo"); - Element attachedToElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (attachedToElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - VirtualMachineDiskGetDiskResponse.VirtualMachineDiskUsageDetails attachedToInstance = new VirtualMachineDiskGetDiskResponse.VirtualMachineDiskUsageDetails(); - result.setUsageDetails(attachedToInstance); - - NodeList elements11 = attachedToElement.getElementsByTagName("HostedServiceName"); - Element hostedServiceNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (hostedServiceNameElement != null) + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String hostedServiceNameInstance; - hostedServiceNameInstance = hostedServiceNameElement.getTextContent(); - attachedToInstance.setHostedServiceName(hostedServiceNameInstance); - } - - NodeList elements12 = attachedToElement.getElementsByTagName("DeploymentName"); - Element deploymentNameElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (deploymentNameElement != null) - { - String deploymentNameInstance; - deploymentNameInstance = deploymentNameElement.getTextContent(); - attachedToInstance.setDeploymentName(deploymentNameInstance); - } - - NodeList elements13 = attachedToElement.getElementsByTagName("RoleName"); - Element roleNameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (roleNameElement != null) - { - String roleNameInstance; - roleNameInstance = roleNameElement.getTextContent(); - attachedToInstance.setRoleName(roleNameInstance); + CloudTracing.error(invocationId, ex); } + throw ex; } - NodeList elements14 = diskElement.getElementsByTagName("IsCorrupted"); - Element isCorruptedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (isCorruptedElement != null && (isCorruptedElement.getTextContent() != null && isCorruptedElement.getTextContent().isEmpty() != true) == false) - { - boolean isCorruptedInstance; - isCorruptedInstance = Boolean.parseBoolean(isCorruptedElement.getTextContent()); - result.setIsCorrupted(isCorruptedInstance); - } + // Create Result + VirtualMachineDiskGetDiskResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineDiskGetDiskResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements15 = diskElement.getElementsByTagName("IsPremium"); - Element isPremiumElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) - { - boolean isPremiumInstance; - isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); - result.setIsPremium(isPremiumInstance); - } - } - - 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); - } - return result; - } - - /** - * The List Disks operation retrieves a list of the disks in your image - * repository. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx for - * more information) - * - * @return The List Disks operation response. - */ - @Override - public Future listDisksAsync() - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public VirtualMachineDiskListResponse call() throws Exception - { - return listDisks(); - } - }); - } - - /** - * The List Disks operation retrieves a list of the disks in your image - * repository. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx for - * more information) - * - * @return The List Disks operation response. - */ - @Override - public VirtualMachineDiskListResponse listDisks() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException - { - // Validate - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - CloudTracing.enter(invocationId, this, "listDisksAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/disks"; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2013-11-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); - if (shouldTrace) + NodeList elements = responseDoc.getElementsByTagName("Disk"); + Element diskElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (diskElement != null) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - VirtualMachineDiskListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineDiskListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Disks"); - Element disksSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (disksSequenceElement != null) - { - for (int i1 = 0; i1 < disksSequenceElement.getElementsByTagName("Disk").getLength(); i1 = i1 + 1) - { - org.w3c.dom.Element disksElement = ((org.w3c.dom.Element) disksSequenceElement.getElementsByTagName("Disk").item(i1)); - VirtualMachineDiskListResponse.VirtualMachineDisk diskInstance = new VirtualMachineDiskListResponse.VirtualMachineDisk(); - result.getDisks().add(diskInstance); - - NodeList elements2 = disksElement.getElementsByTagName("AffinityGroup"); + NodeList elements2 = diskElement.getElementsByTagName("AffinityGroup"); Element affinityGroupElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; if (affinityGroupElement != null) { String affinityGroupInstance; affinityGroupInstance = affinityGroupElement.getTextContent(); - diskInstance.setAffinityGroup(affinityGroupInstance); + result.setAffinityGroup(affinityGroupInstance); } - NodeList elements3 = disksElement.getElementsByTagName("Location"); + NodeList elements3 = diskElement.getElementsByTagName("Location"); Element locationElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; if (locationElement != null) { String locationInstance; locationInstance = locationElement.getTextContent(); - diskInstance.setLocation(locationInstance); + result.setLocation(locationInstance); } - NodeList elements4 = disksElement.getElementsByTagName("Label"); + NodeList elements4 = diskElement.getElementsByTagName("Label"); Element labelElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; if (labelElement != null) { String labelInstance; labelInstance = labelElement.getTextContent(); - diskInstance.setLabel(labelInstance); + result.setLabel(labelInstance); } - NodeList elements5 = disksElement.getElementsByTagName("LogicalDiskSizeInGB"); + NodeList elements5 = diskElement.getElementsByTagName("LogicalDiskSizeInGB"); Element logicalDiskSizeInGBElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; if (logicalDiskSizeInGBElement != null) { double logicalDiskSizeInGBInstance; logicalDiskSizeInGBInstance = Double.parseDouble(logicalDiskSizeInGBElement.getTextContent()); - diskInstance.setLogicalSizeInGB(logicalDiskSizeInGBInstance); + result.setLogicalSizeInGB(logicalDiskSizeInGBInstance); } - NodeList elements6 = disksElement.getElementsByTagName("MediaLink"); + NodeList elements6 = diskElement.getElementsByTagName("MediaLink"); Element mediaLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; if (mediaLinkElement != null) { URI mediaLinkInstance; mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - diskInstance.setMediaLinkUri(mediaLinkInstance); + result.setMediaLinkUri(mediaLinkInstance); } - NodeList elements7 = disksElement.getElementsByTagName("Name"); + NodeList elements7 = diskElement.getElementsByTagName("Name"); Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; if (nameElement != null) { String nameInstance; nameInstance = nameElement.getTextContent(); - diskInstance.setName(nameInstance); + result.setName(nameInstance); } - NodeList elements8 = disksElement.getElementsByTagName("OS"); + NodeList elements8 = diskElement.getElementsByTagName("OS"); Element osElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; if (osElement != null) { String osInstance; osInstance = osElement.getTextContent(); - diskInstance.setOperatingSystemType(osInstance); + result.setOperatingSystemType(osInstance); } - NodeList elements9 = disksElement.getElementsByTagName("SourceImageName"); + NodeList elements9 = diskElement.getElementsByTagName("SourceImageName"); Element sourceImageNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; if (sourceImageNameElement != null) { String sourceImageNameInstance; sourceImageNameInstance = sourceImageNameElement.getTextContent(); - diskInstance.setSourceImageName(sourceImageNameInstance); + result.setSourceImageName(sourceImageNameInstance); } - NodeList elements10 = disksElement.getElementsByTagName("AttachedTo"); + NodeList elements10 = diskElement.getElementsByTagName("AttachedTo"); Element attachedToElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; if (attachedToElement != null) { - VirtualMachineDiskListResponse.VirtualMachineDiskUsageDetails attachedToInstance = new VirtualMachineDiskListResponse.VirtualMachineDiskUsageDetails(); - diskInstance.setUsageDetails(attachedToInstance); + VirtualMachineDiskGetDiskResponse.VirtualMachineDiskUsageDetails attachedToInstance = new VirtualMachineDiskGetDiskResponse.VirtualMachineDiskUsageDetails(); + result.setUsageDetails(attachedToInstance); NodeList elements11 = attachedToElement.getElementsByTagName("HostedServiceName"); Element hostedServiceNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; @@ -1571,37 +1443,297 @@ public VirtualMachineDiskListResponse listDisks() throws IOException, ServiceExc } } - NodeList elements14 = disksElement.getElementsByTagName("IsCorrupted"); + NodeList elements14 = diskElement.getElementsByTagName("IsCorrupted"); Element isCorruptedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; if (isCorruptedElement != null && (isCorruptedElement.getTextContent() != null && isCorruptedElement.getTextContent().isEmpty() != true) == false) { boolean isCorruptedInstance; isCorruptedInstance = Boolean.parseBoolean(isCorruptedElement.getTextContent()); - diskInstance.setIsCorrupted(isCorruptedInstance); + result.setIsCorrupted(isCorruptedInstance); } - NodeList elements15 = disksElement.getElementsByTagName("IsPremium"); + NodeList elements15 = diskElement.getElementsByTagName("IsPremium"); Element isPremiumElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) { boolean isPremiumInstance; isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); - diskInstance.setIsPremium(isPremiumInstance); + result.setIsPremium(isPremiumInstance); } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) + finally { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } + } + + /** + * The List Disks operation retrieves a list of the disks in your image + * repository. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx for + * more information) + * + * @return The List Disks operation response. + */ + @Override + public Future listDisksAsync() + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public VirtualMachineDiskListResponse call() throws Exception + { + return listDisks(); + } + }); + } + + /** + * The List Disks operation retrieves a list of the disks in your image + * repository. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157176.aspx for + * more information) + * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @return The List Disks operation response. + */ + @Override + public VirtualMachineDiskListResponse listDisks() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException + { + // Validate + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; if (shouldTrace) { - CloudTracing.exit(invocationId, result); + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + CloudTracing.enter(invocationId, this, "listDisksAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/disks"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + VirtualMachineDiskListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineDiskListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Disks"); + Element disksSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (disksSequenceElement != null) + { + for (int i1 = 0; i1 < disksSequenceElement.getElementsByTagName("Disk").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element disksElement = ((org.w3c.dom.Element) disksSequenceElement.getElementsByTagName("Disk").item(i1)); + VirtualMachineDiskListResponse.VirtualMachineDisk diskInstance = new VirtualMachineDiskListResponse.VirtualMachineDisk(); + result.getDisks().add(diskInstance); + + NodeList elements2 = disksElement.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + diskInstance.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements3 = disksElement.getElementsByTagName("Location"); + Element locationElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + diskInstance.setLocation(locationInstance); + } + + NodeList elements4 = disksElement.getElementsByTagName("Label"); + Element labelElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent(); + diskInstance.setLabel(labelInstance); + } + + NodeList elements5 = disksElement.getElementsByTagName("LogicalDiskSizeInGB"); + Element logicalDiskSizeInGBElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (logicalDiskSizeInGBElement != null) + { + double logicalDiskSizeInGBInstance; + logicalDiskSizeInGBInstance = Double.parseDouble(logicalDiskSizeInGBElement.getTextContent()); + diskInstance.setLogicalSizeInGB(logicalDiskSizeInGBInstance); + } + + NodeList elements6 = disksElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (mediaLinkElement != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); + diskInstance.setMediaLinkUri(mediaLinkInstance); + } + + NodeList elements7 = disksElement.getElementsByTagName("Name"); + Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + diskInstance.setName(nameInstance); + } + + NodeList elements8 = disksElement.getElementsByTagName("OS"); + Element osElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (osElement != null) + { + String osInstance; + osInstance = osElement.getTextContent(); + diskInstance.setOperatingSystemType(osInstance); + } + + NodeList elements9 = disksElement.getElementsByTagName("SourceImageName"); + Element sourceImageNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (sourceImageNameElement != null) + { + String sourceImageNameInstance; + sourceImageNameInstance = sourceImageNameElement.getTextContent(); + diskInstance.setSourceImageName(sourceImageNameInstance); + } + + NodeList elements10 = disksElement.getElementsByTagName("AttachedTo"); + Element attachedToElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (attachedToElement != null) + { + VirtualMachineDiskListResponse.VirtualMachineDiskUsageDetails attachedToInstance = new VirtualMachineDiskListResponse.VirtualMachineDiskUsageDetails(); + diskInstance.setUsageDetails(attachedToInstance); + + NodeList elements11 = attachedToElement.getElementsByTagName("HostedServiceName"); + Element hostedServiceNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (hostedServiceNameElement != null) + { + String hostedServiceNameInstance; + hostedServiceNameInstance = hostedServiceNameElement.getTextContent(); + attachedToInstance.setHostedServiceName(hostedServiceNameInstance); + } + + NodeList elements12 = attachedToElement.getElementsByTagName("DeploymentName"); + Element deploymentNameElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (deploymentNameElement != null) + { + String deploymentNameInstance; + deploymentNameInstance = deploymentNameElement.getTextContent(); + attachedToInstance.setDeploymentName(deploymentNameInstance); + } + + NodeList elements13 = attachedToElement.getElementsByTagName("RoleName"); + Element roleNameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (roleNameElement != null) + { + String roleNameInstance; + roleNameInstance = roleNameElement.getTextContent(); + attachedToInstance.setRoleName(roleNameInstance); + } + } + + NodeList elements14 = disksElement.getElementsByTagName("IsCorrupted"); + Element isCorruptedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (isCorruptedElement != null && (isCorruptedElement.getTextContent() != null && isCorruptedElement.getTextContent().isEmpty() != true) == false) + { + boolean isCorruptedInstance; + isCorruptedInstance = Boolean.parseBoolean(isCorruptedElement.getTextContent()); + diskInstance.setIsCorrupted(isCorruptedInstance); + } + + NodeList elements15 = disksElement.getElementsByTagName("IsPremium"); + Element isPremiumElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) + { + boolean isPremiumInstance; + isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); + diskInstance.setIsPremium(isPremiumInstance); + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1643,11 +1775,21 @@ public OperationResponse call() throws Exception * @param logicalUnitNumber The logical unit number of the disk. * @param parameters Parameters supplied to the Update Virtual Machine Data * Disk operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse updateDataDisk(String serviceName, String deploymentName, String roleName, int logicalUnitNumber, VirtualMachineDiskUpdateDataDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse updateDataDisk(String serviceName, String deploymentName, String roleName, int logicalUnitNumber, VirtualMachineDiskUpdateDataDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -1751,40 +1893,50 @@ public OperationResponse updateDataDisk(String serviceName, String deploymentNam // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1819,10 +1971,22 @@ public VirtualMachineDiskUpdateDiskResponse call() throws Exception * @param diskName The name of the disk being updated. * @param parameters Parameters supplied to the Update Virtual Machine Disk * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return A virtual machine disk associated with your subscription. */ @Override - public VirtualMachineDiskUpdateDiskResponse updateDisk(String diskName, VirtualMachineDiskUpdateDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException + public VirtualMachineDiskUpdateDiskResponse updateDisk(String diskName, VirtualMachineDiskUpdateDiskParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException { // Validate if (diskName == null) @@ -1873,10 +2037,10 @@ public VirtualMachineDiskUpdateDiskResponse updateDisk(String diskName, VirtualM Element diskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Disk"); requestDoc.appendChild(diskElement); - if (parameters.getHasOperatingSystem() != null) + if (parameters.isHasOperatingSystem() != null) { Element hasOperatingSystemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HasOperatingSystem"); - hasOperatingSystemElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getHasOperatingSystem()).toLowerCase())); + hasOperatingSystemElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.isHasOperatingSystem()).toLowerCase())); diskElement.appendChild(hasOperatingSystemElement); } @@ -1915,122 +2079,132 @@ public VirtualMachineDiskUpdateDiskResponse updateDisk(String diskName, VirtualM // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - VirtualMachineDiskUpdateDiskResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineDiskUpdateDiskResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Disk"); - Element diskElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (diskElement2 != null) - { - NodeList elements2 = diskElement2.getElementsByTagName("OS"); - Element osElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (osElement2 != null) - { - String osInstance; - osInstance = osElement2.getTextContent(); - result.setOperatingSystem(osInstance); - } - - NodeList elements3 = diskElement2.getElementsByTagName("Label"); - Element labelElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (labelElement2 != null) - { - String labelInstance; - labelInstance = labelElement2.getTextContent(); - result.setLabel(labelInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements4 = diskElement2.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (affinityGroupElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - result.setAffinityGroup(affinityGroupInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements5 = diskElement2.getElementsByTagName("Location"); - Element locationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (locationElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String locationInstance; - locationInstance = locationElement.getTextContent(); - result.setLocation(locationInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements6 = diskElement2.getElementsByTagName("LogicalDiskSizeInGB"); - Element logicalDiskSizeInGBElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (logicalDiskSizeInGBElement != null) - { - double logicalDiskSizeInGBInstance; - logicalDiskSizeInGBInstance = Double.parseDouble(logicalDiskSizeInGBElement.getTextContent()); - result.setLogicalSizeInGB(logicalDiskSizeInGBInstance); - } + // Create Result + VirtualMachineDiskUpdateDiskResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineDiskUpdateDiskResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements7 = diskElement2.getElementsByTagName("MediaLink"); - Element mediaLinkElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (mediaLinkElement2 != null) + NodeList elements = responseDoc.getElementsByTagName("Disk"); + Element diskElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (diskElement2 != null) { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement2.getTextContent()); - result.setMediaLinkUri(mediaLinkInstance); + NodeList elements2 = diskElement2.getElementsByTagName("OS"); + Element osElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (osElement2 != null) + { + String osInstance; + osInstance = osElement2.getTextContent(); + result.setOperatingSystem(osInstance); + } + + NodeList elements3 = diskElement2.getElementsByTagName("Label"); + Element labelElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (labelElement2 != null) + { + String labelInstance; + labelInstance = labelElement2.getTextContent(); + result.setLabel(labelInstance); + } + + NodeList elements4 = diskElement2.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + result.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements5 = diskElement2.getElementsByTagName("Location"); + Element locationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + result.setLocation(locationInstance); + } + + NodeList elements6 = diskElement2.getElementsByTagName("LogicalDiskSizeInGB"); + Element logicalDiskSizeInGBElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (logicalDiskSizeInGBElement != null) + { + double logicalDiskSizeInGBInstance; + logicalDiskSizeInGBInstance = Double.parseDouble(logicalDiskSizeInGBElement.getTextContent()); + result.setLogicalSizeInGB(logicalDiskSizeInGBInstance); + } + + NodeList elements7 = diskElement2.getElementsByTagName("MediaLink"); + Element mediaLinkElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (mediaLinkElement2 != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement2.getTextContent()); + result.setMediaLinkUri(mediaLinkInstance); + } + + NodeList elements8 = diskElement2.getElementsByTagName("Name"); + Element nameElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements9 = diskElement2.getElementsByTagName("IsPremium"); + Element isPremiumElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) + { + boolean isPremiumInstance; + isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); + result.setIsPremium(isPremiumInstance); + } } - NodeList elements8 = diskElement2.getElementsByTagName("Name"); - Element nameElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (nameElement2 != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements9 = diskElement2.getElementsByTagName("IsPremium"); - Element isPremiumElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) + if (shouldTrace) { - boolean isPremiumInstance; - isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); - result.setIsPremium(isPremiumInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineImageOperations.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineImageOperations.java index e8ca450e54a53..10ca99c2a1245 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineImageOperations.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineImageOperations.java @@ -32,13 +32,11 @@ import com.microsoft.windowsazure.management.compute.models.VirtualMachineImageUpdateParameters; import com.microsoft.windowsazure.management.compute.models.VirtualMachineImageUpdateResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -58,10 +56,33 @@ public interface VirtualMachineImageOperations * * @param parameters Parameters supplied to the Create Virtual Machine Image * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Parameters returned from the Create Virtual Machine Image * operation. */ - VirtualMachineImageCreateResponse create(VirtualMachineImageCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, ServiceException, URISyntaxException, ParseException; + VirtualMachineImageCreateResponse create(VirtualMachineImageCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerException, ServiceException, URISyntaxException, ParseException; /** * The Add OS Image operation adds an operating system image that is stored @@ -85,6 +106,20 @@ public interface VirtualMachineImageOperations * @param imageName The name of the image to delete. * @param deleteFromStorage Optional. Specifies that the source blob for the * image should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return A standard service response including an HTTP status code and * request ID. */ @@ -111,6 +146,18 @@ public interface VirtualMachineImageOperations * more information) * * @param imageName The name of the OS image to retrieve. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A virtual machine image associated with your subscription. */ VirtualMachineImageGetResponse get(String imageName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -132,6 +179,18 @@ public interface VirtualMachineImageOperations * http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List OS Images operation response. */ VirtualMachineImageListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -155,10 +214,34 @@ public interface VirtualMachineImageOperations * @param imageName The name of the virtual machine image to be updated. * @param parameters Parameters supplied to the Update Virtual Machine Image * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return Parameters returned from the Create Virtual Machine Image * operation. */ - VirtualMachineImageUpdateResponse update(String imageName, VirtualMachineImageUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException; + VirtualMachineImageUpdateResponse update(String imageName, VirtualMachineImageUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException; /** * The Update OS Image operation updates an OS image that in your image diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineImageOperationsImpl.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineImageOperationsImpl.java index a9376e8123c24..2e44b0540e06f 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineImageOperationsImpl.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineImageOperationsImpl.java @@ -33,15 +33,12 @@ import com.microsoft.windowsazure.management.compute.models.VirtualMachineImageListResponse; import com.microsoft.windowsazure.management.compute.models.VirtualMachineImageUpdateParameters; import com.microsoft.windowsazure.management.compute.models.VirtualMachineImageUpdateResponse; -import com.microsoft.windowsazure.management.compute.models.VirtualMachineRoleSize; import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -54,7 +51,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -93,6 +89,7 @@ public class VirtualMachineImageOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (oSImageElement2 != null) - { - NodeList elements2 = oSImageElement2.getElementsByTagName("Location"); - Element locationElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (locationElement != null) - { - String locationInstance; - locationInstance = locationElement.getTextContent(); - result.setLocation(locationInstance); - } - - NodeList elements3 = oSImageElement2.getElementsByTagName("Category"); - Element categoryElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (categoryElement != null) - { - String categoryInstance; - categoryInstance = categoryElement.getTextContent(); - result.setCategory(categoryInstance); - } - - NodeList elements4 = oSImageElement2.getElementsByTagName("Label"); - Element labelElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (labelElement2 != null) - { - String labelInstance; - labelInstance = labelElement2.getTextContent(); - result.setLabel(labelInstance); - } - - NodeList elements5 = oSImageElement2.getElementsByTagName("LogicalSizeInGB"); - Element logicalSizeInGBElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (logicalSizeInGBElement != null) - { - double logicalSizeInGBInstance; - logicalSizeInGBInstance = Double.parseDouble(logicalSizeInGBElement.getTextContent()); - result.setLogicalSizeInGB(logicalSizeInGBInstance); - } - - NodeList elements6 = oSImageElement2.getElementsByTagName("MediaLink"); - Element mediaLinkElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (mediaLinkElement2 != null) - { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement2.getTextContent()); - result.setMediaLinkUri(mediaLinkInstance); - } - - NodeList elements7 = oSImageElement2.getElementsByTagName("Name"); - Element nameElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements8 = oSImageElement2.getElementsByTagName("OS"); - Element osElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (osElement2 != null) - { - String osInstance; - osInstance = osElement2.getTextContent(); - result.setOperatingSystemType(osInstance); - } - - NodeList elements9 = oSImageElement2.getElementsByTagName("Eula"); - Element eulaElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (eulaElement2 != null) - { - String eulaInstance; - eulaInstance = eulaElement2.getTextContent(); - result.setEula(eulaInstance); - } - - NodeList elements10 = oSImageElement2.getElementsByTagName("Description"); - Element descriptionElement2 = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (descriptionElement2 != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement2.getTextContent(); - result.setDescription(descriptionInstance); - } - - NodeList elements11 = oSImageElement2.getElementsByTagName("ImageFamily"); - Element imageFamilyElement2 = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (imageFamilyElement2 != null) - { - String imageFamilyInstance; - imageFamilyInstance = imageFamilyElement2.getTextContent(); - result.setImageFamily(imageFamilyInstance); - } - - NodeList elements12 = oSImageElement2.getElementsByTagName("PublishedDate"); - Element publishedDateElement2 = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (publishedDateElement2 != null && (publishedDateElement2.getTextContent() != null && publishedDateElement2.getTextContent().isEmpty() != true) == false) - { - Calendar publishedDateInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat2.parse(publishedDateElement2.getTextContent())); - publishedDateInstance = calendar; - result.setPublishedDate(publishedDateInstance); - } - - NodeList elements13 = oSImageElement2.getElementsByTagName("PublisherName"); - Element publisherNameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (publisherNameElement != null) - { - String publisherNameInstance; - publisherNameInstance = publisherNameElement.getTextContent(); - result.setPublisherName(publisherNameInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements14 = oSImageElement2.getElementsByTagName("IsPremium"); - Element isPremiumElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (isPremiumElement2 != null && (isPremiumElement2.getTextContent() != null && isPremiumElement2.getTextContent().isEmpty() != true) == false) - { - boolean isPremiumInstance; - isPremiumInstance = Boolean.parseBoolean(isPremiumElement2.getTextContent()); - result.setIsPremium(isPremiumInstance); - } - - NodeList elements15 = oSImageElement2.getElementsByTagName("ShowInGui"); - Element showInGuiElement2 = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (showInGuiElement2 != null && (showInGuiElement2.getTextContent() != null && showInGuiElement2.getTextContent().isEmpty() != true) == false) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - boolean showInGuiInstance; - showInGuiInstance = Boolean.parseBoolean(showInGuiElement2.getTextContent()); - result.setShowInGui(showInGuiInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements16 = oSImageElement2.getElementsByTagName("PrivacyUri"); - Element privacyUriElement2 = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (privacyUriElement2 != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - URI privacyUriInstance; - privacyUriInstance = new URI(privacyUriElement2.getTextContent()); - result.setPrivacyUri(privacyUriInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements17 = oSImageElement2.getElementsByTagName("IconUri"); - Element iconUriElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (iconUriElement2 != null) - { - URI iconUriInstance; - iconUriInstance = new URI(iconUriElement2.getTextContent()); - result.setIconUri(iconUriInstance); - } + // Create Result + VirtualMachineImageCreateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineImageCreateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements18 = oSImageElement2.getElementsByTagName("RecommendedVMSize"); - Element recommendedVMSizeElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (recommendedVMSizeElement2 != null) + NodeList elements = responseDoc.getElementsByTagName("OSImage"); + Element oSImageElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (oSImageElement2 != null) { - VirtualMachineRoleSize recommendedVMSizeInstance; - recommendedVMSizeInstance = VirtualMachineRoleSize.valueOf(recommendedVMSizeElement2.getTextContent()); - result.setRecommendedVMSize(recommendedVMSizeInstance); + NodeList elements2 = oSImageElement2.getElementsByTagName("Location"); + Element locationElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + result.setLocation(locationInstance); + } + + NodeList elements3 = oSImageElement2.getElementsByTagName("Category"); + Element categoryElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (categoryElement != null) + { + String categoryInstance; + categoryInstance = categoryElement.getTextContent(); + result.setCategory(categoryInstance); + } + + NodeList elements4 = oSImageElement2.getElementsByTagName("Label"); + Element labelElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (labelElement2 != null) + { + String labelInstance; + labelInstance = labelElement2.getTextContent(); + result.setLabel(labelInstance); + } + + NodeList elements5 = oSImageElement2.getElementsByTagName("LogicalSizeInGB"); + Element logicalSizeInGBElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (logicalSizeInGBElement != null) + { + double logicalSizeInGBInstance; + logicalSizeInGBInstance = Double.parseDouble(logicalSizeInGBElement.getTextContent()); + result.setLogicalSizeInGB(logicalSizeInGBInstance); + } + + NodeList elements6 = oSImageElement2.getElementsByTagName("MediaLink"); + Element mediaLinkElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (mediaLinkElement2 != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement2.getTextContent()); + result.setMediaLinkUri(mediaLinkInstance); + } + + NodeList elements7 = oSImageElement2.getElementsByTagName("Name"); + Element nameElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements8 = oSImageElement2.getElementsByTagName("OS"); + Element osElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (osElement2 != null) + { + String osInstance; + osInstance = osElement2.getTextContent(); + result.setOperatingSystemType(osInstance); + } + + NodeList elements9 = oSImageElement2.getElementsByTagName("Eula"); + Element eulaElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (eulaElement2 != null) + { + String eulaInstance; + eulaInstance = eulaElement2.getTextContent(); + result.setEula(eulaInstance); + } + + NodeList elements10 = oSImageElement2.getElementsByTagName("Description"); + Element descriptionElement2 = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (descriptionElement2 != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement2.getTextContent(); + result.setDescription(descriptionInstance); + } + + NodeList elements11 = oSImageElement2.getElementsByTagName("ImageFamily"); + Element imageFamilyElement2 = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (imageFamilyElement2 != null) + { + String imageFamilyInstance; + imageFamilyInstance = imageFamilyElement2.getTextContent(); + result.setImageFamily(imageFamilyInstance); + } + + NodeList elements12 = oSImageElement2.getElementsByTagName("PublishedDate"); + Element publishedDateElement2 = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (publishedDateElement2 != null && (publishedDateElement2.getTextContent() != null && publishedDateElement2.getTextContent().isEmpty() != true) == false) + { + Calendar publishedDateInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat2.parse(publishedDateElement2.getTextContent())); + publishedDateInstance = calendar; + result.setPublishedDate(publishedDateInstance); + } + + NodeList elements13 = oSImageElement2.getElementsByTagName("PublisherName"); + Element publisherNameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (publisherNameElement != null) + { + String publisherNameInstance; + publisherNameInstance = publisherNameElement.getTextContent(); + result.setPublisherName(publisherNameInstance); + } + + NodeList elements14 = oSImageElement2.getElementsByTagName("IsPremium"); + Element isPremiumElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (isPremiumElement2 != null && (isPremiumElement2.getTextContent() != null && isPremiumElement2.getTextContent().isEmpty() != true) == false) + { + boolean isPremiumInstance; + isPremiumInstance = Boolean.parseBoolean(isPremiumElement2.getTextContent()); + result.setIsPremium(isPremiumInstance); + } + + NodeList elements15 = oSImageElement2.getElementsByTagName("ShowInGui"); + Element showInGuiElement2 = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (showInGuiElement2 != null && (showInGuiElement2.getTextContent() != null && showInGuiElement2.getTextContent().isEmpty() != true) == false) + { + boolean showInGuiInstance; + showInGuiInstance = Boolean.parseBoolean(showInGuiElement2.getTextContent()); + result.setShowInGui(showInGuiInstance); + } + + NodeList elements16 = oSImageElement2.getElementsByTagName("PrivacyUri"); + Element privacyUriElement2 = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (privacyUriElement2 != null) + { + URI privacyUriInstance; + privacyUriInstance = new URI(privacyUriElement2.getTextContent()); + result.setPrivacyUri(privacyUriInstance); + } + + NodeList elements17 = oSImageElement2.getElementsByTagName("IconUri"); + Element iconUriElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (iconUriElement2 != null) + { + URI iconUriInstance; + iconUriInstance = new URI(iconUriElement2.getTextContent()); + result.setIconUri(iconUriInstance); + } + + NodeList elements18 = oSImageElement2.getElementsByTagName("RecommendedVMSize"); + Element recommendedVMSizeElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (recommendedVMSizeElement2 != null) + { + String recommendedVMSizeInstance; + recommendedVMSizeInstance = recommendedVMSizeElement2.getTextContent(); + result.setRecommendedVMSize(recommendedVMSizeInstance); + } + + NodeList elements19 = oSImageElement2.getElementsByTagName("SmallIconUri"); + Element smallIconUriElement2 = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (smallIconUriElement2 != null) + { + URI smallIconUriInstance; + smallIconUriInstance = new URI(smallIconUriElement2.getTextContent()); + result.setSmallIconUri(smallIconUriInstance); + } + + NodeList elements20 = oSImageElement2.getElementsByTagName("Language"); + Element languageElement2 = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (languageElement2 != null) + { + String languageInstance; + languageInstance = languageElement2.getTextContent(); + result.setLanguage(languageInstance); + } } - NodeList elements19 = oSImageElement2.getElementsByTagName("SmallIconUri"); - Element smallIconUriElement2 = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (smallIconUriElement2 != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - URI smallIconUriInstance; - smallIconUriInstance = new URI(smallIconUriElement2.getTextContent()); - result.setSmallIconUri(smallIconUriInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements20 = oSImageElement2.getElementsByTagName("Language"); - Element languageElement2 = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (languageElement2 != null) + if (shouldTrace) { - String languageInstance; - languageInstance = languageElement2.getTextContent(); - result.setLanguage(languageInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -544,6 +574,20 @@ public OperationResponse call() throws Exception * @param imageName The name of the image to delete. * @param deleteFromStorage Optional. Specifies that the source blob for the * image should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return A standard service response including an HTTP status code and * request ID. */ @@ -569,11 +613,7 @@ public OperationResponse delete(String imageName, boolean deleteFromStorage) thr } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/images/" + imageName + "?"; - if (deleteFromStorage == true) - { - url = url + "&comp=" + URLEncoder.encode("media", "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/images/" + imageName + "?comp=" + deleteFromStorage; // Create HTTP transport objects CustomHttpDelete httpRequest = new CustomHttpDelete(url); @@ -583,40 +623,50 @@ public OperationResponse delete(String imageName, boolean deleteFromStorage) thr // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -647,6 +697,18 @@ public VirtualMachineImageGetResponse call() throws Exception * more information) * * @param imageName The name of the OS image to retrieve. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A virtual machine image associated with your subscription. */ @Override @@ -680,430 +742,151 @@ public VirtualMachineImageGetResponse get(String imageName) throws IOException, // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - VirtualMachineImageGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineImageGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("OSImage"); - Element oSImageElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (oSImageElement != null) - { - NodeList elements2 = oSImageElement.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - result.setAffinityGroup(affinityGroupInstance); - } - - NodeList elements3 = oSImageElement.getElementsByTagName("Category"); - Element categoryElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (categoryElement != null) - { - String categoryInstance; - categoryInstance = categoryElement.getTextContent(); - result.setCategory(categoryInstance); - } - - NodeList elements4 = oSImageElement.getElementsByTagName("Label"); - Element labelElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent(); - result.setLabel(labelInstance); - } - - NodeList elements5 = oSImageElement.getElementsByTagName("Location"); - Element locationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (locationElement != null) - { - String locationInstance; - locationInstance = locationElement.getTextContent(); - result.setLocation(locationInstance); - } - - NodeList elements6 = oSImageElement.getElementsByTagName("LogicalSizeInGB"); - Element logicalSizeInGBElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (logicalSizeInGBElement != null) - { - double logicalSizeInGBInstance; - logicalSizeInGBInstance = Double.parseDouble(logicalSizeInGBElement.getTextContent()); - result.setLogicalSizeInGB(logicalSizeInGBInstance); - } - - NodeList elements7 = oSImageElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (mediaLinkElement != null) - { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - result.setMediaLinkUri(mediaLinkInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements8 = oSImageElement.getElementsByTagName("Name"); - Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements9 = oSImageElement.getElementsByTagName("OS"); - Element osElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (osElement != null) - { - String osInstance; - osInstance = osElement.getTextContent(); - result.setOperatingSystemType(osInstance); - } - - NodeList elements10 = oSImageElement.getElementsByTagName("Eula"); - Element eulaElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (eulaElement != null) - { - String eulaInstance; - eulaInstance = eulaElement.getTextContent(); - result.setEula(eulaInstance); - } - - NodeList elements11 = oSImageElement.getElementsByTagName("Description"); - Element descriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - result.setDescription(descriptionInstance); - } - - NodeList elements12 = oSImageElement.getElementsByTagName("ImageFamily"); - Element imageFamilyElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (imageFamilyElement != null) - { - String imageFamilyInstance; - imageFamilyInstance = imageFamilyElement.getTextContent(); - result.setImageFamily(imageFamilyInstance); - } - - NodeList elements13 = oSImageElement.getElementsByTagName("ShowInGui"); - Element showInGuiElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (showInGuiElement != null && (showInGuiElement.getTextContent() != null && showInGuiElement.getTextContent().isEmpty() != true) == false) - { - boolean showInGuiInstance; - showInGuiInstance = Boolean.parseBoolean(showInGuiElement.getTextContent()); - result.setShowInGui(showInGuiInstance); - } - - NodeList elements14 = oSImageElement.getElementsByTagName("PublishedDate"); - Element publishedDateElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (publishedDateElement != null) - { - Calendar publishedDateInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(publishedDateElement.getTextContent())); - publishedDateInstance = calendar; - result.setPublishedDate(publishedDateInstance); - } - - NodeList elements15 = oSImageElement.getElementsByTagName("IsPremium"); - Element isPremiumElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) - { - boolean isPremiumInstance; - isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); - result.setIsPremium(isPremiumInstance); - } - - NodeList elements16 = oSImageElement.getElementsByTagName("IconUri"); - Element iconUriElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (iconUriElement != null) - { - URI iconUriInstance; - iconUriInstance = new URI(iconUriElement.getTextContent()); - result.setIconUri(iconUriInstance); - } - - NodeList elements17 = oSImageElement.getElementsByTagName("PrivacyUri"); - Element privacyUriElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (privacyUriElement != null) - { - URI privacyUriInstance; - privacyUriInstance = new URI(privacyUriElement.getTextContent()); - result.setPrivacyUri(privacyUriInstance); - } - - NodeList elements18 = oSImageElement.getElementsByTagName("RecommendedVMSize"); - Element recommendedVMSizeElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (recommendedVMSizeElement != null) - { - VirtualMachineRoleSize recommendedVMSizeInstance; - recommendedVMSizeInstance = VirtualMachineRoleSize.valueOf(recommendedVMSizeElement.getTextContent()); - result.setRecommendedVMSize(recommendedVMSizeInstance); - } - - NodeList elements19 = oSImageElement.getElementsByTagName("PublisherName"); - Element publisherNameElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (publisherNameElement != null) - { - String publisherNameInstance; - publisherNameInstance = publisherNameElement.getTextContent(); - result.setPublisherName(publisherNameInstance); - } - - NodeList elements20 = oSImageElement.getElementsByTagName("SmallIconUri"); - Element smallIconUriElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (smallIconUriElement != null) - { - URI smallIconUriInstance; - smallIconUriInstance = new URI(smallIconUriElement.getTextContent()); - result.setSmallIconUri(smallIconUriInstance); - } - - NodeList elements21 = oSImageElement.getElementsByTagName("Language"); - Element languageElement = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (languageElement != null) - { - String languageInstance; - languageInstance = languageElement.getTextContent(); - result.setLanguage(languageInstance); - } - } - - 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); - } - return result; - } - - /** - * The List OS Images operation retrieves a list of the operating system - * images from the image repository. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx for - * more information) - * - * @return The List OS Images operation response. - */ - @Override - public Future listAsync() - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public VirtualMachineImageListResponse call() throws Exception - { - return list(); - } - }); - } - - /** - * The List OS Images operation retrieves a list of the operating system - * images from the image repository. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx for - * more information) - * - * @return The List OS Images operation response. - */ - @Override - public VirtualMachineImageListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException - { - // Validate - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/images"; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2013-11-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.receiveResponse(invocationId, httpResponse); } - throw ex; - } - - // Create Result - VirtualMachineImageListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineImageListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Images"); - Element imagesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (imagesSequenceElement != null) - { - for (int i1 = 0; i1 < imagesSequenceElement.getElementsByTagName("OSImage").getLength(); i1 = i1 + 1) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + VirtualMachineImageGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineImageGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("OSImage"); + Element oSImageElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (oSImageElement != null) { - org.w3c.dom.Element imagesElement = ((org.w3c.dom.Element) imagesSequenceElement.getElementsByTagName("OSImage").item(i1)); - VirtualMachineImageListResponse.VirtualMachineImage oSImageInstance = new VirtualMachineImageListResponse.VirtualMachineImage(); - result.getImages().add(oSImageInstance); - - NodeList elements2 = imagesElement.getElementsByTagName("AffinityGroup"); + NodeList elements2 = oSImageElement.getElementsByTagName("AffinityGroup"); Element affinityGroupElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; if (affinityGroupElement != null) { String affinityGroupInstance; affinityGroupInstance = affinityGroupElement.getTextContent(); - oSImageInstance.setAffinityGroup(affinityGroupInstance); + result.setAffinityGroup(affinityGroupInstance); } - NodeList elements3 = imagesElement.getElementsByTagName("Category"); + NodeList elements3 = oSImageElement.getElementsByTagName("Category"); Element categoryElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; if (categoryElement != null) { String categoryInstance; categoryInstance = categoryElement.getTextContent(); - oSImageInstance.setCategory(categoryInstance); + result.setCategory(categoryInstance); } - NodeList elements4 = imagesElement.getElementsByTagName("Label"); + NodeList elements4 = oSImageElement.getElementsByTagName("Label"); Element labelElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; if (labelElement != null) { String labelInstance; labelInstance = labelElement.getTextContent(); - oSImageInstance.setLabel(labelInstance); + result.setLabel(labelInstance); } - NodeList elements5 = imagesElement.getElementsByTagName("Location"); + NodeList elements5 = oSImageElement.getElementsByTagName("Location"); Element locationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; if (locationElement != null) { String locationInstance; locationInstance = locationElement.getTextContent(); - oSImageInstance.setLocation(locationInstance); + result.setLocation(locationInstance); } - NodeList elements6 = imagesElement.getElementsByTagName("LogicalSizeInGB"); + NodeList elements6 = oSImageElement.getElementsByTagName("LogicalSizeInGB"); Element logicalSizeInGBElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; if (logicalSizeInGBElement != null) { double logicalSizeInGBInstance; logicalSizeInGBInstance = Double.parseDouble(logicalSizeInGBElement.getTextContent()); - oSImageInstance.setLogicalSizeInGB(logicalSizeInGBInstance); + result.setLogicalSizeInGB(logicalSizeInGBInstance); } - NodeList elements7 = imagesElement.getElementsByTagName("MediaLink"); + NodeList elements7 = oSImageElement.getElementsByTagName("MediaLink"); Element mediaLinkElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; if (mediaLinkElement != null) { URI mediaLinkInstance; mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - oSImageInstance.setMediaLinkUri(mediaLinkInstance); + result.setMediaLinkUri(mediaLinkInstance); } - NodeList elements8 = imagesElement.getElementsByTagName("Name"); + NodeList elements8 = oSImageElement.getElementsByTagName("Name"); Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; if (nameElement != null) { String nameInstance; nameInstance = nameElement.getTextContent(); - oSImageInstance.setName(nameInstance); + result.setName(nameInstance); } - NodeList elements9 = imagesElement.getElementsByTagName("OS"); + NodeList elements9 = oSImageElement.getElementsByTagName("OS"); Element osElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; if (osElement != null) { String osInstance; osInstance = osElement.getTextContent(); - oSImageInstance.setOperatingSystemType(osInstance); + result.setOperatingSystemType(osInstance); } - NodeList elements10 = imagesElement.getElementsByTagName("Eula"); + NodeList elements10 = oSImageElement.getElementsByTagName("Eula"); Element eulaElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; if (eulaElement != null) { String eulaInstance; eulaInstance = eulaElement.getTextContent(); - oSImageInstance.setEula(eulaInstance); + result.setEula(eulaInstance); } - NodeList elements11 = imagesElement.getElementsByTagName("Description"); + NodeList elements11 = oSImageElement.getElementsByTagName("Description"); Element descriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; if (descriptionElement != null) { String descriptionInstance; descriptionInstance = descriptionElement.getTextContent(); - oSImageInstance.setDescription(descriptionInstance); + result.setDescription(descriptionInstance); } - NodeList elements12 = imagesElement.getElementsByTagName("ImageFamily"); + NodeList elements12 = oSImageElement.getElementsByTagName("ImageFamily"); Element imageFamilyElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; if (imageFamilyElement != null) { String imageFamilyInstance; imageFamilyInstance = imageFamilyElement.getTextContent(); - oSImageInstance.setImageFamily(imageFamilyInstance); + result.setImageFamily(imageFamilyInstance); } - NodeList elements13 = imagesElement.getElementsByTagName("PublishedDate"); - Element publishedDateElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + NodeList elements13 = oSImageElement.getElementsByTagName("ShowInGui"); + Element showInGuiElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (showInGuiElement != null && (showInGuiElement.getTextContent() != null && showInGuiElement.getTextContent().isEmpty() != true) == false) + { + boolean showInGuiInstance; + showInGuiInstance = Boolean.parseBoolean(showInGuiElement.getTextContent()); + result.setShowInGui(showInGuiInstance); + } + + NodeList elements14 = oSImageElement.getElementsByTagName("PublishedDate"); + Element publishedDateElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; if (publishedDateElement != null) { Calendar publishedDateInstance; @@ -1111,85 +894,396 @@ public VirtualMachineImageListResponse list() throws IOException, ServiceExcepti Calendar calendar = Calendar.getInstance(); calendar.setTime(simpleDateFormat.parse(publishedDateElement.getTextContent())); publishedDateInstance = calendar; - oSImageInstance.setPublishedDate(publishedDateInstance); + result.setPublishedDate(publishedDateInstance); } - NodeList elements14 = imagesElement.getElementsByTagName("IsPremium"); - Element isPremiumElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + NodeList elements15 = oSImageElement.getElementsByTagName("IsPremium"); + Element isPremiumElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) { boolean isPremiumInstance; isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); - oSImageInstance.setIsPremium(isPremiumInstance); + result.setIsPremium(isPremiumInstance); + } + + NodeList elements16 = oSImageElement.getElementsByTagName("IconUri"); + Element iconUriElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (iconUriElement != null) + { + URI iconUriInstance; + iconUriInstance = new URI(iconUriElement.getTextContent()); + result.setIconUri(iconUriInstance); } - NodeList elements15 = imagesElement.getElementsByTagName("PrivacyUri"); - Element privacyUriElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + NodeList elements17 = oSImageElement.getElementsByTagName("PrivacyUri"); + Element privacyUriElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; if (privacyUriElement != null) { URI privacyUriInstance; privacyUriInstance = new URI(privacyUriElement.getTextContent()); - oSImageInstance.setPrivacyUri(privacyUriInstance); + result.setPrivacyUri(privacyUriInstance); } - NodeList elements16 = imagesElement.getElementsByTagName("RecommendedVMSize"); - Element recommendedVMSizeElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + NodeList elements18 = oSImageElement.getElementsByTagName("RecommendedVMSize"); + Element recommendedVMSizeElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; if (recommendedVMSizeElement != null) { - VirtualMachineRoleSize recommendedVMSizeInstance; - recommendedVMSizeInstance = VirtualMachineRoleSize.valueOf(recommendedVMSizeElement.getTextContent()); - oSImageInstance.setRecommendedVMSize(recommendedVMSizeInstance); + String recommendedVMSizeInstance; + recommendedVMSizeInstance = recommendedVMSizeElement.getTextContent(); + result.setRecommendedVMSize(recommendedVMSizeInstance); } - NodeList elements17 = imagesElement.getElementsByTagName("PublisherName"); - Element publisherNameElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + NodeList elements19 = oSImageElement.getElementsByTagName("PublisherName"); + Element publisherNameElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; if (publisherNameElement != null) { String publisherNameInstance; publisherNameInstance = publisherNameElement.getTextContent(); - oSImageInstance.setPublisherName(publisherNameInstance); - } - - NodeList elements18 = imagesElement.getElementsByTagName("PricingDetailLink"); - Element pricingDetailLinkElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (pricingDetailLinkElement != null) - { - URI pricingDetailLinkInstance; - pricingDetailLinkInstance = new URI(pricingDetailLinkElement.getTextContent()); - oSImageInstance.setPricingDetailUri(pricingDetailLinkInstance); + result.setPublisherName(publisherNameInstance); } - NodeList elements19 = imagesElement.getElementsByTagName("SmallIconUri"); - Element smallIconUriElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + NodeList elements20 = oSImageElement.getElementsByTagName("SmallIconUri"); + Element smallIconUriElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; if (smallIconUriElement != null) { URI smallIconUriInstance; smallIconUriInstance = new URI(smallIconUriElement.getTextContent()); - oSImageInstance.setSmallIconUri(smallIconUriInstance); + result.setSmallIconUri(smallIconUriInstance); } - NodeList elements20 = imagesElement.getElementsByTagName("Language"); - Element languageElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + NodeList elements21 = oSImageElement.getElementsByTagName("Language"); + Element languageElement = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; if (languageElement != null) { String languageInstance; languageInstance = languageElement.getTextContent(); - oSImageInstance.setLanguage(languageInstance); + result.setLanguage(languageInstance); } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) + finally { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } + } + + /** + * The List OS Images operation retrieves a list of the operating system + * images from the image repository. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx for + * more information) + * + * @return The List OS Images operation response. + */ + @Override + public Future listAsync() + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public VirtualMachineImageListResponse call() throws Exception + { + return list(); + } + }); + } + + /** + * The List OS Images operation retrieves a list of the operating system + * images from the image repository. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx for + * more information) + * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return The List OS Images operation response. + */ + @Override + public VirtualMachineImageListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException + { + // Validate + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; if (shouldTrace) { - CloudTracing.exit(invocationId, result); + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/images"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + VirtualMachineImageListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineImageListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Images"); + Element imagesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (imagesSequenceElement != null) + { + for (int i1 = 0; i1 < imagesSequenceElement.getElementsByTagName("OSImage").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element imagesElement = ((org.w3c.dom.Element) imagesSequenceElement.getElementsByTagName("OSImage").item(i1)); + VirtualMachineImageListResponse.VirtualMachineImage oSImageInstance = new VirtualMachineImageListResponse.VirtualMachineImage(); + result.getImages().add(oSImageInstance); + + NodeList elements2 = imagesElement.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + oSImageInstance.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements3 = imagesElement.getElementsByTagName("Category"); + Element categoryElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (categoryElement != null) + { + String categoryInstance; + categoryInstance = categoryElement.getTextContent(); + oSImageInstance.setCategory(categoryInstance); + } + + NodeList elements4 = imagesElement.getElementsByTagName("Label"); + Element labelElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent(); + oSImageInstance.setLabel(labelInstance); + } + + NodeList elements5 = imagesElement.getElementsByTagName("Location"); + Element locationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + oSImageInstance.setLocation(locationInstance); + } + + NodeList elements6 = imagesElement.getElementsByTagName("LogicalSizeInGB"); + Element logicalSizeInGBElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (logicalSizeInGBElement != null) + { + double logicalSizeInGBInstance; + logicalSizeInGBInstance = Double.parseDouble(logicalSizeInGBElement.getTextContent()); + oSImageInstance.setLogicalSizeInGB(logicalSizeInGBInstance); + } + + NodeList elements7 = imagesElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (mediaLinkElement != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); + oSImageInstance.setMediaLinkUri(mediaLinkInstance); + } + + NodeList elements8 = imagesElement.getElementsByTagName("Name"); + Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + oSImageInstance.setName(nameInstance); + } + + NodeList elements9 = imagesElement.getElementsByTagName("OS"); + Element osElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (osElement != null) + { + String osInstance; + osInstance = osElement.getTextContent(); + oSImageInstance.setOperatingSystemType(osInstance); + } + + NodeList elements10 = imagesElement.getElementsByTagName("Eula"); + Element eulaElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (eulaElement != null) + { + String eulaInstance; + eulaInstance = eulaElement.getTextContent(); + oSImageInstance.setEula(eulaInstance); + } + + NodeList elements11 = imagesElement.getElementsByTagName("Description"); + Element descriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (descriptionElement != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + oSImageInstance.setDescription(descriptionInstance); + } + + NodeList elements12 = imagesElement.getElementsByTagName("ImageFamily"); + Element imageFamilyElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (imageFamilyElement != null) + { + String imageFamilyInstance; + imageFamilyInstance = imageFamilyElement.getTextContent(); + oSImageInstance.setImageFamily(imageFamilyInstance); + } + + NodeList elements13 = imagesElement.getElementsByTagName("PublishedDate"); + Element publishedDateElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (publishedDateElement != null) + { + Calendar publishedDateInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(publishedDateElement.getTextContent())); + publishedDateInstance = calendar; + oSImageInstance.setPublishedDate(publishedDateInstance); + } + + NodeList elements14 = imagesElement.getElementsByTagName("IsPremium"); + Element isPremiumElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (isPremiumElement != null && (isPremiumElement.getTextContent() != null && isPremiumElement.getTextContent().isEmpty() != true) == false) + { + boolean isPremiumInstance; + isPremiumInstance = Boolean.parseBoolean(isPremiumElement.getTextContent()); + oSImageInstance.setIsPremium(isPremiumInstance); + } + + NodeList elements15 = imagesElement.getElementsByTagName("PrivacyUri"); + Element privacyUriElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (privacyUriElement != null) + { + URI privacyUriInstance; + privacyUriInstance = new URI(privacyUriElement.getTextContent()); + oSImageInstance.setPrivacyUri(privacyUriInstance); + } + + NodeList elements16 = imagesElement.getElementsByTagName("RecommendedVMSize"); + Element recommendedVMSizeElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (recommendedVMSizeElement != null) + { + String recommendedVMSizeInstance; + recommendedVMSizeInstance = recommendedVMSizeElement.getTextContent(); + oSImageInstance.setRecommendedVMSize(recommendedVMSizeInstance); + } + + NodeList elements17 = imagesElement.getElementsByTagName("PublisherName"); + Element publisherNameElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (publisherNameElement != null) + { + String publisherNameInstance; + publisherNameInstance = publisherNameElement.getTextContent(); + oSImageInstance.setPublisherName(publisherNameInstance); + } + + NodeList elements18 = imagesElement.getElementsByTagName("PricingDetailLink"); + Element pricingDetailLinkElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (pricingDetailLinkElement != null) + { + URI pricingDetailLinkInstance; + pricingDetailLinkInstance = new URI(pricingDetailLinkElement.getTextContent()); + oSImageInstance.setPricingDetailUri(pricingDetailLinkInstance); + } + + NodeList elements19 = imagesElement.getElementsByTagName("SmallIconUri"); + Element smallIconUriElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (smallIconUriElement != null) + { + URI smallIconUriInstance; + smallIconUriInstance = new URI(smallIconUriElement.getTextContent()); + oSImageInstance.setSmallIconUri(smallIconUriInstance); + } + + NodeList elements20 = imagesElement.getElementsByTagName("Language"); + Element languageElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (languageElement != null) + { + String languageInstance; + languageInstance = languageElement.getTextContent(); + oSImageInstance.setLanguage(languageInstance); + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1225,11 +1319,35 @@ public VirtualMachineImageUpdateResponse call() throws Exception * @param imageName The name of the virtual machine image to be updated. * @param parameters Parameters supplied to the Update Virtual Machine Image * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return Parameters returned from the Create Virtual Machine Image * operation. */ @Override - public VirtualMachineImageUpdateResponse update(String imageName, VirtualMachineImageUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException + public VirtualMachineImageUpdateResponse update(String imageName, VirtualMachineImageUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException { // Validate if (imageName == null) @@ -1311,7 +1429,7 @@ public VirtualMachineImageUpdateResponse update(String imageName, VirtualMachine } Element isPremiumElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IsPremium"); - isPremiumElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getIsPremium()).toLowerCase())); + isPremiumElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.isPremium()).toLowerCase())); oSImageElement.appendChild(isPremiumElement); if (parameters.getPrivacyUri() != null) @@ -1331,7 +1449,7 @@ public VirtualMachineImageUpdateResponse update(String imageName, VirtualMachine if (parameters.getRecommendedVMSize() != null) { Element recommendedVMSizeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RecommendedVMSize"); - recommendedVMSizeElement.appendChild(requestDoc.createTextNode(parameters.getRecommendedVMSize().toString())); + recommendedVMSizeElement.appendChild(requestDoc.createTextNode(parameters.getRecommendedVMSize())); oSImageElement.appendChild(recommendedVMSizeElement); } @@ -1362,224 +1480,234 @@ public VirtualMachineImageUpdateResponse update(String imageName, VirtualMachine // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - VirtualMachineImageUpdateResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineImageUpdateResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("OSImage"); - Element oSImageElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (oSImageElement2 != null) - { - NodeList elements2 = oSImageElement2.getElementsByTagName("Location"); - Element locationElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (locationElement != null) - { - String locationInstance; - locationInstance = locationElement.getTextContent(); - result.setLocation(locationInstance); - } - - NodeList elements3 = oSImageElement2.getElementsByTagName("Category"); - Element categoryElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (categoryElement != null) - { - String categoryInstance; - categoryInstance = categoryElement.getTextContent(); - result.setCategory(categoryInstance); - } - - NodeList elements4 = oSImageElement2.getElementsByTagName("Label"); - Element labelElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (labelElement2 != null) - { - String labelInstance; - labelInstance = labelElement2.getTextContent(); - result.setLabel(labelInstance); - } - - NodeList elements5 = oSImageElement2.getElementsByTagName("LogicalSizeInGB"); - Element logicalSizeInGBElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (logicalSizeInGBElement != null) - { - double logicalSizeInGBInstance; - logicalSizeInGBInstance = Double.parseDouble(logicalSizeInGBElement.getTextContent()); - result.setLogicalSizeInGB(logicalSizeInGBInstance); - } - - NodeList elements6 = oSImageElement2.getElementsByTagName("MediaLink"); - Element mediaLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (mediaLinkElement != null) - { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - result.setMediaLinkUri(mediaLinkInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements7 = oSImageElement2.getElementsByTagName("Name"); - Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements8 = oSImageElement2.getElementsByTagName("OS"); - Element osElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (osElement != null) - { - String osInstance; - osInstance = osElement.getTextContent(); - result.setOperatingSystemType(osInstance); - } - - NodeList elements9 = oSImageElement2.getElementsByTagName("Eula"); - Element eulaElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (eulaElement2 != null) - { - String eulaInstance; - eulaInstance = eulaElement2.getTextContent(); - result.setEula(eulaInstance); - } - - NodeList elements10 = oSImageElement2.getElementsByTagName("Description"); - Element descriptionElement2 = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (descriptionElement2 != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement2.getTextContent(); - result.setDescription(descriptionInstance); - } - - NodeList elements11 = oSImageElement2.getElementsByTagName("ImageFamily"); - Element imageFamilyElement2 = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (imageFamilyElement2 != null) - { - String imageFamilyInstance; - imageFamilyInstance = imageFamilyElement2.getTextContent(); - result.setImageFamily(imageFamilyInstance); - } - - NodeList elements12 = oSImageElement2.getElementsByTagName("PublishedDate"); - Element publishedDateElement2 = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (publishedDateElement2 != null && (publishedDateElement2.getTextContent() != null && publishedDateElement2.getTextContent().isEmpty() != true) == false) - { - Calendar publishedDateInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat2.parse(publishedDateElement2.getTextContent())); - publishedDateInstance = calendar; - result.setPublishedDate(publishedDateInstance); - } - - NodeList elements13 = oSImageElement2.getElementsByTagName("PublisherName"); - Element publisherNameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (publisherNameElement != null) - { - String publisherNameInstance; - publisherNameInstance = publisherNameElement.getTextContent(); - result.setPublisherName(publisherNameInstance); - } - - NodeList elements14 = oSImageElement2.getElementsByTagName("IsPremium"); - Element isPremiumElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (isPremiumElement2 != null && (isPremiumElement2.getTextContent() != null && isPremiumElement2.getTextContent().isEmpty() != true) == false) - { - boolean isPremiumInstance; - isPremiumInstance = Boolean.parseBoolean(isPremiumElement2.getTextContent()); - result.setIsPremium(isPremiumInstance); - } - - NodeList elements15 = oSImageElement2.getElementsByTagName("ShowInGui"); - Element showInGuiElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (showInGuiElement != null && (showInGuiElement.getTextContent() != null && showInGuiElement.getTextContent().isEmpty() != true) == false) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - boolean showInGuiInstance; - showInGuiInstance = Boolean.parseBoolean(showInGuiElement.getTextContent()); - result.setShowInGui(showInGuiInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements16 = oSImageElement2.getElementsByTagName("PrivacyUri"); - Element privacyUriElement2 = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (privacyUriElement2 != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - URI privacyUriInstance; - privacyUriInstance = new URI(privacyUriElement2.getTextContent()); - result.setPrivacyUri(privacyUriInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements17 = oSImageElement2.getElementsByTagName("IconUri"); - Element iconUriElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (iconUriElement2 != null) - { - URI iconUriInstance; - iconUriInstance = new URI(iconUriElement2.getTextContent()); - result.setIconUri(iconUriInstance); - } + // Create Result + VirtualMachineImageUpdateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineImageUpdateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements18 = oSImageElement2.getElementsByTagName("RecommendedVMSize"); - Element recommendedVMSizeElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (recommendedVMSizeElement2 != null) + NodeList elements = responseDoc.getElementsByTagName("OSImage"); + Element oSImageElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (oSImageElement2 != null) { - VirtualMachineRoleSize recommendedVMSizeInstance; - recommendedVMSizeInstance = VirtualMachineRoleSize.valueOf(recommendedVMSizeElement2.getTextContent()); - result.setRecommendedVMSize(recommendedVMSizeInstance); + NodeList elements2 = oSImageElement2.getElementsByTagName("Location"); + Element locationElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + result.setLocation(locationInstance); + } + + NodeList elements3 = oSImageElement2.getElementsByTagName("Category"); + Element categoryElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (categoryElement != null) + { + String categoryInstance; + categoryInstance = categoryElement.getTextContent(); + result.setCategory(categoryInstance); + } + + NodeList elements4 = oSImageElement2.getElementsByTagName("Label"); + Element labelElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (labelElement2 != null) + { + String labelInstance; + labelInstance = labelElement2.getTextContent(); + result.setLabel(labelInstance); + } + + NodeList elements5 = oSImageElement2.getElementsByTagName("LogicalSizeInGB"); + Element logicalSizeInGBElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (logicalSizeInGBElement != null) + { + double logicalSizeInGBInstance; + logicalSizeInGBInstance = Double.parseDouble(logicalSizeInGBElement.getTextContent()); + result.setLogicalSizeInGB(logicalSizeInGBInstance); + } + + NodeList elements6 = oSImageElement2.getElementsByTagName("MediaLink"); + Element mediaLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (mediaLinkElement != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); + result.setMediaLinkUri(mediaLinkInstance); + } + + NodeList elements7 = oSImageElement2.getElementsByTagName("Name"); + Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements8 = oSImageElement2.getElementsByTagName("OS"); + Element osElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (osElement != null) + { + String osInstance; + osInstance = osElement.getTextContent(); + result.setOperatingSystemType(osInstance); + } + + NodeList elements9 = oSImageElement2.getElementsByTagName("Eula"); + Element eulaElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (eulaElement2 != null) + { + String eulaInstance; + eulaInstance = eulaElement2.getTextContent(); + result.setEula(eulaInstance); + } + + NodeList elements10 = oSImageElement2.getElementsByTagName("Description"); + Element descriptionElement2 = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (descriptionElement2 != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement2.getTextContent(); + result.setDescription(descriptionInstance); + } + + NodeList elements11 = oSImageElement2.getElementsByTagName("ImageFamily"); + Element imageFamilyElement2 = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (imageFamilyElement2 != null) + { + String imageFamilyInstance; + imageFamilyInstance = imageFamilyElement2.getTextContent(); + result.setImageFamily(imageFamilyInstance); + } + + NodeList elements12 = oSImageElement2.getElementsByTagName("PublishedDate"); + Element publishedDateElement2 = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (publishedDateElement2 != null && (publishedDateElement2.getTextContent() != null && publishedDateElement2.getTextContent().isEmpty() != true) == false) + { + Calendar publishedDateInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat2.parse(publishedDateElement2.getTextContent())); + publishedDateInstance = calendar; + result.setPublishedDate(publishedDateInstance); + } + + NodeList elements13 = oSImageElement2.getElementsByTagName("PublisherName"); + Element publisherNameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (publisherNameElement != null) + { + String publisherNameInstance; + publisherNameInstance = publisherNameElement.getTextContent(); + result.setPublisherName(publisherNameInstance); + } + + NodeList elements14 = oSImageElement2.getElementsByTagName("IsPremium"); + Element isPremiumElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (isPremiumElement2 != null && (isPremiumElement2.getTextContent() != null && isPremiumElement2.getTextContent().isEmpty() != true) == false) + { + boolean isPremiumInstance; + isPremiumInstance = Boolean.parseBoolean(isPremiumElement2.getTextContent()); + result.setIsPremium(isPremiumInstance); + } + + NodeList elements15 = oSImageElement2.getElementsByTagName("ShowInGui"); + Element showInGuiElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (showInGuiElement != null && (showInGuiElement.getTextContent() != null && showInGuiElement.getTextContent().isEmpty() != true) == false) + { + boolean showInGuiInstance; + showInGuiInstance = Boolean.parseBoolean(showInGuiElement.getTextContent()); + result.setShowInGui(showInGuiInstance); + } + + NodeList elements16 = oSImageElement2.getElementsByTagName("PrivacyUri"); + Element privacyUriElement2 = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (privacyUriElement2 != null) + { + URI privacyUriInstance; + privacyUriInstance = new URI(privacyUriElement2.getTextContent()); + result.setPrivacyUri(privacyUriInstance); + } + + NodeList elements17 = oSImageElement2.getElementsByTagName("IconUri"); + Element iconUriElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (iconUriElement2 != null) + { + URI iconUriInstance; + iconUriInstance = new URI(iconUriElement2.getTextContent()); + result.setIconUri(iconUriInstance); + } + + NodeList elements18 = oSImageElement2.getElementsByTagName("RecommendedVMSize"); + Element recommendedVMSizeElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (recommendedVMSizeElement2 != null) + { + String recommendedVMSizeInstance; + recommendedVMSizeInstance = recommendedVMSizeElement2.getTextContent(); + result.setRecommendedVMSize(recommendedVMSizeInstance); + } + + NodeList elements19 = oSImageElement2.getElementsByTagName("SmallIconUri"); + Element smallIconUriElement2 = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (smallIconUriElement2 != null) + { + URI smallIconUriInstance; + smallIconUriInstance = new URI(smallIconUriElement2.getTextContent()); + result.setSmallIconUri(smallIconUriInstance); + } + + NodeList elements20 = oSImageElement2.getElementsByTagName("Language"); + Element languageElement2 = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (languageElement2 != null) + { + String languageInstance; + languageInstance = languageElement2.getTextContent(); + result.setLanguage(languageInstance); + } } - NodeList elements19 = oSImageElement2.getElementsByTagName("SmallIconUri"); - Element smallIconUriElement2 = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (smallIconUriElement2 != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - URI smallIconUriInstance; - smallIconUriInstance = new URI(smallIconUriElement2.getTextContent()); - result.setSmallIconUri(smallIconUriInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements20 = oSImageElement2.getElementsByTagName("Language"); - Element languageElement2 = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (languageElement2 != null) + if (shouldTrace) { - String languageInstance; - languageInstance = languageElement2.getTextContent(); - result.setLanguage(languageInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineOperations.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineOperations.java index a4e9b09d1a781..1d229d386731a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineOperations.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineOperations.java @@ -37,13 +37,11 @@ import com.microsoft.windowsazure.management.compute.models.VirtualMachineUpdateLoadBalancedSetParameters; import com.microsoft.windowsazure.management.compute.models.VirtualMachineUpdateParameters; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -55,6 +53,62 @@ */ public interface VirtualMachineOperations { + /** + * The Capture Role operation creates a copy of the operating system virtual + * hard disk (VHD) that is deployed in the virtual machine, saves the VHD + * copy in the same storage location as the operating system VHD, and + * registers the copy as an image in your image gallery. From the captured + * image, you can create additional customized virtual machines. For more + * information about images and disks, see Manage Disks and Images. For + * more information about capturing images, see How to Capture an Image of + * a Virtual Machine Running Windows Server 2008 R2 or How to Capture an + * Image of a Virtual Machine Running Linux. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157201.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to restart. + * @param parameters Parameters supplied to the Capture Virtual Machine + * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + OperationResponse beginCapturing(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineCaptureParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; + + /** + * The Capture Role operation creates a copy of the operating system virtual + * hard disk (VHD) that is deployed in the virtual machine, saves the VHD + * copy in the same storage location as the operating system VHD, and + * registers the copy as an image in your image gallery. From the captured + * image, you can create additional customized virtual machines. For more + * information about images and disks, see Manage Disks and Images. For + * more information about capturing images, see How to Capture an Image of + * a Virtual Machine Running Windows Server 2008 R2 or How to Capture an + * Image of a Virtual Machine Running Linux. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157201.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to restart. + * @param parameters Parameters supplied to the Capture Virtual Machine + * operation. + * @return A standard service response including an HTTP status code and + * request ID. + */ + Future beginCapturingAsync(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineCaptureParameters parameters); + /** * The Add Role operation adds a virtual machine to an existing deployment. * You can refer to the OSDisk in the Add Role operation in the following @@ -74,10 +128,20 @@ public interface VirtualMachineOperations * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Create Virtual Machine * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginCreating(String serviceName, String deploymentName, VirtualMachineCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginCreating(String serviceName, String deploymentName, VirtualMachineCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Add Role operation adds a virtual machine to an existing deployment. @@ -117,10 +181,20 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param parameters Parameters supplied to the Create Virtual Machine * Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginCreatingDeployment(String serviceName, VirtualMachineCreateDeploymentParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginCreatingDeployment(String serviceName, VirtualMachineCreateDeploymentParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Create Virtual Machine Deployment operation provisions a virtual @@ -151,6 +225,10 @@ public interface VirtualMachineOperations * @param virtualMachineName The name of the virtual machine to delete. * @param deleteFromStorage Optional. Specifies that the source blob(s) for * the virtual machine should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -179,10 +257,14 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine to restart. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginRestarting(String serviceName, String deploymentName, String virtualMachineName) throws UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginRestarting(String serviceName, String deploymentName, String virtualMachineName) throws IOException, ServiceException; /** * The Restart role operation restarts the specified virtual machine. (see @@ -206,10 +288,20 @@ public interface VirtualMachineOperations * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine to shutdown. * @param parameters The parameters for the shutdown vm operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginShutdown(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineShutdownParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginShutdown(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineShutdownParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Shutdown Role operation shuts down the specified virtual machine. @@ -232,10 +324,20 @@ public interface VirtualMachineOperations * @param deploymentName The name of your deployment. * @param parameters The set of virtual machine roles to shutdown and their * post shutdown state. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginShuttingDownRoles(String serviceName, String deploymentName, VirtualMachineShutdownRolesParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginShuttingDownRoles(String serviceName, String deploymentName, VirtualMachineShutdownRolesParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Shutdown Roles operation stops the specified set of virtual machines. @@ -257,10 +359,14 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine to start. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginStarting(String serviceName, String deploymentName, String virtualMachineName) throws UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginStarting(String serviceName, String deploymentName, String virtualMachineName) throws IOException, ServiceException; /** * The Start Role operation starts the specified virtual machine. (see @@ -281,10 +387,20 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param parameters The set of virtual machine roles to start. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginStartingRoles(String serviceName, String deploymentName, VirtualMachineStartRolesParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginStartingRoles(String serviceName, String deploymentName, VirtualMachineStartRolesParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Start Roles operation starts the specified set of virtual machines. @@ -308,10 +424,20 @@ public interface VirtualMachineOperations * @param virtualMachineName The name of your virtual machine. * @param parameters Parameters supplied to the Update Virtual Machine * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginUpdating(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginUpdating(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Update Role operation adds a virtual machine to an existing @@ -339,10 +465,20 @@ public interface VirtualMachineOperations * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Update Load Balanced * Endpoint Set operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse beginUpdatingLoadBalancedEndpointSet(String serviceName, String deploymentName, VirtualMachineUpdateLoadBalancedSetParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginUpdatingLoadBalancedEndpointSet(String serviceName, String deploymentName, VirtualMachineUpdateLoadBalancedSetParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The UpdateLoadBalancedEndpointSet operation changes the specified @@ -377,10 +513,29 @@ public interface VirtualMachineOperations * @param virtualMachineName The name of the virtual machine to restart. * @param parameters Parameters supplied to the Capture Virtual Machine * operation. - * @return A standard service response including an HTTP status code and - * request ID. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. */ - OperationResponse capture(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineCaptureParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + ComputeOperationStatusResponse capture(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineCaptureParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException; /** * The Capture Role operation creates a copy of the operating system virtual @@ -400,10 +555,17 @@ public interface VirtualMachineOperations * @param virtualMachineName The name of the virtual machine to restart. * @param parameters Parameters supplied to the Capture Virtual Machine * operation. - * @return A standard service response including an HTTP status code and - * request ID. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. */ - Future captureAsync(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineCaptureParameters parameters); + Future captureAsync(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineCaptureParameters parameters); /** * The Add Role operation adds a virtual machine to an existing deployment. @@ -424,6 +586,29 @@ public interface VirtualMachineOperations * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Create Virtual Machine * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -434,7 +619,7 @@ public interface VirtualMachineOperations * the failed request, and also includes error information regarding the * failure. */ - ComputeOperationStatusResponse create(String serviceName, String deploymentName, VirtualMachineCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, ServiceException, URISyntaxException, ParseException; + ComputeOperationStatusResponse create(String serviceName, String deploymentName, VirtualMachineCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerException, ServiceException, URISyntaxException, ParseException; /** * The Add Role operation adds a virtual machine to an existing deployment. @@ -481,6 +666,18 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param parameters Parameters supplied to the Create Virtual Machine * Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -529,6 +726,20 @@ public interface VirtualMachineOperations * @param virtualMachineName The name of the virtual machine to delete. * @param deleteFromStorage Optional. Specifies that the source blob(s) for * the virtual machine should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -572,6 +783,18 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Virtual Machine operation response. */ VirtualMachineGetResponse get(String serviceName, String deploymentName, String virtualMachineName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -598,6 +821,10 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The Download RDP file operation response. */ VirtualMachineGetRemoteDesktopFileResponse getRemoteDesktopFile(String serviceName, String deploymentName, String virtualMachineName) throws IOException, ServiceException; @@ -623,6 +850,18 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine to restart. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -664,6 +903,18 @@ public interface VirtualMachineOperations * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine to shutdown. * @param parameters The parameters for the shutdown vm operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -704,6 +955,18 @@ public interface VirtualMachineOperations * @param deploymentName The name of your deployment. * @param parameters The set of virtual machine roles to shutdown and their * post shutdown state. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -743,6 +1006,18 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine to start. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -781,6 +1056,18 @@ public interface VirtualMachineOperations * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param parameters The set of virtual machine roles to start. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -822,6 +1109,30 @@ public interface VirtualMachineOperations * @param virtualMachineName The name of your virtual machine. * @param parameters Parameters supplied to the Update Virtual Machine * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -832,7 +1143,7 @@ public interface VirtualMachineOperations * the failed request, and also includes error information regarding the * failure. */ - ComputeOperationStatusResponse update(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException; + ComputeOperationStatusResponse update(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException; /** * The Update Role operation adds a virtual machine to an existing @@ -867,6 +1178,18 @@ public interface VirtualMachineOperations * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Update Load Balanced * Endpoint Set operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineOperationsImpl.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineOperationsImpl.java index 294758dd9baa7..a34292e0e5367 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineOperationsImpl.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/VirtualMachineOperationsImpl.java @@ -53,7 +53,6 @@ import com.microsoft.windowsazure.management.compute.models.VirtualMachineCreateParameters; import com.microsoft.windowsazure.management.compute.models.VirtualMachineGetRemoteDesktopFileResponse; import com.microsoft.windowsazure.management.compute.models.VirtualMachineGetResponse; -import com.microsoft.windowsazure.management.compute.models.VirtualMachineRoleSize; import com.microsoft.windowsazure.management.compute.models.VirtualMachineRoleType; import com.microsoft.windowsazure.management.compute.models.VirtualMachineShutdownParameters; import com.microsoft.windowsazure.management.compute.models.VirtualMachineShutdownRolesParameters; @@ -68,11 +67,9 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; -import java.net.URLEncoder; import java.text.ParseException; import java.util.HashMap; import java.util.concurrent.Callable; @@ -82,7 +79,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -122,6 +118,7 @@ public class VirtualMachineOperationsImpl implements ServiceOperations beginCreatingAsync(final String serviceName, final String deploymentName, final VirtualMachineCreateParameters parameters) + public Future beginCapturingAsync(final String serviceName, final String deploymentName, final String virtualMachineName, final VirtualMachineCaptureParameters parameters) { return this.getClient().getExecutorService().submit(new Callable() { @Override public OperationResponse call() throws Exception { - return beginCreating(serviceName, deploymentName, parameters); + return beginCapturing(serviceName, deploymentName, virtualMachineName, parameters); } }); } /** - * The Add Role operation adds a virtual machine to an existing deployment. - * You can refer to the OSDisk in the Add Role operation in the following - * ways. Platform/User Image – Set the SourceImageName to a platform or - * user image. You can optionally specify the DiskName and MediaLink values - * as part the operation to control the name and location of target disk. - * When DiskName and MediaLink are specified in this mode, they must not - * already exist in the system, otherwise a conflict fault is returned. - * UserDisk – Set DiskName to a user supplied image in image repository. - * SourceImageName must be set to NULL. All other properties are ignored. - * Blob in a Storage Account – Set MediaLink to a blob containing the - * image. SourceImageName and DiskName are set to NULL. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157186.aspx for + * The Capture Role operation creates a copy of the operating system virtual + * hard disk (VHD) that is deployed in the virtual machine, saves the VHD + * copy in the same storage location as the operating system VHD, and + * registers the copy as an image in your image gallery. From the captured + * image, you can create additional customized virtual machines. For more + * information about images and disks, see Manage Disks and Images. For + * more information about capturing images, see How to Capture an Image of + * a Virtual Machine Running Windows Server 2008 R2 or How to Capture an + * Image of a Virtual Machine Running Linux. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157201.aspx for * more information) * * @param serviceName The name of your service. * @param deploymentName The name of your deployment. - * @param parameters Parameters supplied to the Create Virtual Machine + * @param virtualMachineName The name of the virtual machine to restart. + * @param parameters Parameters supplied to the Capture Virtual Machine * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginCreating(String serviceName, String deploymentName, VirtualMachineCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginCapturing(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineCaptureParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -196,102 +201,107 @@ public OperationResponse beginCreating(String serviceName, String deploymentName { throw new NullPointerException("deploymentName"); } + if (virtualMachineName == null) + { + throw new NullPointerException("virtualMachineName"); + } if (parameters == null) { throw new NullPointerException("parameters"); } - if (parameters.getConfigurationSets() != null) + if (parameters.getProvisioningConfiguration() != null) { - for (ConfigurationSet configurationSetsParameterItem : parameters.getConfigurationSets()) + if (parameters.getProvisioningConfiguration().getDomainJoin() != null) { - if (configurationSetsParameterItem.getDomainJoin() != null) + if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials() != null) { - if (configurationSetsParameterItem.getDomainJoin().getCredentials() != null) + if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getPassword() == null) { - if (configurationSetsParameterItem.getDomainJoin().getCredentials().getPassword() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.DomainJoin.Credentials.Password"); - } - if (configurationSetsParameterItem.getDomainJoin().getCredentials().getUserName() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.DomainJoin.Credentials.UserName"); - } + throw new NullPointerException("parameters.ProvisioningConfiguration.DomainJoin.Credentials.Password"); + } + if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getUserName() == null) + { + throw new NullPointerException("parameters.ProvisioningConfiguration.DomainJoin.Credentials.UserName"); } } - if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() < 1) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.HostName"); - } - if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() > 64) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.HostName"); - } - if (configurationSetsParameterItem.getSshSettings() != null) + } + if (parameters.getProvisioningConfiguration().getHostName() != null && parameters.getProvisioningConfiguration().getHostName().length() < 1) + { + throw new IllegalArgumentException("parameters.ProvisioningConfiguration.HostName"); + } + if (parameters.getProvisioningConfiguration().getHostName() != null && parameters.getProvisioningConfiguration().getHostName().length() > 64) + { + throw new IllegalArgumentException("parameters.ProvisioningConfiguration.HostName"); + } + if (parameters.getProvisioningConfiguration().getSshSettings() != null) + { + if (parameters.getProvisioningConfiguration().getSshSettings().getKeyPairs() != null) { - if (configurationSetsParameterItem.getSshSettings().getKeyPairs() != null) + for (SshSettingKeyPair keyPairsParameterItem : parameters.getProvisioningConfiguration().getSshSettings().getKeyPairs()) { - for (SshSettingKeyPair keyPairsParameterItem : configurationSetsParameterItem.getSshSettings().getKeyPairs()) + if (keyPairsParameterItem.getFingerprint() == null) { - if (keyPairsParameterItem.getFingerprint() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.SshSettings.KeyPairs.Fingerprint"); - } - if (keyPairsParameterItem.getPath() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.SshSettings.KeyPairs.Path"); - } + throw new NullPointerException("parameters.ProvisioningConfiguration.SshSettings.KeyPairs.Fingerprint"); } - } - if (configurationSetsParameterItem.getSshSettings().getPublicKeys() != null) - { - for (SshSettingPublicKey publicKeysParameterItem : configurationSetsParameterItem.getSshSettings().getPublicKeys()) + if (keyPairsParameterItem.getPath() == null) { - if (publicKeysParameterItem.getFingerprint() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.SshSettings.PublicKeys.Fingerprint"); - } - if (publicKeysParameterItem.getPath() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.SshSettings.PublicKeys.Path"); - } + throw new NullPointerException("parameters.ProvisioningConfiguration.SshSettings.KeyPairs.Path"); } } } - if (configurationSetsParameterItem.getStoredCertificateSettings() != null) + if (parameters.getProvisioningConfiguration().getSshSettings().getPublicKeys() != null) { - for (StoredCertificateSettings storedCertificateSettingsParameterItem : configurationSetsParameterItem.getStoredCertificateSettings()) + for (SshSettingPublicKey publicKeysParameterItem : parameters.getProvisioningConfiguration().getSshSettings().getPublicKeys()) { - if (storedCertificateSettingsParameterItem.getStoreName() == null) + if (publicKeysParameterItem.getFingerprint() == null) { - throw new NullPointerException("parameters.ConfigurationSets.StoredCertificateSettings.StoreName"); + throw new NullPointerException("parameters.ProvisioningConfiguration.SshSettings.PublicKeys.Fingerprint"); } - if (storedCertificateSettingsParameterItem.getThumbprint() == null) + if (publicKeysParameterItem.getPath() == null) { - throw new NullPointerException("parameters.ConfigurationSets.StoredCertificateSettings.Thumbprint"); + throw new NullPointerException("parameters.ProvisioningConfiguration.SshSettings.PublicKeys.Path"); } } } - if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() < 1) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.UserName"); - } - if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() > 32) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.UserName"); - } - if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() < 6 && (configurationSetsParameterItem.getDisableSshPasswordAuthentication() == false || configurationSetsParameterItem.getUserPassword().length() != 0)) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.UserPassword"); - } - if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() > 72) + } + if (parameters.getProvisioningConfiguration().getStoredCertificateSettings() != null) + { + for (StoredCertificateSettings storedCertificateSettingsParameterItem : parameters.getProvisioningConfiguration().getStoredCertificateSettings()) { - throw new IllegalArgumentException("parameters.ConfigurationSets.UserPassword"); + if (storedCertificateSettingsParameterItem.getStoreName() == null) + { + throw new NullPointerException("parameters.ProvisioningConfiguration.StoredCertificateSettings.StoreName"); + } + if (storedCertificateSettingsParameterItem.getThumbprint() == null) + { + throw new NullPointerException("parameters.ProvisioningConfiguration.StoredCertificateSettings.Thumbprint"); + } } } + if (parameters.getProvisioningConfiguration().getUserName() != null && parameters.getProvisioningConfiguration().getUserName().length() < 1) + { + throw new IllegalArgumentException("parameters.ProvisioningConfiguration.UserName"); + } + if (parameters.getProvisioningConfiguration().getUserName() != null && parameters.getProvisioningConfiguration().getUserName().length() > 32) + { + throw new IllegalArgumentException("parameters.ProvisioningConfiguration.UserName"); + } + if (parameters.getProvisioningConfiguration().getUserPassword() != null && parameters.getProvisioningConfiguration().getUserPassword().length() < 6 && (parameters.getProvisioningConfiguration().isDisableSshPasswordAuthentication() == false || parameters.getProvisioningConfiguration().getUserPassword().length() != 0)) + { + throw new IllegalArgumentException("parameters.ProvisioningConfiguration.UserPassword"); + } + if (parameters.getProvisioningConfiguration().getUserPassword() != null && parameters.getProvisioningConfiguration().getUserPassword().length() > 72) + { + throw new IllegalArgumentException("parameters.ProvisioningConfiguration.UserPassword"); + } } - if (parameters.getRoleName() == null) + if (parameters.getTargetImageLabel() == null) { - throw new NullPointerException("parameters.RoleName"); + throw new NullPointerException("parameters.TargetImageLabel"); + } + if (parameters.getTargetImageName() == null) + { + throw new NullPointerException("parameters.TargetImageName"); } // Tracing @@ -303,12 +313,13 @@ public OperationResponse beginCreating(String serviceName, String deploymentName HashMap tracingParameters = new HashMap(); tracingParameters.put("serviceName", serviceName); tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("virtualMachineName", virtualMachineName); tracingParameters.put("parameters", parameters); - CloudTracing.enter(invocationId, this, "beginCreatingAsync", tracingParameters); + CloudTracing.enter(invocationId, this, "beginCapturingAsync", tracingParameters); } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roles"; + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roleinstances/" + virtualMachineName + "/Operations"; // Create HTTP transport objects HttpPost httpRequest = new HttpPost(url); @@ -323,517 +334,415 @@ public OperationResponse beginCreating(String serviceName, String deploymentName DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document requestDoc = documentBuilder.newDocument(); - Element persistentVMRoleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PersistentVMRole"); - requestDoc.appendChild(persistentVMRoleElement); + Element captureRoleOperationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CaptureRoleOperation"); + requestDoc.appendChild(captureRoleOperationElement); - Element roleNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleName"); - roleNameElement.appendChild(requestDoc.createTextNode(parameters.getRoleName())); - persistentVMRoleElement.appendChild(roleNameElement); + Element operationTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OperationType"); + operationTypeElement.appendChild(requestDoc.createTextNode("CaptureRoleOperation")); + captureRoleOperationElement.appendChild(operationTypeElement); - Element roleTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleType"); - roleTypeElement.appendChild(requestDoc.createTextNode("PersistentVMRole")); - persistentVMRoleElement.appendChild(roleTypeElement); + Element postCaptureActionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PostCaptureAction"); + postCaptureActionElement.appendChild(requestDoc.createTextNode(parameters.getPostCaptureAction().toString())); + captureRoleOperationElement.appendChild(postCaptureActionElement); - if (parameters.getConfigurationSets() != null) + if (parameters.getProvisioningConfiguration() != null) { - Element configurationSetsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSets"); - for (ConfigurationSet configurationSetsItem : parameters.getConfigurationSets()) + Element provisioningConfigurationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ProvisioningConfiguration"); + captureRoleOperationElement.appendChild(provisioningConfigurationElement); + + if (parameters.getProvisioningConfiguration().getConfigurationSetType() != null) { - Element configurationSetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSet"); - configurationSetsSequenceElement.appendChild(configurationSetElement); - - if (configurationSetsItem.getConfigurationSetType() != null) - { - Element configurationSetTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSetType"); - configurationSetTypeElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getConfigurationSetType())); - configurationSetElement.appendChild(configurationSetTypeElement); - } - - if (configurationSetsItem.getInputEndpoints() != null) + Element configurationSetTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSetType"); + configurationSetTypeElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getConfigurationSetType())); + provisioningConfigurationElement.appendChild(configurationSetTypeElement); + } + + if (parameters.getProvisioningConfiguration().getInputEndpoints() != null) + { + Element inputEndpointsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoints"); + for (InputEndpoint inputEndpointsItem : parameters.getProvisioningConfiguration().getInputEndpoints()) { - Element inputEndpointsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoints"); - for (InputEndpoint inputEndpointsItem : configurationSetsItem.getInputEndpoints()) + Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); + inputEndpointsSequenceElement.appendChild(inputEndpointElement); + + if (inputEndpointsItem.getLoadBalancedEndpointSetName() != null) { - Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); - inputEndpointsSequenceElement.appendChild(inputEndpointElement); - - if (inputEndpointsItem.getLoadBalancedEndpointSetName() != null) - { - Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); - loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancedEndpointSetName())); - inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); - } - - if (inputEndpointsItem.getLocalPort() != null) - { - Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); - localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLocalPort()))); - inputEndpointElement.appendChild(localPortElement); - } - - if (inputEndpointsItem.getName() != null) - { - Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); - nameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getName())); - inputEndpointElement.appendChild(nameElement); - } - - if (inputEndpointsItem.getPort() != null) - { - Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getPort()))); - inputEndpointElement.appendChild(portElement); - } + Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); + loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancedEndpointSetName())); + inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); + } + + if (inputEndpointsItem.getLocalPort() != null) + { + Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); + localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLocalPort()))); + inputEndpointElement.appendChild(localPortElement); + } + + if (inputEndpointsItem.getName() != null) + { + Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); + nameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getName())); + inputEndpointElement.appendChild(nameElement); + } + + if (inputEndpointsItem.getPort() != null) + { + Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getPort()))); + inputEndpointElement.appendChild(portElement); + } + + if (inputEndpointsItem.getLoadBalancerProbe() != null) + { + Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); + inputEndpointElement.appendChild(loadBalancerProbeElement); - if (inputEndpointsItem.getLoadBalancerProbe() != null) + if (inputEndpointsItem.getLoadBalancerProbe().getPath() != null) { - Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); - inputEndpointElement.appendChild(loadBalancerProbeElement); - - if (inputEndpointsItem.getLoadBalancerProbe().getPath() != null) - { - Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancerProbe().getPath())); - loadBalancerProbeElement.appendChild(pathElement); - } - - Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement2.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getPort()))); - loadBalancerProbeElement.appendChild(portElement2); - - Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(inputEndpointsItem.getLoadBalancerProbe().getProtocol()))); - loadBalancerProbeElement.appendChild(protocolElement); - - if (inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) - { - Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); - intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); - loadBalancerProbeElement.appendChild(intervalInSecondsElement); - } - - if (inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) - { - Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); - timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); - loadBalancerProbeElement.appendChild(timeoutInSecondsElement); - } + Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancerProbe().getPath())); + loadBalancerProbeElement.appendChild(pathElement); } - if (inputEndpointsItem.getProtocol() != null) - { - Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getProtocol())); - inputEndpointElement.appendChild(protocolElement2); - } + Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement2.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getPort()))); + loadBalancerProbeElement.appendChild(portElement2); - if (inputEndpointsItem.getVirtualIPAddress() != null) - { - Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); - vipElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getVirtualIPAddress().toString())); - inputEndpointElement.appendChild(vipElement); - } + Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(inputEndpointsItem.getLoadBalancerProbe().getProtocol()))); + loadBalancerProbeElement.appendChild(protocolElement); - if (inputEndpointsItem.getEnableDirectServerReturn() != null) + if (inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) { - Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); - enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(inputEndpointsItem.getEnableDirectServerReturn()).toLowerCase())); - inputEndpointElement.appendChild(enableDirectServerReturnElement); + Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); + intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); + loadBalancerProbeElement.appendChild(intervalInSecondsElement); } - if (inputEndpointsItem.getEndpointAcl() != null) + if (inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) { - Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); - inputEndpointElement.appendChild(endpointAclElement); - - if (inputEndpointsItem.getEndpointAcl().getRules() != null) - { - Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); - for (AccessControlListRule rulesItem : inputEndpointsItem.getEndpointAcl().getRules()) - { - Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); - rulesSequenceElement.appendChild(ruleElement); - - if (rulesItem.getOrder() != null) - { - Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); - orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); - ruleElement.appendChild(orderElement); - } - - if (rulesItem.getAction() != null) - { - Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); - actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); - ruleElement.appendChild(actionElement); - } - - if (rulesItem.getRemoteSubnet() != null) - { - Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); - remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); - ruleElement.appendChild(remoteSubnetElement); - } - - if (rulesItem.getDescription() != null) - { - Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); - descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); - ruleElement.appendChild(descriptionElement); - } - } - endpointAclElement.appendChild(rulesSequenceElement); - } + Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); + timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); + loadBalancerProbeElement.appendChild(timeoutInSecondsElement); } } - configurationSetElement.appendChild(inputEndpointsSequenceElement); - } - - if (configurationSetsItem.getSubnetNames() != null) - { - Element subnetNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetNames"); - for (String subnetNamesItem : configurationSetsItem.getSubnetNames()) - { - Element subnetNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetName"); - subnetNamesItemElement.appendChild(requestDoc.createTextNode(subnetNamesItem)); - subnetNamesSequenceElement.appendChild(subnetNamesItemElement); - } - configurationSetElement.appendChild(subnetNamesSequenceElement); - } - - if (configurationSetsItem.getComputerName() != null) - { - Element computerNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ComputerName"); - computerNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getComputerName())); - configurationSetElement.appendChild(computerNameElement); - } - - if (configurationSetsItem.getAdminPassword() != null) - { - Element adminPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminPassword"); - adminPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminPassword())); - configurationSetElement.appendChild(adminPasswordElement); - } - - if (configurationSetsItem.getResetPasswordOnFirstLogon() != null) - { - Element resetPasswordOnFirstLogonElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ResetPasswordOnFirstLogon"); - resetPasswordOnFirstLogonElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.getResetPasswordOnFirstLogon()).toLowerCase())); - configurationSetElement.appendChild(resetPasswordOnFirstLogonElement); - } - - if (configurationSetsItem.getEnableAutomaticUpdates() != null) - { - Element enableAutomaticUpdatesElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableAutomaticUpdates"); - enableAutomaticUpdatesElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.getEnableAutomaticUpdates()).toLowerCase())); - configurationSetElement.appendChild(enableAutomaticUpdatesElement); - } - - if (configurationSetsItem.getTimeZone() != null) - { - Element timeZoneElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeZone"); - timeZoneElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getTimeZone())); - configurationSetElement.appendChild(timeZoneElement); - } - - if (configurationSetsItem.getDomainJoin() != null) - { - Element domainJoinElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DomainJoin"); - configurationSetElement.appendChild(domainJoinElement); - if (configurationSetsItem.getDomainJoin().getCredentials() != null) + if (inputEndpointsItem.getProtocol() != null) { - Element credentialsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Credentials"); - domainJoinElement.appendChild(credentialsElement); - - if (configurationSetsItem.getDomainJoin().getCredentials().getDomain() != null) - { - Element domainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Domain"); - domainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getDomain())); - credentialsElement.appendChild(domainElement); - } - - Element usernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Username"); - usernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getUserName())); - credentialsElement.appendChild(usernameElement); - - Element passwordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Password"); - passwordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getPassword())); - credentialsElement.appendChild(passwordElement); + Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getProtocol())); + inputEndpointElement.appendChild(protocolElement2); } - if (configurationSetsItem.getDomainJoin().getDomainToJoin() != null) + if (inputEndpointsItem.getVirtualIPAddress() != null) { - Element joinDomainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "JoinDomain"); - joinDomainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getDomainToJoin())); - domainJoinElement.appendChild(joinDomainElement); + Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); + vipElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getVirtualIPAddress().toString())); + inputEndpointElement.appendChild(vipElement); } - if (configurationSetsItem.getDomainJoin().getLdapMachineObjectOU() != null) + if (inputEndpointsItem.isEnableDirectServerReturn() != null) { - Element machineObjectOUElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MachineObjectOU"); - machineObjectOUElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getLdapMachineObjectOU())); - domainJoinElement.appendChild(machineObjectOUElement); + Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); + enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(inputEndpointsItem.isEnableDirectServerReturn()).toLowerCase())); + inputEndpointElement.appendChild(enableDirectServerReturnElement); } - if (configurationSetsItem.getDomainJoin().getProvisioning() != null) + if (inputEndpointsItem.getEndpointAcl() != null) { - Element provisioningElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Provisioning"); - domainJoinElement.appendChild(provisioningElement); + Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); + inputEndpointElement.appendChild(endpointAclElement); - if (configurationSetsItem.getDomainJoin().getProvisioning().getAccountData() != null) + if (inputEndpointsItem.getEndpointAcl().getRules() != null) { - Element accountDataElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AccountData"); - accountDataElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getProvisioning().getAccountData())); - provisioningElement.appendChild(accountDataElement); - } - } - } - - if (configurationSetsItem.getStoredCertificateSettings() != null) - { - Element storedCertificateSettingsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoredCertificateSettings"); - for (StoredCertificateSettings storedCertificateSettingsItem : configurationSetsItem.getStoredCertificateSettings()) - { - Element certificateSettingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateSetting"); - storedCertificateSettingsSequenceElement.appendChild(certificateSettingElement); - - Element storeLocationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreLocation"); - storeLocationElement.appendChild(requestDoc.createTextNode("LocalMachine")); - certificateSettingElement.appendChild(storeLocationElement); - - Element storeNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreName"); - storeNameElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getStoreName())); - certificateSettingElement.appendChild(storeNameElement); - - Element thumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Thumbprint"); - thumbprintElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getThumbprint())); - certificateSettingElement.appendChild(thumbprintElement); - } - configurationSetElement.appendChild(storedCertificateSettingsSequenceElement); - } - - if (configurationSetsItem.getWindowsRemoteManagement() != null) - { - Element winRMElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "WinRM"); - configurationSetElement.appendChild(winRMElement); - - if (configurationSetsItem.getWindowsRemoteManagement().getListeners() != null) - { - Element listenersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listeners"); - for (WindowsRemoteManagementListener listenersItem : configurationSetsItem.getWindowsRemoteManagement().getListeners()) - { - Element listenerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listener"); - listenersSequenceElement.appendChild(listenerElement); - - Element protocolElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement3.appendChild(requestDoc.createTextNode(listenersItem.getListenerType().toString())); - listenerElement.appendChild(protocolElement3); - - if (listenersItem.getCertificateThumbprint() != null) + Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); + for (AccessControlListRule rulesItem : inputEndpointsItem.getEndpointAcl().getRules()) { - Element certificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateThumbprint"); - certificateThumbprintElement.appendChild(requestDoc.createTextNode(listenersItem.getCertificateThumbprint())); - listenerElement.appendChild(certificateThumbprintElement); + Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); + rulesSequenceElement.appendChild(ruleElement); + + if (rulesItem.getOrder() != null) + { + Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); + orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); + ruleElement.appendChild(orderElement); + } + + if (rulesItem.getAction() != null) + { + Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); + actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); + ruleElement.appendChild(actionElement); + } + + if (rulesItem.getRemoteSubnet() != null) + { + Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); + remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); + ruleElement.appendChild(remoteSubnetElement); + } + + if (rulesItem.getDescription() != null) + { + Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); + descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); + ruleElement.appendChild(descriptionElement); + } } + endpointAclElement.appendChild(rulesSequenceElement); } - winRMElement.appendChild(listenersSequenceElement); - } - } - - if (configurationSetsItem.getAdminUserName() != null) - { - Element adminUsernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminUsername"); - adminUsernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminUserName())); - configurationSetElement.appendChild(adminUsernameElement); - } - - if (configurationSetsItem.getHostName() != null) - { - Element hostNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostName"); - hostNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getHostName())); - configurationSetElement.appendChild(hostNameElement); - } - - if (configurationSetsItem.getUserName() != null) - { - Element userNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserName"); - userNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserName())); - configurationSetElement.appendChild(userNameElement); - } - - if (configurationSetsItem.getUserPassword() != null) - { - Element userPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserPassword"); - userPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserPassword())); - configurationSetElement.appendChild(userPasswordElement); - } - - if (configurationSetsItem.getDisableSshPasswordAuthentication() != null) - { - Element disableSshPasswordAuthenticationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DisableSshPasswordAuthentication"); - disableSshPasswordAuthenticationElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.getDisableSshPasswordAuthentication()).toLowerCase())); - configurationSetElement.appendChild(disableSshPasswordAuthenticationElement); - } - - if (configurationSetsItem.getSshSettings() != null) - { - Element sSHElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SSH"); - configurationSetElement.appendChild(sSHElement); - - if (configurationSetsItem.getSshSettings().getPublicKeys() != null) - { - Element publicKeysSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKeys"); - for (SshSettingPublicKey publicKeysItem : configurationSetsItem.getSshSettings().getPublicKeys()) - { - Element publicKeyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKey"); - publicKeysSequenceElement.appendChild(publicKeyElement); - - Element fingerprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); - fingerprintElement.appendChild(requestDoc.createTextNode(publicKeysItem.getFingerprint())); - publicKeyElement.appendChild(fingerprintElement); - - Element pathElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement2.appendChild(requestDoc.createTextNode(publicKeysItem.getPath())); - publicKeyElement.appendChild(pathElement2); - } - sSHElement.appendChild(publicKeysSequenceElement); - } - - if (configurationSetsItem.getSshSettings().getKeyPairs() != null) - { - Element keyPairsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPairs"); - for (SshSettingKeyPair keyPairsItem : configurationSetsItem.getSshSettings().getKeyPairs()) - { - Element keyPairElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPair"); - keyPairsSequenceElement.appendChild(keyPairElement); - - Element fingerprintElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); - fingerprintElement2.appendChild(requestDoc.createTextNode(keyPairsItem.getFingerprint())); - keyPairElement.appendChild(fingerprintElement2); - - Element pathElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement3.appendChild(requestDoc.createTextNode(keyPairsItem.getPath())); - keyPairElement.appendChild(pathElement3); - } - sSHElement.appendChild(keyPairsSequenceElement); } } + provisioningConfigurationElement.appendChild(inputEndpointsSequenceElement); } - persistentVMRoleElement.appendChild(configurationSetsSequenceElement); - } - - if (parameters.getAvailabilitySetName() != null) - { - Element availabilitySetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AvailabilitySetName"); - availabilitySetNameElement.appendChild(requestDoc.createTextNode(parameters.getAvailabilitySetName())); - persistentVMRoleElement.appendChild(availabilitySetNameElement); - } - - if (parameters.getDataVirtualHardDisks() != null) - { - Element dataVirtualHardDisksSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisks"); - for (DataVirtualHardDisk dataVirtualHardDisksItem : parameters.getDataVirtualHardDisks()) + + if (parameters.getProvisioningConfiguration().getSubnetNames() != null) { - Element dataVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisk"); - dataVirtualHardDisksSequenceElement.appendChild(dataVirtualHardDiskElement); - - if (dataVirtualHardDisksItem.getHostCaching() != null) - { - Element hostCachingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); - hostCachingElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getHostCaching().toString())); - dataVirtualHardDiskElement.appendChild(hostCachingElement); - } - - if (dataVirtualHardDisksItem.getDiskLabel() != null) - { - Element diskLabelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); - diskLabelElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskLabel())); - dataVirtualHardDiskElement.appendChild(diskLabelElement); - } - - if (dataVirtualHardDisksItem.getDiskName() != null) - { - Element diskNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); - diskNameElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskName())); - dataVirtualHardDiskElement.appendChild(diskNameElement); - } - - if (dataVirtualHardDisksItem.getLogicalUnitNumber() != null) - { - Element lunElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Lun"); - lunElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalUnitNumber()))); - dataVirtualHardDiskElement.appendChild(lunElement); - } - - Element logicalDiskSizeInGBElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB"); - logicalDiskSizeInGBElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalDiskSizeInGB()))); - dataVirtualHardDiskElement.appendChild(logicalDiskSizeInGBElement); - - if (dataVirtualHardDisksItem.getMediaLink() != null) + Element subnetNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetNames"); + for (String subnetNamesItem : parameters.getProvisioningConfiguration().getSubnetNames()) { - Element mediaLinkElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); - mediaLinkElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getMediaLink().toString())); - dataVirtualHardDiskElement.appendChild(mediaLinkElement); + Element subnetNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetName"); + subnetNamesItemElement.appendChild(requestDoc.createTextNode(subnetNamesItem)); + subnetNamesSequenceElement.appendChild(subnetNamesItemElement); } + provisioningConfigurationElement.appendChild(subnetNamesSequenceElement); } - persistentVMRoleElement.appendChild(dataVirtualHardDisksSequenceElement); - } - - if (parameters.getOSVirtualHardDisk() != null) - { - Element oSVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OSVirtualHardDisk"); - persistentVMRoleElement.appendChild(oSVirtualHardDiskElement); - if (parameters.getOSVirtualHardDisk().getHostCaching() != null) + if (parameters.getProvisioningConfiguration().getStaticVirtualNetworkIPAddress() != null) { - Element hostCachingElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); - hostCachingElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getHostCaching().toString())); - oSVirtualHardDiskElement.appendChild(hostCachingElement2); + Element staticVirtualNetworkIPAddressElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StaticVirtualNetworkIPAddress"); + staticVirtualNetworkIPAddressElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getStaticVirtualNetworkIPAddress())); + provisioningConfigurationElement.appendChild(staticVirtualNetworkIPAddressElement); } - if (parameters.getOSVirtualHardDisk().getDiskLabel() != null) + if (parameters.getProvisioningConfiguration().getComputerName() != null) { - Element diskLabelElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); - diskLabelElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getDiskLabel())); - oSVirtualHardDiskElement.appendChild(diskLabelElement2); + Element computerNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ComputerName"); + computerNameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getComputerName())); + provisioningConfigurationElement.appendChild(computerNameElement); } - if (parameters.getOSVirtualHardDisk().getDiskName() != null) + if (parameters.getProvisioningConfiguration().getAdminPassword() != null) { - Element diskNameElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); - diskNameElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getDiskName())); - oSVirtualHardDiskElement.appendChild(diskNameElement2); + Element adminPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminPassword"); + adminPasswordElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getAdminPassword())); + provisioningConfigurationElement.appendChild(adminPasswordElement); } - if (parameters.getOSVirtualHardDisk().getMediaLink() != null) + if (parameters.getProvisioningConfiguration().isResetPasswordOnFirstLogon() != null) { - Element mediaLinkElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); - mediaLinkElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getMediaLink().toString())); - oSVirtualHardDiskElement.appendChild(mediaLinkElement2); + Element resetPasswordOnFirstLogonElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ResetPasswordOnFirstLogon"); + resetPasswordOnFirstLogonElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getProvisioningConfiguration().isResetPasswordOnFirstLogon()).toLowerCase())); + provisioningConfigurationElement.appendChild(resetPasswordOnFirstLogonElement); } - if (parameters.getOSVirtualHardDisk().getSourceImageName() != null) + if (parameters.getProvisioningConfiguration().isEnableAutomaticUpdates() != null) { - Element sourceImageNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SourceImageName"); - sourceImageNameElement.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getSourceImageName())); - oSVirtualHardDiskElement.appendChild(sourceImageNameElement); + Element enableAutomaticUpdatesElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableAutomaticUpdates"); + enableAutomaticUpdatesElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getProvisioningConfiguration().isEnableAutomaticUpdates()).toLowerCase())); + provisioningConfigurationElement.appendChild(enableAutomaticUpdatesElement); } - if (parameters.getOSVirtualHardDisk().getOperatingSystem() != null) + if (parameters.getProvisioningConfiguration().getTimeZone() != null) { - Element osElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OS"); - osElement.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getOperatingSystem())); - oSVirtualHardDiskElement.appendChild(osElement); - } + Element timeZoneElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeZone"); + timeZoneElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getTimeZone())); + provisioningConfigurationElement.appendChild(timeZoneElement); + } + + if (parameters.getProvisioningConfiguration().getDomainJoin() != null) + { + Element domainJoinElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DomainJoin"); + provisioningConfigurationElement.appendChild(domainJoinElement); + + if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials() != null) + { + Element credentialsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Credentials"); + domainJoinElement.appendChild(credentialsElement); + + if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getDomain() != null) + { + Element domainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Domain"); + domainElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getDomain())); + credentialsElement.appendChild(domainElement); + } + + Element usernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Username"); + usernameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getUserName())); + credentialsElement.appendChild(usernameElement); + + Element passwordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Password"); + passwordElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getPassword())); + credentialsElement.appendChild(passwordElement); + } + + if (parameters.getProvisioningConfiguration().getDomainJoin().getDomainToJoin() != null) + { + Element joinDomainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "JoinDomain"); + joinDomainElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getDomainToJoin())); + domainJoinElement.appendChild(joinDomainElement); + } + + if (parameters.getProvisioningConfiguration().getDomainJoin().getLdapMachineObjectOU() != null) + { + Element machineObjectOUElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MachineObjectOU"); + machineObjectOUElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getLdapMachineObjectOU())); + domainJoinElement.appendChild(machineObjectOUElement); + } + + if (parameters.getProvisioningConfiguration().getDomainJoin().getProvisioning() != null) + { + Element provisioningElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Provisioning"); + domainJoinElement.appendChild(provisioningElement); + + if (parameters.getProvisioningConfiguration().getDomainJoin().getProvisioning().getAccountData() != null) + { + Element accountDataElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AccountData"); + accountDataElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getProvisioning().getAccountData())); + provisioningElement.appendChild(accountDataElement); + } + } + } + + if (parameters.getProvisioningConfiguration().getStoredCertificateSettings() != null) + { + Element storedCertificateSettingsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoredCertificateSettings"); + for (StoredCertificateSettings storedCertificateSettingsItem : parameters.getProvisioningConfiguration().getStoredCertificateSettings()) + { + Element certificateSettingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateSetting"); + storedCertificateSettingsSequenceElement.appendChild(certificateSettingElement); + + Element storeLocationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreLocation"); + storeLocationElement.appendChild(requestDoc.createTextNode("LocalMachine")); + certificateSettingElement.appendChild(storeLocationElement); + + Element storeNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreName"); + storeNameElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getStoreName())); + certificateSettingElement.appendChild(storeNameElement); + + Element thumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Thumbprint"); + thumbprintElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getThumbprint())); + certificateSettingElement.appendChild(thumbprintElement); + } + provisioningConfigurationElement.appendChild(storedCertificateSettingsSequenceElement); + } + + if (parameters.getProvisioningConfiguration().getWindowsRemoteManagement() != null) + { + Element winRMElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "WinRM"); + provisioningConfigurationElement.appendChild(winRMElement); + + if (parameters.getProvisioningConfiguration().getWindowsRemoteManagement().getListeners() != null) + { + Element listenersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listeners"); + for (WindowsRemoteManagementListener listenersItem : parameters.getProvisioningConfiguration().getWindowsRemoteManagement().getListeners()) + { + Element listenerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listener"); + listenersSequenceElement.appendChild(listenerElement); + + if (listenersItem.getCertificateThumbprint() != null) + { + Element certificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateThumbprint"); + certificateThumbprintElement.appendChild(requestDoc.createTextNode(listenersItem.getCertificateThumbprint())); + listenerElement.appendChild(certificateThumbprintElement); + } + + Element protocolElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement3.appendChild(requestDoc.createTextNode(listenersItem.getListenerType().toString())); + listenerElement.appendChild(protocolElement3); + } + winRMElement.appendChild(listenersSequenceElement); + } + } + + if (parameters.getProvisioningConfiguration().getAdminUserName() != null) + { + Element adminUsernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminUsername"); + adminUsernameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getAdminUserName())); + provisioningConfigurationElement.appendChild(adminUsernameElement); + } + + if (parameters.getProvisioningConfiguration().getHostName() != null) + { + Element hostNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostName"); + hostNameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getHostName())); + provisioningConfigurationElement.appendChild(hostNameElement); + } + + if (parameters.getProvisioningConfiguration().getUserName() != null) + { + Element userNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserName"); + userNameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getUserName())); + provisioningConfigurationElement.appendChild(userNameElement); + } + + if (parameters.getProvisioningConfiguration().getUserPassword() != null) + { + Element userPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserPassword"); + userPasswordElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getUserPassword())); + provisioningConfigurationElement.appendChild(userPasswordElement); + } + + if (parameters.getProvisioningConfiguration().isDisableSshPasswordAuthentication() != null) + { + Element disableSshPasswordAuthenticationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DisableSshPasswordAuthentication"); + disableSshPasswordAuthenticationElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getProvisioningConfiguration().isDisableSshPasswordAuthentication()).toLowerCase())); + provisioningConfigurationElement.appendChild(disableSshPasswordAuthenticationElement); + } + + if (parameters.getProvisioningConfiguration().getSshSettings() != null) + { + Element sSHElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SSH"); + provisioningConfigurationElement.appendChild(sSHElement); + + if (parameters.getProvisioningConfiguration().getSshSettings().getPublicKeys() != null) + { + Element publicKeysSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKeys"); + for (SshSettingPublicKey publicKeysItem : parameters.getProvisioningConfiguration().getSshSettings().getPublicKeys()) + { + Element publicKeyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKey"); + publicKeysSequenceElement.appendChild(publicKeyElement); + + Element fingerprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); + fingerprintElement.appendChild(requestDoc.createTextNode(publicKeysItem.getFingerprint())); + publicKeyElement.appendChild(fingerprintElement); + + Element pathElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement2.appendChild(requestDoc.createTextNode(publicKeysItem.getPath())); + publicKeyElement.appendChild(pathElement2); + } + sSHElement.appendChild(publicKeysSequenceElement); + } + + if (parameters.getProvisioningConfiguration().getSshSettings().getKeyPairs() != null) + { + Element keyPairsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPairs"); + for (SshSettingKeyPair keyPairsItem : parameters.getProvisioningConfiguration().getSshSettings().getKeyPairs()) + { + Element keyPairElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPair"); + keyPairsSequenceElement.appendChild(keyPairElement); + + Element fingerprintElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); + fingerprintElement2.appendChild(requestDoc.createTextNode(keyPairsItem.getFingerprint())); + keyPairElement.appendChild(fingerprintElement2); + + Element pathElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement3.appendChild(requestDoc.createTextNode(keyPairsItem.getPath())); + keyPairElement.appendChild(pathElement3); + } + sSHElement.appendChild(keyPairsSequenceElement); + } + } } - if (parameters.getRoleSize() != null) - { - Element roleSizeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleSize"); - roleSizeElement.appendChild(requestDoc.createTextNode(parameters.getRoleSize().toString())); - persistentVMRoleElement.appendChild(roleSizeElement); - } + Element targetImageLabelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TargetImageLabel"); + targetImageLabelElement.appendChild(requestDoc.createTextNode(parameters.getTargetImageLabel())); + captureRoleOperationElement.appendChild(targetImageLabelElement); + + Element targetImageNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TargetImageName"); + targetImageNameElement.appendChild(requestDoc.createTextNode(parameters.getTargetImageName())); + captureRoleOperationElement.appendChild(targetImageNameElement); DOMSource domSource = new DOMSource(requestDoc); StringWriter stringWriter = new StringWriter(); @@ -848,211 +757,227 @@ public OperationResponse beginCreating(String serviceName, String deploymentName // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** - * The Create Virtual Machine Deployment operation provisions a virtual - * machine based on the supplied configuration. When you create a - * deployment of a virtual machine, you should make sure that the cloud - * service and the disk or image that you use are located in the same - * region. For example, if the cloud service was created in the West US - * region, the disk or image that you use should also be located in a - * stor4age account in the West US region. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157194.aspx for + * The Add Role operation adds a virtual machine to an existing deployment. + * You can refer to the OSDisk in the Add Role operation in the following + * ways. Platform/User Image – Set the SourceImageName to a platform or + * user image. You can optionally specify the DiskName and MediaLink values + * as part the operation to control the name and location of target disk. + * When DiskName and MediaLink are specified in this mode, they must not + * already exist in the system, otherwise a conflict fault is returned. + * UserDisk – Set DiskName to a user supplied image in image repository. + * SourceImageName must be set to NULL. All other properties are ignored. + * Blob in a Storage Account – Set MediaLink to a blob containing the + * image. SourceImageName and DiskName are set to NULL. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157186.aspx for * more information) * * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Create Virtual Machine - * Deployment operation. + * operation. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public Future beginCreatingDeploymentAsync(final String serviceName, final VirtualMachineCreateDeploymentParameters parameters) + public Future beginCreatingAsync(final String serviceName, final String deploymentName, final VirtualMachineCreateParameters parameters) { return this.getClient().getExecutorService().submit(new Callable() { @Override public OperationResponse call() throws Exception { - return beginCreatingDeployment(serviceName, parameters); + return beginCreating(serviceName, deploymentName, parameters); } }); } /** - * The Create Virtual Machine Deployment operation provisions a virtual - * machine based on the supplied configuration. When you create a - * deployment of a virtual machine, you should make sure that the cloud - * service and the disk or image that you use are located in the same - * region. For example, if the cloud service was created in the West US - * region, the disk or image that you use should also be located in a - * stor4age account in the West US region. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157194.aspx for + * The Add Role operation adds a virtual machine to an existing deployment. + * You can refer to the OSDisk in the Add Role operation in the following + * ways. Platform/User Image – Set the SourceImageName to a platform or + * user image. You can optionally specify the DiskName and MediaLink values + * as part the operation to control the name and location of target disk. + * When DiskName and MediaLink are specified in this mode, they must not + * already exist in the system, otherwise a conflict fault is returned. + * UserDisk – Set DiskName to a user supplied image in image repository. + * SourceImageName must be set to NULL. All other properties are ignored. + * Blob in a Storage Account – Set MediaLink to a blob containing the + * image. SourceImageName and DiskName are set to NULL. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157186.aspx for * more information) * * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Create Virtual Machine - * Deployment operation. + * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginCreatingDeployment(String serviceName, VirtualMachineCreateDeploymentParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginCreating(String serviceName, String deploymentName, VirtualMachineCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) { throw new NullPointerException("serviceName"); } - if (parameters == null) - { - throw new NullPointerException("parameters"); - } - if (parameters.getLabel() == null) - { - throw new NullPointerException("parameters.Label"); - } - if (parameters.getLabel().length() > 100) - { - throw new IllegalArgumentException("parameters.Label"); - } - if (parameters.getName() == null) + if (deploymentName == null) { - throw new NullPointerException("parameters.Name"); + throw new NullPointerException("deploymentName"); } - if (parameters.getRoles() == null) + if (parameters == null) { - throw new NullPointerException("parameters.Roles"); + throw new NullPointerException("parameters"); } - if (parameters.getRoles() != null) + if (parameters.getConfigurationSets() != null) { - for (Role rolesParameterItem : parameters.getRoles()) + for (ConfigurationSet configurationSetsParameterItem : parameters.getConfigurationSets()) { - if (rolesParameterItem.getConfigurationSets() != null) + if (configurationSetsParameterItem.getDomainJoin() != null) { - for (ConfigurationSet configurationSetsParameterItem : rolesParameterItem.getConfigurationSets()) + if (configurationSetsParameterItem.getDomainJoin().getCredentials() != null) { - if (configurationSetsParameterItem.getDomainJoin() != null) - { - if (configurationSetsParameterItem.getDomainJoin().getCredentials() != null) - { - if (configurationSetsParameterItem.getDomainJoin().getCredentials().getPassword() == null) - { - throw new NullPointerException("parameters.Roles.ConfigurationSets.DomainJoin.Credentials.Password"); - } - if (configurationSetsParameterItem.getDomainJoin().getCredentials().getUserName() == null) - { - throw new NullPointerException("parameters.Roles.ConfigurationSets.DomainJoin.Credentials.UserName"); - } - } - } - if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() < 1) + if (configurationSetsParameterItem.getDomainJoin().getCredentials().getPassword() == null) { - throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.HostName"); + throw new NullPointerException("parameters.ConfigurationSets.DomainJoin.Credentials.Password"); } - if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() > 64) + if (configurationSetsParameterItem.getDomainJoin().getCredentials().getUserName() == null) { - throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.HostName"); + throw new NullPointerException("parameters.ConfigurationSets.DomainJoin.Credentials.UserName"); } - if (configurationSetsParameterItem.getSshSettings() != null) + } + } + if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() < 1) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.HostName"); + } + if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() > 64) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.HostName"); + } + if (configurationSetsParameterItem.getSshSettings() != null) + { + if (configurationSetsParameterItem.getSshSettings().getKeyPairs() != null) + { + for (SshSettingKeyPair keyPairsParameterItem : configurationSetsParameterItem.getSshSettings().getKeyPairs()) { - if (configurationSetsParameterItem.getSshSettings().getKeyPairs() != null) + if (keyPairsParameterItem.getFingerprint() == null) { - for (SshSettingKeyPair keyPairsParameterItem : configurationSetsParameterItem.getSshSettings().getKeyPairs()) - { - if (keyPairsParameterItem.getFingerprint() == null) - { - throw new NullPointerException("parameters.Roles.ConfigurationSets.SshSettings.KeyPairs.Fingerprint"); - } - if (keyPairsParameterItem.getPath() == null) - { - throw new NullPointerException("parameters.Roles.ConfigurationSets.SshSettings.KeyPairs.Path"); - } - } + throw new NullPointerException("parameters.ConfigurationSets.SshSettings.KeyPairs.Fingerprint"); } - if (configurationSetsParameterItem.getSshSettings().getPublicKeys() != null) + if (keyPairsParameterItem.getPath() == null) { - for (SshSettingPublicKey publicKeysParameterItem : configurationSetsParameterItem.getSshSettings().getPublicKeys()) - { - if (publicKeysParameterItem.getFingerprint() == null) - { - throw new NullPointerException("parameters.Roles.ConfigurationSets.SshSettings.PublicKeys.Fingerprint"); - } - if (publicKeysParameterItem.getPath() == null) - { - throw new NullPointerException("parameters.Roles.ConfigurationSets.SshSettings.PublicKeys.Path"); - } - } + throw new NullPointerException("parameters.ConfigurationSets.SshSettings.KeyPairs.Path"); } } - if (configurationSetsParameterItem.getStoredCertificateSettings() != null) + } + if (configurationSetsParameterItem.getSshSettings().getPublicKeys() != null) + { + for (SshSettingPublicKey publicKeysParameterItem : configurationSetsParameterItem.getSshSettings().getPublicKeys()) { - for (StoredCertificateSettings storedCertificateSettingsParameterItem : configurationSetsParameterItem.getStoredCertificateSettings()) + if (publicKeysParameterItem.getFingerprint() == null) { - if (storedCertificateSettingsParameterItem.getStoreName() == null) - { - throw new NullPointerException("parameters.Roles.ConfigurationSets.StoredCertificateSettings.StoreName"); - } - if (storedCertificateSettingsParameterItem.getThumbprint() == null) - { - throw new NullPointerException("parameters.Roles.ConfigurationSets.StoredCertificateSettings.Thumbprint"); - } + throw new NullPointerException("parameters.ConfigurationSets.SshSettings.PublicKeys.Fingerprint"); + } + if (publicKeysParameterItem.getPath() == null) + { + throw new NullPointerException("parameters.ConfigurationSets.SshSettings.PublicKeys.Path"); } } - if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() < 1) - { - throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.UserName"); - } - if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() > 32) - { - throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.UserName"); - } - if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() < 6 && (configurationSetsParameterItem.getDisableSshPasswordAuthentication() == false || configurationSetsParameterItem.getUserPassword().length() != 0)) + } + } + if (configurationSetsParameterItem.getStoredCertificateSettings() != null) + { + for (StoredCertificateSettings storedCertificateSettingsParameterItem : configurationSetsParameterItem.getStoredCertificateSettings()) + { + if (storedCertificateSettingsParameterItem.getStoreName() == null) { - throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.UserPassword"); + throw new NullPointerException("parameters.ConfigurationSets.StoredCertificateSettings.StoreName"); } - if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() > 72) + if (storedCertificateSettingsParameterItem.getThumbprint() == null) { - throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.UserPassword"); + throw new NullPointerException("parameters.ConfigurationSets.StoredCertificateSettings.Thumbprint"); } } } + if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() < 1) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.UserName"); + } + if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() > 32) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.UserName"); + } + if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() < 6 && (configurationSetsParameterItem.isDisableSshPasswordAuthentication() == false || configurationSetsParameterItem.getUserPassword().length() != 0)) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.UserPassword"); + } + if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() > 72) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.UserPassword"); + } } } + if (parameters.getRoleName() == null) + { + throw new NullPointerException("parameters.RoleName"); + } // Tracing boolean shouldTrace = CloudTracing.getIsEnabled(); @@ -1062,12 +987,13 @@ public OperationResponse beginCreatingDeployment(String serviceName, VirtualMach invocationId = Long.toString(CloudTracing.getNextInvocationId()); HashMap tracingParameters = new HashMap(); tracingParameters.put("serviceName", serviceName); + tracingParameters.put("deploymentName", deploymentName); tracingParameters.put("parameters", parameters); - CloudTracing.enter(invocationId, this, "beginCreatingDeploymentAsync", tracingParameters); + CloudTracing.enter(invocationId, this, "beginCreatingAsync", tracingParameters); } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments"; + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roles"; // Create HTTP transport objects HttpPost httpRequest = new HttpPost(url); @@ -1082,608 +1008,523 @@ public OperationResponse beginCreatingDeployment(String serviceName, VirtualMach DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document requestDoc = documentBuilder.newDocument(); - Element deploymentElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Deployment"); - requestDoc.appendChild(deploymentElement); - - Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); - nameElement.appendChild(requestDoc.createTextNode(parameters.getName())); - deploymentElement.appendChild(nameElement); + Element persistentVMRoleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PersistentVMRole"); + requestDoc.appendChild(persistentVMRoleElement); - Element deploymentSlotElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DeploymentSlot"); - deploymentSlotElement.appendChild(requestDoc.createTextNode(parameters.getDeploymentSlot().toString())); - deploymentElement.appendChild(deploymentSlotElement); + Element roleNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleName"); + roleNameElement.appendChild(requestDoc.createTextNode(parameters.getRoleName())); + persistentVMRoleElement.appendChild(roleNameElement); - Element labelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Label"); - labelElement.appendChild(requestDoc.createTextNode(new String(Base64.encodeBase64(parameters.getLabel().getBytes())))); - deploymentElement.appendChild(labelElement); + Element roleTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleType"); + roleTypeElement.appendChild(requestDoc.createTextNode("PersistentVMRole")); + persistentVMRoleElement.appendChild(roleTypeElement); - Element roleListSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleList"); - for (Role roleListItem : parameters.getRoles()) + if (parameters.getConfigurationSets() != null) { - Element roleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Role"); - roleListSequenceElement.appendChild(roleElement); - - if (roleListItem.getRoleName() != null) - { - Element roleNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleName"); - roleNameElement.appendChild(requestDoc.createTextNode(roleListItem.getRoleName())); - roleElement.appendChild(roleNameElement); - } - - if (roleListItem.getOSVersion() != null) - { - Element osVersionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OsVersion"); - osVersionElement.appendChild(requestDoc.createTextNode(roleListItem.getOSVersion())); - roleElement.appendChild(osVersionElement); - } - - if (roleListItem.getRoleType() != null) - { - Element roleTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleType"); - roleTypeElement.appendChild(requestDoc.createTextNode(roleListItem.getRoleType())); - roleElement.appendChild(roleTypeElement); - } - - if (roleListItem.getConfigurationSets() != null) + Element configurationSetsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSets"); + for (ConfigurationSet configurationSetsItem : parameters.getConfigurationSets()) { - Element configurationSetsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSets"); - for (ConfigurationSet configurationSetsItem : roleListItem.getConfigurationSets()) + Element configurationSetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSet"); + configurationSetsSequenceElement.appendChild(configurationSetElement); + + if (configurationSetsItem.getConfigurationSetType() != null) { - Element configurationSetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSet"); - configurationSetsSequenceElement.appendChild(configurationSetElement); - - if (configurationSetsItem.getConfigurationSetType() != null) + Element configurationSetTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSetType"); + configurationSetTypeElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getConfigurationSetType())); + configurationSetElement.appendChild(configurationSetTypeElement); + } + + if (configurationSetsItem.getInputEndpoints() != null) + { + Element inputEndpointsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoints"); + for (InputEndpoint inputEndpointsItem : configurationSetsItem.getInputEndpoints()) { - Element configurationSetTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSetType"); - configurationSetTypeElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getConfigurationSetType())); - configurationSetElement.appendChild(configurationSetTypeElement); - } - - if (configurationSetsItem.getInputEndpoints() != null) - { - Element inputEndpointsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoints"); - for (InputEndpoint inputEndpointsItem : configurationSetsItem.getInputEndpoints()) + Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); + inputEndpointsSequenceElement.appendChild(inputEndpointElement); + + if (inputEndpointsItem.getLoadBalancedEndpointSetName() != null) { - Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); - inputEndpointsSequenceElement.appendChild(inputEndpointElement); - - if (inputEndpointsItem.getLoadBalancedEndpointSetName() != null) - { - Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); - loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancedEndpointSetName())); - inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); - } - - if (inputEndpointsItem.getLocalPort() != null) - { - Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); - localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLocalPort()))); - inputEndpointElement.appendChild(localPortElement); - } - - if (inputEndpointsItem.getName() != null) - { - Element nameElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); - nameElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getName())); - inputEndpointElement.appendChild(nameElement2); - } + Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); + loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancedEndpointSetName())); + inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); + } + + if (inputEndpointsItem.getLocalPort() != null) + { + Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); + localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLocalPort()))); + inputEndpointElement.appendChild(localPortElement); + } + + if (inputEndpointsItem.getName() != null) + { + Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); + nameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getName())); + inputEndpointElement.appendChild(nameElement); + } + + if (inputEndpointsItem.getPort() != null) + { + Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getPort()))); + inputEndpointElement.appendChild(portElement); + } + + if (inputEndpointsItem.getLoadBalancerProbe() != null) + { + Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); + inputEndpointElement.appendChild(loadBalancerProbeElement); - if (inputEndpointsItem.getPort() != null) + if (inputEndpointsItem.getLoadBalancerProbe().getPath() != null) { - Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getPort()))); - inputEndpointElement.appendChild(portElement); + Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancerProbe().getPath())); + loadBalancerProbeElement.appendChild(pathElement); } - if (inputEndpointsItem.getLoadBalancerProbe() != null) - { - Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); - inputEndpointElement.appendChild(loadBalancerProbeElement); - - if (inputEndpointsItem.getLoadBalancerProbe().getPath() != null) - { - Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancerProbe().getPath())); - loadBalancerProbeElement.appendChild(pathElement); - } - - Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement2.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getPort()))); - loadBalancerProbeElement.appendChild(portElement2); - - Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(inputEndpointsItem.getLoadBalancerProbe().getProtocol()))); - loadBalancerProbeElement.appendChild(protocolElement); - - if (inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) - { - Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); - intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); - loadBalancerProbeElement.appendChild(intervalInSecondsElement); - } - - if (inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) - { - Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); - timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); - loadBalancerProbeElement.appendChild(timeoutInSecondsElement); - } - } + Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement2.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getPort()))); + loadBalancerProbeElement.appendChild(portElement2); - if (inputEndpointsItem.getProtocol() != null) - { - Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getProtocol())); - inputEndpointElement.appendChild(protocolElement2); - } + Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(inputEndpointsItem.getLoadBalancerProbe().getProtocol()))); + loadBalancerProbeElement.appendChild(protocolElement); - if (inputEndpointsItem.getVirtualIPAddress() != null) + if (inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) { - Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); - vipElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getVirtualIPAddress().toString())); - inputEndpointElement.appendChild(vipElement); + Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); + intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); + loadBalancerProbeElement.appendChild(intervalInSecondsElement); } - if (inputEndpointsItem.getEnableDirectServerReturn() != null) + if (inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) { - Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); - enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(inputEndpointsItem.getEnableDirectServerReturn()).toLowerCase())); - inputEndpointElement.appendChild(enableDirectServerReturnElement); + Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); + timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); + loadBalancerProbeElement.appendChild(timeoutInSecondsElement); } + } + + if (inputEndpointsItem.getProtocol() != null) + { + Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getProtocol())); + inputEndpointElement.appendChild(protocolElement2); + } + + if (inputEndpointsItem.getVirtualIPAddress() != null) + { + Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); + vipElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getVirtualIPAddress().toString())); + inputEndpointElement.appendChild(vipElement); + } + + if (inputEndpointsItem.isEnableDirectServerReturn() != null) + { + Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); + enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(inputEndpointsItem.isEnableDirectServerReturn()).toLowerCase())); + inputEndpointElement.appendChild(enableDirectServerReturnElement); + } + + if (inputEndpointsItem.getEndpointAcl() != null) + { + Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); + inputEndpointElement.appendChild(endpointAclElement); - if (inputEndpointsItem.getEndpointAcl() != null) + if (inputEndpointsItem.getEndpointAcl().getRules() != null) { - Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); - inputEndpointElement.appendChild(endpointAclElement); - - if (inputEndpointsItem.getEndpointAcl().getRules() != null) + Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); + for (AccessControlListRule rulesItem : inputEndpointsItem.getEndpointAcl().getRules()) { - Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); - for (AccessControlListRule rulesItem : inputEndpointsItem.getEndpointAcl().getRules()) + Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); + rulesSequenceElement.appendChild(ruleElement); + + if (rulesItem.getOrder() != null) { - Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); - rulesSequenceElement.appendChild(ruleElement); - - if (rulesItem.getOrder() != null) - { - Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); - orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); - ruleElement.appendChild(orderElement); - } - - if (rulesItem.getAction() != null) - { - Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); - actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); - ruleElement.appendChild(actionElement); - } - - if (rulesItem.getRemoteSubnet() != null) - { - Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); - remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); - ruleElement.appendChild(remoteSubnetElement); - } - - if (rulesItem.getDescription() != null) - { - Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); - descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); - ruleElement.appendChild(descriptionElement); - } + Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); + orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); + ruleElement.appendChild(orderElement); + } + + if (rulesItem.getAction() != null) + { + Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); + actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); + ruleElement.appendChild(actionElement); + } + + if (rulesItem.getRemoteSubnet() != null) + { + Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); + remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); + ruleElement.appendChild(remoteSubnetElement); + } + + if (rulesItem.getDescription() != null) + { + Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); + descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); + ruleElement.appendChild(descriptionElement); } - endpointAclElement.appendChild(rulesSequenceElement); } + endpointAclElement.appendChild(rulesSequenceElement); } } - configurationSetElement.appendChild(inputEndpointsSequenceElement); - } - - if (configurationSetsItem.getSubnetNames() != null) - { - Element subnetNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetNames"); - for (String subnetNamesItem : configurationSetsItem.getSubnetNames()) - { - Element subnetNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetName"); - subnetNamesItemElement.appendChild(requestDoc.createTextNode(subnetNamesItem)); - subnetNamesSequenceElement.appendChild(subnetNamesItemElement); - } - configurationSetElement.appendChild(subnetNamesSequenceElement); } - - if (configurationSetsItem.getComputerName() != null) + configurationSetElement.appendChild(inputEndpointsSequenceElement); + } + + if (configurationSetsItem.getSubnetNames() != null) + { + Element subnetNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetNames"); + for (String subnetNamesItem : configurationSetsItem.getSubnetNames()) { - Element computerNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ComputerName"); - computerNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getComputerName())); - configurationSetElement.appendChild(computerNameElement); - } - - if (configurationSetsItem.getAdminPassword() != null) - { - Element adminPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminPassword"); - adminPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminPassword())); - configurationSetElement.appendChild(adminPasswordElement); + Element subnetNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetName"); + subnetNamesItemElement.appendChild(requestDoc.createTextNode(subnetNamesItem)); + subnetNamesSequenceElement.appendChild(subnetNamesItemElement); } + configurationSetElement.appendChild(subnetNamesSequenceElement); + } + + if (configurationSetsItem.getStaticVirtualNetworkIPAddress() != null) + { + Element staticVirtualNetworkIPAddressElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StaticVirtualNetworkIPAddress"); + staticVirtualNetworkIPAddressElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getStaticVirtualNetworkIPAddress())); + configurationSetElement.appendChild(staticVirtualNetworkIPAddressElement); + } + + if (configurationSetsItem.getComputerName() != null) + { + Element computerNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ComputerName"); + computerNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getComputerName())); + configurationSetElement.appendChild(computerNameElement); + } + + if (configurationSetsItem.getAdminPassword() != null) + { + Element adminPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminPassword"); + adminPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminPassword())); + configurationSetElement.appendChild(adminPasswordElement); + } + + if (configurationSetsItem.isResetPasswordOnFirstLogon() != null) + { + Element resetPasswordOnFirstLogonElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ResetPasswordOnFirstLogon"); + resetPasswordOnFirstLogonElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.isResetPasswordOnFirstLogon()).toLowerCase())); + configurationSetElement.appendChild(resetPasswordOnFirstLogonElement); + } + + if (configurationSetsItem.isEnableAutomaticUpdates() != null) + { + Element enableAutomaticUpdatesElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableAutomaticUpdates"); + enableAutomaticUpdatesElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.isEnableAutomaticUpdates()).toLowerCase())); + configurationSetElement.appendChild(enableAutomaticUpdatesElement); + } + + if (configurationSetsItem.getTimeZone() != null) + { + Element timeZoneElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeZone"); + timeZoneElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getTimeZone())); + configurationSetElement.appendChild(timeZoneElement); + } + + if (configurationSetsItem.getDomainJoin() != null) + { + Element domainJoinElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DomainJoin"); + configurationSetElement.appendChild(domainJoinElement); - if (configurationSetsItem.getResetPasswordOnFirstLogon() != null) + if (configurationSetsItem.getDomainJoin().getCredentials() != null) { - Element resetPasswordOnFirstLogonElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ResetPasswordOnFirstLogon"); - resetPasswordOnFirstLogonElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.getResetPasswordOnFirstLogon()).toLowerCase())); - configurationSetElement.appendChild(resetPasswordOnFirstLogonElement); + Element credentialsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Credentials"); + domainJoinElement.appendChild(credentialsElement); + + if (configurationSetsItem.getDomainJoin().getCredentials().getDomain() != null) + { + Element domainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Domain"); + domainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getDomain())); + credentialsElement.appendChild(domainElement); + } + + Element usernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Username"); + usernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getUserName())); + credentialsElement.appendChild(usernameElement); + + Element passwordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Password"); + passwordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getPassword())); + credentialsElement.appendChild(passwordElement); } - if (configurationSetsItem.getEnableAutomaticUpdates() != null) + if (configurationSetsItem.getDomainJoin().getDomainToJoin() != null) { - Element enableAutomaticUpdatesElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableAutomaticUpdates"); - enableAutomaticUpdatesElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.getEnableAutomaticUpdates()).toLowerCase())); - configurationSetElement.appendChild(enableAutomaticUpdatesElement); + Element joinDomainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "JoinDomain"); + joinDomainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getDomainToJoin())); + domainJoinElement.appendChild(joinDomainElement); } - if (configurationSetsItem.getTimeZone() != null) + if (configurationSetsItem.getDomainJoin().getLdapMachineObjectOU() != null) { - Element timeZoneElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeZone"); - timeZoneElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getTimeZone())); - configurationSetElement.appendChild(timeZoneElement); + Element machineObjectOUElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MachineObjectOU"); + machineObjectOUElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getLdapMachineObjectOU())); + domainJoinElement.appendChild(machineObjectOUElement); } - if (configurationSetsItem.getDomainJoin() != null) + if (configurationSetsItem.getDomainJoin().getProvisioning() != null) { - Element domainJoinElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DomainJoin"); - configurationSetElement.appendChild(domainJoinElement); + Element provisioningElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Provisioning"); + domainJoinElement.appendChild(provisioningElement); - if (configurationSetsItem.getDomainJoin().getCredentials() != null) + if (configurationSetsItem.getDomainJoin().getProvisioning().getAccountData() != null) { - Element credentialsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Credentials"); - domainJoinElement.appendChild(credentialsElement); - - if (configurationSetsItem.getDomainJoin().getCredentials().getDomain() != null) - { - Element domainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Domain"); - domainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getDomain())); - credentialsElement.appendChild(domainElement); - } - - Element usernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Username"); - usernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getUserName())); - credentialsElement.appendChild(usernameElement); - - Element passwordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Password"); - passwordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getPassword())); - credentialsElement.appendChild(passwordElement); + Element accountDataElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AccountData"); + accountDataElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getProvisioning().getAccountData())); + provisioningElement.appendChild(accountDataElement); } + } + } + + if (configurationSetsItem.getStoredCertificateSettings() != null) + { + Element storedCertificateSettingsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoredCertificateSettings"); + for (StoredCertificateSettings storedCertificateSettingsItem : configurationSetsItem.getStoredCertificateSettings()) + { + Element certificateSettingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateSetting"); + storedCertificateSettingsSequenceElement.appendChild(certificateSettingElement); - if (configurationSetsItem.getDomainJoin().getDomainToJoin() != null) - { - Element joinDomainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "JoinDomain"); - joinDomainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getDomainToJoin())); - domainJoinElement.appendChild(joinDomainElement); - } + Element storeLocationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreLocation"); + storeLocationElement.appendChild(requestDoc.createTextNode("LocalMachine")); + certificateSettingElement.appendChild(storeLocationElement); - if (configurationSetsItem.getDomainJoin().getLdapMachineObjectOU() != null) - { - Element machineObjectOUElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MachineObjectOU"); - machineObjectOUElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getLdapMachineObjectOU())); - domainJoinElement.appendChild(machineObjectOUElement); - } + Element storeNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreName"); + storeNameElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getStoreName())); + certificateSettingElement.appendChild(storeNameElement); - if (configurationSetsItem.getDomainJoin().getProvisioning() != null) + Element thumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Thumbprint"); + thumbprintElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getThumbprint())); + certificateSettingElement.appendChild(thumbprintElement); + } + configurationSetElement.appendChild(storedCertificateSettingsSequenceElement); + } + + if (configurationSetsItem.getWindowsRemoteManagement() != null) + { + Element winRMElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "WinRM"); + configurationSetElement.appendChild(winRMElement); + + if (configurationSetsItem.getWindowsRemoteManagement().getListeners() != null) + { + Element listenersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listeners"); + for (WindowsRemoteManagementListener listenersItem : configurationSetsItem.getWindowsRemoteManagement().getListeners()) { - Element provisioningElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Provisioning"); - domainJoinElement.appendChild(provisioningElement); + Element listenerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listener"); + listenersSequenceElement.appendChild(listenerElement); - if (configurationSetsItem.getDomainJoin().getProvisioning().getAccountData() != null) + if (listenersItem.getCertificateThumbprint() != null) { - Element accountDataElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AccountData"); - accountDataElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getProvisioning().getAccountData())); - provisioningElement.appendChild(accountDataElement); + Element certificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateThumbprint"); + certificateThumbprintElement.appendChild(requestDoc.createTextNode(listenersItem.getCertificateThumbprint())); + listenerElement.appendChild(certificateThumbprintElement); } + + Element protocolElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement3.appendChild(requestDoc.createTextNode(listenersItem.getListenerType().toString())); + listenerElement.appendChild(protocolElement3); } + winRMElement.appendChild(listenersSequenceElement); } + } + + if (configurationSetsItem.getAdminUserName() != null) + { + Element adminUsernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminUsername"); + adminUsernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminUserName())); + configurationSetElement.appendChild(adminUsernameElement); + } + + if (configurationSetsItem.getHostName() != null) + { + Element hostNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostName"); + hostNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getHostName())); + configurationSetElement.appendChild(hostNameElement); + } + + if (configurationSetsItem.getUserName() != null) + { + Element userNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserName"); + userNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserName())); + configurationSetElement.appendChild(userNameElement); + } + + if (configurationSetsItem.getUserPassword() != null) + { + Element userPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserPassword"); + userPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserPassword())); + configurationSetElement.appendChild(userPasswordElement); + } + + if (configurationSetsItem.isDisableSshPasswordAuthentication() != null) + { + Element disableSshPasswordAuthenticationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DisableSshPasswordAuthentication"); + disableSshPasswordAuthenticationElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.isDisableSshPasswordAuthentication()).toLowerCase())); + configurationSetElement.appendChild(disableSshPasswordAuthenticationElement); + } + + if (configurationSetsItem.getSshSettings() != null) + { + Element sSHElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SSH"); + configurationSetElement.appendChild(sSHElement); - if (configurationSetsItem.getStoredCertificateSettings() != null) + if (configurationSetsItem.getSshSettings().getPublicKeys() != null) { - Element storedCertificateSettingsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoredCertificateSettings"); - for (StoredCertificateSettings storedCertificateSettingsItem : configurationSetsItem.getStoredCertificateSettings()) + Element publicKeysSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKeys"); + for (SshSettingPublicKey publicKeysItem : configurationSetsItem.getSshSettings().getPublicKeys()) { - Element certificateSettingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateSetting"); - storedCertificateSettingsSequenceElement.appendChild(certificateSettingElement); - - Element storeLocationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreLocation"); - storeLocationElement.appendChild(requestDoc.createTextNode("LocalMachine")); - certificateSettingElement.appendChild(storeLocationElement); + Element publicKeyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKey"); + publicKeysSequenceElement.appendChild(publicKeyElement); - Element storeNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreName"); - storeNameElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getStoreName())); - certificateSettingElement.appendChild(storeNameElement); + Element fingerprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); + fingerprintElement.appendChild(requestDoc.createTextNode(publicKeysItem.getFingerprint())); + publicKeyElement.appendChild(fingerprintElement); - Element thumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Thumbprint"); - thumbprintElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getThumbprint())); - certificateSettingElement.appendChild(thumbprintElement); + Element pathElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement2.appendChild(requestDoc.createTextNode(publicKeysItem.getPath())); + publicKeyElement.appendChild(pathElement2); } - configurationSetElement.appendChild(storedCertificateSettingsSequenceElement); + sSHElement.appendChild(publicKeysSequenceElement); } - if (configurationSetsItem.getWindowsRemoteManagement() != null) + if (configurationSetsItem.getSshSettings().getKeyPairs() != null) { - Element winRMElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "WinRM"); - configurationSetElement.appendChild(winRMElement); - - if (configurationSetsItem.getWindowsRemoteManagement().getListeners() != null) + Element keyPairsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPairs"); + for (SshSettingKeyPair keyPairsItem : configurationSetsItem.getSshSettings().getKeyPairs()) { - Element listenersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listeners"); - for (WindowsRemoteManagementListener listenersItem : configurationSetsItem.getWindowsRemoteManagement().getListeners()) - { - Element listenerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listener"); - listenersSequenceElement.appendChild(listenerElement); - - Element protocolElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement3.appendChild(requestDoc.createTextNode(listenersItem.getListenerType().toString())); - listenerElement.appendChild(protocolElement3); - - if (listenersItem.getCertificateThumbprint() != null) - { - Element certificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateThumbprint"); - certificateThumbprintElement.appendChild(requestDoc.createTextNode(listenersItem.getCertificateThumbprint())); - listenerElement.appendChild(certificateThumbprintElement); - } - } - winRMElement.appendChild(listenersSequenceElement); - } - } - - if (configurationSetsItem.getAdminUserName() != null) - { - Element adminUsernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminUsername"); - adminUsernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminUserName())); - configurationSetElement.appendChild(adminUsernameElement); - } - - if (configurationSetsItem.getHostName() != null) - { - Element hostNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostName"); - hostNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getHostName())); - configurationSetElement.appendChild(hostNameElement); - } - - if (configurationSetsItem.getUserName() != null) - { - Element userNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserName"); - userNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserName())); - configurationSetElement.appendChild(userNameElement); - } - - if (configurationSetsItem.getUserPassword() != null) - { - Element userPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserPassword"); - userPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserPassword())); - configurationSetElement.appendChild(userPasswordElement); - } - - if (configurationSetsItem.getDisableSshPasswordAuthentication() != null) - { - Element disableSshPasswordAuthenticationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DisableSshPasswordAuthentication"); - disableSshPasswordAuthenticationElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.getDisableSshPasswordAuthentication()).toLowerCase())); - configurationSetElement.appendChild(disableSshPasswordAuthenticationElement); - } - - if (configurationSetsItem.getSshSettings() != null) - { - Element sSHElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SSH"); - configurationSetElement.appendChild(sSHElement); - - if (configurationSetsItem.getSshSettings().getPublicKeys() != null) - { - Element publicKeysSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKeys"); - for (SshSettingPublicKey publicKeysItem : configurationSetsItem.getSshSettings().getPublicKeys()) - { - Element publicKeyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKey"); - publicKeysSequenceElement.appendChild(publicKeyElement); - - Element fingerprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); - fingerprintElement.appendChild(requestDoc.createTextNode(publicKeysItem.getFingerprint())); - publicKeyElement.appendChild(fingerprintElement); - - Element pathElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement2.appendChild(requestDoc.createTextNode(publicKeysItem.getPath())); - publicKeyElement.appendChild(pathElement2); - } - sSHElement.appendChild(publicKeysSequenceElement); - } - - if (configurationSetsItem.getSshSettings().getKeyPairs() != null) - { - Element keyPairsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPairs"); - for (SshSettingKeyPair keyPairsItem : configurationSetsItem.getSshSettings().getKeyPairs()) - { - Element keyPairElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPair"); - keyPairsSequenceElement.appendChild(keyPairElement); - - Element fingerprintElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); - fingerprintElement2.appendChild(requestDoc.createTextNode(keyPairsItem.getFingerprint())); - keyPairElement.appendChild(fingerprintElement2); - - Element pathElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement3.appendChild(requestDoc.createTextNode(keyPairsItem.getPath())); - keyPairElement.appendChild(pathElement3); - } - sSHElement.appendChild(keyPairsSequenceElement); + Element keyPairElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPair"); + keyPairsSequenceElement.appendChild(keyPairElement); + + Element fingerprintElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); + fingerprintElement2.appendChild(requestDoc.createTextNode(keyPairsItem.getFingerprint())); + keyPairElement.appendChild(fingerprintElement2); + + Element pathElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement3.appendChild(requestDoc.createTextNode(keyPairsItem.getPath())); + keyPairElement.appendChild(pathElement3); } + sSHElement.appendChild(keyPairsSequenceElement); } } - roleElement.appendChild(configurationSetsSequenceElement); - } - - if (roleListItem.getAvailabilitySetName() != null) - { - Element availabilitySetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AvailabilitySetName"); - availabilitySetNameElement.appendChild(requestDoc.createTextNode(roleListItem.getAvailabilitySetName())); - roleElement.appendChild(availabilitySetNameElement); - } - - if (roleListItem.getDataVirtualHardDisks() != null) - { - Element dataVirtualHardDisksSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisks"); - for (DataVirtualHardDisk dataVirtualHardDisksItem : roleListItem.getDataVirtualHardDisks()) - { - Element dataVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisk"); - dataVirtualHardDisksSequenceElement.appendChild(dataVirtualHardDiskElement); - - if (dataVirtualHardDisksItem.getHostCaching() != null) - { - Element hostCachingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); - hostCachingElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getHostCaching().toString())); - dataVirtualHardDiskElement.appendChild(hostCachingElement); - } - - if (dataVirtualHardDisksItem.getDiskLabel() != null) - { - Element diskLabelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); - diskLabelElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskLabel())); - dataVirtualHardDiskElement.appendChild(diskLabelElement); - } - - if (dataVirtualHardDisksItem.getDiskName() != null) - { - Element diskNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); - diskNameElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskName())); - dataVirtualHardDiskElement.appendChild(diskNameElement); - } - - if (dataVirtualHardDisksItem.getLogicalUnitNumber() != null) - { - Element lunElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Lun"); - lunElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalUnitNumber()))); - dataVirtualHardDiskElement.appendChild(lunElement); - } - - Element logicalDiskSizeInGBElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB"); - logicalDiskSizeInGBElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalDiskSizeInGB()))); - dataVirtualHardDiskElement.appendChild(logicalDiskSizeInGBElement); - - if (dataVirtualHardDisksItem.getMediaLink() != null) - { - Element mediaLinkElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); - mediaLinkElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getMediaLink().toString())); - dataVirtualHardDiskElement.appendChild(mediaLinkElement); - } - } - roleElement.appendChild(dataVirtualHardDisksSequenceElement); - } - - if (roleListItem.getLabel() != null) - { - Element labelElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Label"); - labelElement2.appendChild(requestDoc.createTextNode(roleListItem.getLabel())); - roleElement.appendChild(labelElement2); } - - if (roleListItem.getOSVirtualHardDisk() != null) + persistentVMRoleElement.appendChild(configurationSetsSequenceElement); + } + + if (parameters.getAvailabilitySetName() != null) + { + Element availabilitySetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AvailabilitySetName"); + availabilitySetNameElement.appendChild(requestDoc.createTextNode(parameters.getAvailabilitySetName())); + persistentVMRoleElement.appendChild(availabilitySetNameElement); + } + + if (parameters.getDataVirtualHardDisks() != null) + { + Element dataVirtualHardDisksSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisks"); + for (DataVirtualHardDisk dataVirtualHardDisksItem : parameters.getDataVirtualHardDisks()) { - Element oSVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OSVirtualHardDisk"); - roleElement.appendChild(oSVirtualHardDiskElement); + Element dataVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisk"); + dataVirtualHardDisksSequenceElement.appendChild(dataVirtualHardDiskElement); - if (roleListItem.getOSVirtualHardDisk().getHostCaching() != null) + if (dataVirtualHardDisksItem.getHostCaching() != null) { - Element hostCachingElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); - hostCachingElement2.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getHostCaching().toString())); - oSVirtualHardDiskElement.appendChild(hostCachingElement2); + Element hostCachingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); + hostCachingElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getHostCaching().toString())); + dataVirtualHardDiskElement.appendChild(hostCachingElement); } - if (roleListItem.getOSVirtualHardDisk().getDiskLabel() != null) + if (dataVirtualHardDisksItem.getDiskLabel() != null) { - Element diskLabelElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); - diskLabelElement2.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getDiskLabel())); - oSVirtualHardDiskElement.appendChild(diskLabelElement2); + Element diskLabelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); + diskLabelElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskLabel())); + dataVirtualHardDiskElement.appendChild(diskLabelElement); } - if (roleListItem.getOSVirtualHardDisk().getDiskName() != null) + if (dataVirtualHardDisksItem.getDiskName() != null) { - Element diskNameElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); - diskNameElement2.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getDiskName())); - oSVirtualHardDiskElement.appendChild(diskNameElement2); + Element diskNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); + diskNameElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskName())); + dataVirtualHardDiskElement.appendChild(diskNameElement); } - if (roleListItem.getOSVirtualHardDisk().getMediaLink() != null) + if (dataVirtualHardDisksItem.getLogicalUnitNumber() != null) { - Element mediaLinkElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); - mediaLinkElement2.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getMediaLink().toString())); - oSVirtualHardDiskElement.appendChild(mediaLinkElement2); + Element lunElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Lun"); + lunElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalUnitNumber()))); + dataVirtualHardDiskElement.appendChild(lunElement); } - if (roleListItem.getOSVirtualHardDisk().getSourceImageName() != null) - { - Element sourceImageNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SourceImageName"); - sourceImageNameElement.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getSourceImageName())); - oSVirtualHardDiskElement.appendChild(sourceImageNameElement); - } + Element logicalDiskSizeInGBElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB"); + logicalDiskSizeInGBElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalDiskSizeInGB()))); + dataVirtualHardDiskElement.appendChild(logicalDiskSizeInGBElement); - if (roleListItem.getOSVirtualHardDisk().getOperatingSystem() != null) + if (dataVirtualHardDisksItem.getMediaLink() != null) { - Element osElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OS"); - osElement.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getOperatingSystem())); - oSVirtualHardDiskElement.appendChild(osElement); + Element mediaLinkElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); + mediaLinkElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getMediaLink().toString())); + dataVirtualHardDiskElement.appendChild(mediaLinkElement); } } + persistentVMRoleElement.appendChild(dataVirtualHardDisksSequenceElement); + } + + if (parameters.getOSVirtualHardDisk() != null) + { + Element oSVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OSVirtualHardDisk"); + persistentVMRoleElement.appendChild(oSVirtualHardDiskElement); - if (roleListItem.getRoleSize() != null) + if (parameters.getOSVirtualHardDisk().getHostCaching() != null) { - Element roleSizeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleSize"); - roleSizeElement.appendChild(requestDoc.createTextNode(roleListItem.getRoleSize().toString())); - roleElement.appendChild(roleSizeElement); + Element hostCachingElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); + hostCachingElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getHostCaching().toString())); + oSVirtualHardDiskElement.appendChild(hostCachingElement2); } - if (roleListItem.getDefaultWinRmCertificateThumbprint() != null) + if (parameters.getOSVirtualHardDisk().getDiskLabel() != null) { - Element defaultWinRmCertificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DefaultWinRmCertificateThumbprint"); - defaultWinRmCertificateThumbprintElement.appendChild(requestDoc.createTextNode(roleListItem.getDefaultWinRmCertificateThumbprint())); - roleElement.appendChild(defaultWinRmCertificateThumbprintElement); + Element diskLabelElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); + diskLabelElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getDiskLabel())); + oSVirtualHardDiskElement.appendChild(diskLabelElement2); } - } - deploymentElement.appendChild(roleListSequenceElement); - - if (parameters.getVirtualNetworkName() != null) - { - Element virtualNetworkNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "VirtualNetworkName"); - virtualNetworkNameElement.appendChild(requestDoc.createTextNode(parameters.getVirtualNetworkName())); - deploymentElement.appendChild(virtualNetworkNameElement); - } - - if (parameters.getDnsSettings() != null) - { - Element dnsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Dns"); - deploymentElement.appendChild(dnsElement); - if (parameters.getDnsSettings().getDnsServers() != null) + if (parameters.getOSVirtualHardDisk().getDiskName() != null) { - Element dnsServersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DnsServers"); - for (DnsServer dnsServersItem : parameters.getDnsSettings().getDnsServers()) - { - Element dnsServerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DnsServer"); - dnsServersSequenceElement.appendChild(dnsServerElement); - - if (dnsServersItem.getName() != null) - { - Element nameElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); - nameElement3.appendChild(requestDoc.createTextNode(dnsServersItem.getName())); - dnsServerElement.appendChild(nameElement3); - } - - if (dnsServersItem.getAddress() != null) - { - Element addressElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Address"); - addressElement.appendChild(requestDoc.createTextNode(dnsServersItem.getAddress().toString())); - dnsServerElement.appendChild(addressElement); - } - } - dnsElement.appendChild(dnsServersSequenceElement); + Element diskNameElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); + diskNameElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getDiskName())); + oSVirtualHardDiskElement.appendChild(diskNameElement2); + } + + if (parameters.getOSVirtualHardDisk().getMediaLink() != null) + { + Element mediaLinkElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); + mediaLinkElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getMediaLink().toString())); + oSVirtualHardDiskElement.appendChild(mediaLinkElement2); + } + + if (parameters.getOSVirtualHardDisk().getSourceImageName() != null) + { + Element sourceImageNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SourceImageName"); + sourceImageNameElement.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getSourceImageName())); + oSVirtualHardDiskElement.appendChild(sourceImageNameElement); + } + + if (parameters.getOSVirtualHardDisk().getOperatingSystem() != null) + { + Element osElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OS"); + osElement.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getOperatingSystem())); + oSVirtualHardDiskElement.appendChild(osElement); } } - if (parameters.getReservedIPName() != null) + if (parameters.getRoleSize() != null) { - Element reservedIPNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ReservedIPName"); - reservedIPNameElement.appendChild(requestDoc.createTextNode(parameters.getReservedIPName())); - deploymentElement.appendChild(reservedIPNameElement); + Element roleSizeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleSize"); + roleSizeElement.appendChild(requestDoc.createTextNode(parameters.getRoleSize())); + persistentVMRoleElement.appendChild(roleSizeElement); } DOMSource domSource = new DOMSource(requestDoc); @@ -1699,95 +1540,230 @@ public OperationResponse beginCreatingDeployment(String serviceName, VirtualMach // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** - * The Delete Role operation deletes the specified virtual machine. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157184.aspx for + * The Create Virtual Machine Deployment operation provisions a virtual + * machine based on the supplied configuration. When you create a + * deployment of a virtual machine, you should make sure that the cloud + * service and the disk or image that you use are located in the same + * region. For example, if the cloud service was created in the West US + * region, the disk or image that you use should also be located in a + * stor4age account in the West US region. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157194.aspx for * more information) * * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to delete. - * @param deleteFromStorage Optional. Specifies that the source blob(s) for - * the virtual machine should also be deleted from storage. + * @param parameters Parameters supplied to the Create Virtual Machine + * Deployment operation. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public Future beginDeletingAsync(final String serviceName, final String deploymentName, final String virtualMachineName, final boolean deleteFromStorage) + public Future beginCreatingDeploymentAsync(final String serviceName, final VirtualMachineCreateDeploymentParameters parameters) { return this.getClient().getExecutorService().submit(new Callable() { @Override public OperationResponse call() throws Exception { - return beginDeleting(serviceName, deploymentName, virtualMachineName, deleteFromStorage); + return beginCreatingDeployment(serviceName, parameters); } }); } /** - * The Delete Role operation deletes the specified virtual machine. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157184.aspx for + * The Create Virtual Machine Deployment operation provisions a virtual + * machine based on the supplied configuration. When you create a + * deployment of a virtual machine, you should make sure that the cloud + * service and the disk or image that you use are located in the same + * region. For example, if the cloud service was created in the West US + * region, the disk or image that you use should also be located in a + * stor4age account in the West US region. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157194.aspx for * more information) * * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to delete. - * @param deleteFromStorage Optional. Specifies that the source blob(s) for - * the virtual machine should also be deleted from storage. + * @param parameters Parameters supplied to the Create Virtual Machine + * Deployment operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginDeleting(String serviceName, String deploymentName, String virtualMachineName, boolean deleteFromStorage) throws IOException, ServiceException + public OperationResponse beginCreatingDeployment(String serviceName, VirtualMachineCreateDeploymentParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) { throw new NullPointerException("serviceName"); } - if (deploymentName == null) + if (parameters == null) { - throw new NullPointerException("deploymentName"); + throw new NullPointerException("parameters"); } - if (virtualMachineName == null) + if (parameters.getLabel() == null) { - throw new NullPointerException("virtualMachineName"); + throw new NullPointerException("parameters.Label"); + } + if (parameters.getLabel().length() > 100) + { + throw new IllegalArgumentException("parameters.Label"); + } + if (parameters.getName() == null) + { + throw new NullPointerException("parameters.Name"); + } + if (parameters.getRoles() == null) + { + throw new NullPointerException("parameters.Roles"); + } + if (parameters.getRoles() != null) + { + for (Role rolesParameterItem : parameters.getRoles()) + { + if (rolesParameterItem.getConfigurationSets() != null) + { + for (ConfigurationSet configurationSetsParameterItem : rolesParameterItem.getConfigurationSets()) + { + if (configurationSetsParameterItem.getDomainJoin() != null) + { + if (configurationSetsParameterItem.getDomainJoin().getCredentials() != null) + { + if (configurationSetsParameterItem.getDomainJoin().getCredentials().getPassword() == null) + { + throw new NullPointerException("parameters.Roles.ConfigurationSets.DomainJoin.Credentials.Password"); + } + if (configurationSetsParameterItem.getDomainJoin().getCredentials().getUserName() == null) + { + throw new NullPointerException("parameters.Roles.ConfigurationSets.DomainJoin.Credentials.UserName"); + } + } + } + if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() < 1) + { + throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.HostName"); + } + if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() > 64) + { + throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.HostName"); + } + if (configurationSetsParameterItem.getSshSettings() != null) + { + if (configurationSetsParameterItem.getSshSettings().getKeyPairs() != null) + { + for (SshSettingKeyPair keyPairsParameterItem : configurationSetsParameterItem.getSshSettings().getKeyPairs()) + { + if (keyPairsParameterItem.getFingerprint() == null) + { + throw new NullPointerException("parameters.Roles.ConfigurationSets.SshSettings.KeyPairs.Fingerprint"); + } + if (keyPairsParameterItem.getPath() == null) + { + throw new NullPointerException("parameters.Roles.ConfigurationSets.SshSettings.KeyPairs.Path"); + } + } + } + if (configurationSetsParameterItem.getSshSettings().getPublicKeys() != null) + { + for (SshSettingPublicKey publicKeysParameterItem : configurationSetsParameterItem.getSshSettings().getPublicKeys()) + { + if (publicKeysParameterItem.getFingerprint() == null) + { + throw new NullPointerException("parameters.Roles.ConfigurationSets.SshSettings.PublicKeys.Fingerprint"); + } + if (publicKeysParameterItem.getPath() == null) + { + throw new NullPointerException("parameters.Roles.ConfigurationSets.SshSettings.PublicKeys.Path"); + } + } + } + } + if (configurationSetsParameterItem.getStoredCertificateSettings() != null) + { + for (StoredCertificateSettings storedCertificateSettingsParameterItem : configurationSetsParameterItem.getStoredCertificateSettings()) + { + if (storedCertificateSettingsParameterItem.getStoreName() == null) + { + throw new NullPointerException("parameters.Roles.ConfigurationSets.StoredCertificateSettings.StoreName"); + } + if (storedCertificateSettingsParameterItem.getThumbprint() == null) + { + throw new NullPointerException("parameters.Roles.ConfigurationSets.StoredCertificateSettings.Thumbprint"); + } + } + } + if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() < 1) + { + throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.UserName"); + } + if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() > 32) + { + throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.UserName"); + } + if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() < 6 && (configurationSetsParameterItem.isDisableSshPasswordAuthentication() == false || configurationSetsParameterItem.getUserPassword().length() != 0)) + { + throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.UserPassword"); + } + if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() > 72) + { + throw new IllegalArgumentException("parameters.Roles.ConfigurationSets.UserPassword"); + } + } + } + } } // Tracing @@ -1798,261 +1774,18 @@ public OperationResponse beginDeleting(String serviceName, String deploymentName invocationId = Long.toString(CloudTracing.getNextInvocationId()); HashMap tracingParameters = new HashMap(); tracingParameters.put("serviceName", serviceName); - tracingParameters.put("deploymentName", deploymentName); - tracingParameters.put("virtualMachineName", virtualMachineName); - tracingParameters.put("deleteFromStorage", deleteFromStorage); - CloudTracing.enter(invocationId, this, "beginDeletingAsync", tracingParameters); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "beginCreatingDeploymentAsync", tracingParameters); } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roles/" + virtualMachineName + "?"; - if (deleteFromStorage == true) - { - url = url + "&comp=" + URLEncoder.encode("media", "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments"; // Create HTTP transport objects - CustomHttpDelete httpRequest = new CustomHttpDelete(url); + HttpPost httpRequest = new HttpPost(url); // Set Headers - httpRequest.setHeader("x-ms-version", "2013-11-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); - if (shouldTrace) - { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - 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); - } - return result; - } - - /** - * The Restart role operation restarts the specified virtual machine. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157197.aspx for - * more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to restart. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public Future beginRestartingAsync(final String serviceName, final String deploymentName, final String virtualMachineName) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public OperationResponse call() throws Exception - { - return beginRestarting(serviceName, deploymentName, virtualMachineName); - } - }); - } - - /** - * The Restart role operation restarts the specified virtual machine. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157197.aspx for - * more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to restart. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public OperationResponse beginRestarting(String serviceName, String deploymentName, String virtualMachineName) throws UnsupportedEncodingException, IOException, ServiceException - { - // Validate - if (serviceName == null) - { - throw new NullPointerException("serviceName"); - } - if (deploymentName == null) - { - throw new NullPointerException("deploymentName"); - } - if (virtualMachineName == null) - { - throw new NullPointerException("virtualMachineName"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serviceName", serviceName); - tracingParameters.put("deploymentName", deploymentName); - tracingParameters.put("virtualMachineName", virtualMachineName); - CloudTracing.enter(invocationId, this, "beginRestartingAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roleinstances/" + virtualMachineName + "/Operations"; - - // Create HTTP transport objects - HttpPost httpRequest = new HttpPost(url); - - // Set Headers - httpRequest.setHeader("Content-Type", "application/xml"); - httpRequest.setHeader("x-ms-version", "2013-11-01"); - - // Serialize Request - String requestContent = null; - requestContent = "RestartRoleOperation"; - StringEntity entity = new StringEntity(requestContent); - httpRequest.setEntity(entity); - httpRequest.setHeader("Content-Type", "application/xml"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); - if (shouldTrace) - { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - 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); - } - return result; - } - - /** - * The Shutdown Role operation shuts down the specified virtual machine. - * (see http://msdn.microsoft.com/en-us/library/windowsazure/jj157195.aspx - * for more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to shutdown. - * @param parameters The parameters for the shutdown vm operation. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public Future beginShutdownAsync(final String serviceName, final String deploymentName, final String virtualMachineName, final VirtualMachineShutdownParameters parameters) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public OperationResponse call() throws Exception - { - return beginShutdown(serviceName, deploymentName, virtualMachineName, parameters); - } - }); - } - - /** - * The Shutdown Role operation shuts down the specified virtual machine. - * (see http://msdn.microsoft.com/en-us/library/windowsazure/jj157195.aspx - * for more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to shutdown. - * @param parameters The parameters for the shutdown vm operation. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public OperationResponse beginShutdown(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineShutdownParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException - { - // Validate - if (serviceName == null) - { - throw new NullPointerException("serviceName"); - } - if (deploymentName == null) - { - throw new NullPointerException("deploymentName"); - } - if (virtualMachineName == null) - { - throw new NullPointerException("virtualMachineName"); - } - if (parameters == null) - { - throw new NullPointerException("parameters"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serviceName", serviceName); - tracingParameters.put("deploymentName", deploymentName); - tracingParameters.put("virtualMachineName", virtualMachineName); - tracingParameters.put("parameters", parameters); - CloudTracing.enter(invocationId, this, "beginShutdownAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roleinstances/" + virtualMachineName + "/Operations"; - - // Create HTTP transport objects - HttpPost httpRequest = new HttpPost(url); - - // Set Headers - httpRequest.setHeader("Content-Type", "application/xml"); + httpRequest.setHeader("Content-Type", "application/xml"); httpRequest.setHeader("x-ms-version", "2013-11-01"); // Serialize Request @@ -2061,1177 +1794,1515 @@ public OperationResponse beginShutdown(String serviceName, String deploymentName DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document requestDoc = documentBuilder.newDocument(); - Element shutdownRoleOperationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ShutdownRoleOperation"); - requestDoc.appendChild(shutdownRoleOperationElement); + Element deploymentElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Deployment"); + requestDoc.appendChild(deploymentElement); - Element operationTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OperationType"); - operationTypeElement.appendChild(requestDoc.createTextNode("ShutdownRoleOperation")); - shutdownRoleOperationElement.appendChild(operationTypeElement); + Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); + nameElement.appendChild(requestDoc.createTextNode(parameters.getName())); + deploymentElement.appendChild(nameElement); - Element postShutdownActionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PostShutdownAction"); - postShutdownActionElement.appendChild(requestDoc.createTextNode(parameters.getPostShutdownAction().toString())); - shutdownRoleOperationElement.appendChild(postShutdownActionElement); + Element deploymentSlotElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DeploymentSlot"); + deploymentSlotElement.appendChild(requestDoc.createTextNode(parameters.getDeploymentSlot().toString())); + deploymentElement.appendChild(deploymentSlotElement); - DOMSource domSource = new DOMSource(requestDoc); - StringWriter stringWriter = new StringWriter(); - StreamResult streamResult = new StreamResult(stringWriter); - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - transformer.transform(domSource, streamResult); - requestContent = stringWriter.toString(); - StringEntity entity = new StringEntity(requestContent); - httpRequest.setEntity(entity); - httpRequest.setHeader("Content-Type", "application/xml"); + Element labelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Label"); + labelElement.appendChild(requestDoc.createTextNode(new String(Base64.encodeBase64(parameters.getLabel().getBytes())))); + deploymentElement.appendChild(labelElement); - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + Element roleListSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleList"); + for (Role roleListItem : parameters.getRoles()) { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); - if (shouldTrace) + Element roleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Role"); + roleListSequenceElement.appendChild(roleElement); + + if (roleListItem.getRoleName() != null) { - CloudTracing.error(invocationId, ex); + Element roleNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleName"); + roleNameElement.appendChild(requestDoc.createTextNode(roleListItem.getRoleName())); + roleElement.appendChild(roleNameElement); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - 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); - } - return result; - } - - /** - * The Shutdown Roles operation stops the specified set of virtual machines. - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param parameters The set of virtual machine roles to shutdown and their - * post shutdown state. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public Future beginShuttingDownRolesAsync(final String serviceName, final String deploymentName, final VirtualMachineShutdownRolesParameters parameters) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public OperationResponse call() throws Exception - { - return beginShuttingDownRoles(serviceName, deploymentName, parameters); - } - }); - } - - /** - * The Shutdown Roles operation stops the specified set of virtual machines. - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param parameters The set of virtual machine roles to shutdown and their - * post shutdown state. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public OperationResponse beginShuttingDownRoles(String serviceName, String deploymentName, VirtualMachineShutdownRolesParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException - { - // Validate - if (serviceName == null) - { - throw new NullPointerException("serviceName"); - } - if (deploymentName == null) - { - throw new NullPointerException("deploymentName"); - } - if (parameters == null) - { - throw new NullPointerException("parameters"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serviceName", serviceName); - tracingParameters.put("deploymentName", deploymentName); - tracingParameters.put("parameters", parameters); - CloudTracing.enter(invocationId, this, "beginShuttingDownRolesAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/Roles/Operations"; - - // Create HTTP transport objects - HttpPost httpRequest = new HttpPost(url); - - // Set Headers - httpRequest.setHeader("Content-Type", "application/xml"); - httpRequest.setHeader("x-ms-version", "2013-11-01"); - - // Serialize Request - String requestContent = null; - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document requestDoc = documentBuilder.newDocument(); - - Element shutdownRolesOperationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ShutdownRolesOperation"); - requestDoc.appendChild(shutdownRolesOperationElement); - - Element operationTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OperationType"); - operationTypeElement.appendChild(requestDoc.createTextNode("ShutdownRolesOperation")); - shutdownRolesOperationElement.appendChild(operationTypeElement); - - if (parameters.getRoles() != null) - { - Element rolesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Roles"); - for (String rolesItem : parameters.getRoles()) - { - Element rolesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); - rolesItemElement.appendChild(requestDoc.createTextNode(rolesItem)); - rolesSequenceElement.appendChild(rolesItemElement); - } - shutdownRolesOperationElement.appendChild(rolesSequenceElement); - } - - if (parameters.getPostShutdownAction() != null) - { - Element postShutdownActionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PostShutdownAction"); - postShutdownActionElement.appendChild(requestDoc.createTextNode(parameters.getPostShutdownAction().toString())); - shutdownRolesOperationElement.appendChild(postShutdownActionElement); - } - - DOMSource domSource = new DOMSource(requestDoc); - StringWriter stringWriter = new StringWriter(); - StreamResult streamResult = new StreamResult(stringWriter); - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - transformer.transform(domSource, streamResult); - requestContent = stringWriter.toString(); - StringEntity entity = new StringEntity(requestContent); - httpRequest.setEntity(entity); - httpRequest.setHeader("Content-Type", "application/xml"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); - if (shouldTrace) + + if (roleListItem.getOSVersion() != null) { - CloudTracing.error(invocationId, ex); + Element osVersionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OsVersion"); + osVersionElement.appendChild(requestDoc.createTextNode(roleListItem.getOSVersion())); + roleElement.appendChild(osVersionElement); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - 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); - } - return result; - } - - /** - * The Start Role operation starts the specified virtual machine. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157189.aspx for - * more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to start. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public Future beginStartingAsync(final String serviceName, final String deploymentName, final String virtualMachineName) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public OperationResponse call() throws Exception + + if (roleListItem.getRoleType() != null) { - return beginStarting(serviceName, deploymentName, virtualMachineName); + Element roleTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleType"); + roleTypeElement.appendChild(requestDoc.createTextNode(roleListItem.getRoleType())); + roleElement.appendChild(roleTypeElement); } - }); - } - - /** - * The Start Role operation starts the specified virtual machine. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157189.aspx for - * more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to start. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public OperationResponse beginStarting(String serviceName, String deploymentName, String virtualMachineName) throws UnsupportedEncodingException, IOException, ServiceException - { - // Validate - if (serviceName == null) - { - throw new NullPointerException("serviceName"); - } - if (deploymentName == null) - { - throw new NullPointerException("deploymentName"); - } - if (virtualMachineName == null) - { - throw new NullPointerException("virtualMachineName"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serviceName", serviceName); - tracingParameters.put("deploymentName", deploymentName); - tracingParameters.put("virtualMachineName", virtualMachineName); - CloudTracing.enter(invocationId, this, "beginStartingAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roleinstances/" + virtualMachineName + "/Operations"; - - // Create HTTP transport objects - HttpPost httpRequest = new HttpPost(url); - - // Set Headers - httpRequest.setHeader("Content-Type", "application/xml"); - httpRequest.setHeader("x-ms-version", "2013-11-01"); - - // Serialize Request - String requestContent = null; - requestContent = "StartRoleOperation"; - StringEntity entity = new StringEntity(requestContent); - httpRequest.setEntity(entity); - httpRequest.setHeader("Content-Type", "application/xml"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); - if (shouldTrace) + + if (roleListItem.getConfigurationSets() != null) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - 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); - } - return result; - } - - /** - * The Start Roles operation starts the specified set of virtual machines. - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param parameters The set of virtual machine roles to start. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public Future beginStartingRolesAsync(final String serviceName, final String deploymentName, final VirtualMachineStartRolesParameters parameters) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public OperationResponse call() throws Exception - { - return beginStartingRoles(serviceName, deploymentName, parameters); - } - }); - } - - /** - * The Start Roles operation starts the specified set of virtual machines. - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param parameters The set of virtual machine roles to start. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public OperationResponse beginStartingRoles(String serviceName, String deploymentName, VirtualMachineStartRolesParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException - { - // Validate - if (serviceName == null) - { - throw new NullPointerException("serviceName"); - } - if (deploymentName == null) - { - throw new NullPointerException("deploymentName"); - } - if (parameters == null) - { - throw new NullPointerException("parameters"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serviceName", serviceName); - tracingParameters.put("deploymentName", deploymentName); - tracingParameters.put("parameters", parameters); - CloudTracing.enter(invocationId, this, "beginStartingRolesAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/Roles/Operations"; - - // Create HTTP transport objects - HttpPost httpRequest = new HttpPost(url); - - // Set Headers - httpRequest.setHeader("Content-Type", "application/xml"); - httpRequest.setHeader("x-ms-version", "2013-11-01"); - - // Serialize Request - String requestContent = null; - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document requestDoc = documentBuilder.newDocument(); - - Element startRolesOperationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StartRolesOperation"); - requestDoc.appendChild(startRolesOperationElement); - - Element operationTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OperationType"); - operationTypeElement.appendChild(requestDoc.createTextNode("StartRolesOperation")); - startRolesOperationElement.appendChild(operationTypeElement); - - if (parameters.getRoles() != null) - { - Element rolesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Roles"); - for (String rolesItem : parameters.getRoles()) - { - Element rolesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); - rolesItemElement.appendChild(requestDoc.createTextNode(rolesItem)); - rolesSequenceElement.appendChild(rolesItemElement); - } - startRolesOperationElement.appendChild(rolesSequenceElement); - } - - DOMSource domSource = new DOMSource(requestDoc); - StringWriter stringWriter = new StringWriter(); - StreamResult streamResult = new StreamResult(stringWriter); - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - transformer.transform(domSource, streamResult); - requestContent = stringWriter.toString(); - StringEntity entity = new StringEntity(requestContent); - httpRequest.setEntity(entity); - httpRequest.setHeader("Content-Type", "application/xml"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); - if (shouldTrace) - { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - 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); - } - return result; - } - - /** - * The Update Role operation adds a virtual machine to an existing - * deployment. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157187.aspx for - * more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of your virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine - * operation. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public Future beginUpdatingAsync(final String serviceName, final String deploymentName, final String virtualMachineName, final VirtualMachineUpdateParameters parameters) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public OperationResponse call() throws Exception - { - return beginUpdating(serviceName, deploymentName, virtualMachineName, parameters); - } - }); - } - - /** - * The Update Role operation adds a virtual machine to an existing - * deployment. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157187.aspx for - * more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of your virtual machine. - * @param parameters Parameters supplied to the Update Virtual Machine - * operation. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public OperationResponse beginUpdating(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException - { - // Validate - if (serviceName == null) - { - throw new NullPointerException("serviceName"); - } - if (deploymentName == null) - { - throw new NullPointerException("deploymentName"); - } - if (virtualMachineName == null) - { - throw new NullPointerException("virtualMachineName"); - } - if (parameters == null) - { - throw new NullPointerException("parameters"); - } - if (parameters.getConfigurationSets() != null) - { - for (ConfigurationSet configurationSetsParameterItem : parameters.getConfigurationSets()) - { - if (configurationSetsParameterItem.getDomainJoin() != null) + Element configurationSetsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSets"); + for (ConfigurationSet configurationSetsItem : roleListItem.getConfigurationSets()) { - if (configurationSetsParameterItem.getDomainJoin().getCredentials() != null) + Element configurationSetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSet"); + configurationSetsSequenceElement.appendChild(configurationSetElement); + + if (configurationSetsItem.getConfigurationSetType() != null) { - if (configurationSetsParameterItem.getDomainJoin().getCredentials().getPassword() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.DomainJoin.Credentials.Password"); - } - if (configurationSetsParameterItem.getDomainJoin().getCredentials().getUserName() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.DomainJoin.Credentials.UserName"); - } + Element configurationSetTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSetType"); + configurationSetTypeElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getConfigurationSetType())); + configurationSetElement.appendChild(configurationSetTypeElement); } - } - if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() < 1) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.HostName"); - } - if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() > 64) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.HostName"); - } - if (configurationSetsParameterItem.getSshSettings() != null) - { - if (configurationSetsParameterItem.getSshSettings().getKeyPairs() != null) + + if (configurationSetsItem.getInputEndpoints() != null) { - for (SshSettingKeyPair keyPairsParameterItem : configurationSetsParameterItem.getSshSettings().getKeyPairs()) + Element inputEndpointsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoints"); + for (InputEndpoint inputEndpointsItem : configurationSetsItem.getInputEndpoints()) { - if (keyPairsParameterItem.getFingerprint() == null) + Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); + inputEndpointsSequenceElement.appendChild(inputEndpointElement); + + if (inputEndpointsItem.getLoadBalancedEndpointSetName() != null) { - throw new NullPointerException("parameters.ConfigurationSets.SshSettings.KeyPairs.Fingerprint"); + Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); + loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancedEndpointSetName())); + inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); } - if (keyPairsParameterItem.getPath() == null) + + if (inputEndpointsItem.getLocalPort() != null) { - throw new NullPointerException("parameters.ConfigurationSets.SshSettings.KeyPairs.Path"); + Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); + localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLocalPort()))); + inputEndpointElement.appendChild(localPortElement); } - } - } - if (configurationSetsParameterItem.getSshSettings().getPublicKeys() != null) - { - for (SshSettingPublicKey publicKeysParameterItem : configurationSetsParameterItem.getSshSettings().getPublicKeys()) - { - if (publicKeysParameterItem.getFingerprint() == null) + + if (inputEndpointsItem.getName() != null) { - throw new NullPointerException("parameters.ConfigurationSets.SshSettings.PublicKeys.Fingerprint"); + Element nameElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); + nameElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getName())); + inputEndpointElement.appendChild(nameElement2); } - if (publicKeysParameterItem.getPath() == null) + + if (inputEndpointsItem.getPort() != null) { - throw new NullPointerException("parameters.ConfigurationSets.SshSettings.PublicKeys.Path"); + Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getPort()))); + inputEndpointElement.appendChild(portElement); } - } - } - } - if (configurationSetsParameterItem.getStoredCertificateSettings() != null) - { - for (StoredCertificateSettings storedCertificateSettingsParameterItem : configurationSetsParameterItem.getStoredCertificateSettings()) - { - if (storedCertificateSettingsParameterItem.getStoreName() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.StoredCertificateSettings.StoreName"); - } - if (storedCertificateSettingsParameterItem.getThumbprint() == null) - { - throw new NullPointerException("parameters.ConfigurationSets.StoredCertificateSettings.Thumbprint"); - } - } - } - if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() < 1) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.UserName"); - } - if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() > 32) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.UserName"); - } - if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() < 6 && (configurationSetsParameterItem.getDisableSshPasswordAuthentication() == false || configurationSetsParameterItem.getUserPassword().length() != 0)) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.UserPassword"); - } - if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() > 72) - { - throw new IllegalArgumentException("parameters.ConfigurationSets.UserPassword"); - } - } - } - if (parameters.getOSVirtualHardDisk() == null) - { - throw new NullPointerException("parameters.OSVirtualHardDisk"); - } - if (parameters.getRoleName() == null) - { - throw new NullPointerException("parameters.RoleName"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serviceName", serviceName); - tracingParameters.put("deploymentName", deploymentName); - tracingParameters.put("virtualMachineName", virtualMachineName); - tracingParameters.put("parameters", parameters); - CloudTracing.enter(invocationId, this, "beginUpdatingAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roles/" + virtualMachineName; - - // Create HTTP transport objects - HttpPut httpRequest = new HttpPut(url); - - // Set Headers - httpRequest.setHeader("Content-Type", "application/xml"); - httpRequest.setHeader("x-ms-version", "2013-11-01"); - - // Serialize Request - String requestContent = null; - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document requestDoc = documentBuilder.newDocument(); - - Element persistentVMRoleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PersistentVMRole"); - requestDoc.appendChild(persistentVMRoleElement); - - Element roleNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleName"); - roleNameElement.appendChild(requestDoc.createTextNode(parameters.getRoleName())); - persistentVMRoleElement.appendChild(roleNameElement); - - Element roleTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleType"); - roleTypeElement.appendChild(requestDoc.createTextNode("PersistentVMRole")); - persistentVMRoleElement.appendChild(roleTypeElement); - - if (parameters.getConfigurationSets() != null) - { - Element configurationSetsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSets"); - for (ConfigurationSet configurationSetsItem : parameters.getConfigurationSets()) - { - Element configurationSetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSet"); - configurationSetsSequenceElement.appendChild(configurationSetElement); - - if (configurationSetsItem.getConfigurationSetType() != null) - { - Element configurationSetTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSetType"); - configurationSetTypeElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getConfigurationSetType())); - configurationSetElement.appendChild(configurationSetTypeElement); - } - - if (configurationSetsItem.getInputEndpoints() != null) - { - Element inputEndpointsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoints"); - for (InputEndpoint inputEndpointsItem : configurationSetsItem.getInputEndpoints()) - { - Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); - inputEndpointsSequenceElement.appendChild(inputEndpointElement); - - if (inputEndpointsItem.getLoadBalancedEndpointSetName() != null) - { - Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); - loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancedEndpointSetName())); - inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); - } - - if (inputEndpointsItem.getLocalPort() != null) - { - Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); - localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLocalPort()))); - inputEndpointElement.appendChild(localPortElement); - } - - if (inputEndpointsItem.getName() != null) - { - Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); - nameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getName())); - inputEndpointElement.appendChild(nameElement); - } - - if (inputEndpointsItem.getPort() != null) - { - Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getPort()))); - inputEndpointElement.appendChild(portElement); - } - - if (inputEndpointsItem.getLoadBalancerProbe() != null) - { - Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); - inputEndpointElement.appendChild(loadBalancerProbeElement); - if (inputEndpointsItem.getLoadBalancerProbe().getPath() != null) + if (inputEndpointsItem.getLoadBalancerProbe() != null) { - Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancerProbe().getPath())); - loadBalancerProbeElement.appendChild(pathElement); + Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); + inputEndpointElement.appendChild(loadBalancerProbeElement); + + if (inputEndpointsItem.getLoadBalancerProbe().getPath() != null) + { + Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancerProbe().getPath())); + loadBalancerProbeElement.appendChild(pathElement); + } + + Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement2.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getPort()))); + loadBalancerProbeElement.appendChild(portElement2); + + Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(inputEndpointsItem.getLoadBalancerProbe().getProtocol()))); + loadBalancerProbeElement.appendChild(protocolElement); + + if (inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) + { + Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); + intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); + loadBalancerProbeElement.appendChild(intervalInSecondsElement); + } + + if (inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) + { + Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); + timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); + loadBalancerProbeElement.appendChild(timeoutInSecondsElement); + } } - Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement2.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getPort()))); - loadBalancerProbeElement.appendChild(portElement2); - - Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(inputEndpointsItem.getLoadBalancerProbe().getProtocol()))); - loadBalancerProbeElement.appendChild(protocolElement); + if (inputEndpointsItem.getProtocol() != null) + { + Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getProtocol())); + inputEndpointElement.appendChild(protocolElement2); + } - if (inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) + if (inputEndpointsItem.getVirtualIPAddress() != null) { - Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); - intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); - loadBalancerProbeElement.appendChild(intervalInSecondsElement); + Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); + vipElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getVirtualIPAddress().toString())); + inputEndpointElement.appendChild(vipElement); } - if (inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) + if (inputEndpointsItem.isEnableDirectServerReturn() != null) { - Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); - timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); - loadBalancerProbeElement.appendChild(timeoutInSecondsElement); + Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); + enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(inputEndpointsItem.isEnableDirectServerReturn()).toLowerCase())); + inputEndpointElement.appendChild(enableDirectServerReturnElement); } - } - - if (inputEndpointsItem.getProtocol() != null) - { - Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getProtocol())); - inputEndpointElement.appendChild(protocolElement2); - } - - if (inputEndpointsItem.getVirtualIPAddress() != null) - { - Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); - vipElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getVirtualIPAddress().toString())); - inputEndpointElement.appendChild(vipElement); - } - - if (inputEndpointsItem.getEnableDirectServerReturn() != null) - { - Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); - enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(inputEndpointsItem.getEnableDirectServerReturn()).toLowerCase())); - inputEndpointElement.appendChild(enableDirectServerReturnElement); - } - - if (inputEndpointsItem.getEndpointAcl() != null) - { - Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); - inputEndpointElement.appendChild(endpointAclElement); - if (inputEndpointsItem.getEndpointAcl().getRules() != null) + if (inputEndpointsItem.getEndpointAcl() != null) { - Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); - for (AccessControlListRule rulesItem : inputEndpointsItem.getEndpointAcl().getRules()) + Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); + inputEndpointElement.appendChild(endpointAclElement); + + if (inputEndpointsItem.getEndpointAcl().getRules() != null) { - Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); - rulesSequenceElement.appendChild(ruleElement); - - if (rulesItem.getOrder() != null) - { - Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); - orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); - ruleElement.appendChild(orderElement); - } - - if (rulesItem.getAction() != null) - { - Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); - actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); - ruleElement.appendChild(actionElement); - } - - if (rulesItem.getRemoteSubnet() != null) + Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); + for (AccessControlListRule rulesItem : inputEndpointsItem.getEndpointAcl().getRules()) { - Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); - remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); - ruleElement.appendChild(remoteSubnetElement); - } - - if (rulesItem.getDescription() != null) - { - Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); - descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); - ruleElement.appendChild(descriptionElement); + Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); + rulesSequenceElement.appendChild(ruleElement); + + if (rulesItem.getOrder() != null) + { + Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); + orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); + ruleElement.appendChild(orderElement); + } + + if (rulesItem.getAction() != null) + { + Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); + actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); + ruleElement.appendChild(actionElement); + } + + if (rulesItem.getRemoteSubnet() != null) + { + Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); + remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); + ruleElement.appendChild(remoteSubnetElement); + } + + if (rulesItem.getDescription() != null) + { + Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); + descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); + ruleElement.appendChild(descriptionElement); + } } + endpointAclElement.appendChild(rulesSequenceElement); } - endpointAclElement.appendChild(rulesSequenceElement); } } + configurationSetElement.appendChild(inputEndpointsSequenceElement); } - configurationSetElement.appendChild(inputEndpointsSequenceElement); - } - - if (configurationSetsItem.getSubnetNames() != null) - { - Element subnetNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetNames"); - for (String subnetNamesItem : configurationSetsItem.getSubnetNames()) - { - Element subnetNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetName"); - subnetNamesItemElement.appendChild(requestDoc.createTextNode(subnetNamesItem)); - subnetNamesSequenceElement.appendChild(subnetNamesItemElement); - } - configurationSetElement.appendChild(subnetNamesSequenceElement); - } - - if (configurationSetsItem.getComputerName() != null) - { - Element computerNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ComputerName"); - computerNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getComputerName())); - configurationSetElement.appendChild(computerNameElement); - } - - if (configurationSetsItem.getAdminPassword() != null) - { - Element adminPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminPassword"); - adminPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminPassword())); - configurationSetElement.appendChild(adminPasswordElement); - } - - if (configurationSetsItem.getResetPasswordOnFirstLogon() != null) - { - Element resetPasswordOnFirstLogonElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ResetPasswordOnFirstLogon"); - resetPasswordOnFirstLogonElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.getResetPasswordOnFirstLogon()).toLowerCase())); - configurationSetElement.appendChild(resetPasswordOnFirstLogonElement); - } - - if (configurationSetsItem.getEnableAutomaticUpdates() != null) - { - Element enableAutomaticUpdatesElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableAutomaticUpdates"); - enableAutomaticUpdatesElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.getEnableAutomaticUpdates()).toLowerCase())); - configurationSetElement.appendChild(enableAutomaticUpdatesElement); - } - - if (configurationSetsItem.getTimeZone() != null) - { - Element timeZoneElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeZone"); - timeZoneElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getTimeZone())); - configurationSetElement.appendChild(timeZoneElement); - } - - if (configurationSetsItem.getDomainJoin() != null) - { - Element domainJoinElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DomainJoin"); - configurationSetElement.appendChild(domainJoinElement); - if (configurationSetsItem.getDomainJoin().getCredentials() != null) + if (configurationSetsItem.getSubnetNames() != null) { - Element credentialsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Credentials"); - domainJoinElement.appendChild(credentialsElement); - - if (configurationSetsItem.getDomainJoin().getCredentials().getDomain() != null) + Element subnetNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetNames"); + for (String subnetNamesItem : configurationSetsItem.getSubnetNames()) { - Element domainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Domain"); - domainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getDomain())); - credentialsElement.appendChild(domainElement); + Element subnetNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetName"); + subnetNamesItemElement.appendChild(requestDoc.createTextNode(subnetNamesItem)); + subnetNamesSequenceElement.appendChild(subnetNamesItemElement); } - - Element usernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Username"); - usernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getUserName())); - credentialsElement.appendChild(usernameElement); - - Element passwordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Password"); - passwordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getPassword())); - credentialsElement.appendChild(passwordElement); + configurationSetElement.appendChild(subnetNamesSequenceElement); } - if (configurationSetsItem.getDomainJoin().getDomainToJoin() != null) + if (configurationSetsItem.getStaticVirtualNetworkIPAddress() != null) { - Element joinDomainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "JoinDomain"); - joinDomainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getDomainToJoin())); - domainJoinElement.appendChild(joinDomainElement); + Element staticVirtualNetworkIPAddressElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StaticVirtualNetworkIPAddress"); + staticVirtualNetworkIPAddressElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getStaticVirtualNetworkIPAddress())); + configurationSetElement.appendChild(staticVirtualNetworkIPAddressElement); } - if (configurationSetsItem.getDomainJoin().getLdapMachineObjectOU() != null) + if (configurationSetsItem.getComputerName() != null) { - Element machineObjectOUElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MachineObjectOU"); - machineObjectOUElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getLdapMachineObjectOU())); - domainJoinElement.appendChild(machineObjectOUElement); + Element computerNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ComputerName"); + computerNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getComputerName())); + configurationSetElement.appendChild(computerNameElement); } - if (configurationSetsItem.getDomainJoin().getProvisioning() != null) + if (configurationSetsItem.getAdminPassword() != null) { - Element provisioningElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Provisioning"); - domainJoinElement.appendChild(provisioningElement); - - if (configurationSetsItem.getDomainJoin().getProvisioning().getAccountData() != null) - { - Element accountDataElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AccountData"); - accountDataElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getProvisioning().getAccountData())); - provisioningElement.appendChild(accountDataElement); - } + Element adminPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminPassword"); + adminPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminPassword())); + configurationSetElement.appendChild(adminPasswordElement); } - } - - if (configurationSetsItem.getStoredCertificateSettings() != null) - { - Element storedCertificateSettingsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoredCertificateSettings"); - for (StoredCertificateSettings storedCertificateSettingsItem : configurationSetsItem.getStoredCertificateSettings()) + + if (configurationSetsItem.isResetPasswordOnFirstLogon() != null) { - Element certificateSettingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateSetting"); - storedCertificateSettingsSequenceElement.appendChild(certificateSettingElement); - - Element storeLocationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreLocation"); - storeLocationElement.appendChild(requestDoc.createTextNode("LocalMachine")); - certificateSettingElement.appendChild(storeLocationElement); - - Element storeNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreName"); - storeNameElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getStoreName())); - certificateSettingElement.appendChild(storeNameElement); - - Element thumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Thumbprint"); - thumbprintElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getThumbprint())); - certificateSettingElement.appendChild(thumbprintElement); + Element resetPasswordOnFirstLogonElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ResetPasswordOnFirstLogon"); + resetPasswordOnFirstLogonElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.isResetPasswordOnFirstLogon()).toLowerCase())); + configurationSetElement.appendChild(resetPasswordOnFirstLogonElement); } - configurationSetElement.appendChild(storedCertificateSettingsSequenceElement); - } - - if (configurationSetsItem.getWindowsRemoteManagement() != null) - { - Element winRMElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "WinRM"); - configurationSetElement.appendChild(winRMElement); - if (configurationSetsItem.getWindowsRemoteManagement().getListeners() != null) + if (configurationSetsItem.isEnableAutomaticUpdates() != null) { - Element listenersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listeners"); - for (WindowsRemoteManagementListener listenersItem : configurationSetsItem.getWindowsRemoteManagement().getListeners()) + Element enableAutomaticUpdatesElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableAutomaticUpdates"); + enableAutomaticUpdatesElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.isEnableAutomaticUpdates()).toLowerCase())); + configurationSetElement.appendChild(enableAutomaticUpdatesElement); + } + + if (configurationSetsItem.getTimeZone() != null) + { + Element timeZoneElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeZone"); + timeZoneElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getTimeZone())); + configurationSetElement.appendChild(timeZoneElement); + } + + if (configurationSetsItem.getDomainJoin() != null) + { + Element domainJoinElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DomainJoin"); + configurationSetElement.appendChild(domainJoinElement); + + if (configurationSetsItem.getDomainJoin().getCredentials() != null) { - Element listenerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listener"); - listenersSequenceElement.appendChild(listenerElement); + Element credentialsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Credentials"); + domainJoinElement.appendChild(credentialsElement); - Element protocolElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement3.appendChild(requestDoc.createTextNode(listenersItem.getListenerType().toString())); - listenerElement.appendChild(protocolElement3); + if (configurationSetsItem.getDomainJoin().getCredentials().getDomain() != null) + { + Element domainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Domain"); + domainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getDomain())); + credentialsElement.appendChild(domainElement); + } - if (listenersItem.getCertificateThumbprint() != null) + Element usernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Username"); + usernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getUserName())); + credentialsElement.appendChild(usernameElement); + + Element passwordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Password"); + passwordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getPassword())); + credentialsElement.appendChild(passwordElement); + } + + if (configurationSetsItem.getDomainJoin().getDomainToJoin() != null) + { + Element joinDomainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "JoinDomain"); + joinDomainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getDomainToJoin())); + domainJoinElement.appendChild(joinDomainElement); + } + + if (configurationSetsItem.getDomainJoin().getLdapMachineObjectOU() != null) + { + Element machineObjectOUElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MachineObjectOU"); + machineObjectOUElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getLdapMachineObjectOU())); + domainJoinElement.appendChild(machineObjectOUElement); + } + + if (configurationSetsItem.getDomainJoin().getProvisioning() != null) + { + Element provisioningElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Provisioning"); + domainJoinElement.appendChild(provisioningElement); + + if (configurationSetsItem.getDomainJoin().getProvisioning().getAccountData() != null) { - Element certificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateThumbprint"); - certificateThumbprintElement.appendChild(requestDoc.createTextNode(listenersItem.getCertificateThumbprint())); - listenerElement.appendChild(certificateThumbprintElement); + Element accountDataElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AccountData"); + accountDataElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getProvisioning().getAccountData())); + provisioningElement.appendChild(accountDataElement); } } - winRMElement.appendChild(listenersSequenceElement); } - } - - if (configurationSetsItem.getAdminUserName() != null) - { - Element adminUsernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminUsername"); - adminUsernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminUserName())); - configurationSetElement.appendChild(adminUsernameElement); - } - - if (configurationSetsItem.getHostName() != null) - { - Element hostNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostName"); - hostNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getHostName())); - configurationSetElement.appendChild(hostNameElement); - } - - if (configurationSetsItem.getUserName() != null) - { - Element userNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserName"); - userNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserName())); - configurationSetElement.appendChild(userNameElement); - } - - if (configurationSetsItem.getUserPassword() != null) - { - Element userPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserPassword"); - userPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserPassword())); - configurationSetElement.appendChild(userPasswordElement); - } - - if (configurationSetsItem.getDisableSshPasswordAuthentication() != null) - { - Element disableSshPasswordAuthenticationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DisableSshPasswordAuthentication"); - disableSshPasswordAuthenticationElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.getDisableSshPasswordAuthentication()).toLowerCase())); - configurationSetElement.appendChild(disableSshPasswordAuthenticationElement); - } - - if (configurationSetsItem.getSshSettings() != null) - { - Element sSHElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SSH"); - configurationSetElement.appendChild(sSHElement); - if (configurationSetsItem.getSshSettings().getPublicKeys() != null) + if (configurationSetsItem.getStoredCertificateSettings() != null) { - Element publicKeysSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKeys"); - for (SshSettingPublicKey publicKeysItem : configurationSetsItem.getSshSettings().getPublicKeys()) + Element storedCertificateSettingsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoredCertificateSettings"); + for (StoredCertificateSettings storedCertificateSettingsItem : configurationSetsItem.getStoredCertificateSettings()) { - Element publicKeyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKey"); - publicKeysSequenceElement.appendChild(publicKeyElement); + Element certificateSettingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateSetting"); + storedCertificateSettingsSequenceElement.appendChild(certificateSettingElement); - Element fingerprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); - fingerprintElement.appendChild(requestDoc.createTextNode(publicKeysItem.getFingerprint())); - publicKeyElement.appendChild(fingerprintElement); + Element storeLocationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreLocation"); + storeLocationElement.appendChild(requestDoc.createTextNode("LocalMachine")); + certificateSettingElement.appendChild(storeLocationElement); - Element pathElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement2.appendChild(requestDoc.createTextNode(publicKeysItem.getPath())); - publicKeyElement.appendChild(pathElement2); + Element storeNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreName"); + storeNameElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getStoreName())); + certificateSettingElement.appendChild(storeNameElement); + + Element thumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Thumbprint"); + thumbprintElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getThumbprint())); + certificateSettingElement.appendChild(thumbprintElement); } - sSHElement.appendChild(publicKeysSequenceElement); + configurationSetElement.appendChild(storedCertificateSettingsSequenceElement); } - if (configurationSetsItem.getSshSettings().getKeyPairs() != null) + if (configurationSetsItem.getWindowsRemoteManagement() != null) { - Element keyPairsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPairs"); - for (SshSettingKeyPair keyPairsItem : configurationSetsItem.getSshSettings().getKeyPairs()) + Element winRMElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "WinRM"); + configurationSetElement.appendChild(winRMElement); + + if (configurationSetsItem.getWindowsRemoteManagement().getListeners() != null) { - Element keyPairElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPair"); - keyPairsSequenceElement.appendChild(keyPairElement); - - Element fingerprintElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); - fingerprintElement2.appendChild(requestDoc.createTextNode(keyPairsItem.getFingerprint())); - keyPairElement.appendChild(fingerprintElement2); - - Element pathElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement3.appendChild(requestDoc.createTextNode(keyPairsItem.getPath())); - keyPairElement.appendChild(pathElement3); + Element listenersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listeners"); + for (WindowsRemoteManagementListener listenersItem : configurationSetsItem.getWindowsRemoteManagement().getListeners()) + { + Element listenerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listener"); + listenersSequenceElement.appendChild(listenerElement); + + if (listenersItem.getCertificateThumbprint() != null) + { + Element certificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateThumbprint"); + certificateThumbprintElement.appendChild(requestDoc.createTextNode(listenersItem.getCertificateThumbprint())); + listenerElement.appendChild(certificateThumbprintElement); + } + + Element protocolElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement3.appendChild(requestDoc.createTextNode(listenersItem.getListenerType().toString())); + listenerElement.appendChild(protocolElement3); + } + winRMElement.appendChild(listenersSequenceElement); } - sSHElement.appendChild(keyPairsSequenceElement); } + + if (configurationSetsItem.getAdminUserName() != null) + { + Element adminUsernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminUsername"); + adminUsernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminUserName())); + configurationSetElement.appendChild(adminUsernameElement); + } + + if (configurationSetsItem.getHostName() != null) + { + Element hostNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostName"); + hostNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getHostName())); + configurationSetElement.appendChild(hostNameElement); + } + + if (configurationSetsItem.getUserName() != null) + { + Element userNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserName"); + userNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserName())); + configurationSetElement.appendChild(userNameElement); + } + + if (configurationSetsItem.getUserPassword() != null) + { + Element userPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserPassword"); + userPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserPassword())); + configurationSetElement.appendChild(userPasswordElement); + } + + if (configurationSetsItem.isDisableSshPasswordAuthentication() != null) + { + Element disableSshPasswordAuthenticationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DisableSshPasswordAuthentication"); + disableSshPasswordAuthenticationElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.isDisableSshPasswordAuthentication()).toLowerCase())); + configurationSetElement.appendChild(disableSshPasswordAuthenticationElement); + } + + if (configurationSetsItem.getSshSettings() != null) + { + Element sSHElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SSH"); + configurationSetElement.appendChild(sSHElement); + + if (configurationSetsItem.getSshSettings().getPublicKeys() != null) + { + Element publicKeysSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKeys"); + for (SshSettingPublicKey publicKeysItem : configurationSetsItem.getSshSettings().getPublicKeys()) + { + Element publicKeyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKey"); + publicKeysSequenceElement.appendChild(publicKeyElement); + + Element fingerprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); + fingerprintElement.appendChild(requestDoc.createTextNode(publicKeysItem.getFingerprint())); + publicKeyElement.appendChild(fingerprintElement); + + Element pathElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement2.appendChild(requestDoc.createTextNode(publicKeysItem.getPath())); + publicKeyElement.appendChild(pathElement2); + } + sSHElement.appendChild(publicKeysSequenceElement); + } + + if (configurationSetsItem.getSshSettings().getKeyPairs() != null) + { + Element keyPairsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPairs"); + for (SshSettingKeyPair keyPairsItem : configurationSetsItem.getSshSettings().getKeyPairs()) + { + Element keyPairElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPair"); + keyPairsSequenceElement.appendChild(keyPairElement); + + Element fingerprintElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); + fingerprintElement2.appendChild(requestDoc.createTextNode(keyPairsItem.getFingerprint())); + keyPairElement.appendChild(fingerprintElement2); + + Element pathElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement3.appendChild(requestDoc.createTextNode(keyPairsItem.getPath())); + keyPairElement.appendChild(pathElement3); + } + sSHElement.appendChild(keyPairsSequenceElement); + } + } + } + roleElement.appendChild(configurationSetsSequenceElement); + } + + if (roleListItem.getAvailabilitySetName() != null) + { + Element availabilitySetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AvailabilitySetName"); + availabilitySetNameElement.appendChild(requestDoc.createTextNode(roleListItem.getAvailabilitySetName())); + roleElement.appendChild(availabilitySetNameElement); + } + + if (roleListItem.getDataVirtualHardDisks() != null) + { + Element dataVirtualHardDisksSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisks"); + for (DataVirtualHardDisk dataVirtualHardDisksItem : roleListItem.getDataVirtualHardDisks()) + { + Element dataVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisk"); + dataVirtualHardDisksSequenceElement.appendChild(dataVirtualHardDiskElement); + + if (dataVirtualHardDisksItem.getHostCaching() != null) + { + Element hostCachingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); + hostCachingElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getHostCaching().toString())); + dataVirtualHardDiskElement.appendChild(hostCachingElement); + } + + if (dataVirtualHardDisksItem.getDiskLabel() != null) + { + Element diskLabelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); + diskLabelElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskLabel())); + dataVirtualHardDiskElement.appendChild(diskLabelElement); + } + + if (dataVirtualHardDisksItem.getDiskName() != null) + { + Element diskNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); + diskNameElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskName())); + dataVirtualHardDiskElement.appendChild(diskNameElement); + } + + if (dataVirtualHardDisksItem.getLogicalUnitNumber() != null) + { + Element lunElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Lun"); + lunElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalUnitNumber()))); + dataVirtualHardDiskElement.appendChild(lunElement); + } + + Element logicalDiskSizeInGBElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB"); + logicalDiskSizeInGBElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalDiskSizeInGB()))); + dataVirtualHardDiskElement.appendChild(logicalDiskSizeInGBElement); + + if (dataVirtualHardDisksItem.getMediaLink() != null) + { + Element mediaLinkElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); + mediaLinkElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getMediaLink().toString())); + dataVirtualHardDiskElement.appendChild(mediaLinkElement); + } + } + roleElement.appendChild(dataVirtualHardDisksSequenceElement); + } + + if (roleListItem.getLabel() != null) + { + Element labelElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Label"); + labelElement2.appendChild(requestDoc.createTextNode(roleListItem.getLabel())); + roleElement.appendChild(labelElement2); + } + + if (roleListItem.getOSVirtualHardDisk() != null) + { + Element oSVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OSVirtualHardDisk"); + roleElement.appendChild(oSVirtualHardDiskElement); + + if (roleListItem.getOSVirtualHardDisk().getHostCaching() != null) + { + Element hostCachingElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); + hostCachingElement2.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getHostCaching().toString())); + oSVirtualHardDiskElement.appendChild(hostCachingElement2); + } + + if (roleListItem.getOSVirtualHardDisk().getDiskLabel() != null) + { + Element diskLabelElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); + diskLabelElement2.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getDiskLabel())); + oSVirtualHardDiskElement.appendChild(diskLabelElement2); } + + if (roleListItem.getOSVirtualHardDisk().getDiskName() != null) + { + Element diskNameElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); + diskNameElement2.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getDiskName())); + oSVirtualHardDiskElement.appendChild(diskNameElement2); + } + + if (roleListItem.getOSVirtualHardDisk().getMediaLink() != null) + { + Element mediaLinkElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); + mediaLinkElement2.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getMediaLink().toString())); + oSVirtualHardDiskElement.appendChild(mediaLinkElement2); + } + + if (roleListItem.getOSVirtualHardDisk().getSourceImageName() != null) + { + Element sourceImageNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SourceImageName"); + sourceImageNameElement.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getSourceImageName())); + oSVirtualHardDiskElement.appendChild(sourceImageNameElement); + } + + if (roleListItem.getOSVirtualHardDisk().getOperatingSystem() != null) + { + Element osElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OS"); + osElement.appendChild(requestDoc.createTextNode(roleListItem.getOSVirtualHardDisk().getOperatingSystem())); + oSVirtualHardDiskElement.appendChild(osElement); + } + } + + if (roleListItem.getRoleSize() != null) + { + Element roleSizeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleSize"); + roleSizeElement.appendChild(requestDoc.createTextNode(roleListItem.getRoleSize())); + roleElement.appendChild(roleSizeElement); + } + + if (roleListItem.getDefaultWinRmCertificateThumbprint() != null) + { + Element defaultWinRmCertificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DefaultWinRmCertificateThumbprint"); + defaultWinRmCertificateThumbprintElement.appendChild(requestDoc.createTextNode(roleListItem.getDefaultWinRmCertificateThumbprint())); + roleElement.appendChild(defaultWinRmCertificateThumbprintElement); + } + } + deploymentElement.appendChild(roleListSequenceElement); + + if (parameters.getVirtualNetworkName() != null) + { + Element virtualNetworkNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "VirtualNetworkName"); + virtualNetworkNameElement.appendChild(requestDoc.createTextNode(parameters.getVirtualNetworkName())); + deploymentElement.appendChild(virtualNetworkNameElement); + } + + if (parameters.getDnsSettings() != null) + { + Element dnsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Dns"); + deploymentElement.appendChild(dnsElement); + + if (parameters.getDnsSettings().getDnsServers() != null) + { + Element dnsServersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DnsServers"); + for (DnsServer dnsServersItem : parameters.getDnsSettings().getDnsServers()) + { + Element dnsServerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DnsServer"); + dnsServersSequenceElement.appendChild(dnsServerElement); + + if (dnsServersItem.getName() != null) + { + Element nameElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); + nameElement3.appendChild(requestDoc.createTextNode(dnsServersItem.getName())); + dnsServerElement.appendChild(nameElement3); + } + + if (dnsServersItem.getAddress() != null) + { + Element addressElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Address"); + addressElement.appendChild(requestDoc.createTextNode(dnsServersItem.getAddress().toString())); + dnsServerElement.appendChild(addressElement); + } + } + dnsElement.appendChild(dnsServersSequenceElement); + } + } + + if (parameters.getReservedIPName() != null) + { + Element reservedIPNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ReservedIPName"); + reservedIPNameElement.appendChild(requestDoc.createTextNode(parameters.getReservedIPName())); + deploymentElement.appendChild(reservedIPNameElement); + } + + DOMSource domSource = new DOMSource(requestDoc); + StringWriter stringWriter = new StringWriter(); + StreamResult streamResult = new StreamResult(stringWriter); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + transformer.transform(domSource, streamResult); + requestContent = stringWriter.toString(); + StringEntity entity = new StringEntity(requestContent); + httpRequest.setEntity(entity); + httpRequest.setHeader("Content-Type", "application/xml"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * The Delete Role operation deletes the specified virtual machine. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157184.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to delete. + * @param deleteFromStorage Optional. Specifies that the source blob(s) for + * the virtual machine should also be deleted from storage. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future beginDeletingAsync(final String serviceName, final String deploymentName, final String virtualMachineName, final boolean deleteFromStorage) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception + { + return beginDeleting(serviceName, deploymentName, virtualMachineName, deleteFromStorage); + } + }); + } + + /** + * The Delete Role operation deletes the specified virtual machine. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157184.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to delete. + * @param deleteFromStorage Optional. Specifies that the source blob(s) for + * the virtual machine should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse beginDeleting(String serviceName, String deploymentName, String virtualMachineName, boolean deleteFromStorage) throws IOException, ServiceException + { + // Validate + if (serviceName == null) + { + throw new NullPointerException("serviceName"); + } + if (deploymentName == null) + { + throw new NullPointerException("deploymentName"); + } + if (virtualMachineName == null) + { + throw new NullPointerException("virtualMachineName"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serviceName", serviceName); + tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("virtualMachineName", virtualMachineName); + tracingParameters.put("deleteFromStorage", deleteFromStorage); + CloudTracing.enter(invocationId, this, "beginDeletingAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roles/" + virtualMachineName + "?comp=" + deleteFromStorage; + + // Create HTTP transport objects + CustomHttpDelete httpRequest = new CustomHttpDelete(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * The Restart role operation restarts the specified virtual machine. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157197.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to restart. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future beginRestartingAsync(final String serviceName, final String deploymentName, final String virtualMachineName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception + { + return beginRestarting(serviceName, deploymentName, virtualMachineName); + } + }); + } + + /** + * The Restart role operation restarts the specified virtual machine. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157197.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to restart. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse beginRestarting(String serviceName, String deploymentName, String virtualMachineName) throws IOException, ServiceException + { + // Validate + if (serviceName == null) + { + throw new NullPointerException("serviceName"); + } + if (deploymentName == null) + { + throw new NullPointerException("deploymentName"); + } + if (virtualMachineName == null) + { + throw new NullPointerException("virtualMachineName"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serviceName", serviceName); + tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("virtualMachineName", virtualMachineName); + CloudTracing.enter(invocationId, this, "beginRestartingAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roleinstances/" + virtualMachineName + "/Operations"; + + // Create HTTP transport objects + HttpPost httpRequest = new HttpPost(url); + + // Set Headers + httpRequest.setHeader("Content-Type", "application/xml"); + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Serialize Request + String requestContent = null; + requestContent = "RestartRoleOperation"; + StringEntity entity = new StringEntity(requestContent); + httpRequest.setEntity(entity); + httpRequest.setHeader("Content-Type", "application/xml"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * The Shutdown Role operation shuts down the specified virtual machine. + * (see http://msdn.microsoft.com/en-us/library/windowsazure/jj157195.aspx + * for more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to shutdown. + * @param parameters The parameters for the shutdown vm operation. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future beginShutdownAsync(final String serviceName, final String deploymentName, final String virtualMachineName, final VirtualMachineShutdownParameters parameters) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception + { + return beginShutdown(serviceName, deploymentName, virtualMachineName, parameters); + } + }); + } + + /** + * The Shutdown Role operation shuts down the specified virtual machine. + * (see http://msdn.microsoft.com/en-us/library/windowsazure/jj157195.aspx + * for more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to shutdown. + * @param parameters The parameters for the shutdown vm operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse beginShutdown(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineShutdownParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException + { + // Validate + if (serviceName == null) + { + throw new NullPointerException("serviceName"); + } + if (deploymentName == null) + { + throw new NullPointerException("deploymentName"); + } + if (virtualMachineName == null) + { + throw new NullPointerException("virtualMachineName"); + } + if (parameters == null) + { + throw new NullPointerException("parameters"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serviceName", serviceName); + tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("virtualMachineName", virtualMachineName); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "beginShutdownAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roleinstances/" + virtualMachineName + "/Operations"; + + // Create HTTP transport objects + HttpPost httpRequest = new HttpPost(url); + + // Set Headers + httpRequest.setHeader("Content-Type", "application/xml"); + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Serialize Request + String requestContent = null; + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document requestDoc = documentBuilder.newDocument(); + + Element shutdownRoleOperationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ShutdownRoleOperation"); + requestDoc.appendChild(shutdownRoleOperationElement); + + Element operationTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OperationType"); + operationTypeElement.appendChild(requestDoc.createTextNode("ShutdownRoleOperation")); + shutdownRoleOperationElement.appendChild(operationTypeElement); + + Element postShutdownActionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PostShutdownAction"); + postShutdownActionElement.appendChild(requestDoc.createTextNode(parameters.getPostShutdownAction().toString())); + shutdownRoleOperationElement.appendChild(postShutdownActionElement); + + DOMSource domSource = new DOMSource(requestDoc); + StringWriter stringWriter = new StringWriter(); + StreamResult streamResult = new StreamResult(stringWriter); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + transformer.transform(domSource, streamResult); + requestContent = stringWriter.toString(); + StringEntity entity = new StringEntity(requestContent); + httpRequest.setEntity(entity); + httpRequest.setHeader("Content-Type", "application/xml"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * The Shutdown Roles operation stops the specified set of virtual machines. + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param parameters The set of virtual machine roles to shutdown and their + * post shutdown state. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future beginShuttingDownRolesAsync(final String serviceName, final String deploymentName, final VirtualMachineShutdownRolesParameters parameters) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception + { + return beginShuttingDownRoles(serviceName, deploymentName, parameters); + } + }); + } + + /** + * The Shutdown Roles operation stops the specified set of virtual machines. + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param parameters The set of virtual machine roles to shutdown and their + * post shutdown state. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse beginShuttingDownRoles(String serviceName, String deploymentName, VirtualMachineShutdownRolesParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException + { + // Validate + if (serviceName == null) + { + throw new NullPointerException("serviceName"); + } + if (deploymentName == null) + { + throw new NullPointerException("deploymentName"); + } + if (parameters == null) + { + throw new NullPointerException("parameters"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serviceName", serviceName); + tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "beginShuttingDownRolesAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/Roles/Operations"; + + // Create HTTP transport objects + HttpPost httpRequest = new HttpPost(url); + + // Set Headers + httpRequest.setHeader("Content-Type", "application/xml"); + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Serialize Request + String requestContent = null; + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document requestDoc = documentBuilder.newDocument(); + + Element shutdownRolesOperationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ShutdownRolesOperation"); + requestDoc.appendChild(shutdownRolesOperationElement); + + Element operationTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OperationType"); + operationTypeElement.appendChild(requestDoc.createTextNode("ShutdownRolesOperation")); + shutdownRolesOperationElement.appendChild(operationTypeElement); + + if (parameters.getRoles() != null) + { + Element rolesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Roles"); + for (String rolesItem : parameters.getRoles()) + { + Element rolesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); + rolesItemElement.appendChild(requestDoc.createTextNode(rolesItem)); + rolesSequenceElement.appendChild(rolesItemElement); } - persistentVMRoleElement.appendChild(configurationSetsSequenceElement); + shutdownRolesOperationElement.appendChild(rolesSequenceElement); } - if (parameters.getAvailabilitySetName() != null) + if (parameters.getPostShutdownAction() != null) { - Element availabilitySetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AvailabilitySetName"); - availabilitySetNameElement.appendChild(requestDoc.createTextNode(parameters.getAvailabilitySetName())); - persistentVMRoleElement.appendChild(availabilitySetNameElement); + Element postShutdownActionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PostShutdownAction"); + postShutdownActionElement.appendChild(requestDoc.createTextNode(parameters.getPostShutdownAction().toString())); + shutdownRolesOperationElement.appendChild(postShutdownActionElement); } - if (parameters.getDataVirtualHardDisks() != null) + DOMSource domSource = new DOMSource(requestDoc); + StringWriter stringWriter = new StringWriter(); + StreamResult streamResult = new StreamResult(stringWriter); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + transformer.transform(domSource, streamResult); + requestContent = stringWriter.toString(); + StringEntity entity = new StringEntity(requestContent); + httpRequest.setEntity(entity); + httpRequest.setHeader("Content-Type", "application/xml"); + + // Send Request + HttpResponse httpResponse = null; + try { - Element dataVirtualHardDisksSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisks"); - for (DataVirtualHardDisk dataVirtualHardDisksItem : parameters.getDataVirtualHardDisks()) + if (shouldTrace) { - Element dataVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisk"); - dataVirtualHardDisksSequenceElement.appendChild(dataVirtualHardDiskElement); - - if (dataVirtualHardDisksItem.getHostCaching() != null) - { - Element hostCachingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); - hostCachingElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getHostCaching().toString())); - dataVirtualHardDiskElement.appendChild(hostCachingElement); - } - - if (dataVirtualHardDisksItem.getDiskLabel() != null) - { - Element diskLabelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); - diskLabelElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskLabel())); - dataVirtualHardDiskElement.appendChild(diskLabelElement); - } - - if (dataVirtualHardDisksItem.getDiskName() != null) - { - Element diskNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); - diskNameElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskName())); - dataVirtualHardDiskElement.appendChild(diskNameElement); - } - - if (dataVirtualHardDisksItem.getLogicalUnitNumber() != null) + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - Element lunElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Lun"); - lunElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalUnitNumber()))); - dataVirtualHardDiskElement.appendChild(lunElement); + CloudTracing.error(invocationId, ex); } - - Element logicalDiskSizeInGBElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB"); - logicalDiskSizeInGBElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalDiskSizeInGB()))); - dataVirtualHardDiskElement.appendChild(logicalDiskSizeInGBElement); - - if (dataVirtualHardDisksItem.getMediaLink() != null) + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * The Start Role operation starts the specified virtual machine. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157189.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to start. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future beginStartingAsync(final String serviceName, final String deploymentName, final String virtualMachineName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception + { + return beginStarting(serviceName, deploymentName, virtualMachineName); + } + }); + } + + /** + * The Start Role operation starts the specified virtual machine. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157189.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to start. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse beginStarting(String serviceName, String deploymentName, String virtualMachineName) throws IOException, ServiceException + { + // Validate + if (serviceName == null) + { + throw new NullPointerException("serviceName"); + } + if (deploymentName == null) + { + throw new NullPointerException("deploymentName"); + } + if (virtualMachineName == null) + { + throw new NullPointerException("virtualMachineName"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serviceName", serviceName); + tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("virtualMachineName", virtualMachineName); + CloudTracing.enter(invocationId, this, "beginStartingAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roleinstances/" + virtualMachineName + "/Operations"; + + // Create HTTP transport objects + HttpPost httpRequest = new HttpPost(url); + + // Set Headers + httpRequest.setHeader("Content-Type", "application/xml"); + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Serialize Request + String requestContent = null; + requestContent = "StartRoleOperation"; + StringEntity entity = new StringEntity(requestContent); + httpRequest.setEntity(entity); + httpRequest.setHeader("Content-Type", "application/xml"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - Element mediaLinkElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); - mediaLinkElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getMediaLink().toString())); - dataVirtualHardDiskElement.appendChild(mediaLinkElement); + CloudTracing.error(invocationId, ex); } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * The Start Roles operation starts the specified set of virtual machines. + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param parameters The set of virtual machine roles to start. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future beginStartingRolesAsync(final String serviceName, final String deploymentName, final VirtualMachineStartRolesParameters parameters) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception + { + return beginStartingRoles(serviceName, deploymentName, parameters); } - persistentVMRoleElement.appendChild(dataVirtualHardDisksSequenceElement); - } - - Element oSVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OSVirtualHardDisk"); - persistentVMRoleElement.appendChild(oSVirtualHardDiskElement); - - if (parameters.getOSVirtualHardDisk().getHostCaching() != null) + }); + } + + /** + * The Start Roles operation starts the specified set of virtual machines. + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param parameters The set of virtual machine roles to start. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse beginStartingRoles(String serviceName, String deploymentName, VirtualMachineStartRolesParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException + { + // Validate + if (serviceName == null) { - Element hostCachingElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); - hostCachingElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getHostCaching().toString())); - oSVirtualHardDiskElement.appendChild(hostCachingElement2); + throw new NullPointerException("serviceName"); } - - if (parameters.getOSVirtualHardDisk().getDiskLabel() != null) + if (deploymentName == null) { - Element diskLabelElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); - diskLabelElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getDiskLabel())); - oSVirtualHardDiskElement.appendChild(diskLabelElement2); + throw new NullPointerException("deploymentName"); } - - if (parameters.getOSVirtualHardDisk().getDiskName() != null) + if (parameters == null) { - Element diskNameElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); - diskNameElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getDiskName())); - oSVirtualHardDiskElement.appendChild(diskNameElement2); + throw new NullPointerException("parameters"); } - if (parameters.getOSVirtualHardDisk().getMediaLink() != null) + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) { - Element mediaLinkElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); - mediaLinkElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getMediaLink().toString())); - oSVirtualHardDiskElement.appendChild(mediaLinkElement2); + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serviceName", serviceName); + tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "beginStartingRolesAsync", tracingParameters); } - if (parameters.getOSVirtualHardDisk().getSourceImageName() != null) - { - Element sourceImageNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SourceImageName"); - sourceImageNameElement.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getSourceImageName())); - oSVirtualHardDiskElement.appendChild(sourceImageNameElement); - } + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/Roles/Operations"; - if (parameters.getOSVirtualHardDisk().getOperatingSystem() != null) - { - Element osElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OS"); - osElement.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getOperatingSystem())); - oSVirtualHardDiskElement.appendChild(osElement); - } + // Create HTTP transport objects + HttpPost httpRequest = new HttpPost(url); - if (parameters.getRoleSize() != null) + // Set Headers + httpRequest.setHeader("Content-Type", "application/xml"); + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Serialize Request + String requestContent = null; + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document requestDoc = documentBuilder.newDocument(); + + Element startRolesOperationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StartRolesOperation"); + requestDoc.appendChild(startRolesOperationElement); + + Element operationTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OperationType"); + operationTypeElement.appendChild(requestDoc.createTextNode("StartRolesOperation")); + startRolesOperationElement.appendChild(operationTypeElement); + + if (parameters.getRoles() != null) { - Element roleSizeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleSize"); - roleSizeElement.appendChild(requestDoc.createTextNode(parameters.getRoleSize().toString())); - persistentVMRoleElement.appendChild(roleSizeElement); + Element rolesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Roles"); + for (String rolesItem : parameters.getRoles()) + { + Element rolesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); + rolesItemElement.appendChild(requestDoc.createTextNode(rolesItem)); + rolesSequenceElement.appendChild(rolesItemElement); + } + startRolesOperationElement.appendChild(rolesSequenceElement); } DOMSource domSource = new DOMSource(requestDoc); @@ -3247,82 +3318,104 @@ public OperationResponse beginUpdating(String serviceName, String deploymentName // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** - * The UpdateLoadBalancedEndpointSet operation changes the specified - * load-balanced InputEndpoints on all the roles of an Infrastructure as a - * Service deployment. Non load-balanced endpoints must be changed using - * UpdateRole. + * The Update Role operation adds a virtual machine to an existing + * deployment. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157187.aspx for + * more information) * * @param serviceName The name of your service. * @param deploymentName The name of your deployment. - * @param parameters Parameters supplied to the Update Load Balanced - * Endpoint Set operation. + * @param virtualMachineName The name of your virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine + * operation. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public Future beginUpdatingLoadBalancedEndpointSetAsync(final String serviceName, final String deploymentName, final VirtualMachineUpdateLoadBalancedSetParameters parameters) + public Future beginUpdatingAsync(final String serviceName, final String deploymentName, final String virtualMachineName, final VirtualMachineUpdateParameters parameters) { return this.getClient().getExecutorService().submit(new Callable() { @Override public OperationResponse call() throws Exception { - return beginUpdatingLoadBalancedEndpointSet(serviceName, deploymentName, parameters); + return beginUpdating(serviceName, deploymentName, virtualMachineName, parameters); } }); } /** - * The UpdateLoadBalancedEndpointSet operation changes the specified - * load-balanced InputEndpoints on all the roles of an Infrastructure as a - * Service deployment. Non load-balanced endpoints must be changed using - * UpdateRole. + * The Update Role operation adds a virtual machine to an existing + * deployment. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157187.aspx for + * more information) * * @param serviceName The name of your service. * @param deploymentName The name of your deployment. - * @param parameters Parameters supplied to the Update Load Balanced - * Endpoint Set operation. + * @param virtualMachineName The name of your virtual machine. + * @param parameters Parameters supplied to the Update Virtual Machine + * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse beginUpdatingLoadBalancedEndpointSet(String serviceName, String deploymentName, VirtualMachineUpdateLoadBalancedSetParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse beginUpdating(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -3333,19 +3426,110 @@ public OperationResponse beginUpdatingLoadBalancedEndpointSet(String serviceName { throw new NullPointerException("deploymentName"); } - if (parameters == null) + if (virtualMachineName == null) + { + throw new NullPointerException("virtualMachineName"); + } + if (parameters == null) + { + throw new NullPointerException("parameters"); + } + if (parameters.getConfigurationSets() != null) + { + for (ConfigurationSet configurationSetsParameterItem : parameters.getConfigurationSets()) + { + if (configurationSetsParameterItem.getDomainJoin() != null) + { + if (configurationSetsParameterItem.getDomainJoin().getCredentials() != null) + { + if (configurationSetsParameterItem.getDomainJoin().getCredentials().getPassword() == null) + { + throw new NullPointerException("parameters.ConfigurationSets.DomainJoin.Credentials.Password"); + } + if (configurationSetsParameterItem.getDomainJoin().getCredentials().getUserName() == null) + { + throw new NullPointerException("parameters.ConfigurationSets.DomainJoin.Credentials.UserName"); + } + } + } + if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() < 1) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.HostName"); + } + if (configurationSetsParameterItem.getHostName() != null && configurationSetsParameterItem.getHostName().length() > 64) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.HostName"); + } + if (configurationSetsParameterItem.getSshSettings() != null) + { + if (configurationSetsParameterItem.getSshSettings().getKeyPairs() != null) + { + for (SshSettingKeyPair keyPairsParameterItem : configurationSetsParameterItem.getSshSettings().getKeyPairs()) + { + if (keyPairsParameterItem.getFingerprint() == null) + { + throw new NullPointerException("parameters.ConfigurationSets.SshSettings.KeyPairs.Fingerprint"); + } + if (keyPairsParameterItem.getPath() == null) + { + throw new NullPointerException("parameters.ConfigurationSets.SshSettings.KeyPairs.Path"); + } + } + } + if (configurationSetsParameterItem.getSshSettings().getPublicKeys() != null) + { + for (SshSettingPublicKey publicKeysParameterItem : configurationSetsParameterItem.getSshSettings().getPublicKeys()) + { + if (publicKeysParameterItem.getFingerprint() == null) + { + throw new NullPointerException("parameters.ConfigurationSets.SshSettings.PublicKeys.Fingerprint"); + } + if (publicKeysParameterItem.getPath() == null) + { + throw new NullPointerException("parameters.ConfigurationSets.SshSettings.PublicKeys.Path"); + } + } + } + } + if (configurationSetsParameterItem.getStoredCertificateSettings() != null) + { + for (StoredCertificateSettings storedCertificateSettingsParameterItem : configurationSetsParameterItem.getStoredCertificateSettings()) + { + if (storedCertificateSettingsParameterItem.getStoreName() == null) + { + throw new NullPointerException("parameters.ConfigurationSets.StoredCertificateSettings.StoreName"); + } + if (storedCertificateSettingsParameterItem.getThumbprint() == null) + { + throw new NullPointerException("parameters.ConfigurationSets.StoredCertificateSettings.Thumbprint"); + } + } + } + if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() < 1) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.UserName"); + } + if (configurationSetsParameterItem.getUserName() != null && configurationSetsParameterItem.getUserName().length() > 32) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.UserName"); + } + if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() < 6 && (configurationSetsParameterItem.isDisableSshPasswordAuthentication() == false || configurationSetsParameterItem.getUserPassword().length() != 0)) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.UserPassword"); + } + if (configurationSetsParameterItem.getUserPassword() != null && configurationSetsParameterItem.getUserPassword().length() > 72) + { + throw new IllegalArgumentException("parameters.ConfigurationSets.UserPassword"); + } + } + } + if (parameters.getOSVirtualHardDisk() == null) { - throw new NullPointerException("parameters"); + throw new NullPointerException("parameters.OSVirtualHardDisk"); } - if (parameters.getLoadBalancedEndpoints() != null) + if (parameters.getRoleName() == null) { - for (VirtualMachineUpdateLoadBalancedSetParameters.InputEndpoint loadBalancedEndpointsParameterItem : parameters.getLoadBalancedEndpoints()) - { - if (loadBalancedEndpointsParameterItem.getLoadBalancedEndpointSetName() == null) - { - throw new NullPointerException("parameters.LoadBalancedEndpoints.LoadBalancedEndpointSetName"); - } - } + throw new NullPointerException("parameters.RoleName"); } // Tracing @@ -3357,15 +3541,16 @@ public OperationResponse beginUpdatingLoadBalancedEndpointSet(String serviceName HashMap tracingParameters = new HashMap(); tracingParameters.put("serviceName", serviceName); tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("virtualMachineName", virtualMachineName); tracingParameters.put("parameters", parameters); - CloudTracing.enter(invocationId, this, "beginUpdatingLoadBalancedEndpointSetAsync", tracingParameters); + CloudTracing.enter(invocationId, this, "beginUpdatingAsync", tracingParameters); } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "?comp=UpdateLbSet"; + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roles/" + virtualMachineName; // Create HTTP transport objects - HttpPost httpRequest = new HttpPost(url); + HttpPut httpRequest = new HttpPut(url); // Set Headers httpRequest.setHeader("Content-Type", "application/xml"); @@ -3377,792 +3562,820 @@ public OperationResponse beginUpdatingLoadBalancedEndpointSet(String serviceName DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document requestDoc = documentBuilder.newDocument(); - Element loadBalancedEndpointListElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointList"); - requestDoc.appendChild(loadBalancedEndpointListElement); + Element persistentVMRoleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PersistentVMRole"); + requestDoc.appendChild(persistentVMRoleElement); - if (parameters.getLoadBalancedEndpoints() != null) + Element roleNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleName"); + roleNameElement.appendChild(requestDoc.createTextNode(parameters.getRoleName())); + persistentVMRoleElement.appendChild(roleNameElement); + + Element roleTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleType"); + roleTypeElement.appendChild(requestDoc.createTextNode("PersistentVMRole")); + persistentVMRoleElement.appendChild(roleTypeElement); + + if (parameters.getConfigurationSets() != null) { - for (VirtualMachineUpdateLoadBalancedSetParameters.InputEndpoint loadBalancedEndpointsItem : parameters.getLoadBalancedEndpoints()) + Element configurationSetsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSets"); + for (ConfigurationSet configurationSetsItem : parameters.getConfigurationSets()) { - Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); - loadBalancedEndpointListElement.appendChild(inputEndpointElement); + Element configurationSetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSet"); + configurationSetsSequenceElement.appendChild(configurationSetElement); - Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); - loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getLoadBalancedEndpointSetName())); - inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); + if (configurationSetsItem.getConfigurationSetType() != null) + { + Element configurationSetTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSetType"); + configurationSetTypeElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getConfigurationSetType())); + configurationSetElement.appendChild(configurationSetTypeElement); + } - if (loadBalancedEndpointsItem.getLocalPort() != null) + if (configurationSetsItem.getInputEndpoints() != null) { - Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); - localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getLocalPort()))); - inputEndpointElement.appendChild(localPortElement); + Element inputEndpointsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoints"); + for (InputEndpoint inputEndpointsItem : configurationSetsItem.getInputEndpoints()) + { + Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); + inputEndpointsSequenceElement.appendChild(inputEndpointElement); + + if (inputEndpointsItem.getLoadBalancedEndpointSetName() != null) + { + Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); + loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancedEndpointSetName())); + inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); + } + + if (inputEndpointsItem.getLocalPort() != null) + { + Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); + localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLocalPort()))); + inputEndpointElement.appendChild(localPortElement); + } + + if (inputEndpointsItem.getName() != null) + { + Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); + nameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getName())); + inputEndpointElement.appendChild(nameElement); + } + + if (inputEndpointsItem.getPort() != null) + { + Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getPort()))); + inputEndpointElement.appendChild(portElement); + } + + if (inputEndpointsItem.getLoadBalancerProbe() != null) + { + Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); + inputEndpointElement.appendChild(loadBalancerProbeElement); + + if (inputEndpointsItem.getLoadBalancerProbe().getPath() != null) + { + Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancerProbe().getPath())); + loadBalancerProbeElement.appendChild(pathElement); + } + + Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement2.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getPort()))); + loadBalancerProbeElement.appendChild(portElement2); + + Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(inputEndpointsItem.getLoadBalancerProbe().getProtocol()))); + loadBalancerProbeElement.appendChild(protocolElement); + + if (inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) + { + Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); + intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); + loadBalancerProbeElement.appendChild(intervalInSecondsElement); + } + + if (inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) + { + Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); + timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); + loadBalancerProbeElement.appendChild(timeoutInSecondsElement); + } + } + + if (inputEndpointsItem.getProtocol() != null) + { + Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getProtocol())); + inputEndpointElement.appendChild(protocolElement2); + } + + if (inputEndpointsItem.getVirtualIPAddress() != null) + { + Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); + vipElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getVirtualIPAddress().toString())); + inputEndpointElement.appendChild(vipElement); + } + + if (inputEndpointsItem.isEnableDirectServerReturn() != null) + { + Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); + enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(inputEndpointsItem.isEnableDirectServerReturn()).toLowerCase())); + inputEndpointElement.appendChild(enableDirectServerReturnElement); + } + + if (inputEndpointsItem.getEndpointAcl() != null) + { + Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); + inputEndpointElement.appendChild(endpointAclElement); + + if (inputEndpointsItem.getEndpointAcl().getRules() != null) + { + Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); + for (AccessControlListRule rulesItem : inputEndpointsItem.getEndpointAcl().getRules()) + { + Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); + rulesSequenceElement.appendChild(ruleElement); + + if (rulesItem.getOrder() != null) + { + Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); + orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); + ruleElement.appendChild(orderElement); + } + + if (rulesItem.getAction() != null) + { + Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); + actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); + ruleElement.appendChild(actionElement); + } + + if (rulesItem.getRemoteSubnet() != null) + { + Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); + remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); + ruleElement.appendChild(remoteSubnetElement); + } + + if (rulesItem.getDescription() != null) + { + Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); + descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); + ruleElement.appendChild(descriptionElement); + } + } + endpointAclElement.appendChild(rulesSequenceElement); + } + } + } + configurationSetElement.appendChild(inputEndpointsSequenceElement); } - if (loadBalancedEndpointsItem.getName() != null) + if (configurationSetsItem.getSubnetNames() != null) { - Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); - nameElement.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getName())); - inputEndpointElement.appendChild(nameElement); + Element subnetNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetNames"); + for (String subnetNamesItem : configurationSetsItem.getSubnetNames()) + { + Element subnetNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetName"); + subnetNamesItemElement.appendChild(requestDoc.createTextNode(subnetNamesItem)); + subnetNamesSequenceElement.appendChild(subnetNamesItemElement); + } + configurationSetElement.appendChild(subnetNamesSequenceElement); } - if (loadBalancedEndpointsItem.getPort() != null) + if (configurationSetsItem.getStaticVirtualNetworkIPAddress() != null) { - Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getPort()))); - inputEndpointElement.appendChild(portElement); + Element staticVirtualNetworkIPAddressElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StaticVirtualNetworkIPAddress"); + staticVirtualNetworkIPAddressElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getStaticVirtualNetworkIPAddress())); + configurationSetElement.appendChild(staticVirtualNetworkIPAddressElement); } - if (loadBalancedEndpointsItem.getLoadBalancerProbe() != null) + if (configurationSetsItem.getComputerName() != null) { - Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); - inputEndpointElement.appendChild(loadBalancerProbeElement); - - if (loadBalancedEndpointsItem.getLoadBalancerProbe().getPath() != null) - { - Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getLoadBalancerProbe().getPath())); - loadBalancerProbeElement.appendChild(pathElement); - } - - Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement2.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getLoadBalancerProbe().getPort()))); - loadBalancerProbeElement.appendChild(portElement2); - - Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(loadBalancedEndpointsItem.getLoadBalancerProbe().getProtocol()))); - loadBalancerProbeElement.appendChild(protocolElement); - - if (loadBalancedEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) - { - Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); - intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); - loadBalancerProbeElement.appendChild(intervalInSecondsElement); - } - - if (loadBalancedEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) - { - Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); - timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); - loadBalancerProbeElement.appendChild(timeoutInSecondsElement); - } + Element computerNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ComputerName"); + computerNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getComputerName())); + configurationSetElement.appendChild(computerNameElement); } - if (loadBalancedEndpointsItem.getProtocol() != null) + if (configurationSetsItem.getAdminPassword() != null) { - Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement2.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getProtocol())); - inputEndpointElement.appendChild(protocolElement2); + Element adminPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminPassword"); + adminPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminPassword())); + configurationSetElement.appendChild(adminPasswordElement); } - if (loadBalancedEndpointsItem.getVirtualIPAddress() != null) + if (configurationSetsItem.isResetPasswordOnFirstLogon() != null) { - Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); - vipElement.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getVirtualIPAddress().toString())); - inputEndpointElement.appendChild(vipElement); + Element resetPasswordOnFirstLogonElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ResetPasswordOnFirstLogon"); + resetPasswordOnFirstLogonElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.isResetPasswordOnFirstLogon()).toLowerCase())); + configurationSetElement.appendChild(resetPasswordOnFirstLogonElement); } - if (loadBalancedEndpointsItem.getEnableDirectServerReturn() != null) + if (configurationSetsItem.isEnableAutomaticUpdates() != null) { - Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); - enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(loadBalancedEndpointsItem.getEnableDirectServerReturn()).toLowerCase())); - inputEndpointElement.appendChild(enableDirectServerReturnElement); + Element enableAutomaticUpdatesElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableAutomaticUpdates"); + enableAutomaticUpdatesElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.isEnableAutomaticUpdates()).toLowerCase())); + configurationSetElement.appendChild(enableAutomaticUpdatesElement); } - Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); - inputEndpointElement.appendChild(endpointAclElement); + if (configurationSetsItem.getTimeZone() != null) + { + Element timeZoneElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeZone"); + timeZoneElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getTimeZone())); + configurationSetElement.appendChild(timeZoneElement); + } - if (loadBalancedEndpointsItem.getRules() != null) + if (configurationSetsItem.getDomainJoin() != null) { - Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); - for (AccessControlListRule rulesItem : loadBalancedEndpointsItem.getRules()) + Element domainJoinElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DomainJoin"); + configurationSetElement.appendChild(domainJoinElement); + + if (configurationSetsItem.getDomainJoin().getCredentials() != null) { - Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); - rulesSequenceElement.appendChild(ruleElement); + Element credentialsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Credentials"); + domainJoinElement.appendChild(credentialsElement); - if (rulesItem.getOrder() != null) + if (configurationSetsItem.getDomainJoin().getCredentials().getDomain() != null) { - Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); - orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); - ruleElement.appendChild(orderElement); + Element domainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Domain"); + domainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getDomain())); + credentialsElement.appendChild(domainElement); } - if (rulesItem.getAction() != null) - { - Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); - actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); - ruleElement.appendChild(actionElement); - } + Element usernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Username"); + usernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getUserName())); + credentialsElement.appendChild(usernameElement); - if (rulesItem.getRemoteSubnet() != null) - { - Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); - remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); - ruleElement.appendChild(remoteSubnetElement); - } + Element passwordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Password"); + passwordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getCredentials().getPassword())); + credentialsElement.appendChild(passwordElement); + } + + if (configurationSetsItem.getDomainJoin().getDomainToJoin() != null) + { + Element joinDomainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "JoinDomain"); + joinDomainElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getDomainToJoin())); + domainJoinElement.appendChild(joinDomainElement); + } + + if (configurationSetsItem.getDomainJoin().getLdapMachineObjectOU() != null) + { + Element machineObjectOUElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MachineObjectOU"); + machineObjectOUElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getLdapMachineObjectOU())); + domainJoinElement.appendChild(machineObjectOUElement); + } + + if (configurationSetsItem.getDomainJoin().getProvisioning() != null) + { + Element provisioningElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Provisioning"); + domainJoinElement.appendChild(provisioningElement); - if (rulesItem.getDescription() != null) + if (configurationSetsItem.getDomainJoin().getProvisioning().getAccountData() != null) { - Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); - descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); - ruleElement.appendChild(descriptionElement); + Element accountDataElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AccountData"); + accountDataElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getDomainJoin().getProvisioning().getAccountData())); + provisioningElement.appendChild(accountDataElement); } } - endpointAclElement.appendChild(rulesSequenceElement); } - } - } - - DOMSource domSource = new DOMSource(requestDoc); - StringWriter stringWriter = new StringWriter(); - StreamResult streamResult = new StreamResult(stringWriter); - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - transformer.transform(domSource, streamResult); - requestContent = stringWriter.toString(); - StringEntity entity = new StringEntity(requestContent); - httpRequest.setEntity(entity); - httpRequest.setHeader("Content-Type", "application/xml"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); - if (shouldTrace) - { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - 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); - } - return result; - } - - /** - * The Capture Role operation creates a copy of the operating system virtual - * hard disk (VHD) that is deployed in the virtual machine, saves the VHD - * copy in the same storage location as the operating system VHD, and - * registers the copy as an image in your image gallery. From the captured - * image, you can create additional customized virtual machines. For more - * information about images and disks, see Manage Disks and Images. For - * more information about capturing images, see How to Capture an Image of - * a Virtual Machine Running Windows Server 2008 R2 or How to Capture an - * Image of a Virtual Machine Running Linux. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157201.aspx for - * more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to restart. - * @param parameters Parameters supplied to the Capture Virtual Machine - * operation. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public Future captureAsync(final String serviceName, final String deploymentName, final String virtualMachineName, final VirtualMachineCaptureParameters parameters) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public OperationResponse call() throws Exception - { - return capture(serviceName, deploymentName, virtualMachineName, parameters); - } - }); - } - - /** - * The Capture Role operation creates a copy of the operating system virtual - * hard disk (VHD) that is deployed in the virtual machine, saves the VHD - * copy in the same storage location as the operating system VHD, and - * registers the copy as an image in your image gallery. From the captured - * image, you can create additional customized virtual machines. For more - * information about images and disks, see Manage Disks and Images. For - * more information about capturing images, see How to Capture an Image of - * a Virtual Machine Running Windows Server 2008 R2 or How to Capture an - * Image of a Virtual Machine Running Linux. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/jj157201.aspx for - * more information) - * - * @param serviceName The name of your service. - * @param deploymentName The name of your deployment. - * @param virtualMachineName The name of the virtual machine to restart. - * @param parameters Parameters supplied to the Capture Virtual Machine - * operation. - * @return A standard service response including an HTTP status code and - * request ID. - */ - @Override - public OperationResponse capture(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineCaptureParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException - { - // Validate - if (serviceName == null) - { - throw new NullPointerException("serviceName"); - } - if (deploymentName == null) - { - throw new NullPointerException("deploymentName"); - } - if (virtualMachineName == null) - { - throw new NullPointerException("virtualMachineName"); - } - if (parameters == null) - { - throw new NullPointerException("parameters"); - } - if (parameters.getProvisioningConfiguration() != null) - { - if (parameters.getProvisioningConfiguration().getDomainJoin() != null) - { - if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials() != null) + + if (configurationSetsItem.getStoredCertificateSettings() != null) { - if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getPassword() == null) - { - throw new NullPointerException("parameters.ProvisioningConfiguration.DomainJoin.Credentials.Password"); - } - if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getUserName() == null) + Element storedCertificateSettingsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoredCertificateSettings"); + for (StoredCertificateSettings storedCertificateSettingsItem : configurationSetsItem.getStoredCertificateSettings()) { - throw new NullPointerException("parameters.ProvisioningConfiguration.DomainJoin.Credentials.UserName"); + Element certificateSettingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateSetting"); + storedCertificateSettingsSequenceElement.appendChild(certificateSettingElement); + + Element storeLocationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreLocation"); + storeLocationElement.appendChild(requestDoc.createTextNode("LocalMachine")); + certificateSettingElement.appendChild(storeLocationElement); + + Element storeNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreName"); + storeNameElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getStoreName())); + certificateSettingElement.appendChild(storeNameElement); + + Element thumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Thumbprint"); + thumbprintElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getThumbprint())); + certificateSettingElement.appendChild(thumbprintElement); } + configurationSetElement.appendChild(storedCertificateSettingsSequenceElement); } - } - if (parameters.getProvisioningConfiguration().getHostName() != null && parameters.getProvisioningConfiguration().getHostName().length() < 1) - { - throw new IllegalArgumentException("parameters.ProvisioningConfiguration.HostName"); - } - if (parameters.getProvisioningConfiguration().getHostName() != null && parameters.getProvisioningConfiguration().getHostName().length() > 64) - { - throw new IllegalArgumentException("parameters.ProvisioningConfiguration.HostName"); - } - if (parameters.getProvisioningConfiguration().getSshSettings() != null) - { - if (parameters.getProvisioningConfiguration().getSshSettings().getKeyPairs() != null) + + if (configurationSetsItem.getWindowsRemoteManagement() != null) { - for (SshSettingKeyPair keyPairsParameterItem : parameters.getProvisioningConfiguration().getSshSettings().getKeyPairs()) - { - if (keyPairsParameterItem.getFingerprint() == null) - { - throw new NullPointerException("parameters.ProvisioningConfiguration.SshSettings.KeyPairs.Fingerprint"); - } - if (keyPairsParameterItem.getPath() == null) + Element winRMElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "WinRM"); + configurationSetElement.appendChild(winRMElement); + + if (configurationSetsItem.getWindowsRemoteManagement().getListeners() != null) + { + Element listenersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listeners"); + for (WindowsRemoteManagementListener listenersItem : configurationSetsItem.getWindowsRemoteManagement().getListeners()) { - throw new NullPointerException("parameters.ProvisioningConfiguration.SshSettings.KeyPairs.Path"); + Element listenerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listener"); + listenersSequenceElement.appendChild(listenerElement); + + if (listenersItem.getCertificateThumbprint() != null) + { + Element certificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateThumbprint"); + certificateThumbprintElement.appendChild(requestDoc.createTextNode(listenersItem.getCertificateThumbprint())); + listenerElement.appendChild(certificateThumbprintElement); + } + + Element protocolElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement3.appendChild(requestDoc.createTextNode(listenersItem.getListenerType().toString())); + listenerElement.appendChild(protocolElement3); } + winRMElement.appendChild(listenersSequenceElement); } } - if (parameters.getProvisioningConfiguration().getSshSettings().getPublicKeys() != null) + + if (configurationSetsItem.getAdminUserName() != null) { - for (SshSettingPublicKey publicKeysParameterItem : parameters.getProvisioningConfiguration().getSshSettings().getPublicKeys()) + Element adminUsernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminUsername"); + adminUsernameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getAdminUserName())); + configurationSetElement.appendChild(adminUsernameElement); + } + + if (configurationSetsItem.getHostName() != null) + { + Element hostNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostName"); + hostNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getHostName())); + configurationSetElement.appendChild(hostNameElement); + } + + if (configurationSetsItem.getUserName() != null) + { + Element userNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserName"); + userNameElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserName())); + configurationSetElement.appendChild(userNameElement); + } + + if (configurationSetsItem.getUserPassword() != null) + { + Element userPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserPassword"); + userPasswordElement.appendChild(requestDoc.createTextNode(configurationSetsItem.getUserPassword())); + configurationSetElement.appendChild(userPasswordElement); + } + + if (configurationSetsItem.isDisableSshPasswordAuthentication() != null) + { + Element disableSshPasswordAuthenticationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DisableSshPasswordAuthentication"); + disableSshPasswordAuthenticationElement.appendChild(requestDoc.createTextNode(Boolean.toString(configurationSetsItem.isDisableSshPasswordAuthentication()).toLowerCase())); + configurationSetElement.appendChild(disableSshPasswordAuthenticationElement); + } + + if (configurationSetsItem.getSshSettings() != null) + { + Element sSHElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SSH"); + configurationSetElement.appendChild(sSHElement); + + if (configurationSetsItem.getSshSettings().getPublicKeys() != null) { - if (publicKeysParameterItem.getFingerprint() == null) + Element publicKeysSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKeys"); + for (SshSettingPublicKey publicKeysItem : configurationSetsItem.getSshSettings().getPublicKeys()) { - throw new NullPointerException("parameters.ProvisioningConfiguration.SshSettings.PublicKeys.Fingerprint"); + Element publicKeyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKey"); + publicKeysSequenceElement.appendChild(publicKeyElement); + + Element fingerprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); + fingerprintElement.appendChild(requestDoc.createTextNode(publicKeysItem.getFingerprint())); + publicKeyElement.appendChild(fingerprintElement); + + Element pathElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement2.appendChild(requestDoc.createTextNode(publicKeysItem.getPath())); + publicKeyElement.appendChild(pathElement2); } - if (publicKeysParameterItem.getPath() == null) + sSHElement.appendChild(publicKeysSequenceElement); + } + + if (configurationSetsItem.getSshSettings().getKeyPairs() != null) + { + Element keyPairsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPairs"); + for (SshSettingKeyPair keyPairsItem : configurationSetsItem.getSshSettings().getKeyPairs()) { - throw new NullPointerException("parameters.ProvisioningConfiguration.SshSettings.PublicKeys.Path"); + Element keyPairElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPair"); + keyPairsSequenceElement.appendChild(keyPairElement); + + Element fingerprintElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); + fingerprintElement2.appendChild(requestDoc.createTextNode(keyPairsItem.getFingerprint())); + keyPairElement.appendChild(fingerprintElement2); + + Element pathElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement3.appendChild(requestDoc.createTextNode(keyPairsItem.getPath())); + keyPairElement.appendChild(pathElement3); } + sSHElement.appendChild(keyPairsSequenceElement); } } } - if (parameters.getProvisioningConfiguration().getStoredCertificateSettings() != null) + persistentVMRoleElement.appendChild(configurationSetsSequenceElement); + } + + if (parameters.getAvailabilitySetName() != null) + { + Element availabilitySetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AvailabilitySetName"); + availabilitySetNameElement.appendChild(requestDoc.createTextNode(parameters.getAvailabilitySetName())); + persistentVMRoleElement.appendChild(availabilitySetNameElement); + } + + if (parameters.getDataVirtualHardDisks() != null) + { + Element dataVirtualHardDisksSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisks"); + for (DataVirtualHardDisk dataVirtualHardDisksItem : parameters.getDataVirtualHardDisks()) { - for (StoredCertificateSettings storedCertificateSettingsParameterItem : parameters.getProvisioningConfiguration().getStoredCertificateSettings()) + Element dataVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DataVirtualHardDisk"); + dataVirtualHardDisksSequenceElement.appendChild(dataVirtualHardDiskElement); + + if (dataVirtualHardDisksItem.getHostCaching() != null) { - if (storedCertificateSettingsParameterItem.getStoreName() == null) - { - throw new NullPointerException("parameters.ProvisioningConfiguration.StoredCertificateSettings.StoreName"); - } - if (storedCertificateSettingsParameterItem.getThumbprint() == null) - { - throw new NullPointerException("parameters.ProvisioningConfiguration.StoredCertificateSettings.Thumbprint"); - } + Element hostCachingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); + hostCachingElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getHostCaching().toString())); + dataVirtualHardDiskElement.appendChild(hostCachingElement); + } + + if (dataVirtualHardDisksItem.getDiskLabel() != null) + { + Element diskLabelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); + diskLabelElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskLabel())); + dataVirtualHardDiskElement.appendChild(diskLabelElement); + } + + if (dataVirtualHardDisksItem.getDiskName() != null) + { + Element diskNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); + diskNameElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getDiskName())); + dataVirtualHardDiskElement.appendChild(diskNameElement); + } + + if (dataVirtualHardDisksItem.getLogicalUnitNumber() != null) + { + Element lunElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Lun"); + lunElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalUnitNumber()))); + dataVirtualHardDiskElement.appendChild(lunElement); + } + + Element logicalDiskSizeInGBElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB"); + logicalDiskSizeInGBElement.appendChild(requestDoc.createTextNode(Integer.toString(dataVirtualHardDisksItem.getLogicalDiskSizeInGB()))); + dataVirtualHardDiskElement.appendChild(logicalDiskSizeInGBElement); + + if (dataVirtualHardDisksItem.getMediaLink() != null) + { + Element mediaLinkElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); + mediaLinkElement.appendChild(requestDoc.createTextNode(dataVirtualHardDisksItem.getMediaLink().toString())); + dataVirtualHardDiskElement.appendChild(mediaLinkElement); } } - if (parameters.getProvisioningConfiguration().getUserName() != null && parameters.getProvisioningConfiguration().getUserName().length() < 1) - { - throw new IllegalArgumentException("parameters.ProvisioningConfiguration.UserName"); - } - if (parameters.getProvisioningConfiguration().getUserName() != null && parameters.getProvisioningConfiguration().getUserName().length() > 32) - { - throw new IllegalArgumentException("parameters.ProvisioningConfiguration.UserName"); - } - if (parameters.getProvisioningConfiguration().getUserPassword() != null && parameters.getProvisioningConfiguration().getUserPassword().length() < 6 && (parameters.getProvisioningConfiguration().getDisableSshPasswordAuthentication() == false || parameters.getProvisioningConfiguration().getUserPassword().length() != 0)) - { - throw new IllegalArgumentException("parameters.ProvisioningConfiguration.UserPassword"); - } - if (parameters.getProvisioningConfiguration().getUserPassword() != null && parameters.getProvisioningConfiguration().getUserPassword().length() > 72) - { - throw new IllegalArgumentException("parameters.ProvisioningConfiguration.UserPassword"); - } + persistentVMRoleElement.appendChild(dataVirtualHardDisksSequenceElement); } - if (parameters.getTargetImageLabel() == null) + + Element oSVirtualHardDiskElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OSVirtualHardDisk"); + persistentVMRoleElement.appendChild(oSVirtualHardDiskElement); + + if (parameters.getOSVirtualHardDisk().getHostCaching() != null) { - throw new NullPointerException("parameters.TargetImageLabel"); + Element hostCachingElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostCaching"); + hostCachingElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getHostCaching().toString())); + oSVirtualHardDiskElement.appendChild(hostCachingElement2); } - if (parameters.getTargetImageName() == null) + + if (parameters.getOSVirtualHardDisk().getDiskLabel() != null) { - throw new NullPointerException("parameters.TargetImageName"); + Element diskLabelElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskLabel"); + diskLabelElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getDiskLabel())); + oSVirtualHardDiskElement.appendChild(diskLabelElement2); } - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) + if (parameters.getOSVirtualHardDisk().getDiskName() != null) { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serviceName", serviceName); - tracingParameters.put("deploymentName", deploymentName); - tracingParameters.put("virtualMachineName", virtualMachineName); - tracingParameters.put("parameters", parameters); - CloudTracing.enter(invocationId, this, "captureAsync", tracingParameters); + Element diskNameElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DiskName"); + diskNameElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getDiskName())); + oSVirtualHardDiskElement.appendChild(diskNameElement2); } - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "/roleinstances/" + virtualMachineName + "/Operations"; - - // Create HTTP transport objects - HttpPost httpRequest = new HttpPost(url); - - // Set Headers - httpRequest.setHeader("Content-Type", "application/xml"); - httpRequest.setHeader("x-ms-version", "2013-11-01"); + if (parameters.getOSVirtualHardDisk().getMediaLink() != null) + { + Element mediaLinkElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MediaLink"); + mediaLinkElement2.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getMediaLink().toString())); + oSVirtualHardDiskElement.appendChild(mediaLinkElement2); + } - // Serialize Request - String requestContent = null; - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document requestDoc = documentBuilder.newDocument(); + if (parameters.getOSVirtualHardDisk().getSourceImageName() != null) + { + Element sourceImageNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SourceImageName"); + sourceImageNameElement.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getSourceImageName())); + oSVirtualHardDiskElement.appendChild(sourceImageNameElement); + } - Element captureRoleOperationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CaptureRoleOperation"); - requestDoc.appendChild(captureRoleOperationElement); + if (parameters.getOSVirtualHardDisk().getOperatingSystem() != null) + { + Element osElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OS"); + osElement.appendChild(requestDoc.createTextNode(parameters.getOSVirtualHardDisk().getOperatingSystem())); + oSVirtualHardDiskElement.appendChild(osElement); + } - Element operationTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "OperationType"); - operationTypeElement.appendChild(requestDoc.createTextNode("CaptureRoleOperation")); - captureRoleOperationElement.appendChild(operationTypeElement); + if (parameters.getRoleSize() != null) + { + Element roleSizeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RoleSize"); + roleSizeElement.appendChild(requestDoc.createTextNode(parameters.getRoleSize())); + persistentVMRoleElement.appendChild(roleSizeElement); + } - Element postCaptureActionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PostCaptureAction"); - postCaptureActionElement.appendChild(requestDoc.createTextNode(parameters.getPostCaptureAction().toString())); - captureRoleOperationElement.appendChild(postCaptureActionElement); + DOMSource domSource = new DOMSource(requestDoc); + StringWriter stringWriter = new StringWriter(); + StreamResult streamResult = new StreamResult(stringWriter); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + transformer.transform(domSource, streamResult); + requestContent = stringWriter.toString(); + StringEntity entity = new StringEntity(requestContent); + httpRequest.setEntity(entity); + httpRequest.setHeader("Content-Type", "application/xml"); - if (parameters.getProvisioningConfiguration() != null) + // Send Request + HttpResponse httpResponse = null; + try { - Element provisioningConfigurationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ProvisioningConfiguration"); - captureRoleOperationElement.appendChild(provisioningConfigurationElement); - - if (parameters.getProvisioningConfiguration().getConfigurationSetType() != null) + if (shouldTrace) { - Element configurationSetTypeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ConfigurationSetType"); - configurationSetTypeElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getConfigurationSetType())); - provisioningConfigurationElement.appendChild(configurationSetTypeElement); + CloudTracing.sendRequest(invocationId, httpRequest); } - - if (parameters.getProvisioningConfiguration().getInputEndpoints() != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - Element inputEndpointsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoints"); - for (InputEndpoint inputEndpointsItem : parameters.getProvisioningConfiguration().getInputEndpoints()) - { - Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); - inputEndpointsSequenceElement.appendChild(inputEndpointElement); - - if (inputEndpointsItem.getLoadBalancedEndpointSetName() != null) - { - Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); - loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancedEndpointSetName())); - inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); - } - - if (inputEndpointsItem.getLocalPort() != null) - { - Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); - localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLocalPort()))); - inputEndpointElement.appendChild(localPortElement); - } - - if (inputEndpointsItem.getName() != null) - { - Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); - nameElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getName())); - inputEndpointElement.appendChild(nameElement); - } - - if (inputEndpointsItem.getPort() != null) - { - Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getPort()))); - inputEndpointElement.appendChild(portElement); - } - - if (inputEndpointsItem.getLoadBalancerProbe() != null) - { - Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); - inputEndpointElement.appendChild(loadBalancerProbeElement); - - if (inputEndpointsItem.getLoadBalancerProbe().getPath() != null) - { - Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getLoadBalancerProbe().getPath())); - loadBalancerProbeElement.appendChild(pathElement); - } - - Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); - portElement2.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getPort()))); - loadBalancerProbeElement.appendChild(portElement2); - - Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(inputEndpointsItem.getLoadBalancerProbe().getProtocol()))); - loadBalancerProbeElement.appendChild(protocolElement); - - if (inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) - { - Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); - intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); - loadBalancerProbeElement.appendChild(intervalInSecondsElement); - } - - if (inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) - { - Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); - timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(inputEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); - loadBalancerProbeElement.appendChild(timeoutInSecondsElement); - } - } - - if (inputEndpointsItem.getProtocol() != null) - { - Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement2.appendChild(requestDoc.createTextNode(inputEndpointsItem.getProtocol())); - inputEndpointElement.appendChild(protocolElement2); - } - - if (inputEndpointsItem.getVirtualIPAddress() != null) - { - Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); - vipElement.appendChild(requestDoc.createTextNode(inputEndpointsItem.getVirtualIPAddress().toString())); - inputEndpointElement.appendChild(vipElement); - } - - if (inputEndpointsItem.getEnableDirectServerReturn() != null) - { - Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); - enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(inputEndpointsItem.getEnableDirectServerReturn()).toLowerCase())); - inputEndpointElement.appendChild(enableDirectServerReturnElement); - } - - if (inputEndpointsItem.getEndpointAcl() != null) - { - Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); - inputEndpointElement.appendChild(endpointAclElement); - - if (inputEndpointsItem.getEndpointAcl().getRules() != null) - { - Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); - for (AccessControlListRule rulesItem : inputEndpointsItem.getEndpointAcl().getRules()) - { - Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); - rulesSequenceElement.appendChild(ruleElement); - - if (rulesItem.getOrder() != null) - { - Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); - orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); - ruleElement.appendChild(orderElement); - } - - if (rulesItem.getAction() != null) - { - Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); - actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); - ruleElement.appendChild(actionElement); - } - - if (rulesItem.getRemoteSubnet() != null) - { - Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); - remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); - ruleElement.appendChild(remoteSubnetElement); - } - - if (rulesItem.getDescription() != null) - { - Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); - descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); - ruleElement.appendChild(descriptionElement); - } - } - endpointAclElement.appendChild(rulesSequenceElement); - } - } - } - provisioningConfigurationElement.appendChild(inputEndpointsSequenceElement); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - if (parameters.getProvisioningConfiguration().getSubnetNames() != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) { - Element subnetNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetNames"); - for (String subnetNamesItem : parameters.getProvisioningConfiguration().getSubnetNames()) + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - Element subnetNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SubnetName"); - subnetNamesItemElement.appendChild(requestDoc.createTextNode(subnetNamesItem)); - subnetNamesSequenceElement.appendChild(subnetNamesItemElement); + CloudTracing.error(invocationId, ex); } - provisioningConfigurationElement.appendChild(subnetNamesSequenceElement); + throw ex; } - if (parameters.getProvisioningConfiguration().getComputerName() != null) + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - Element computerNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ComputerName"); - computerNameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getComputerName())); - provisioningConfigurationElement.appendChild(computerNameElement); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - if (parameters.getProvisioningConfiguration().getAdminPassword() != null) + if (shouldTrace) { - Element adminPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminPassword"); - adminPasswordElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getAdminPassword())); - provisioningConfigurationElement.appendChild(adminPasswordElement); + CloudTracing.exit(invocationId, result); } - - if (parameters.getProvisioningConfiguration().getResetPasswordOnFirstLogon() != null) + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) { - Element resetPasswordOnFirstLogonElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ResetPasswordOnFirstLogon"); - resetPasswordOnFirstLogonElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getProvisioningConfiguration().getResetPasswordOnFirstLogon()).toLowerCase())); - provisioningConfigurationElement.appendChild(resetPasswordOnFirstLogonElement); + httpResponse.getEntity().getContent().close(); } - - if (parameters.getProvisioningConfiguration().getEnableAutomaticUpdates() != null) + } + } + + /** + * The UpdateLoadBalancedEndpointSet operation changes the specified + * load-balanced InputEndpoints on all the roles of an Infrastructure as a + * Service deployment. Non load-balanced endpoints must be changed using + * UpdateRole. + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param parameters Parameters supplied to the Update Load Balanced + * Endpoint Set operation. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public Future beginUpdatingLoadBalancedEndpointSetAsync(final String serviceName, final String deploymentName, final VirtualMachineUpdateLoadBalancedSetParameters parameters) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public OperationResponse call() throws Exception { - Element enableAutomaticUpdatesElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableAutomaticUpdates"); - enableAutomaticUpdatesElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getProvisioningConfiguration().getEnableAutomaticUpdates()).toLowerCase())); - provisioningConfigurationElement.appendChild(enableAutomaticUpdatesElement); + return beginUpdatingLoadBalancedEndpointSet(serviceName, deploymentName, parameters); } - - if (parameters.getProvisioningConfiguration().getTimeZone() != null) + }); + } + + /** + * The UpdateLoadBalancedEndpointSet operation changes the specified + * load-balanced InputEndpoints on all the roles of an Infrastructure as a + * Service deployment. Non load-balanced endpoints must be changed using + * UpdateRole. + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param parameters Parameters supplied to the Update Load Balanced + * Endpoint Set operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + @Override + public OperationResponse beginUpdatingLoadBalancedEndpointSet(String serviceName, String deploymentName, VirtualMachineUpdateLoadBalancedSetParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException + { + // Validate + if (serviceName == null) + { + throw new NullPointerException("serviceName"); + } + if (deploymentName == null) + { + throw new NullPointerException("deploymentName"); + } + if (parameters == null) + { + throw new NullPointerException("parameters"); + } + if (parameters.getLoadBalancedEndpoints() != null) + { + for (VirtualMachineUpdateLoadBalancedSetParameters.InputEndpoint loadBalancedEndpointsParameterItem : parameters.getLoadBalancedEndpoints()) { - Element timeZoneElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeZone"); - timeZoneElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getTimeZone())); - provisioningConfigurationElement.appendChild(timeZoneElement); + if (loadBalancedEndpointsParameterItem.getLoadBalancedEndpointSetName() == null) + { + throw new NullPointerException("parameters.LoadBalancedEndpoints.LoadBalancedEndpointSetName"); + } } - - if (parameters.getProvisioningConfiguration().getDomainJoin() != null) + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serviceName", serviceName); + tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "beginUpdatingLoadBalancedEndpointSetAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/hostedservices/" + serviceName + "/deployments/" + deploymentName + "?comp=UpdateLbSet"; + + // Create HTTP transport objects + HttpPost httpRequest = new HttpPost(url); + + // Set Headers + httpRequest.setHeader("Content-Type", "application/xml"); + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Serialize Request + String requestContent = null; + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document requestDoc = documentBuilder.newDocument(); + + Element loadBalancedEndpointListElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointList"); + requestDoc.appendChild(loadBalancedEndpointListElement); + + if (parameters.getLoadBalancedEndpoints() != null) + { + for (VirtualMachineUpdateLoadBalancedSetParameters.InputEndpoint loadBalancedEndpointsItem : parameters.getLoadBalancedEndpoints()) { - Element domainJoinElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DomainJoin"); - provisioningConfigurationElement.appendChild(domainJoinElement); + Element inputEndpointElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "InputEndpoint"); + loadBalancedEndpointListElement.appendChild(inputEndpointElement); - if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials() != null) + Element loadBalancedEndpointSetNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancedEndpointSetName"); + loadBalancedEndpointSetNameElement.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getLoadBalancedEndpointSetName())); + inputEndpointElement.appendChild(loadBalancedEndpointSetNameElement); + + if (loadBalancedEndpointsItem.getLocalPort() != null) { - Element credentialsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Credentials"); - domainJoinElement.appendChild(credentialsElement); - - if (parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getDomain() != null) - { - Element domainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Domain"); - domainElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getDomain())); - credentialsElement.appendChild(domainElement); - } - - Element usernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Username"); - usernameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getUserName())); - credentialsElement.appendChild(usernameElement); - - Element passwordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Password"); - passwordElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getCredentials().getPassword())); - credentialsElement.appendChild(passwordElement); + Element localPortElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LocalPort"); + localPortElement.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getLocalPort()))); + inputEndpointElement.appendChild(localPortElement); } - if (parameters.getProvisioningConfiguration().getDomainJoin().getDomainToJoin() != null) + if (loadBalancedEndpointsItem.getName() != null) { - Element joinDomainElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "JoinDomain"); - joinDomainElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getDomainToJoin())); - domainJoinElement.appendChild(joinDomainElement); + Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); + nameElement.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getName())); + inputEndpointElement.appendChild(nameElement); } - if (parameters.getProvisioningConfiguration().getDomainJoin().getLdapMachineObjectOU() != null) + if (loadBalancedEndpointsItem.getPort() != null) { - Element machineObjectOUElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "MachineObjectOU"); - machineObjectOUElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getLdapMachineObjectOU())); - domainJoinElement.appendChild(machineObjectOUElement); + Element portElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getPort()))); + inputEndpointElement.appendChild(portElement); } - if (parameters.getProvisioningConfiguration().getDomainJoin().getProvisioning() != null) + if (loadBalancedEndpointsItem.getLoadBalancerProbe() != null) { - Element provisioningElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Provisioning"); - domainJoinElement.appendChild(provisioningElement); + Element loadBalancerProbeElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "LoadBalancerProbe"); + inputEndpointElement.appendChild(loadBalancerProbeElement); - if (parameters.getProvisioningConfiguration().getDomainJoin().getProvisioning().getAccountData() != null) + if (loadBalancedEndpointsItem.getLoadBalancerProbe().getPath() != null) { - Element accountDataElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AccountData"); - accountDataElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getDomainJoin().getProvisioning().getAccountData())); - provisioningElement.appendChild(accountDataElement); + Element pathElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); + pathElement.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getLoadBalancerProbe().getPath())); + loadBalancerProbeElement.appendChild(pathElement); } - } - } - - if (parameters.getProvisioningConfiguration().getStoredCertificateSettings() != null) - { - Element storedCertificateSettingsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoredCertificateSettings"); - for (StoredCertificateSettings storedCertificateSettingsItem : parameters.getProvisioningConfiguration().getStoredCertificateSettings()) - { - Element certificateSettingElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateSetting"); - storedCertificateSettingsSequenceElement.appendChild(certificateSettingElement); - Element storeLocationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreLocation"); - storeLocationElement.appendChild(requestDoc.createTextNode("LocalMachine")); - certificateSettingElement.appendChild(storeLocationElement); + Element portElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Port"); + portElement2.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getLoadBalancerProbe().getPort()))); + loadBalancerProbeElement.appendChild(portElement2); - Element storeNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "StoreName"); - storeNameElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getStoreName())); - certificateSettingElement.appendChild(storeNameElement); + Element protocolElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement.appendChild(requestDoc.createTextNode(ComputeManagementClientImpl.loadBalancerProbeTransportProtocolToString(loadBalancedEndpointsItem.getLoadBalancerProbe().getProtocol()))); + loadBalancerProbeElement.appendChild(protocolElement); - Element thumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Thumbprint"); - thumbprintElement.appendChild(requestDoc.createTextNode(storedCertificateSettingsItem.getThumbprint())); - certificateSettingElement.appendChild(thumbprintElement); + if (loadBalancedEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds() != null) + { + Element intervalInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "IntervalInSeconds"); + intervalInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getLoadBalancerProbe().getIntervalInSeconds()))); + loadBalancerProbeElement.appendChild(intervalInSecondsElement); + } + + if (loadBalancedEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds() != null) + { + Element timeoutInSecondsElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TimeoutInSeconds"); + timeoutInSecondsElement.appendChild(requestDoc.createTextNode(Integer.toString(loadBalancedEndpointsItem.getLoadBalancerProbe().getTimeoutInSeconds()))); + loadBalancerProbeElement.appendChild(timeoutInSecondsElement); + } } - provisioningConfigurationElement.appendChild(storedCertificateSettingsSequenceElement); - } - - if (parameters.getProvisioningConfiguration().getWindowsRemoteManagement() != null) - { - Element winRMElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "WinRM"); - provisioningConfigurationElement.appendChild(winRMElement); - if (parameters.getProvisioningConfiguration().getWindowsRemoteManagement().getListeners() != null) + if (loadBalancedEndpointsItem.getProtocol() != null) { - Element listenersSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listeners"); - for (WindowsRemoteManagementListener listenersItem : parameters.getProvisioningConfiguration().getWindowsRemoteManagement().getListeners()) - { - Element listenerElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Listener"); - listenersSequenceElement.appendChild(listenerElement); - - Element protocolElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); - protocolElement3.appendChild(requestDoc.createTextNode(listenersItem.getListenerType().toString())); - listenerElement.appendChild(protocolElement3); - - if (listenersItem.getCertificateThumbprint() != null) - { - Element certificateThumbprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "CertificateThumbprint"); - certificateThumbprintElement.appendChild(requestDoc.createTextNode(listenersItem.getCertificateThumbprint())); - listenerElement.appendChild(certificateThumbprintElement); - } - } - winRMElement.appendChild(listenersSequenceElement); + Element protocolElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Protocol"); + protocolElement2.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getProtocol())); + inputEndpointElement.appendChild(protocolElement2); } - } - - if (parameters.getProvisioningConfiguration().getAdminUserName() != null) - { - Element adminUsernameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "AdminUsername"); - adminUsernameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getAdminUserName())); - provisioningConfigurationElement.appendChild(adminUsernameElement); - } - - if (parameters.getProvisioningConfiguration().getHostName() != null) - { - Element hostNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostName"); - hostNameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getHostName())); - provisioningConfigurationElement.appendChild(hostNameElement); - } - - if (parameters.getProvisioningConfiguration().getUserName() != null) - { - Element userNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserName"); - userNameElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getUserName())); - provisioningConfigurationElement.appendChild(userNameElement); - } - - if (parameters.getProvisioningConfiguration().getUserPassword() != null) - { - Element userPasswordElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "UserPassword"); - userPasswordElement.appendChild(requestDoc.createTextNode(parameters.getProvisioningConfiguration().getUserPassword())); - provisioningConfigurationElement.appendChild(userPasswordElement); - } - - if (parameters.getProvisioningConfiguration().getDisableSshPasswordAuthentication() != null) - { - Element disableSshPasswordAuthenticationElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "DisableSshPasswordAuthentication"); - disableSshPasswordAuthenticationElement.appendChild(requestDoc.createTextNode(Boolean.toString(parameters.getProvisioningConfiguration().getDisableSshPasswordAuthentication()).toLowerCase())); - provisioningConfigurationElement.appendChild(disableSshPasswordAuthenticationElement); - } - - if (parameters.getProvisioningConfiguration().getSshSettings() != null) - { - Element sSHElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "SSH"); - provisioningConfigurationElement.appendChild(sSHElement); - if (parameters.getProvisioningConfiguration().getSshSettings().getPublicKeys() != null) + if (loadBalancedEndpointsItem.getVirtualIPAddress() != null) { - Element publicKeysSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKeys"); - for (SshSettingPublicKey publicKeysItem : parameters.getProvisioningConfiguration().getSshSettings().getPublicKeys()) - { - Element publicKeyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublicKey"); - publicKeysSequenceElement.appendChild(publicKeyElement); - - Element fingerprintElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); - fingerprintElement.appendChild(requestDoc.createTextNode(publicKeysItem.getFingerprint())); - publicKeyElement.appendChild(fingerprintElement); - - Element pathElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement2.appendChild(requestDoc.createTextNode(publicKeysItem.getPath())); - publicKeyElement.appendChild(pathElement2); - } - sSHElement.appendChild(publicKeysSequenceElement); + Element vipElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Vip"); + vipElement.appendChild(requestDoc.createTextNode(loadBalancedEndpointsItem.getVirtualIPAddress().toString())); + inputEndpointElement.appendChild(vipElement); } - if (parameters.getProvisioningConfiguration().getSshSettings().getKeyPairs() != null) + if (loadBalancedEndpointsItem.isEnableDirectServerReturn() != null) { - Element keyPairsSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPairs"); - for (SshSettingKeyPair keyPairsItem : parameters.getProvisioningConfiguration().getSshSettings().getKeyPairs()) + Element enableDirectServerReturnElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EnableDirectServerReturn"); + enableDirectServerReturnElement.appendChild(requestDoc.createTextNode(Boolean.toString(loadBalancedEndpointsItem.isEnableDirectServerReturn()).toLowerCase())); + inputEndpointElement.appendChild(enableDirectServerReturnElement); + } + + Element endpointAclElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "EndpointAcl"); + inputEndpointElement.appendChild(endpointAclElement); + + if (loadBalancedEndpointsItem.getRules() != null) + { + Element rulesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rules"); + for (AccessControlListRule rulesItem : loadBalancedEndpointsItem.getRules()) { - Element keyPairElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "KeyPair"); - keyPairsSequenceElement.appendChild(keyPairElement); + Element ruleElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Rule"); + rulesSequenceElement.appendChild(ruleElement); - Element fingerprintElement2 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Fingerprint"); - fingerprintElement2.appendChild(requestDoc.createTextNode(keyPairsItem.getFingerprint())); - keyPairElement.appendChild(fingerprintElement2); + if (rulesItem.getOrder() != null) + { + Element orderElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Order"); + orderElement.appendChild(requestDoc.createTextNode(Integer.toString(rulesItem.getOrder()))); + ruleElement.appendChild(orderElement); + } + + if (rulesItem.getAction() != null) + { + Element actionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Action"); + actionElement.appendChild(requestDoc.createTextNode(rulesItem.getAction())); + ruleElement.appendChild(actionElement); + } + + if (rulesItem.getRemoteSubnet() != null) + { + Element remoteSubnetElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "RemoteSubnet"); + remoteSubnetElement.appendChild(requestDoc.createTextNode(rulesItem.getRemoteSubnet())); + ruleElement.appendChild(remoteSubnetElement); + } - Element pathElement3 = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Path"); - pathElement3.appendChild(requestDoc.createTextNode(keyPairsItem.getPath())); - keyPairElement.appendChild(pathElement3); + if (rulesItem.getDescription() != null) + { + Element descriptionElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); + descriptionElement.appendChild(requestDoc.createTextNode(rulesItem.getDescription())); + ruleElement.appendChild(descriptionElement); + } } - sSHElement.appendChild(keyPairsSequenceElement); + endpointAclElement.appendChild(rulesSequenceElement); } } } - Element targetImageLabelElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TargetImageLabel"); - targetImageLabelElement.appendChild(requestDoc.createTextNode(parameters.getTargetImageLabel())); - captureRoleOperationElement.appendChild(targetImageLabelElement); - - Element targetImageNameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "TargetImageName"); - targetImageNameElement.appendChild(requestDoc.createTextNode(parameters.getTargetImageName())); - captureRoleOperationElement.appendChild(targetImageNameElement); - DOMSource domSource = new DOMSource(requestDoc); StringWriter stringWriter = new StringWriter(); StreamResult streamResult = new StreamResult(stringWriter); @@ -4176,40 +4389,203 @@ public OperationResponse capture(String serviceName, String deploymentName, Stri // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; + } + finally { - CloudTracing.sendRequest(invocationId, httpRequest); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); + } + + /** + * The Capture Role operation creates a copy of the operating system virtual + * hard disk (VHD) that is deployed in the virtual machine, saves the VHD + * copy in the same storage location as the operating system VHD, and + * registers the copy as an image in your image gallery. From the captured + * image, you can create additional customized virtual machines. For more + * information about images and disks, see Manage Disks and Images. For + * more information about capturing images, see How to Capture an Image of + * a Virtual Machine Running Windows Server 2008 R2 or How to Capture an + * Image of a Virtual Machine Running Linux. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157201.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to restart. + * @param parameters Parameters supplied to the Capture Virtual Machine + * operation. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + @Override + public Future captureAsync(final String serviceName, final String deploymentName, final String virtualMachineName, final VirtualMachineCaptureParameters parameters) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public ComputeOperationStatusResponse call() throws Exception + { + return capture(serviceName, deploymentName, virtualMachineName, parameters); + } + }); + } + + /** + * The Capture Role operation creates a copy of the operating system virtual + * hard disk (VHD) that is deployed in the virtual machine, saves the VHD + * copy in the same storage location as the operating system VHD, and + * registers the copy as an image in your image gallery. From the captured + * image, you can create additional customized virtual machines. For more + * information about images and disks, see Manage Disks and Images. For + * more information about capturing images, see How to Capture an Image of + * a Virtual Machine Running Windows Server 2008 R2 or How to Capture an + * Image of a Virtual Machine Running Linux. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/jj157201.aspx for + * more information) + * + * @param serviceName The name of your service. + * @param deploymentName The name of your deployment. + * @param virtualMachineName The name of the virtual machine to restart. + * @param parameters Parameters supplied to the Capture Virtual Machine + * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @return The response body contains the status of the specified + * asynchronous operation, indicating whether it has succeeded, is + * inprogress, or has failed. Note that this status is distinct from the + * HTTP status code returned for the Get Operation Status operation itself. + * If the asynchronous operation succeeded, the response body includes the + * HTTP status code for the successful request. If the asynchronous + * operation failed, the response body includes the HTTP status code for + * the failed request, and also includes error information regarding the + * failure. + */ + @Override + public ComputeOperationStatusResponse capture(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineCaptureParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException + { + ComputeManagementClient client2 = this.getClient(); + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; if (shouldTrace) { - CloudTracing.receiveResponse(invocationId, httpResponse); + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serviceName", serviceName); + tracingParameters.put("deploymentName", deploymentName); + tracingParameters.put("virtualMachineName", virtualMachineName); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "captureAsync", tracingParameters); } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_CREATED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + client2 = this.getClient().withRequestFilterLast(new ClientRequestTrackingHandler(invocationId)).withResponseFilterLast(new ClientRequestTrackingHandler(invocationId)); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + + OperationResponse response = client2.getVirtualMachinesOperations().beginCapturingAsync(serviceName, deploymentName, virtualMachineName, parameters).get(); + ComputeOperationStatusResponse result = client2.getOperationStatusAsync(response.getRequestId()).get(); + int delayInSeconds = 30; + while ((result.getStatus() != OperationStatus.InProgress) == false) + { + Thread.sleep(delayInSeconds * 1000); + result = client2.getOperationStatusAsync(response.getRequestId()).get(); + delayInSeconds = 30; + } + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + + if (result.getStatus() != OperationStatus.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; + } + } + + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (this.getClient() != null && shouldTrace) + { + this.getClient().close(); + } } - return result; } /** @@ -4272,6 +4648,29 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Create Virtual Machine * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -4283,7 +4682,7 @@ public ComputeOperationStatusResponse call() throws Exception * failure. */ @Override - public ComputeOperationStatusResponse create(String serviceName, String deploymentName, VirtualMachineCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, ServiceException, URISyntaxException, ParseException + public ComputeOperationStatusResponse create(String serviceName, String deploymentName, VirtualMachineCreateParameters parameters) throws InterruptedException, ExecutionException, ServiceException, IOException, ParserConfigurationException, SAXException, TransformerException, ServiceException, URISyntaxException, ParseException { ComputeManagementClient client2 = this.getClient(); boolean shouldTrace = CloudTracing.getIsEnabled(); @@ -4404,6 +4803,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The name of your service. * @param parameters Parameters supplied to the Create Virtual Machine * Deployment operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -4527,6 +4938,20 @@ public ComputeOperationStatusResponse call() throws Exception * @param virtualMachineName The name of the virtual machine to delete. * @param deleteFromStorage Optional. Specifies that the source blob(s) for * the virtual machine should also be deleted from storage. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -4642,6 +5067,18 @@ public VirtualMachineGetResponse call() throws Exception * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Virtual Machine operation response. */ @Override @@ -4685,759 +5122,778 @@ public VirtualMachineGetResponse get(String serviceName, String deploymentName, // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - VirtualMachineGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("PersistentVMRole"); - Element persistentVMRoleElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (persistentVMRoleElement != null) - { - NodeList elements2 = persistentVMRoleElement.getElementsByTagName("RoleName"); - Element roleNameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (roleNameElement != null) - { - String roleNameInstance; - roleNameInstance = roleNameElement.getTextContent(); - result.setRoleName(roleNameInstance); - } - - NodeList elements3 = persistentVMRoleElement.getElementsByTagName("OsVersion"); - Element osVersionElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (osVersionElement != null) - { - String osVersionInstance; - osVersionInstance = osVersionElement.getTextContent(); - result.setOsVersion(osVersionInstance); - } - - NodeList elements4 = persistentVMRoleElement.getElementsByTagName("RoleType"); - Element roleTypeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (roleTypeElement != null) - { - VirtualMachineRoleType roleTypeInstance; - roleTypeInstance = VirtualMachineRoleType.valueOf(roleTypeElement.getTextContent()); - result.setRoleType(roleTypeInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements5 = persistentVMRoleElement.getElementsByTagName("AvailabilitySetName"); - Element availabilitySetNameElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (availabilitySetNameElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String availabilitySetNameInstance; - availabilitySetNameInstance = availabilitySetNameElement.getTextContent(); - result.setAvailabilitySetName(availabilitySetNameInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements6 = persistentVMRoleElement.getElementsByTagName("RoleSize"); - Element roleSizeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (roleSizeElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - VirtualMachineRoleSize roleSizeInstance; - roleSizeInstance = VirtualMachineRoleSize.valueOf(roleSizeElement.getTextContent()); - result.setRoleSize(roleSizeInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements7 = persistentVMRoleElement.getElementsByTagName("DefaultWinRmCertificateThumbprint"); - Element defaultWinRmCertificateThumbprintElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (defaultWinRmCertificateThumbprintElement != null) - { - String defaultWinRmCertificateThumbprintInstance; - defaultWinRmCertificateThumbprintInstance = defaultWinRmCertificateThumbprintElement.getTextContent(); - result.setDefaultWinRmCertificateThumbprint(defaultWinRmCertificateThumbprintInstance); - } + // Create Result + VirtualMachineGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements8 = persistentVMRoleElement.getElementsByTagName("ConfigurationSets"); - Element configurationSetsSequenceElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (configurationSetsSequenceElement != null) + NodeList elements = responseDoc.getElementsByTagName("PersistentVMRole"); + Element persistentVMRoleElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (persistentVMRoleElement != null) { - for (int i1 = 0; i1 < configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").getLength(); i1 = i1 + 1) + NodeList elements2 = persistentVMRoleElement.getElementsByTagName("RoleName"); + Element roleNameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (roleNameElement != null) { - org.w3c.dom.Element configurationSetsElement = ((org.w3c.dom.Element) configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").item(i1)); - ConfigurationSet configurationSetInstance = new ConfigurationSet(); - result.getConfigurationSets().add(configurationSetInstance); - - NodeList elements9 = configurationSetsElement.getElementsByTagName("ConfigurationSetType"); - Element configurationSetTypeElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (configurationSetTypeElement != null) - { - String configurationSetTypeInstance; - configurationSetTypeInstance = configurationSetTypeElement.getTextContent(); - configurationSetInstance.setConfigurationSetType(configurationSetTypeInstance); - } - - NodeList elements10 = configurationSetsElement.getElementsByTagName("InputEndpoints"); - Element inputEndpointsSequenceElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (inputEndpointsSequenceElement != null) + String roleNameInstance; + roleNameInstance = roleNameElement.getTextContent(); + result.setRoleName(roleNameInstance); + } + + NodeList elements3 = persistentVMRoleElement.getElementsByTagName("OsVersion"); + Element osVersionElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (osVersionElement != null) + { + String osVersionInstance; + osVersionInstance = osVersionElement.getTextContent(); + result.setOsVersion(osVersionInstance); + } + + NodeList elements4 = persistentVMRoleElement.getElementsByTagName("RoleType"); + Element roleTypeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (roleTypeElement != null) + { + VirtualMachineRoleType roleTypeInstance; + roleTypeInstance = VirtualMachineRoleType.valueOf(roleTypeElement.getTextContent()); + result.setRoleType(roleTypeInstance); + } + + NodeList elements5 = persistentVMRoleElement.getElementsByTagName("AvailabilitySetName"); + Element availabilitySetNameElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (availabilitySetNameElement != null) + { + String availabilitySetNameInstance; + availabilitySetNameInstance = availabilitySetNameElement.getTextContent(); + result.setAvailabilitySetName(availabilitySetNameInstance); + } + + NodeList elements6 = persistentVMRoleElement.getElementsByTagName("RoleSize"); + Element roleSizeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (roleSizeElement != null) + { + String roleSizeInstance; + roleSizeInstance = roleSizeElement.getTextContent(); + result.setRoleSize(roleSizeInstance); + } + + NodeList elements7 = persistentVMRoleElement.getElementsByTagName("DefaultWinRmCertificateThumbprint"); + Element defaultWinRmCertificateThumbprintElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (defaultWinRmCertificateThumbprintElement != null) + { + String defaultWinRmCertificateThumbprintInstance; + defaultWinRmCertificateThumbprintInstance = defaultWinRmCertificateThumbprintElement.getTextContent(); + result.setDefaultWinRmCertificateThumbprint(defaultWinRmCertificateThumbprintInstance); + } + + NodeList elements8 = persistentVMRoleElement.getElementsByTagName("ConfigurationSets"); + Element configurationSetsSequenceElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (configurationSetsSequenceElement != null) + { + for (int i1 = 0; i1 < configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").getLength(); i1 = i1 + 1) { - for (int i2 = 0; i2 < inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").getLength(); i2 = i2 + 1) + org.w3c.dom.Element configurationSetsElement = ((org.w3c.dom.Element) configurationSetsSequenceElement.getElementsByTagName("ConfigurationSet").item(i1)); + ConfigurationSet configurationSetInstance = new ConfigurationSet(); + result.getConfigurationSets().add(configurationSetInstance); + + NodeList elements9 = configurationSetsElement.getElementsByTagName("ConfigurationSetType"); + Element configurationSetTypeElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (configurationSetTypeElement != null) { - org.w3c.dom.Element inputEndpointsElement = ((org.w3c.dom.Element) inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").item(i2)); - InputEndpoint inputEndpointInstance = new InputEndpoint(); - configurationSetInstance.getInputEndpoints().add(inputEndpointInstance); - - NodeList elements11 = inputEndpointsElement.getElementsByTagName("LoadBalancedEndpointSetName"); - Element loadBalancedEndpointSetNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (loadBalancedEndpointSetNameElement != null) - { - String loadBalancedEndpointSetNameInstance; - loadBalancedEndpointSetNameInstance = loadBalancedEndpointSetNameElement.getTextContent(); - inputEndpointInstance.setLoadBalancedEndpointSetName(loadBalancedEndpointSetNameInstance); - } - - NodeList elements12 = inputEndpointsElement.getElementsByTagName("LocalPort"); - Element localPortElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (localPortElement != null && (localPortElement.getTextContent() != null && localPortElement.getTextContent().isEmpty() != true) == false) - { - int localPortInstance; - localPortInstance = Integer.parseInt(localPortElement.getTextContent()); - inputEndpointInstance.setLocalPort(localPortInstance); - } - - NodeList elements13 = inputEndpointsElement.getElementsByTagName("Name"); - Element nameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - inputEndpointInstance.setName(nameInstance); - } - - NodeList elements14 = inputEndpointsElement.getElementsByTagName("Port"); - Element portElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (portElement != null && (portElement.getTextContent() != null && portElement.getTextContent().isEmpty() != true) == false) - { - int portInstance; - portInstance = Integer.parseInt(portElement.getTextContent()); - inputEndpointInstance.setPort(portInstance); - } - - NodeList elements15 = inputEndpointsElement.getElementsByTagName("LoadBalancerProbe"); - Element loadBalancerProbeElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (loadBalancerProbeElement != null) + String configurationSetTypeInstance; + configurationSetTypeInstance = configurationSetTypeElement.getTextContent(); + configurationSetInstance.setConfigurationSetType(configurationSetTypeInstance); + } + + NodeList elements10 = configurationSetsElement.getElementsByTagName("InputEndpoints"); + Element inputEndpointsSequenceElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (inputEndpointsSequenceElement != null) + { + for (int i2 = 0; i2 < inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").getLength(); i2 = i2 + 1) { - LoadBalancerProbe loadBalancerProbeInstance = new LoadBalancerProbe(); - inputEndpointInstance.setLoadBalancerProbe(loadBalancerProbeInstance); + org.w3c.dom.Element inputEndpointsElement = ((org.w3c.dom.Element) inputEndpointsSequenceElement.getElementsByTagName("InputEndpoint").item(i2)); + InputEndpoint inputEndpointInstance = new InputEndpoint(); + configurationSetInstance.getInputEndpoints().add(inputEndpointInstance); + + NodeList elements11 = inputEndpointsElement.getElementsByTagName("LoadBalancedEndpointSetName"); + Element loadBalancedEndpointSetNameElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (loadBalancedEndpointSetNameElement != null) + { + String loadBalancedEndpointSetNameInstance; + loadBalancedEndpointSetNameInstance = loadBalancedEndpointSetNameElement.getTextContent(); + inputEndpointInstance.setLoadBalancedEndpointSetName(loadBalancedEndpointSetNameInstance); + } + + NodeList elements12 = inputEndpointsElement.getElementsByTagName("LocalPort"); + Element localPortElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (localPortElement != null && (localPortElement.getTextContent() != null && localPortElement.getTextContent().isEmpty() != true) == false) + { + int localPortInstance; + localPortInstance = Integer.parseInt(localPortElement.getTextContent()); + inputEndpointInstance.setLocalPort(localPortInstance); + } - NodeList elements16 = loadBalancerProbeElement.getElementsByTagName("Path"); - Element pathElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (pathElement != null) + NodeList elements13 = inputEndpointsElement.getElementsByTagName("Name"); + Element nameElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (nameElement != null) { - String pathInstance; - pathInstance = pathElement.getTextContent(); - loadBalancerProbeInstance.setPath(pathInstance); + String nameInstance; + nameInstance = nameElement.getTextContent(); + inputEndpointInstance.setName(nameInstance); } - NodeList elements17 = loadBalancerProbeElement.getElementsByTagName("Port"); - Element portElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (portElement2 != null) + NodeList elements14 = inputEndpointsElement.getElementsByTagName("Port"); + Element portElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (portElement != null && (portElement.getTextContent() != null && portElement.getTextContent().isEmpty() != true) == false) { - int portInstance2; - portInstance2 = Integer.parseInt(portElement2.getTextContent()); - loadBalancerProbeInstance.setPort(portInstance2); + int portInstance; + portInstance = Integer.parseInt(portElement.getTextContent()); + inputEndpointInstance.setPort(portInstance); + } + + NodeList elements15 = inputEndpointsElement.getElementsByTagName("LoadBalancerProbe"); + Element loadBalancerProbeElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (loadBalancerProbeElement != null) + { + LoadBalancerProbe loadBalancerProbeInstance = new LoadBalancerProbe(); + inputEndpointInstance.setLoadBalancerProbe(loadBalancerProbeInstance); + + NodeList elements16 = loadBalancerProbeElement.getElementsByTagName("Path"); + Element pathElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (pathElement != null) + { + String pathInstance; + pathInstance = pathElement.getTextContent(); + loadBalancerProbeInstance.setPath(pathInstance); + } + + NodeList elements17 = loadBalancerProbeElement.getElementsByTagName("Port"); + Element portElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (portElement2 != null) + { + int portInstance2; + portInstance2 = Integer.parseInt(portElement2.getTextContent()); + loadBalancerProbeInstance.setPort(portInstance2); + } + + NodeList elements18 = loadBalancerProbeElement.getElementsByTagName("Protocol"); + Element protocolElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (protocolElement != null) + { + LoadBalancerProbeTransportProtocol protocolInstance; + protocolInstance = ComputeManagementClientImpl.parseLoadBalancerProbeTransportProtocol(protocolElement.getTextContent()); + loadBalancerProbeInstance.setProtocol(protocolInstance); + } + + NodeList elements19 = loadBalancerProbeElement.getElementsByTagName("IntervalInSeconds"); + Element intervalInSecondsElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (intervalInSecondsElement != null && (intervalInSecondsElement.getTextContent() != null && intervalInSecondsElement.getTextContent().isEmpty() != true) == false) + { + int intervalInSecondsInstance; + intervalInSecondsInstance = Integer.parseInt(intervalInSecondsElement.getTextContent()); + loadBalancerProbeInstance.setIntervalInSeconds(intervalInSecondsInstance); + } + + NodeList elements20 = loadBalancerProbeElement.getElementsByTagName("TimeoutInSeconds"); + Element timeoutInSecondsElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (timeoutInSecondsElement != null && (timeoutInSecondsElement.getTextContent() != null && timeoutInSecondsElement.getTextContent().isEmpty() != true) == false) + { + int timeoutInSecondsInstance; + timeoutInSecondsInstance = Integer.parseInt(timeoutInSecondsElement.getTextContent()); + loadBalancerProbeInstance.setTimeoutInSeconds(timeoutInSecondsInstance); + } } - NodeList elements18 = loadBalancerProbeElement.getElementsByTagName("Protocol"); - Element protocolElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (protocolElement != null) + NodeList elements21 = inputEndpointsElement.getElementsByTagName("Protocol"); + Element protocolElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (protocolElement2 != null) { - LoadBalancerProbeTransportProtocol protocolInstance; - protocolInstance = ComputeManagementClientImpl.parseLoadBalancerProbeTransportProtocol(protocolElement.getTextContent()); - loadBalancerProbeInstance.setProtocol(protocolInstance); + String protocolInstance2; + protocolInstance2 = protocolElement2.getTextContent(); + inputEndpointInstance.setProtocol(protocolInstance2); } - NodeList elements19 = loadBalancerProbeElement.getElementsByTagName("IntervalInSeconds"); - Element intervalInSecondsElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (intervalInSecondsElement != null && (intervalInSecondsElement.getTextContent() != null && intervalInSecondsElement.getTextContent().isEmpty() != true) == false) + NodeList elements22 = inputEndpointsElement.getElementsByTagName("Vip"); + Element vipElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (vipElement != null) { - int intervalInSecondsInstance; - intervalInSecondsInstance = Integer.parseInt(intervalInSecondsElement.getTextContent()); - loadBalancerProbeInstance.setIntervalInSeconds(intervalInSecondsInstance); + InetAddress vipInstance; + vipInstance = InetAddress.getByName(vipElement.getTextContent()); + inputEndpointInstance.setVirtualIPAddress(vipInstance); } - NodeList elements20 = loadBalancerProbeElement.getElementsByTagName("TimeoutInSeconds"); - Element timeoutInSecondsElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (timeoutInSecondsElement != null && (timeoutInSecondsElement.getTextContent() != null && timeoutInSecondsElement.getTextContent().isEmpty() != true) == false) + NodeList elements23 = inputEndpointsElement.getElementsByTagName("EnableDirectServerReturn"); + Element enableDirectServerReturnElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (enableDirectServerReturnElement != null && (enableDirectServerReturnElement.getTextContent() != null && enableDirectServerReturnElement.getTextContent().isEmpty() != true) == false) { - int timeoutInSecondsInstance; - timeoutInSecondsInstance = Integer.parseInt(timeoutInSecondsElement.getTextContent()); - loadBalancerProbeInstance.setTimeoutInSeconds(timeoutInSecondsInstance); + boolean enableDirectServerReturnInstance; + enableDirectServerReturnInstance = Boolean.parseBoolean(enableDirectServerReturnElement.getTextContent()); + inputEndpointInstance.setEnableDirectServerReturn(enableDirectServerReturnInstance); } - } - - NodeList elements21 = inputEndpointsElement.getElementsByTagName("Protocol"); - Element protocolElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (protocolElement2 != null) - { - String protocolInstance2; - protocolInstance2 = protocolElement2.getTextContent(); - inputEndpointInstance.setProtocol(protocolInstance2); - } - - NodeList elements22 = inputEndpointsElement.getElementsByTagName("Vip"); - Element vipElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (vipElement != null) - { - InetAddress vipInstance; - vipInstance = InetAddress.getByName(vipElement.getTextContent()); - inputEndpointInstance.setVirtualIPAddress(vipInstance); - } - - NodeList elements23 = inputEndpointsElement.getElementsByTagName("EnableDirectServerReturn"); - Element enableDirectServerReturnElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (enableDirectServerReturnElement != null && (enableDirectServerReturnElement.getTextContent() != null && enableDirectServerReturnElement.getTextContent().isEmpty() != true) == false) - { - boolean enableDirectServerReturnInstance; - enableDirectServerReturnInstance = Boolean.parseBoolean(enableDirectServerReturnElement.getTextContent()); - inputEndpointInstance.setEnableDirectServerReturn(enableDirectServerReturnInstance); - } - - NodeList elements24 = inputEndpointsElement.getElementsByTagName("EndpointAcl"); - Element endpointAclElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (endpointAclElement != null) - { - EndpointAcl endpointAclInstance = new EndpointAcl(); - inputEndpointInstance.setEndpointAcl(endpointAclInstance); - NodeList elements25 = endpointAclElement.getElementsByTagName("Rules"); - Element rulesSequenceElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (rulesSequenceElement != null) + NodeList elements24 = inputEndpointsElement.getElementsByTagName("EndpointAcl"); + Element endpointAclElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (endpointAclElement != null) { - for (int i3 = 0; i3 < rulesSequenceElement.getElementsByTagName("Rule").getLength(); i3 = i3 + 1) + EndpointAcl endpointAclInstance = new EndpointAcl(); + inputEndpointInstance.setEndpointAcl(endpointAclInstance); + + NodeList elements25 = endpointAclElement.getElementsByTagName("Rules"); + Element rulesSequenceElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (rulesSequenceElement != null) { - org.w3c.dom.Element rulesElement = ((org.w3c.dom.Element) rulesSequenceElement.getElementsByTagName("Rule").item(i3)); - AccessControlListRule ruleInstance = new AccessControlListRule(); - endpointAclInstance.getRules().add(ruleInstance); - - NodeList elements26 = rulesElement.getElementsByTagName("Order"); - Element orderElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (orderElement != null && (orderElement.getTextContent() != null && orderElement.getTextContent().isEmpty() != true) == false) - { - int orderInstance; - orderInstance = Integer.parseInt(orderElement.getTextContent()); - ruleInstance.setOrder(orderInstance); - } - - NodeList elements27 = rulesElement.getElementsByTagName("Action"); - Element actionElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; - if (actionElement != null) - { - String actionInstance; - actionInstance = actionElement.getTextContent(); - ruleInstance.setAction(actionInstance); - } - - NodeList elements28 = rulesElement.getElementsByTagName("RemoteSubnet"); - Element remoteSubnetElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; - if (remoteSubnetElement != null) - { - String remoteSubnetInstance; - remoteSubnetInstance = remoteSubnetElement.getTextContent(); - ruleInstance.setRemoteSubnet(remoteSubnetInstance); - } - - NodeList elements29 = rulesElement.getElementsByTagName("Description"); - Element descriptionElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; - if (descriptionElement != null) + for (int i3 = 0; i3 < rulesSequenceElement.getElementsByTagName("Rule").getLength(); i3 = i3 + 1) { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - ruleInstance.setDescription(descriptionInstance); + org.w3c.dom.Element rulesElement = ((org.w3c.dom.Element) rulesSequenceElement.getElementsByTagName("Rule").item(i3)); + AccessControlListRule ruleInstance = new AccessControlListRule(); + endpointAclInstance.getRules().add(ruleInstance); + + NodeList elements26 = rulesElement.getElementsByTagName("Order"); + Element orderElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (orderElement != null && (orderElement.getTextContent() != null && orderElement.getTextContent().isEmpty() != true) == false) + { + int orderInstance; + orderInstance = Integer.parseInt(orderElement.getTextContent()); + ruleInstance.setOrder(orderInstance); + } + + NodeList elements27 = rulesElement.getElementsByTagName("Action"); + Element actionElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; + if (actionElement != null) + { + String actionInstance; + actionInstance = actionElement.getTextContent(); + ruleInstance.setAction(actionInstance); + } + + NodeList elements28 = rulesElement.getElementsByTagName("RemoteSubnet"); + Element remoteSubnetElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; + if (remoteSubnetElement != null) + { + String remoteSubnetInstance; + remoteSubnetInstance = remoteSubnetElement.getTextContent(); + ruleInstance.setRemoteSubnet(remoteSubnetInstance); + } + + NodeList elements29 = rulesElement.getElementsByTagName("Description"); + Element descriptionElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; + if (descriptionElement != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + ruleInstance.setDescription(descriptionInstance); + } } } } } } - } - - NodeList elements30 = configurationSetsElement.getElementsByTagName("SubnetNames"); - Element subnetNamesSequenceElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; - if (subnetNamesSequenceElement != null) - { - for (int i4 = 0; i4 < subnetNamesSequenceElement.getElementsByTagName("SubnetName").getLength(); i4 = i4 + 1) - { - org.w3c.dom.Element subnetNamesElement = ((org.w3c.dom.Element) subnetNamesSequenceElement.getElementsByTagName("SubnetName").item(i4)); - configurationSetInstance.getSubnetNames().add(subnetNamesElement.getTextContent()); - } - } - - NodeList elements31 = configurationSetsElement.getElementsByTagName("ComputerName"); - Element computerNameElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; - if (computerNameElement != null) - { - String computerNameInstance; - computerNameInstance = computerNameElement.getTextContent(); - configurationSetInstance.setComputerName(computerNameInstance); - } - - NodeList elements32 = configurationSetsElement.getElementsByTagName("AdminPassword"); - Element adminPasswordElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; - if (adminPasswordElement != null) - { - String adminPasswordInstance; - adminPasswordInstance = adminPasswordElement.getTextContent(); - configurationSetInstance.setAdminPassword(adminPasswordInstance); - } - - NodeList elements33 = configurationSetsElement.getElementsByTagName("ResetPasswordOnFirstLogon"); - Element resetPasswordOnFirstLogonElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; - if (resetPasswordOnFirstLogonElement != null && (resetPasswordOnFirstLogonElement.getTextContent() != null && resetPasswordOnFirstLogonElement.getTextContent().isEmpty() != true) == false) - { - boolean resetPasswordOnFirstLogonInstance; - resetPasswordOnFirstLogonInstance = Boolean.parseBoolean(resetPasswordOnFirstLogonElement.getTextContent()); - configurationSetInstance.setResetPasswordOnFirstLogon(resetPasswordOnFirstLogonInstance); - } - - NodeList elements34 = configurationSetsElement.getElementsByTagName("EnableAutomaticUpdates"); - Element enableAutomaticUpdatesElement = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; - if (enableAutomaticUpdatesElement != null && (enableAutomaticUpdatesElement.getTextContent() != null && enableAutomaticUpdatesElement.getTextContent().isEmpty() != true) == false) - { - boolean enableAutomaticUpdatesInstance; - enableAutomaticUpdatesInstance = Boolean.parseBoolean(enableAutomaticUpdatesElement.getTextContent()); - configurationSetInstance.setEnableAutomaticUpdates(enableAutomaticUpdatesInstance); - } - - NodeList elements35 = configurationSetsElement.getElementsByTagName("TimeZone"); - Element timeZoneElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; - if (timeZoneElement != null) - { - String timeZoneInstance; - timeZoneInstance = timeZoneElement.getTextContent(); - configurationSetInstance.setTimeZone(timeZoneInstance); - } - - NodeList elements36 = configurationSetsElement.getElementsByTagName("DomainJoin"); - Element domainJoinElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; - if (domainJoinElement != null) - { - DomainJoinSettings domainJoinInstance = new DomainJoinSettings(); - configurationSetInstance.setDomainJoin(domainJoinInstance); - NodeList elements37 = domainJoinElement.getElementsByTagName("Credentials"); - Element credentialsElement = elements37.getLength() > 0 ? ((Element) elements37.item(0)) : null; - if (credentialsElement != null) + NodeList elements30 = configurationSetsElement.getElementsByTagName("SubnetNames"); + Element subnetNamesSequenceElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; + if (subnetNamesSequenceElement != null) { - DomainJoinCredentials credentialsInstance = new DomainJoinCredentials(); - domainJoinInstance.setCredentials(credentialsInstance); - - NodeList elements38 = credentialsElement.getElementsByTagName("Domain"); - Element domainElement = elements38.getLength() > 0 ? ((Element) elements38.item(0)) : null; - if (domainElement != null) - { - String domainInstance; - domainInstance = domainElement.getTextContent(); - credentialsInstance.setDomain(domainInstance); - } - - NodeList elements39 = credentialsElement.getElementsByTagName("Username"); - Element usernameElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; - if (usernameElement != null) + for (int i4 = 0; i4 < subnetNamesSequenceElement.getElementsByTagName("SubnetName").getLength(); i4 = i4 + 1) { - String usernameInstance; - usernameInstance = usernameElement.getTextContent(); - credentialsInstance.setUserName(usernameInstance); - } - - NodeList elements40 = credentialsElement.getElementsByTagName("Password"); - Element passwordElement = elements40.getLength() > 0 ? ((Element) elements40.item(0)) : null; - if (passwordElement != null) - { - String passwordInstance; - passwordInstance = passwordElement.getTextContent(); - credentialsInstance.setPassword(passwordInstance); + org.w3c.dom.Element subnetNamesElement = ((org.w3c.dom.Element) subnetNamesSequenceElement.getElementsByTagName("SubnetName").item(i4)); + configurationSetInstance.getSubnetNames().add(subnetNamesElement.getTextContent()); } } - NodeList elements41 = domainJoinElement.getElementsByTagName("JoinDomain"); - Element joinDomainElement = elements41.getLength() > 0 ? ((Element) elements41.item(0)) : null; - if (joinDomainElement != null) + NodeList elements31 = configurationSetsElement.getElementsByTagName("StaticVirtualNetworkIPAddress"); + Element staticVirtualNetworkIPAddressElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; + if (staticVirtualNetworkIPAddressElement != null) + { + String staticVirtualNetworkIPAddressInstance; + staticVirtualNetworkIPAddressInstance = staticVirtualNetworkIPAddressElement.getTextContent(); + configurationSetInstance.setStaticVirtualNetworkIPAddress(staticVirtualNetworkIPAddressInstance); + } + + NodeList elements32 = configurationSetsElement.getElementsByTagName("ComputerName"); + Element computerNameElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; + if (computerNameElement != null) + { + String computerNameInstance; + computerNameInstance = computerNameElement.getTextContent(); + configurationSetInstance.setComputerName(computerNameInstance); + } + + NodeList elements33 = configurationSetsElement.getElementsByTagName("AdminPassword"); + Element adminPasswordElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; + if (adminPasswordElement != null) + { + String adminPasswordInstance; + adminPasswordInstance = adminPasswordElement.getTextContent(); + configurationSetInstance.setAdminPassword(adminPasswordInstance); + } + + NodeList elements34 = configurationSetsElement.getElementsByTagName("ResetPasswordOnFirstLogon"); + Element resetPasswordOnFirstLogonElement = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; + if (resetPasswordOnFirstLogonElement != null && (resetPasswordOnFirstLogonElement.getTextContent() != null && resetPasswordOnFirstLogonElement.getTextContent().isEmpty() != true) == false) { - String joinDomainInstance; - joinDomainInstance = joinDomainElement.getTextContent(); - domainJoinInstance.setDomainToJoin(joinDomainInstance); + boolean resetPasswordOnFirstLogonInstance; + resetPasswordOnFirstLogonInstance = Boolean.parseBoolean(resetPasswordOnFirstLogonElement.getTextContent()); + configurationSetInstance.setResetPasswordOnFirstLogon(resetPasswordOnFirstLogonInstance); } - NodeList elements42 = domainJoinElement.getElementsByTagName("MachineObjectOU"); - Element machineObjectOUElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; - if (machineObjectOUElement != null) + NodeList elements35 = configurationSetsElement.getElementsByTagName("EnableAutomaticUpdates"); + Element enableAutomaticUpdatesElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; + if (enableAutomaticUpdatesElement != null && (enableAutomaticUpdatesElement.getTextContent() != null && enableAutomaticUpdatesElement.getTextContent().isEmpty() != true) == false) { - String machineObjectOUInstance; - machineObjectOUInstance = machineObjectOUElement.getTextContent(); - domainJoinInstance.setLdapMachineObjectOU(machineObjectOUInstance); + boolean enableAutomaticUpdatesInstance; + enableAutomaticUpdatesInstance = Boolean.parseBoolean(enableAutomaticUpdatesElement.getTextContent()); + configurationSetInstance.setEnableAutomaticUpdates(enableAutomaticUpdatesInstance); } - NodeList elements43 = domainJoinElement.getElementsByTagName("Provisioning"); - Element provisioningElement = elements43.getLength() > 0 ? ((Element) elements43.item(0)) : null; - if (provisioningElement != null) + NodeList elements36 = configurationSetsElement.getElementsByTagName("TimeZone"); + Element timeZoneElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; + if (timeZoneElement != null) { - DomainJoinProvisioning provisioningInstance = new DomainJoinProvisioning(); - domainJoinInstance.setProvisioning(provisioningInstance); + String timeZoneInstance; + timeZoneInstance = timeZoneElement.getTextContent(); + configurationSetInstance.setTimeZone(timeZoneInstance); + } + + NodeList elements37 = configurationSetsElement.getElementsByTagName("DomainJoin"); + Element domainJoinElement = elements37.getLength() > 0 ? ((Element) elements37.item(0)) : null; + if (domainJoinElement != null) + { + DomainJoinSettings domainJoinInstance = new DomainJoinSettings(); + configurationSetInstance.setDomainJoin(domainJoinInstance); - NodeList elements44 = provisioningElement.getElementsByTagName("AccountData"); - Element accountDataElement = elements44.getLength() > 0 ? ((Element) elements44.item(0)) : null; - if (accountDataElement != null) + NodeList elements38 = domainJoinElement.getElementsByTagName("Credentials"); + Element credentialsElement = elements38.getLength() > 0 ? ((Element) elements38.item(0)) : null; + if (credentialsElement != null) { - String accountDataInstance; - accountDataInstance = accountDataElement.getTextContent(); - provisioningInstance.setAccountData(accountDataInstance); + DomainJoinCredentials credentialsInstance = new DomainJoinCredentials(); + domainJoinInstance.setCredentials(credentialsInstance); + + NodeList elements39 = credentialsElement.getElementsByTagName("Domain"); + Element domainElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; + if (domainElement != null) + { + String domainInstance; + domainInstance = domainElement.getTextContent(); + credentialsInstance.setDomain(domainInstance); + } + + NodeList elements40 = credentialsElement.getElementsByTagName("Username"); + Element usernameElement = elements40.getLength() > 0 ? ((Element) elements40.item(0)) : null; + if (usernameElement != null) + { + String usernameInstance; + usernameInstance = usernameElement.getTextContent(); + credentialsInstance.setUserName(usernameInstance); + } + + NodeList elements41 = credentialsElement.getElementsByTagName("Password"); + Element passwordElement = elements41.getLength() > 0 ? ((Element) elements41.item(0)) : null; + if (passwordElement != null) + { + String passwordInstance; + passwordInstance = passwordElement.getTextContent(); + credentialsInstance.setPassword(passwordInstance); + } } - } - } - - NodeList elements45 = configurationSetsElement.getElementsByTagName("StoredCertificateSettings"); - Element storedCertificateSettingsSequenceElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; - if (storedCertificateSettingsSequenceElement != null) - { - for (int i5 = 0; i5 < storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").getLength(); i5 = i5 + 1) - { - org.w3c.dom.Element storedCertificateSettingsElement = ((org.w3c.dom.Element) storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").item(i5)); - StoredCertificateSettings certificateSettingInstance = new StoredCertificateSettings(); - configurationSetInstance.getStoredCertificateSettings().add(certificateSettingInstance); - NodeList elements46 = storedCertificateSettingsElement.getElementsByTagName("StoreLocation"); - Element storeLocationElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; - if (storeLocationElement != null) + NodeList elements42 = domainJoinElement.getElementsByTagName("JoinDomain"); + Element joinDomainElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; + if (joinDomainElement != null) { + String joinDomainInstance; + joinDomainInstance = joinDomainElement.getTextContent(); + domainJoinInstance.setDomainToJoin(joinDomainInstance); } - NodeList elements47 = storedCertificateSettingsElement.getElementsByTagName("StoreName"); - Element storeNameElement = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; - if (storeNameElement != null) + NodeList elements43 = domainJoinElement.getElementsByTagName("MachineObjectOU"); + Element machineObjectOUElement = elements43.getLength() > 0 ? ((Element) elements43.item(0)) : null; + if (machineObjectOUElement != null) { - String storeNameInstance; - storeNameInstance = storeNameElement.getTextContent(); - certificateSettingInstance.setStoreName(storeNameInstance); + String machineObjectOUInstance; + machineObjectOUInstance = machineObjectOUElement.getTextContent(); + domainJoinInstance.setLdapMachineObjectOU(machineObjectOUInstance); } - NodeList elements48 = storedCertificateSettingsElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements48.getLength() > 0 ? ((Element) elements48.item(0)) : null; - if (thumbprintElement != null) + NodeList elements44 = domainJoinElement.getElementsByTagName("Provisioning"); + Element provisioningElement = elements44.getLength() > 0 ? ((Element) elements44.item(0)) : null; + if (provisioningElement != null) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - certificateSettingInstance.setThumbprint(thumbprintInstance); + DomainJoinProvisioning provisioningInstance = new DomainJoinProvisioning(); + domainJoinInstance.setProvisioning(provisioningInstance); + + NodeList elements45 = provisioningElement.getElementsByTagName("AccountData"); + Element accountDataElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; + if (accountDataElement != null) + { + String accountDataInstance; + accountDataInstance = accountDataElement.getTextContent(); + provisioningInstance.setAccountData(accountDataInstance); + } } } - } - - NodeList elements49 = configurationSetsElement.getElementsByTagName("WinRM"); - Element winRMElement = elements49.getLength() > 0 ? ((Element) elements49.item(0)) : null; - if (winRMElement != null) - { - WindowsRemoteManagementSettings winRMInstance = new WindowsRemoteManagementSettings(); - configurationSetInstance.setWindowsRemoteManagement(winRMInstance); - NodeList elements50 = winRMElement.getElementsByTagName("Listeners"); - Element listenersSequenceElement = elements50.getLength() > 0 ? ((Element) elements50.item(0)) : null; - if (listenersSequenceElement != null) + NodeList elements46 = configurationSetsElement.getElementsByTagName("StoredCertificateSettings"); + Element storedCertificateSettingsSequenceElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; + if (storedCertificateSettingsSequenceElement != null) { - for (int i6 = 0; i6 < listenersSequenceElement.getElementsByTagName("Listener").getLength(); i6 = i6 + 1) + for (int i5 = 0; i5 < storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").getLength(); i5 = i5 + 1) { - org.w3c.dom.Element listenersElement = ((org.w3c.dom.Element) listenersSequenceElement.getElementsByTagName("Listener").item(i6)); - WindowsRemoteManagementListener listenerInstance = new WindowsRemoteManagementListener(); - winRMInstance.getListeners().add(listenerInstance); + org.w3c.dom.Element storedCertificateSettingsElement = ((org.w3c.dom.Element) storedCertificateSettingsSequenceElement.getElementsByTagName("CertificateSetting").item(i5)); + StoredCertificateSettings certificateSettingInstance = new StoredCertificateSettings(); + configurationSetInstance.getStoredCertificateSettings().add(certificateSettingInstance); + + NodeList elements47 = storedCertificateSettingsElement.getElementsByTagName("StoreLocation"); + Element storeLocationElement = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; + if (storeLocationElement != null) + { + } - NodeList elements51 = listenersElement.getElementsByTagName("Protocol"); - Element protocolElement3 = elements51.getLength() > 0 ? ((Element) elements51.item(0)) : null; - if (protocolElement3 != null) + NodeList elements48 = storedCertificateSettingsElement.getElementsByTagName("StoreName"); + Element storeNameElement = elements48.getLength() > 0 ? ((Element) elements48.item(0)) : null; + if (storeNameElement != null) { - VirtualMachineWindowsRemoteManagementListenerType protocolInstance3; - protocolInstance3 = VirtualMachineWindowsRemoteManagementListenerType.valueOf(protocolElement3.getTextContent()); - listenerInstance.setListenerType(protocolInstance3); + String storeNameInstance; + storeNameInstance = storeNameElement.getTextContent(); + certificateSettingInstance.setStoreName(storeNameInstance); } - NodeList elements52 = listenersElement.getElementsByTagName("CertificateThumbprint"); - Element certificateThumbprintElement = elements52.getLength() > 0 ? ((Element) elements52.item(0)) : null; - if (certificateThumbprintElement != null) + NodeList elements49 = storedCertificateSettingsElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements49.getLength() > 0 ? ((Element) elements49.item(0)) : null; + if (thumbprintElement != null) { - String certificateThumbprintInstance; - certificateThumbprintInstance = certificateThumbprintElement.getTextContent(); - listenerInstance.setCertificateThumbprint(certificateThumbprintInstance); + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + certificateSettingInstance.setThumbprint(thumbprintInstance); } } } - } - - NodeList elements53 = configurationSetsElement.getElementsByTagName("AdminUsername"); - Element adminUsernameElement = elements53.getLength() > 0 ? ((Element) elements53.item(0)) : null; - if (adminUsernameElement != null) - { - String adminUsernameInstance; - adminUsernameInstance = adminUsernameElement.getTextContent(); - configurationSetInstance.setAdminUserName(adminUsernameInstance); - } - - NodeList elements54 = configurationSetsElement.getElementsByTagName("HostName"); - Element hostNameElement = elements54.getLength() > 0 ? ((Element) elements54.item(0)) : null; - if (hostNameElement != null) - { - String hostNameInstance; - hostNameInstance = hostNameElement.getTextContent(); - configurationSetInstance.setHostName(hostNameInstance); - } - - NodeList elements55 = configurationSetsElement.getElementsByTagName("UserName"); - Element userNameElement = elements55.getLength() > 0 ? ((Element) elements55.item(0)) : null; - if (userNameElement != null) - { - String userNameInstance; - userNameInstance = userNameElement.getTextContent(); - configurationSetInstance.setUserName(userNameInstance); - } - - NodeList elements56 = configurationSetsElement.getElementsByTagName("UserPassword"); - Element userPasswordElement = elements56.getLength() > 0 ? ((Element) elements56.item(0)) : null; - if (userPasswordElement != null) - { - String userPasswordInstance; - userPasswordInstance = userPasswordElement.getTextContent(); - configurationSetInstance.setUserPassword(userPasswordInstance); - } - - NodeList elements57 = configurationSetsElement.getElementsByTagName("DisableSshPasswordAuthentication"); - Element disableSshPasswordAuthenticationElement = elements57.getLength() > 0 ? ((Element) elements57.item(0)) : null; - if (disableSshPasswordAuthenticationElement != null && (disableSshPasswordAuthenticationElement.getTextContent() != null && disableSshPasswordAuthenticationElement.getTextContent().isEmpty() != true) == false) - { - boolean disableSshPasswordAuthenticationInstance; - disableSshPasswordAuthenticationInstance = Boolean.parseBoolean(disableSshPasswordAuthenticationElement.getTextContent()); - configurationSetInstance.setDisableSshPasswordAuthentication(disableSshPasswordAuthenticationInstance); - } - - NodeList elements58 = configurationSetsElement.getElementsByTagName("SSH"); - Element sSHElement = elements58.getLength() > 0 ? ((Element) elements58.item(0)) : null; - if (sSHElement != null) - { - SshSettings sSHInstance = new SshSettings(); - configurationSetInstance.setSshSettings(sSHInstance); - NodeList elements59 = sSHElement.getElementsByTagName("PublicKeys"); - Element publicKeysSequenceElement = elements59.getLength() > 0 ? ((Element) elements59.item(0)) : null; - if (publicKeysSequenceElement != null) + NodeList elements50 = configurationSetsElement.getElementsByTagName("WinRM"); + Element winRMElement = elements50.getLength() > 0 ? ((Element) elements50.item(0)) : null; + if (winRMElement != null) { - for (int i7 = 0; i7 < publicKeysSequenceElement.getElementsByTagName("PublicKey").getLength(); i7 = i7 + 1) + WindowsRemoteManagementSettings winRMInstance = new WindowsRemoteManagementSettings(); + configurationSetInstance.setWindowsRemoteManagement(winRMInstance); + + NodeList elements51 = winRMElement.getElementsByTagName("Listeners"); + Element listenersSequenceElement = elements51.getLength() > 0 ? ((Element) elements51.item(0)) : null; + if (listenersSequenceElement != null) { - org.w3c.dom.Element publicKeysElement = ((org.w3c.dom.Element) publicKeysSequenceElement.getElementsByTagName("PublicKey").item(i7)); - SshSettingPublicKey publicKeyInstance = new SshSettingPublicKey(); - sSHInstance.getPublicKeys().add(publicKeyInstance); - - NodeList elements60 = publicKeysElement.getElementsByTagName("Fingerprint"); - Element fingerprintElement = elements60.getLength() > 0 ? ((Element) elements60.item(0)) : null; - if (fingerprintElement != null) - { - String fingerprintInstance; - fingerprintInstance = fingerprintElement.getTextContent(); - publicKeyInstance.setFingerprint(fingerprintInstance); - } - - NodeList elements61 = publicKeysElement.getElementsByTagName("Path"); - Element pathElement2 = elements61.getLength() > 0 ? ((Element) elements61.item(0)) : null; - if (pathElement2 != null) + for (int i6 = 0; i6 < listenersSequenceElement.getElementsByTagName("Listener").getLength(); i6 = i6 + 1) { - String pathInstance2; - pathInstance2 = pathElement2.getTextContent(); - publicKeyInstance.setPath(pathInstance2); + org.w3c.dom.Element listenersElement = ((org.w3c.dom.Element) listenersSequenceElement.getElementsByTagName("Listener").item(i6)); + WindowsRemoteManagementListener listenerInstance = new WindowsRemoteManagementListener(); + winRMInstance.getListeners().add(listenerInstance); + + NodeList elements52 = listenersElement.getElementsByTagName("Protocol"); + Element protocolElement3 = elements52.getLength() > 0 ? ((Element) elements52.item(0)) : null; + if (protocolElement3 != null) + { + VirtualMachineWindowsRemoteManagementListenerType protocolInstance3; + protocolInstance3 = VirtualMachineWindowsRemoteManagementListenerType.valueOf(protocolElement3.getTextContent()); + listenerInstance.setListenerType(protocolInstance3); + } + + NodeList elements53 = listenersElement.getElementsByTagName("CertificateThumbprint"); + Element certificateThumbprintElement = elements53.getLength() > 0 ? ((Element) elements53.item(0)) : null; + if (certificateThumbprintElement != null) + { + String certificateThumbprintInstance; + certificateThumbprintInstance = certificateThumbprintElement.getTextContent(); + listenerInstance.setCertificateThumbprint(certificateThumbprintInstance); + } } } } - NodeList elements62 = sSHElement.getElementsByTagName("KeyPairs"); - Element keyPairsSequenceElement = elements62.getLength() > 0 ? ((Element) elements62.item(0)) : null; - if (keyPairsSequenceElement != null) + NodeList elements54 = configurationSetsElement.getElementsByTagName("AdminUsername"); + Element adminUsernameElement = elements54.getLength() > 0 ? ((Element) elements54.item(0)) : null; + if (adminUsernameElement != null) + { + String adminUsernameInstance; + adminUsernameInstance = adminUsernameElement.getTextContent(); + configurationSetInstance.setAdminUserName(adminUsernameInstance); + } + + NodeList elements55 = configurationSetsElement.getElementsByTagName("HostName"); + Element hostNameElement = elements55.getLength() > 0 ? ((Element) elements55.item(0)) : null; + if (hostNameElement != null) + { + String hostNameInstance; + hostNameInstance = hostNameElement.getTextContent(); + configurationSetInstance.setHostName(hostNameInstance); + } + + NodeList elements56 = configurationSetsElement.getElementsByTagName("UserName"); + Element userNameElement = elements56.getLength() > 0 ? ((Element) elements56.item(0)) : null; + if (userNameElement != null) + { + String userNameInstance; + userNameInstance = userNameElement.getTextContent(); + configurationSetInstance.setUserName(userNameInstance); + } + + NodeList elements57 = configurationSetsElement.getElementsByTagName("UserPassword"); + Element userPasswordElement = elements57.getLength() > 0 ? ((Element) elements57.item(0)) : null; + if (userPasswordElement != null) + { + String userPasswordInstance; + userPasswordInstance = userPasswordElement.getTextContent(); + configurationSetInstance.setUserPassword(userPasswordInstance); + } + + NodeList elements58 = configurationSetsElement.getElementsByTagName("DisableSshPasswordAuthentication"); + Element disableSshPasswordAuthenticationElement = elements58.getLength() > 0 ? ((Element) elements58.item(0)) : null; + if (disableSshPasswordAuthenticationElement != null && (disableSshPasswordAuthenticationElement.getTextContent() != null && disableSshPasswordAuthenticationElement.getTextContent().isEmpty() != true) == false) + { + boolean disableSshPasswordAuthenticationInstance; + disableSshPasswordAuthenticationInstance = Boolean.parseBoolean(disableSshPasswordAuthenticationElement.getTextContent()); + configurationSetInstance.setDisableSshPasswordAuthentication(disableSshPasswordAuthenticationInstance); + } + + NodeList elements59 = configurationSetsElement.getElementsByTagName("SSH"); + Element sSHElement = elements59.getLength() > 0 ? ((Element) elements59.item(0)) : null; + if (sSHElement != null) { - for (int i8 = 0; i8 < keyPairsSequenceElement.getElementsByTagName("KeyPair").getLength(); i8 = i8 + 1) + SshSettings sSHInstance = new SshSettings(); + configurationSetInstance.setSshSettings(sSHInstance); + + NodeList elements60 = sSHElement.getElementsByTagName("PublicKeys"); + Element publicKeysSequenceElement = elements60.getLength() > 0 ? ((Element) elements60.item(0)) : null; + if (publicKeysSequenceElement != null) { - org.w3c.dom.Element keyPairsElement = ((org.w3c.dom.Element) keyPairsSequenceElement.getElementsByTagName("KeyPair").item(i8)); - SshSettingKeyPair keyPairInstance = new SshSettingKeyPair(); - sSHInstance.getKeyPairs().add(keyPairInstance); - - NodeList elements63 = keyPairsElement.getElementsByTagName("Fingerprint"); - Element fingerprintElement2 = elements63.getLength() > 0 ? ((Element) elements63.item(0)) : null; - if (fingerprintElement2 != null) + for (int i7 = 0; i7 < publicKeysSequenceElement.getElementsByTagName("PublicKey").getLength(); i7 = i7 + 1) { - String fingerprintInstance2; - fingerprintInstance2 = fingerprintElement2.getTextContent(); - keyPairInstance.setFingerprint(fingerprintInstance2); + org.w3c.dom.Element publicKeysElement = ((org.w3c.dom.Element) publicKeysSequenceElement.getElementsByTagName("PublicKey").item(i7)); + SshSettingPublicKey publicKeyInstance = new SshSettingPublicKey(); + sSHInstance.getPublicKeys().add(publicKeyInstance); + + NodeList elements61 = publicKeysElement.getElementsByTagName("Fingerprint"); + Element fingerprintElement = elements61.getLength() > 0 ? ((Element) elements61.item(0)) : null; + if (fingerprintElement != null) + { + String fingerprintInstance; + fingerprintInstance = fingerprintElement.getTextContent(); + publicKeyInstance.setFingerprint(fingerprintInstance); + } + + NodeList elements62 = publicKeysElement.getElementsByTagName("Path"); + Element pathElement2 = elements62.getLength() > 0 ? ((Element) elements62.item(0)) : null; + if (pathElement2 != null) + { + String pathInstance2; + pathInstance2 = pathElement2.getTextContent(); + publicKeyInstance.setPath(pathInstance2); + } } - - NodeList elements64 = keyPairsElement.getElementsByTagName("Path"); - Element pathElement3 = elements64.getLength() > 0 ? ((Element) elements64.item(0)) : null; - if (pathElement3 != null) + } + + NodeList elements63 = sSHElement.getElementsByTagName("KeyPairs"); + Element keyPairsSequenceElement = elements63.getLength() > 0 ? ((Element) elements63.item(0)) : null; + if (keyPairsSequenceElement != null) + { + for (int i8 = 0; i8 < keyPairsSequenceElement.getElementsByTagName("KeyPair").getLength(); i8 = i8 + 1) { - String pathInstance3; - pathInstance3 = pathElement3.getTextContent(); - keyPairInstance.setPath(pathInstance3); + org.w3c.dom.Element keyPairsElement = ((org.w3c.dom.Element) keyPairsSequenceElement.getElementsByTagName("KeyPair").item(i8)); + SshSettingKeyPair keyPairInstance = new SshSettingKeyPair(); + sSHInstance.getKeyPairs().add(keyPairInstance); + + NodeList elements64 = keyPairsElement.getElementsByTagName("Fingerprint"); + Element fingerprintElement2 = elements64.getLength() > 0 ? ((Element) elements64.item(0)) : null; + if (fingerprintElement2 != null) + { + String fingerprintInstance2; + fingerprintInstance2 = fingerprintElement2.getTextContent(); + keyPairInstance.setFingerprint(fingerprintInstance2); + } + + NodeList elements65 = keyPairsElement.getElementsByTagName("Path"); + Element pathElement3 = elements65.getLength() > 0 ? ((Element) elements65.item(0)) : null; + if (pathElement3 != null) + { + String pathInstance3; + pathInstance3 = pathElement3.getTextContent(); + keyPairInstance.setPath(pathInstance3); + } } } } } } - } - - NodeList elements65 = persistentVMRoleElement.getElementsByTagName("DataVirtualHardDisks"); - Element dataVirtualHardDisksSequenceElement = elements65.getLength() > 0 ? ((Element) elements65.item(0)) : null; - if (dataVirtualHardDisksSequenceElement != null) - { - for (int i9 = 0; i9 < dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").getLength(); i9 = i9 + 1) + + NodeList elements66 = persistentVMRoleElement.getElementsByTagName("DataVirtualHardDisks"); + Element dataVirtualHardDisksSequenceElement = elements66.getLength() > 0 ? ((Element) elements66.item(0)) : null; + if (dataVirtualHardDisksSequenceElement != null) + { + for (int i9 = 0; i9 < dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").getLength(); i9 = i9 + 1) + { + org.w3c.dom.Element dataVirtualHardDisksElement = ((org.w3c.dom.Element) dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").item(i9)); + DataVirtualHardDisk dataVirtualHardDiskInstance = new DataVirtualHardDisk(); + result.getDataVirtualHardDisks().add(dataVirtualHardDiskInstance); + + NodeList elements67 = dataVirtualHardDisksElement.getElementsByTagName("HostCaching"); + Element hostCachingElement = elements67.getLength() > 0 ? ((Element) elements67.item(0)) : null; + if (hostCachingElement != null && (hostCachingElement.getTextContent() != null && hostCachingElement.getTextContent().isEmpty() != true) == false) + { + VirtualHardDiskHostCaching hostCachingInstance; + hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); + dataVirtualHardDiskInstance.setHostCaching(hostCachingInstance); + } + + NodeList elements68 = dataVirtualHardDisksElement.getElementsByTagName("DiskLabel"); + Element diskLabelElement = elements68.getLength() > 0 ? ((Element) elements68.item(0)) : null; + if (diskLabelElement != null) + { + String diskLabelInstance; + diskLabelInstance = diskLabelElement.getTextContent(); + dataVirtualHardDiskInstance.setDiskLabel(diskLabelInstance); + } + + NodeList elements69 = dataVirtualHardDisksElement.getElementsByTagName("DiskName"); + Element diskNameElement = elements69.getLength() > 0 ? ((Element) elements69.item(0)) : null; + if (diskNameElement != null) + { + String diskNameInstance; + diskNameInstance = diskNameElement.getTextContent(); + dataVirtualHardDiskInstance.setDiskName(diskNameInstance); + } + + NodeList elements70 = dataVirtualHardDisksElement.getElementsByTagName("Lun"); + Element lunElement = elements70.getLength() > 0 ? ((Element) elements70.item(0)) : null; + if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + { + int lunInstance; + lunInstance = Integer.parseInt(lunElement.getTextContent()); + dataVirtualHardDiskInstance.setLogicalUnitNumber(lunInstance); + } + + NodeList elements71 = dataVirtualHardDisksElement.getElementsByTagName("LogicalDiskSizeInGB"); + Element logicalDiskSizeInGBElement = elements71.getLength() > 0 ? ((Element) elements71.item(0)) : null; + if (logicalDiskSizeInGBElement != null) + { + int logicalDiskSizeInGBInstance; + logicalDiskSizeInGBInstance = Integer.parseInt(logicalDiskSizeInGBElement.getTextContent()); + dataVirtualHardDiskInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + } + + NodeList elements72 = dataVirtualHardDisksElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement = elements72.getLength() > 0 ? ((Element) elements72.item(0)) : null; + if (mediaLinkElement != null) + { + URI mediaLinkInstance; + mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); + dataVirtualHardDiskInstance.setMediaLink(mediaLinkInstance); + } + } + } + + NodeList elements73 = persistentVMRoleElement.getElementsByTagName("OSVirtualHardDisk"); + Element oSVirtualHardDiskElement = elements73.getLength() > 0 ? ((Element) elements73.item(0)) : null; + if (oSVirtualHardDiskElement != null) { - org.w3c.dom.Element dataVirtualHardDisksElement = ((org.w3c.dom.Element) dataVirtualHardDisksSequenceElement.getElementsByTagName("DataVirtualHardDisk").item(i9)); - DataVirtualHardDisk dataVirtualHardDiskInstance = new DataVirtualHardDisk(); - result.getDataVirtualHardDisks().add(dataVirtualHardDiskInstance); + OSVirtualHardDisk oSVirtualHardDiskInstance = new OSVirtualHardDisk(); + result.setOSVirtualHardDisk(oSVirtualHardDiskInstance); - NodeList elements66 = dataVirtualHardDisksElement.getElementsByTagName("HostCaching"); - Element hostCachingElement = elements66.getLength() > 0 ? ((Element) elements66.item(0)) : null; - if (hostCachingElement != null && (hostCachingElement.getTextContent() != null && hostCachingElement.getTextContent().isEmpty() != true) == false) + NodeList elements74 = oSVirtualHardDiskElement.getElementsByTagName("HostCaching"); + Element hostCachingElement2 = elements74.getLength() > 0 ? ((Element) elements74.item(0)) : null; + if (hostCachingElement2 != null && (hostCachingElement2.getTextContent() != null && hostCachingElement2.getTextContent().isEmpty() != true) == false) { - VirtualHardDiskHostCaching hostCachingInstance; - hostCachingInstance = VirtualHardDiskHostCaching.valueOf(hostCachingElement.getTextContent()); - dataVirtualHardDiskInstance.setHostCaching(hostCachingInstance); + VirtualHardDiskHostCaching hostCachingInstance2; + hostCachingInstance2 = VirtualHardDiskHostCaching.valueOf(hostCachingElement2.getTextContent()); + oSVirtualHardDiskInstance.setHostCaching(hostCachingInstance2); } - NodeList elements67 = dataVirtualHardDisksElement.getElementsByTagName("DiskLabel"); - Element diskLabelElement = elements67.getLength() > 0 ? ((Element) elements67.item(0)) : null; - if (diskLabelElement != null) + NodeList elements75 = oSVirtualHardDiskElement.getElementsByTagName("DiskLabel"); + Element diskLabelElement2 = elements75.getLength() > 0 ? ((Element) elements75.item(0)) : null; + if (diskLabelElement2 != null) { - String diskLabelInstance; - diskLabelInstance = diskLabelElement.getTextContent(); - dataVirtualHardDiskInstance.setDiskLabel(diskLabelInstance); + String diskLabelInstance2; + diskLabelInstance2 = diskLabelElement2.getTextContent(); + oSVirtualHardDiskInstance.setDiskLabel(diskLabelInstance2); } - NodeList elements68 = dataVirtualHardDisksElement.getElementsByTagName("DiskName"); - Element diskNameElement = elements68.getLength() > 0 ? ((Element) elements68.item(0)) : null; - if (diskNameElement != null) + NodeList elements76 = oSVirtualHardDiskElement.getElementsByTagName("DiskName"); + Element diskNameElement2 = elements76.getLength() > 0 ? ((Element) elements76.item(0)) : null; + if (diskNameElement2 != null) { - String diskNameInstance; - diskNameInstance = diskNameElement.getTextContent(); - dataVirtualHardDiskInstance.setDiskName(diskNameInstance); + String diskNameInstance2; + diskNameInstance2 = diskNameElement2.getTextContent(); + oSVirtualHardDiskInstance.setDiskName(diskNameInstance2); } - NodeList elements69 = dataVirtualHardDisksElement.getElementsByTagName("Lun"); - Element lunElement = elements69.getLength() > 0 ? ((Element) elements69.item(0)) : null; - if (lunElement != null && (lunElement.getTextContent() != null && lunElement.getTextContent().isEmpty() != true) == false) + NodeList elements77 = oSVirtualHardDiskElement.getElementsByTagName("MediaLink"); + Element mediaLinkElement2 = elements77.getLength() > 0 ? ((Element) elements77.item(0)) : null; + if (mediaLinkElement2 != null) { - int lunInstance; - lunInstance = Integer.parseInt(lunElement.getTextContent()); - dataVirtualHardDiskInstance.setLogicalUnitNumber(lunInstance); + URI mediaLinkInstance2; + mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent()); + oSVirtualHardDiskInstance.setMediaLink(mediaLinkInstance2); } - NodeList elements70 = dataVirtualHardDisksElement.getElementsByTagName("LogicalDiskSizeInGB"); - Element logicalDiskSizeInGBElement = elements70.getLength() > 0 ? ((Element) elements70.item(0)) : null; - if (logicalDiskSizeInGBElement != null) + NodeList elements78 = oSVirtualHardDiskElement.getElementsByTagName("SourceImageName"); + Element sourceImageNameElement = elements78.getLength() > 0 ? ((Element) elements78.item(0)) : null; + if (sourceImageNameElement != null) { - int logicalDiskSizeInGBInstance; - logicalDiskSizeInGBInstance = Integer.parseInt(logicalDiskSizeInGBElement.getTextContent()); - dataVirtualHardDiskInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance); + String sourceImageNameInstance; + sourceImageNameInstance = sourceImageNameElement.getTextContent(); + oSVirtualHardDiskInstance.setSourceImageName(sourceImageNameInstance); } - NodeList elements71 = dataVirtualHardDisksElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement = elements71.getLength() > 0 ? ((Element) elements71.item(0)) : null; - if (mediaLinkElement != null) + NodeList elements79 = oSVirtualHardDiskElement.getElementsByTagName("OS"); + Element osElement = elements79.getLength() > 0 ? ((Element) elements79.item(0)) : null; + if (osElement != null) { - URI mediaLinkInstance; - mediaLinkInstance = new URI(mediaLinkElement.getTextContent()); - dataVirtualHardDiskInstance.setMediaLink(mediaLinkInstance); + String osInstance; + osInstance = osElement.getTextContent(); + oSVirtualHardDiskInstance.setOperatingSystem(osInstance); } } } - NodeList elements72 = persistentVMRoleElement.getElementsByTagName("OSVirtualHardDisk"); - Element oSVirtualHardDiskElement = elements72.getLength() > 0 ? ((Element) elements72.item(0)) : null; - if (oSVirtualHardDiskElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - OSVirtualHardDisk oSVirtualHardDiskInstance = new OSVirtualHardDisk(); - result.setOSVirtualHardDisk(oSVirtualHardDiskInstance); - - NodeList elements73 = oSVirtualHardDiskElement.getElementsByTagName("HostCaching"); - Element hostCachingElement2 = elements73.getLength() > 0 ? ((Element) elements73.item(0)) : null; - if (hostCachingElement2 != null && (hostCachingElement2.getTextContent() != null && hostCachingElement2.getTextContent().isEmpty() != true) == false) - { - VirtualHardDiskHostCaching hostCachingInstance2; - hostCachingInstance2 = VirtualHardDiskHostCaching.valueOf(hostCachingElement2.getTextContent()); - oSVirtualHardDiskInstance.setHostCaching(hostCachingInstance2); - } - - NodeList elements74 = oSVirtualHardDiskElement.getElementsByTagName("DiskLabel"); - Element diskLabelElement2 = elements74.getLength() > 0 ? ((Element) elements74.item(0)) : null; - if (diskLabelElement2 != null) - { - String diskLabelInstance2; - diskLabelInstance2 = diskLabelElement2.getTextContent(); - oSVirtualHardDiskInstance.setDiskLabel(diskLabelInstance2); - } - - NodeList elements75 = oSVirtualHardDiskElement.getElementsByTagName("DiskName"); - Element diskNameElement2 = elements75.getLength() > 0 ? ((Element) elements75.item(0)) : null; - if (diskNameElement2 != null) - { - String diskNameInstance2; - diskNameInstance2 = diskNameElement2.getTextContent(); - oSVirtualHardDiskInstance.setDiskName(diskNameInstance2); - } - - NodeList elements76 = oSVirtualHardDiskElement.getElementsByTagName("MediaLink"); - Element mediaLinkElement2 = elements76.getLength() > 0 ? ((Element) elements76.item(0)) : null; - if (mediaLinkElement2 != null) - { - URI mediaLinkInstance2; - mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent()); - oSVirtualHardDiskInstance.setMediaLink(mediaLinkInstance2); - } - - NodeList elements77 = oSVirtualHardDiskElement.getElementsByTagName("SourceImageName"); - Element sourceImageNameElement = elements77.getLength() > 0 ? ((Element) elements77.item(0)) : null; - if (sourceImageNameElement != null) - { - String sourceImageNameInstance; - sourceImageNameInstance = sourceImageNameElement.getTextContent(); - oSVirtualHardDiskInstance.setSourceImageName(sourceImageNameInstance); - } - - NodeList elements78 = oSVirtualHardDiskElement.getElementsByTagName("OS"); - Element osElement = elements78.getLength() > 0 ? ((Element) elements78.item(0)) : null; - if (osElement != null) - { - String osInstance; - osInstance = osElement.getTextContent(); - oSVirtualHardDiskInstance.setOperatingSystem(osInstance); - } + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -5472,6 +5928,10 @@ public VirtualMachineGetRemoteDesktopFileResponse call() throws Exception * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The Download RDP file operation response. */ @Override @@ -5515,44 +5975,54 @@ public VirtualMachineGetRemoteDesktopFileResponse getRemoteDesktopFile(String se // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - VirtualMachineGetRemoteDesktopFileResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new VirtualMachineGetRemoteDesktopFileResponse(); - result.setRemoteDesktopFile(StreamUtils.toString(responseContent).getBytes("UTF-8")); - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + VirtualMachineGetRemoteDesktopFileResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualMachineGetRemoteDesktopFileResponse(); + result.setRemoteDesktopFile(StreamUtils.toString(responseContent).getBytes("UTF-8")); + + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -5593,6 +6063,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine to restart. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -5715,6 +6197,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine to shutdown. * @param parameters The parameters for the shutdown vm operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -5834,6 +6328,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentName The name of your deployment. * @param parameters The set of virtual machine roles to shutdown and their * post shutdown state. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -5954,6 +6460,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param virtualMachineName The name of the virtual machine to start. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -6070,6 +6588,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param serviceName The name of your service. * @param deploymentName The name of your deployment. * @param parameters The set of virtual machine roles to start. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -6196,6 +6726,30 @@ public ComputeOperationStatusResponse call() throws Exception * @param virtualMachineName The name of your virtual machine. * @param parameters Parameters supplied to the Update Virtual Machine * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -6207,7 +6761,7 @@ public ComputeOperationStatusResponse call() throws Exception * failure. */ @Override - public ComputeOperationStatusResponse update(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException + public ComputeOperationStatusResponse update(String serviceName, String deploymentName, String virtualMachineName, VirtualMachineUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException, ParseException, InterruptedException, ExecutionException, ServiceException { ComputeManagementClient client2 = this.getClient(); boolean shouldTrace = CloudTracing.getIsEnabled(); @@ -6321,6 +6875,18 @@ public ComputeOperationStatusResponse call() throws Exception * @param deploymentName The name of your deployment. * @param parameters Parameters supplied to the Update Load Balanced * Endpoint Set operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/AccessControlListRule.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/AccessControlListRule.java index f6befc04d4d04..a1a933fd7e67f 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/AccessControlListRule.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/AccessControlListRule.java @@ -32,6 +32,7 @@ public class AccessControlListRule /** * the action allowed by this Access Control List Rule. + * @return The Action value. */ public String getAction() { @@ -40,16 +41,18 @@ public String getAction() /** * the action allowed by this Access Control List Rule. + * @param actionValue The Action value. */ - public void setAction(String action) + public void setAction(final String actionValue) { - this.action = action; + this.action = actionValue; } private String description; /** * the description for this Access Control List Rule. + * @return The Description value. */ public String getDescription() { @@ -58,16 +61,18 @@ public String getDescription() /** * the description for this Access Control List Rule. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private Integer order; /** * the order of application for this Access Control List Rule. + * @return The Order value. */ public Integer getOrder() { @@ -76,10 +81,11 @@ public Integer getOrder() /** * the order of application for this Access Control List Rule. + * @param orderValue The Order value. */ - public void setOrder(Integer order) + public void setOrder(final Integer orderValue) { - this.order = order; + this.order = orderValue; } private String remoteSubnet; @@ -87,6 +93,7 @@ public void setOrder(Integer order) /** * the remote subnet that is granted access for this Access Control List * Rule. + * @return The RemoteSubnet value. */ public String getRemoteSubnet() { @@ -96,9 +103,10 @@ public String getRemoteSubnet() /** * the remote subnet that is granted access for this Access Control List * Rule. + * @param remoteSubnetValue The RemoteSubnet value. */ - public void setRemoteSubnet(String remoteSubnet) + public void setRemoteSubnet(final String remoteSubnetValue) { - this.remoteSubnet = remoteSubnet; + this.remoteSubnet = remoteSubnetValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ComputeOperationStatusResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ComputeOperationStatusResponse.java index ffd72ad8093f2..e22e8bd7325c1 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ComputeOperationStatusResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ComputeOperationStatusResponse.java @@ -43,6 +43,7 @@ public class ComputeOperationStatusResponse extends OperationResponse * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @return The Error value. */ public ComputeOperationStatusResponse.ErrorDetails getError() { @@ -53,16 +54,18 @@ public ComputeOperationStatusResponse.ErrorDetails getError() * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @param errorValue The Error value. */ - public void setError(ComputeOperationStatusResponse.ErrorDetails error) + public void setError(final ComputeOperationStatusResponse.ErrorDetails errorValue) { - this.error = error; + this.error = errorValue; } private Integer httpStatusCode; /** * The HTTP status code for the asynchronous request. + * @return The HttpStatusCode value. */ public Integer getHttpStatusCode() { @@ -71,10 +74,11 @@ public Integer getHttpStatusCode() /** * The HTTP status code for the asynchronous request. + * @param httpStatusCodeValue The HttpStatusCode value. */ - public void setHttpStatusCode(Integer httpStatusCode) + public void setHttpStatusCode(final Integer httpStatusCodeValue) { - this.httpStatusCode = httpStatusCode; + this.httpStatusCode = httpStatusCodeValue; } private String id; @@ -82,6 +86,7 @@ public void setHttpStatusCode(Integer httpStatusCode) /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @return The Id value. */ public String getId() { @@ -91,16 +96,18 @@ public String getId() /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private OperationStatus status; /** * The status of the asynchronous request. + * @return The Status value. */ public OperationStatus getStatus() { @@ -109,10 +116,11 @@ public OperationStatus getStatus() /** * The status of the asynchronous request. + * @param statusValue The Status value. */ - public void setStatus(OperationStatus status) + public void setStatus(final OperationStatus statusValue) { - this.status = status; + this.status = statusValue; } /** @@ -127,6 +135,7 @@ public static class ErrorDetails /** * The management service error code returned if the asynchronous * request failed. + * @return The Code value. */ public String getCode() { @@ -136,10 +145,11 @@ public String getCode() /** * The management service error code returned if the asynchronous * request failed. + * @param codeValue The Code value. */ - public void setCode(String code) + public void setCode(final String codeValue) { - this.code = code; + this.code = codeValue; } private String message; @@ -147,6 +157,7 @@ public void setCode(String code) /** * The management service error message returned if the asynchronous * request failed. + * @return The Message value. */ public String getMessage() { @@ -156,10 +167,11 @@ public String getMessage() /** * The management service error message returned if the asynchronous * request failed. + * @param messageValue The Message value. */ - public void setMessage(String message) + public void setMessage(final String messageValue) { - this.message = message; + this.message = messageValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ConfigurationSet.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ConfigurationSet.java index e36209aa06504..ffd889094bd2a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ConfigurationSet.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ConfigurationSet.java @@ -35,6 +35,7 @@ public class ConfigurationSet /** * Required. Specifies the string representing the administrator password to * use for the virtual machine. + * @return The AdminPassword value. */ public String getAdminPassword() { @@ -44,10 +45,11 @@ public String getAdminPassword() /** * Required. Specifies the string representing the administrator password to * use for the virtual machine. + * @param adminPasswordValue The AdminPassword value. */ - public void setAdminPassword(String adminPassword) + public void setAdminPassword(final String adminPasswordValue) { - this.adminPassword = adminPassword; + this.adminPassword = adminPasswordValue; } private String adminUserName; @@ -56,6 +58,7 @@ public void setAdminPassword(String adminPassword) * Required. Specifies the name that is used to rename the default * administrator account. This is a required parameter after version * 2013-03-01. + * @return The AdminUserName value. */ public String getAdminUserName() { @@ -66,10 +69,11 @@ public String getAdminUserName() * Required. Specifies the name that is used to rename the default * administrator account. This is a required parameter after version * 2013-03-01. + * @param adminUserNameValue The AdminUserName value. */ - public void setAdminUserName(String adminUserName) + public void setAdminUserName(final String adminUserNameValue) { - this.adminUserName = adminUserName; + this.adminUserName = adminUserNameValue; } private String computerName; @@ -79,6 +83,7 @@ public void setAdminUserName(String adminUserName) * computer name is not specified, a name is created based on the name of * the role. Computer names must be 1 to 15 characters in length. This * element is only used with the WindowsProvisioningConfiguration set. + * @return The ComputerName value. */ public String getComputerName() { @@ -90,16 +95,18 @@ public String getComputerName() * computer name is not specified, a name is created based on the name of * the role. Computer names must be 1 to 15 characters in length. This * element is only used with the WindowsProvisioningConfiguration set. + * @param computerNameValue The ComputerName value. */ - public void setComputerName(String computerName) + public void setComputerName(final String computerNameValue) { - this.computerName = computerName; + this.computerName = computerNameValue; } private String configurationSetType; /** * Specifies the configuration type for the configuration set. + * @return The ConfigurationSetType value. */ public String getConfigurationSetType() { @@ -108,10 +115,11 @@ public String getConfigurationSetType() /** * Specifies the configuration type for the configuration set. + * @param configurationSetTypeValue The ConfigurationSetType value. */ - public void setConfigurationSetType(String configurationSetType) + public void setConfigurationSetType(final String configurationSetTypeValue) { - this.configurationSetType = configurationSetType; + this.configurationSetType = configurationSetTypeValue; } private Boolean disableSshPasswordAuthentication; @@ -120,8 +128,9 @@ public void setConfigurationSetType(String configurationSetType) * Optional. Specifies whether or not SSH authentication is disabled for the * password. This element is only used with the * LinuxProvisioningConfiguration set. By default this value is set to true. + * @return The DisableSshPasswordAuthentication value. */ - public Boolean getDisableSshPasswordAuthentication() + public Boolean isDisableSshPasswordAuthentication() { return this.disableSshPasswordAuthentication; } @@ -130,10 +139,12 @@ public Boolean getDisableSshPasswordAuthentication() * Optional. Specifies whether or not SSH authentication is disabled for the * password. This element is only used with the * LinuxProvisioningConfiguration set. By default this value is set to true. + * @param disableSshPasswordAuthenticationValue The + * DisableSshPasswordAuthentication value. */ - public void setDisableSshPasswordAuthentication(Boolean disableSshPasswordAuthentication) + public void setDisableSshPasswordAuthentication(final Boolean disableSshPasswordAuthenticationValue) { - this.disableSshPasswordAuthentication = disableSshPasswordAuthentication; + this.disableSshPasswordAuthentication = disableSshPasswordAuthenticationValue; } private DomainJoinSettings domainJoin; @@ -142,6 +153,7 @@ public void setDisableSshPasswordAuthentication(Boolean disableSshPasswordAuthen * Optional. Contains properties that specify a domain to which the virtual * machine will be joined. This element is only used with the * WindowsProvisioningConfiguration set. + * @return The DomainJoin value. */ public DomainJoinSettings getDomainJoin() { @@ -152,10 +164,11 @@ public DomainJoinSettings getDomainJoin() * Optional. Contains properties that specify a domain to which the virtual * machine will be joined. This element is only used with the * WindowsProvisioningConfiguration set. + * @param domainJoinValue The DomainJoin value. */ - public void setDomainJoin(DomainJoinSettings domainJoin) + public void setDomainJoin(final DomainJoinSettings domainJoinValue) { - this.domainJoin = domainJoin; + this.domainJoin = domainJoinValue; } private Boolean enableAutomaticUpdates; @@ -164,8 +177,9 @@ public void setDomainJoin(DomainJoinSettings domainJoin) * Optional. Specifies whether automatic updates are enabled for the virtual * machine. This element is only used with the * WindowsProvisioningConfiguration set. The default value is false. + * @return The EnableAutomaticUpdates value. */ - public Boolean getEnableAutomaticUpdates() + public Boolean isEnableAutomaticUpdates() { return this.enableAutomaticUpdates; } @@ -174,10 +188,11 @@ public Boolean getEnableAutomaticUpdates() * Optional. Specifies whether automatic updates are enabled for the virtual * machine. This element is only used with the * WindowsProvisioningConfiguration set. The default value is false. + * @param enableAutomaticUpdatesValue The EnableAutomaticUpdates value. */ - public void setEnableAutomaticUpdates(Boolean enableAutomaticUpdates) + public void setEnableAutomaticUpdates(final Boolean enableAutomaticUpdatesValue) { - this.enableAutomaticUpdates = enableAutomaticUpdates; + this.enableAutomaticUpdates = enableAutomaticUpdatesValue; } private String hostName; @@ -186,6 +201,7 @@ public void setEnableAutomaticUpdates(Boolean enableAutomaticUpdates) * Required. Specifies the host name for the VM. Host names are ASCII * character strings 1 to 64 characters in length. This element is only * used with the LinuxProvisioningConfiguration set. + * @return The HostName value. */ public String getHostName() { @@ -196,10 +212,11 @@ public String getHostName() * Required. Specifies the host name for the VM. Host names are ASCII * character strings 1 to 64 characters in length. This element is only * used with the LinuxProvisioningConfiguration set. + * @param hostNameValue The HostName value. */ - public void setHostName(String hostName) + public void setHostName(final String hostNameValue) { - this.hostName = hostName; + this.hostName = hostNameValue; } private ArrayList inputEndpoints; @@ -207,6 +224,7 @@ public void setHostName(String hostName) /** * Contains a collection of external endpoints for the virtual machine. * This element is only used with the NetworkConfigurationSet type. + * @return The InputEndpoints value. */ public ArrayList getInputEndpoints() { @@ -216,10 +234,11 @@ public ArrayList getInputEndpoints() /** * Contains a collection of external endpoints for the virtual machine. * This element is only used with the NetworkConfigurationSet type. + * @param inputEndpointsValue The InputEndpoints value. */ - public void setInputEndpoints(ArrayList inputEndpoints) + public void setInputEndpoints(final ArrayList inputEndpointsValue) { - this.inputEndpoints = inputEndpoints; + this.inputEndpoints = inputEndpointsValue; } private Boolean resetPasswordOnFirstLogon; @@ -227,8 +246,9 @@ public void setInputEndpoints(ArrayList inputEndpoints) /** * Optional. Specifies whether password should be reset the first time the * administrator logs in. + * @return The ResetPasswordOnFirstLogon value. */ - public Boolean getResetPasswordOnFirstLogon() + public Boolean isResetPasswordOnFirstLogon() { return this.resetPasswordOnFirstLogon; } @@ -236,10 +256,11 @@ public Boolean getResetPasswordOnFirstLogon() /** * Optional. Specifies whether password should be reset the first time the * administrator logs in. + * @param resetPasswordOnFirstLogonValue The ResetPasswordOnFirstLogon value. */ - public void setResetPasswordOnFirstLogon(Boolean resetPasswordOnFirstLogon) + public void setResetPasswordOnFirstLogon(final Boolean resetPasswordOnFirstLogonValue) { - this.resetPasswordOnFirstLogon = resetPasswordOnFirstLogon; + this.resetPasswordOnFirstLogon = resetPasswordOnFirstLogonValue; } private SshSettings sshSettings; @@ -248,6 +269,7 @@ public void setResetPasswordOnFirstLogon(Boolean resetPasswordOnFirstLogon) * Optional. Specifies the SSH public keys and key pairs to populate in the * image during provisioning. This element is only used with the * LinuxProvisioningConfiguration set. + * @return The SshSettings value. */ public SshSettings getSshSettings() { @@ -258,10 +280,34 @@ public SshSettings getSshSettings() * Optional. Specifies the SSH public keys and key pairs to populate in the * image during provisioning. This element is only used with the * LinuxProvisioningConfiguration set. + * @param sshSettingsValue The SshSettings value. */ - public void setSshSettings(SshSettings sshSettings) + public void setSshSettings(final SshSettings sshSettingsValue) { - this.sshSettings = sshSettings; + this.sshSettings = sshSettingsValue; + } + + private String staticVirtualNetworkIPAddress; + + /** + * Optional. Specifies a Customer Address, i.e. an IP address assigned to a + * VM in a VNet's SubNet, for example: 10.0.0.4. + * @return The StaticVirtualNetworkIPAddress value. + */ + public String getStaticVirtualNetworkIPAddress() + { + return this.staticVirtualNetworkIPAddress; + } + + /** + * Optional. Specifies a Customer Address, i.e. an IP address assigned to a + * VM in a VNet's SubNet, for example: 10.0.0.4. + * @param staticVirtualNetworkIPAddressValue The + * StaticVirtualNetworkIPAddress value. + */ + public void setStaticVirtualNetworkIPAddress(final String staticVirtualNetworkIPAddressValue) + { + this.staticVirtualNetworkIPAddress = staticVirtualNetworkIPAddressValue; } private ArrayList storedCertificateSettings; @@ -270,6 +316,7 @@ public void setSshSettings(SshSettings sshSettings) * Optional. Contains a list of service certificates with which to provision * to the new role. This element is only used with the * WindowsProvisioningConfiguration set. + * @return The StoredCertificateSettings value. */ public ArrayList getStoredCertificateSettings() { @@ -280,10 +327,11 @@ public ArrayList getStoredCertificateSettings() * Optional. Contains a list of service certificates with which to provision * to the new role. This element is only used with the * WindowsProvisioningConfiguration set. + * @param storedCertificateSettingsValue The StoredCertificateSettings value. */ - public void setStoredCertificateSettings(ArrayList storedCertificateSettings) + public void setStoredCertificateSettings(final ArrayList storedCertificateSettingsValue) { - this.storedCertificateSettings = storedCertificateSettings; + this.storedCertificateSettings = storedCertificateSettingsValue; } private ArrayList subnetNames; @@ -291,6 +339,7 @@ public void setStoredCertificateSettings(ArrayList st /** * The list of Virtual Network subnet names that the deployment belongs to. * This element is only used with the NetworkConfigurationSet type. + * @return The SubnetNames value. */ public ArrayList getSubnetNames() { @@ -300,10 +349,11 @@ public ArrayList getSubnetNames() /** * The list of Virtual Network subnet names that the deployment belongs to. * This element is only used with the NetworkConfigurationSet type. + * @param subnetNamesValue The SubnetNames value. */ - public void setSubnetNames(ArrayList subnetNames) + public void setSubnetNames(final ArrayList subnetNamesValue) { - this.subnetNames = subnetNames; + this.subnetNames = subnetNamesValue; } private String timeZone; @@ -318,6 +368,7 @@ public void setSubnetNames(ArrayList subnetNames) * Server 2008, and Windows Server 2008 R2. You can use the tzutil * command-line tool to list the valid time. The tzutil tool is installed * by default on Windows 7, Windows Server 2008, and Windows Server 2008 R2. + * @return The TimeZone value. */ public String getTimeZone() { @@ -334,10 +385,11 @@ public String getTimeZone() * Server 2008, and Windows Server 2008 R2. You can use the tzutil * command-line tool to list the valid time. The tzutil tool is installed * by default on Windows 7, Windows Server 2008, and Windows Server 2008 R2. + * @param timeZoneValue The TimeZone value. */ - public void setTimeZone(String timeZone) + public void setTimeZone(final String timeZoneValue) { - this.timeZone = timeZone; + this.timeZone = timeZoneValue; } private String userName; @@ -347,6 +399,7 @@ public void setTimeZone(String timeZone) * of the virtual machine. User names are ASCII character strings 1 to 32 * characters in length. This element is only used with the * LinuxProvisioningConfiguration set. + * @return The UserName value. */ public String getUserName() { @@ -358,10 +411,11 @@ public String getUserName() * of the virtual machine. User names are ASCII character strings 1 to 32 * characters in length. This element is only used with the * LinuxProvisioningConfiguration set. + * @param userNameValue The UserName value. */ - public void setUserName(String userName) + public void setUserName(final String userNameValue) { - this.userName = userName; + this.userName = userNameValue; } private String userPassword; @@ -370,6 +424,7 @@ public void setUserName(String userName) * Required. Specifies the password for user name. Passwords are ASCII * character strings 6 to 72 characters in length. This element is only * used with the LinuxProvisioningConfiguration set. + * @return The UserPassword value. */ public String getUserPassword() { @@ -380,10 +435,11 @@ public String getUserPassword() * Required. Specifies the password for user name. Passwords are ASCII * character strings 6 to 72 characters in length. This element is only * used with the LinuxProvisioningConfiguration set. + * @param userPasswordValue The UserPassword value. */ - public void setUserPassword(String userPassword) + public void setUserPassword(final String userPasswordValue) { - this.userPassword = userPassword; + this.userPassword = userPasswordValue; } private WindowsRemoteManagementSettings windowsRemoteManagement; @@ -391,6 +447,7 @@ public void setUserPassword(String userPassword) /** * Optional. Configures the Windows Remote Management service on the virtual * machine, which enables remote Windows PowerShell. + * @return The WindowsRemoteManagement value. */ public WindowsRemoteManagementSettings getWindowsRemoteManagement() { @@ -400,10 +457,11 @@ public WindowsRemoteManagementSettings getWindowsRemoteManagement() /** * Optional. Configures the Windows Remote Management service on the virtual * machine, which enables remote Windows PowerShell. + * @param windowsRemoteManagementValue The WindowsRemoteManagement value. */ - public void setWindowsRemoteManagement(WindowsRemoteManagementSettings windowsRemoteManagement) + public void setWindowsRemoteManagement(final WindowsRemoteManagementSettings windowsRemoteManagementValue) { - this.windowsRemoteManagement = windowsRemoteManagement; + this.windowsRemoteManagement = windowsRemoteManagementValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DataVirtualHardDisk.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DataVirtualHardDisk.java index eefc690166672..2f8e9091da27d 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DataVirtualHardDisk.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DataVirtualHardDisk.java @@ -35,6 +35,7 @@ public class DataVirtualHardDisk /** * Specifies the friendly name of the VHD to use to create thedata disk for * the virtual machine. + * @return The DiskLabel value. */ public String getDiskLabel() { @@ -44,10 +45,11 @@ public String getDiskLabel() /** * Specifies the friendly name of the VHD to use to create thedata disk for * the virtual machine. + * @param diskLabelValue The DiskLabel value. */ - public void setDiskLabel(String diskLabel) + public void setDiskLabel(final String diskLabelValue) { - this.diskLabel = diskLabel; + this.diskLabel = diskLabelValue; } private String diskName; @@ -55,6 +57,7 @@ public void setDiskLabel(String diskLabel) /** * Specifies the name of the VHD to use to create thedata disk for the * virtual machine. + * @return The DiskName value. */ public String getDiskName() { @@ -64,10 +67,11 @@ public String getDiskName() /** * Specifies the name of the VHD to use to create thedata disk for the * virtual machine. + * @param diskNameValue The DiskName value. */ - public void setDiskName(String diskName) + public void setDiskName(final String diskNameValue) { - this.diskName = diskName; + this.diskName = diskNameValue; } private VirtualHardDiskHostCaching hostCaching; @@ -75,6 +79,7 @@ public void setDiskName(String diskName) /** * Specifies the platform caching behavior of the data disk blob for * read/write efficiency. The default vault is ReadOnly. + * @return The HostCaching value. */ public VirtualHardDiskHostCaching getHostCaching() { @@ -84,10 +89,11 @@ public VirtualHardDiskHostCaching getHostCaching() /** * Specifies the platform caching behavior of the data disk blob for * read/write efficiency. The default vault is ReadOnly. + * @param hostCachingValue The HostCaching value. */ - public void setHostCaching(VirtualHardDiskHostCaching hostCaching) + public void setHostCaching(final VirtualHardDiskHostCaching hostCachingValue) { - this.hostCaching = hostCaching; + this.hostCaching = hostCachingValue; } private int logicalDiskSizeInGB; @@ -98,6 +104,7 @@ public void setHostCaching(VirtualHardDiskHostCaching hostCaching) * machine call by specifying the value for this property. Windows Azure * creates the empty VHD based on size preference and attaches the newly * created VHD to the virtual machine. + * @return The LogicalDiskSizeInGB value. */ public int getLogicalDiskSizeInGB() { @@ -110,10 +117,11 @@ public int getLogicalDiskSizeInGB() * machine call by specifying the value for this property. Windows Azure * creates the empty VHD based on size preference and attaches the newly * created VHD to the virtual machine. + * @param logicalDiskSizeInGBValue The LogicalDiskSizeInGB value. */ - public void setLogicalDiskSizeInGB(int logicalDiskSizeInGB) + public void setLogicalDiskSizeInGB(final int logicalDiskSizeInGBValue) { - this.logicalDiskSizeInGB = logicalDiskSizeInGB; + this.logicalDiskSizeInGB = logicalDiskSizeInGBValue; } private Integer logicalUnitNumber; @@ -123,6 +131,7 @@ public void setLogicalDiskSizeInGB(int logicalDiskSizeInGB) * specifies the slot in which the data drive appears when mounted for * usage by the virtual machine. This element is only listed when more than * one data disk is attached to a virtual machine. + * @return The LogicalUnitNumber value. */ public Integer getLogicalUnitNumber() { @@ -134,16 +143,18 @@ public Integer getLogicalUnitNumber() * specifies the slot in which the data drive appears when mounted for * usage by the virtual machine. This element is only listed when more than * one data disk is attached to a virtual machine. + * @param logicalUnitNumberValue The LogicalUnitNumber value. */ - public void setLogicalUnitNumber(Integer logicalUnitNumber) + public void setLogicalUnitNumber(final Integer logicalUnitNumberValue) { - this.logicalUnitNumber = logicalUnitNumber; + this.logicalUnitNumber = logicalUnitNumberValue; } private URI mediaLink; /** * Specifies the location of the disk in Windows Azure storage. + * @return The MediaLink value. */ public URI getMediaLink() { @@ -152,9 +163,10 @@ public URI getMediaLink() /** * Specifies the location of the disk in Windows Azure storage. + * @param mediaLinkValue The MediaLink value. */ - public void setMediaLink(URI mediaLink) + public void setMediaLink(final URI mediaLinkValue) { - this.mediaLink = mediaLink; + this.mediaLink = mediaLinkValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentChangeConfigurationParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentChangeConfigurationParameters.java index dd5c1d7344df5..be1738683fccf 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentChangeConfigurationParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentChangeConfigurationParameters.java @@ -34,6 +34,7 @@ public class DeploymentChangeConfigurationParameters /** * Required. The encoded service configuration file for the deployment. + * @return The Configuration value. */ public String getConfiguration() { @@ -42,10 +43,11 @@ public String getConfiguration() /** * Required. The encoded service configuration file for the deployment. + * @param configurationValue The Configuration value. */ - public void setConfiguration(String configuration) + public void setConfiguration(final String configurationValue) { - this.configuration = configuration; + this.configuration = configurationValue; } private HashMap extendedProperties; @@ -60,6 +62,7 @@ public void setConfiguration(String configuration) * non-letter character, or entering a name that is identical to that of * another extended property owned by the same hosted service, will result * in a status code 400 (Bad Request) error. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -76,10 +79,11 @@ public HashMap getExtendedProperties() * non-letter character, or entering a name that is identical to that of * another extended property owned by the same hosted service, will result * in a status code 400 (Bad Request) error. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private ExtensionConfiguration extensionConfiguration; @@ -91,6 +95,7 @@ public void setExtendedProperties(HashMap extendedProperties) * can run as extensions to the cloud service. You must add an extension to * the cloud service by using Add Extension before it can be added to the * deployment. + * @return The ExtensionConfiguration value. */ public ExtensionConfiguration getExtensionConfiguration() { @@ -104,10 +109,11 @@ public ExtensionConfiguration getExtensionConfiguration() * can run as extensions to the cloud service. You must add an extension to * the cloud service by using Add Extension before it can be added to the * deployment. + * @param extensionConfigurationValue The ExtensionConfiguration value. */ - public void setExtensionConfiguration(ExtensionConfiguration extensionConfiguration) + public void setExtensionConfiguration(final ExtensionConfiguration extensionConfigurationValue) { - this.extensionConfiguration = extensionConfiguration; + this.extensionConfiguration = extensionConfigurationValue; } private DeploymentChangeConfigurationMode mode; @@ -117,6 +123,7 @@ public void setExtensionConfiguration(ExtensionConfiguration extensionConfigurat * default value is Auto. If set to Manual, WalkUpgradeDomain must be * called to apply the update. If set to Auto, the update is automatically * applied to each update domain for the service. + * @return The Mode value. */ public DeploymentChangeConfigurationMode getMode() { @@ -128,10 +135,11 @@ public DeploymentChangeConfigurationMode getMode() * default value is Auto. If set to Manual, WalkUpgradeDomain must be * called to apply the update. If set to Auto, the update is automatically * applied to each update domain for the service. + * @param modeValue The Mode value. */ - public void setMode(DeploymentChangeConfigurationMode mode) + public void setMode(final DeploymentChangeConfigurationMode modeValue) { - this.mode = mode; + this.mode = modeValue; } private Boolean treatWarningsAsError; @@ -141,8 +149,9 @@ public void setMode(DeploymentChangeConfigurationMode mode) * errors. The default value is false. If set to true, the Created * Deployment operation fails if there are validation warnings on the * service package. + * @return The TreatWarningsAsError value. */ - public Boolean getTreatWarningsAsError() + public Boolean isTreatWarningsAsError() { return this.treatWarningsAsError; } @@ -152,10 +161,11 @@ public Boolean getTreatWarningsAsError() * errors. The default value is false. If set to true, the Created * Deployment operation fails if there are validation warnings on the * service package. + * @param treatWarningsAsErrorValue The TreatWarningsAsError value. */ - public void setTreatWarningsAsError(Boolean treatWarningsAsError) + public void setTreatWarningsAsError(final Boolean treatWarningsAsErrorValue) { - this.treatWarningsAsError = treatWarningsAsError; + this.treatWarningsAsError = treatWarningsAsErrorValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentCreateParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentCreateParameters.java index 29e078b747339..5ec1d7d926ed2 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentCreateParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentCreateParameters.java @@ -35,6 +35,7 @@ public class DeploymentCreateParameters /** * Required. The service configuration file for the deployment. + * @return The Configuration value. */ public String getConfiguration() { @@ -43,10 +44,11 @@ public String getConfiguration() /** * Required. The service configuration file for the deployment. + * @param configurationValue The Configuration value. */ - public void setConfiguration(String configuration) + public void setConfiguration(final String configurationValue) { - this.configuration = configuration; + this.configuration = configurationValue; } private HashMap extendedProperties; @@ -61,6 +63,7 @@ public void setConfiguration(String configuration) * non-letter character, or entering a name that is identical to that of * another extended property owned by the same hosted service, will result * in a status code 400 (Bad Request) error. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -77,10 +80,11 @@ public HashMap getExtendedProperties() * non-letter character, or entering a name that is identical to that of * another extended property owned by the same hosted service, will result * in a status code 400 (Bad Request) error. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private ExtensionConfiguration extensionConfiguration; @@ -92,6 +96,7 @@ public void setExtendedProperties(HashMap extendedProperties) * can run as extensions to the cloud service. You must add an extension to * the cloud service by using Add Extension before it can be added to the * deployment. + * @return The ExtensionConfiguration value. */ public ExtensionConfiguration getExtensionConfiguration() { @@ -105,10 +110,11 @@ public ExtensionConfiguration getExtensionConfiguration() * can run as extensions to the cloud service. You must add an extension to * the cloud service by using Add Extension before it can be added to the * deployment. + * @param extensionConfigurationValue The ExtensionConfiguration value. */ - public void setExtensionConfiguration(ExtensionConfiguration extensionConfiguration) + public void setExtensionConfiguration(final ExtensionConfiguration extensionConfigurationValue) { - this.extensionConfiguration = extensionConfiguration; + this.extensionConfiguration = extensionConfigurationValue; } private String label; @@ -118,6 +124,7 @@ public void setExtensionConfiguration(ExtensionConfiguration extensionConfigurat * characters in length. It is recommended that the label be unique within * the subscription. The name can be used identify the hosted service for * your tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -129,10 +136,11 @@ public String getLabel() * characters in length. It is recommended that the label be unique within * the subscription. The name can be used identify the hosted service for * your tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String name; @@ -140,6 +148,7 @@ public void setLabel(String label) /** * Required. The name for the deployment. The deployment name must be unique * among other deployments for the cloud service. + * @return The Name value. */ public String getName() { @@ -149,10 +158,11 @@ public String getName() /** * Required. The name for the deployment. The deployment name must be unique * among other deployments for the cloud service. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private URI packageUri; @@ -165,6 +175,7 @@ public void setName(String name) * Signatures, see Delegating Access with a Shared Access Signature (REST * API) at * http://msdn.microsoft.com/en-us/library/windowsazure/ee395415.aspx. + * @return The PackageUri value. */ public URI getPackageUri() { @@ -179,10 +190,11 @@ public URI getPackageUri() * Signatures, see Delegating Access with a Shared Access Signature (REST * API) at * http://msdn.microsoft.com/en-us/library/windowsazure/ee395415.aspx. + * @param packageUriValue The PackageUri value. */ - public void setPackageUri(URI packageUri) + public void setPackageUri(final URI packageUriValue) { - this.packageUri = packageUri; + this.packageUri = packageUriValue; } private Boolean startDeployment; @@ -195,8 +207,9 @@ public void setPackageUri(URI packageUri) * Deployment Status and set the status toRunning, at which time the * service will be started. A deployed service still incurs charges, even * if it is suspended. + * @return The StartDeployment value. */ - public Boolean getStartDeployment() + public Boolean isStartDeployment() { return this.startDeployment; } @@ -209,10 +222,11 @@ public Boolean getStartDeployment() * Deployment Status and set the status toRunning, at which time the * service will be started. A deployed service still incurs charges, even * if it is suspended. + * @param startDeploymentValue The StartDeployment value. */ - public void setStartDeployment(Boolean startDeployment) + public void setStartDeployment(final Boolean startDeploymentValue) { - this.startDeployment = startDeployment; + this.startDeployment = startDeploymentValue; } private Boolean treatWarningsAsError; @@ -222,8 +236,9 @@ public void setStartDeployment(Boolean startDeployment) * errors. The default value is false. If set to true, the Created * Deployment operation fails if there are validation warnings on the * service package. + * @return The TreatWarningsAsError value. */ - public Boolean getTreatWarningsAsError() + public Boolean isTreatWarningsAsError() { return this.treatWarningsAsError; } @@ -233,10 +248,11 @@ public Boolean getTreatWarningsAsError() * errors. The default value is false. If set to true, the Created * Deployment operation fails if there are validation warnings on the * service package. + * @param treatWarningsAsErrorValue The TreatWarningsAsError value. */ - public void setTreatWarningsAsError(Boolean treatWarningsAsError) + public void setTreatWarningsAsError(final Boolean treatWarningsAsErrorValue) { - this.treatWarningsAsError = treatWarningsAsError; + this.treatWarningsAsError = treatWarningsAsErrorValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentGetPackageParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentGetPackageParameters.java index 373294b11592a..5a605a20bca4e 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentGetPackageParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentGetPackageParameters.java @@ -35,6 +35,7 @@ public class DeploymentGetPackageParameters /** * Required. Specifies the URI of the container to which the packages will * be saved. + * @return The ContainerUri value. */ public URI getContainerUri() { @@ -44,10 +45,11 @@ public URI getContainerUri() /** * Required. Specifies the URI of the container to which the packages will * be saved. + * @param containerUriValue The ContainerUri value. */ - public void setContainerUri(URI containerUri) + public void setContainerUri(final URI containerUriValue) { - this.containerUri = containerUri; + this.containerUri = containerUriValue; } private Boolean overwriteExisting; @@ -56,8 +58,9 @@ public void setContainerUri(URI containerUri) * Optional. Specifies whether an existing package in the storage container * should be overwritten. If true the packages with the same names under * the specified storage container will be overwritten; otherwise false. + * @return The OverwriteExisting value. */ - public Boolean getOverwriteExisting() + public Boolean isOverwriteExisting() { return this.overwriteExisting; } @@ -66,9 +69,10 @@ public Boolean getOverwriteExisting() * Optional. Specifies whether an existing package in the storage container * should be overwritten. If true the packages with the same names under * the specified storage container will be overwritten; otherwise false. + * @param overwriteExistingValue The OverwriteExisting value. */ - public void setOverwriteExisting(Boolean overwriteExisting) + public void setOverwriteExisting(final Boolean overwriteExistingValue) { - this.overwriteExisting = overwriteExisting; + this.overwriteExisting = overwriteExistingValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentGetResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentGetResponse.java index 60b158ee67f81..ebb8ecdfae48b 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentGetResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentGetResponse.java @@ -38,6 +38,7 @@ public class DeploymentGetResponse extends OperationResponse /** * The configuration file of the deployment. + * @return The Configuration value. */ public String getConfiguration() { @@ -46,16 +47,18 @@ public String getConfiguration() /** * The configuration file of the deployment. + * @param configurationValue The Configuration value. */ - public void setConfiguration(String configuration) + public void setConfiguration(final String configurationValue) { - this.configuration = configuration; + this.configuration = configurationValue; } private Calendar createdTime; /** * The time that the deployment was created. + * @return The CreatedTime value. */ public Calendar getCreatedTime() { @@ -64,16 +67,18 @@ public Calendar getCreatedTime() /** * The time that the deployment was created. + * @param createdTimeValue The CreatedTime value. */ - public void setCreatedTime(Calendar createdTime) + public void setCreatedTime(final Calendar createdTimeValue) { - this.createdTime = createdTime; + this.createdTime = createdTimeValue; } private DeploymentSlot deploymentSlot; /** * The deployment environment in which this deployment is running. + * @return The DeploymentSlot value. */ public DeploymentSlot getDeploymentSlot() { @@ -82,16 +87,18 @@ public DeploymentSlot getDeploymentSlot() /** * The deployment environment in which this deployment is running. + * @param deploymentSlotValue The DeploymentSlot value. */ - public void setDeploymentSlot(DeploymentSlot deploymentSlot) + public void setDeploymentSlot(final DeploymentSlot deploymentSlotValue) { - this.deploymentSlot = deploymentSlot; + this.deploymentSlot = deploymentSlotValue; } private DnsSettings dnsSettings; /** * The custom DNS settings that are specified for deployment. + * @return The DnsSettings value. */ public DnsSettings getDnsSettings() { @@ -100,10 +107,11 @@ public DnsSettings getDnsSettings() /** * The custom DNS settings that are specified for deployment. + * @param dnsSettingsValue The DnsSettings value. */ - public void setDnsSettings(DnsSettings dnsSettings) + public void setDnsSettings(final DnsSettings dnsSettingsValue) { - this.dnsSettings = dnsSettings; + this.dnsSettings = dnsSettingsValue; } private HashMap extendedProperties; @@ -119,6 +127,7 @@ public void setDnsSettings(DnsSettings dnsSettings) * extended property owned by the same service, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -136,16 +145,18 @@ public HashMap getExtendedProperties() * extended property owned by the same service, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private ExtensionConfiguration extensionConfiguration; /** * Represents an extension that is added to the cloud service. + * @return The ExtensionConfiguration value. */ public ExtensionConfiguration getExtensionConfiguration() { @@ -154,10 +165,11 @@ public ExtensionConfiguration getExtensionConfiguration() /** * Represents an extension that is added to the cloud service. + * @param extensionConfigurationValue The ExtensionConfiguration value. */ - public void setExtensionConfiguration(ExtensionConfiguration extensionConfiguration) + public void setExtensionConfiguration(final ExtensionConfiguration extensionConfigurationValue) { - this.extensionConfiguration = extensionConfiguration; + this.extensionConfiguration = extensionConfigurationValue; } private String label; @@ -165,6 +177,7 @@ public void setExtensionConfiguration(ExtensionConfiguration extensionConfigurat /** * The user supplied name of the deployment. This name can be used identify * the deployment for tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -174,16 +187,18 @@ public String getLabel() /** * The user supplied name of the deployment. This name can be used identify * the deployment for tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private Calendar lastModifiedTime; /** * The last time that the deployment was modified. + * @return The LastModifiedTime value. */ public Calendar getLastModifiedTime() { @@ -192,10 +207,11 @@ public Calendar getLastModifiedTime() /** * The last time that the deployment was modified. + * @param lastModifiedTimeValue The LastModifiedTime value. */ - public void setLastModifiedTime(Calendar lastModifiedTime) + public void setLastModifiedTime(final Calendar lastModifiedTimeValue) { - this.lastModifiedTime = lastModifiedTime; + this.lastModifiedTime = lastModifiedTimeValue; } private boolean locked; @@ -204,8 +220,9 @@ public void setLastModifiedTime(Calendar lastModifiedTime) * Indicates whether the deployment is locked for new write operations. True * if the deployment is locked because an existing operation is updating * the deployment; otherwise false. + * @return The Locked value. */ - public boolean getLocked() + public boolean isLocked() { return this.locked; } @@ -214,22 +231,29 @@ public boolean getLocked() * Indicates whether the deployment is locked for new write operations. True * if the deployment is locked because an existing operation is updating * the deployment; otherwise false. + * @param lockedValue The Locked value. */ - public void setLocked(boolean locked) + public void setLocked(final boolean lockedValue) { - this.locked = locked; + this.locked = lockedValue; } private String name; + /** + * @return The Name value. + */ public String getName() { return this.name; } - public void setName(String name) + /** + * @param nameValue The Name value. + */ + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private PersistentVMDowntime persistentVMDowntime; @@ -237,6 +261,7 @@ public void setName(String name) /** * Specifies information about when the virtual machine has been started and * stopped. + * @return The PersistentVMDowntime value. */ public PersistentVMDowntime getPersistentVMDowntime() { @@ -246,16 +271,18 @@ public PersistentVMDowntime getPersistentVMDowntime() /** * Specifies information about when the virtual machine has been started and * stopped. + * @param persistentVMDowntimeValue The PersistentVMDowntime value. */ - public void setPersistentVMDowntime(PersistentVMDowntime persistentVMDowntime) + public void setPersistentVMDowntime(final PersistentVMDowntime persistentVMDowntimeValue) { - this.persistentVMDowntime = persistentVMDowntime; + this.persistentVMDowntime = persistentVMDowntimeValue; } private String privateId; /** * The unique identifier for this deployment. + * @return The PrivateId value. */ public String getPrivateId() { @@ -264,16 +291,18 @@ public String getPrivateId() /** * The unique identifier for this deployment. + * @param privateIdValue The PrivateId value. */ - public void setPrivateId(String privateId) + public void setPrivateId(final String privateIdValue) { - this.privateId = privateId; + this.privateId = privateIdValue; } private String reservedIPName; /** * Preview Only. The name of the Reserved IP that the deployment belongs to. + * @return The ReservedIPName value. */ public String getReservedIPName() { @@ -282,16 +311,18 @@ public String getReservedIPName() /** * Preview Only. The name of the Reserved IP that the deployment belongs to. + * @param reservedIPNameValue The ReservedIPName value. */ - public void setReservedIPName(String reservedIPName) + public void setReservedIPName(final String reservedIPNameValue) { - this.reservedIPName = reservedIPName; + this.reservedIPName = reservedIPNameValue; } private ArrayList roleInstances; /** * The list of role instances in the deployment. + * @return The RoleInstances value. */ public ArrayList getRoleInstances() { @@ -300,16 +331,18 @@ public ArrayList getRoleInstances() /** * The list of role instances in the deployment. + * @param roleInstancesValue The RoleInstances value. */ - public void setRoleInstances(ArrayList roleInstances) + public void setRoleInstances(final ArrayList roleInstancesValue) { - this.roleInstances = roleInstances; + this.roleInstances = roleInstancesValue; } private ArrayList roles; /** * The list of roles in the deployment. + * @return The Roles value. */ public ArrayList getRoles() { @@ -318,10 +351,11 @@ public ArrayList getRoles() /** * The list of roles in the deployment. + * @param rolesValue The Roles value. */ - public void setRoles(ArrayList roles) + public void setRoles(final ArrayList rolesValue) { - this.roles = roles; + this.roles = rolesValue; } private String rollbackAllowed; @@ -329,6 +363,7 @@ public void setRoles(ArrayList roles) /** * Indicates whether the Rollback Update Or Upgrade operation is allowed at * this time. True if the operation is allowed; otherwise false. + * @return The RollbackAllowed value. */ public String getRollbackAllowed() { @@ -338,10 +373,11 @@ public String getRollbackAllowed() /** * Indicates whether the Rollback Update Or Upgrade operation is allowed at * this time. True if the operation is allowed; otherwise false. + * @param rollbackAllowedValue The RollbackAllowed value. */ - public void setRollbackAllowed(String rollbackAllowed) + public void setRollbackAllowed(final String rollbackAllowedValue) { - this.rollbackAllowed = rollbackAllowed; + this.rollbackAllowed = rollbackAllowedValue; } private String sdkVersion; @@ -351,6 +387,7 @@ public void setRollbackAllowed(String rollbackAllowed) * that created this deployment. The first two numerical components of the * returned version represent the version of the SDK used to create the * package. + * @return The SdkVersion value. */ public String getSdkVersion() { @@ -362,16 +399,18 @@ public String getSdkVersion() * that created this deployment. The first two numerical components of the * returned version represent the version of the SDK used to create the * package. + * @param sdkVersionValue The SdkVersion value. */ - public void setSdkVersion(String sdkVersion) + public void setSdkVersion(final String sdkVersionValue) { - this.sdkVersion = sdkVersion; + this.sdkVersion = sdkVersionValue; } private DeploymentStatus status; /** * The status of the deployment. + * @return The Status value. */ public DeploymentStatus getStatus() { @@ -380,16 +419,18 @@ public DeploymentStatus getStatus() /** * The status of the deployment. + * @param statusValue The Status value. */ - public void setStatus(DeploymentStatus status) + public void setStatus(final DeploymentStatus statusValue) { - this.status = status; + this.status = statusValue; } private int upgradeDomainCount; /** * The number of upgrade domains available to this cloud service. + * @return The UpgradeDomainCount value. */ public int getUpgradeDomainCount() { @@ -398,16 +439,18 @@ public int getUpgradeDomainCount() /** * The number of upgrade domains available to this cloud service. + * @param upgradeDomainCountValue The UpgradeDomainCount value. */ - public void setUpgradeDomainCount(int upgradeDomainCount) + public void setUpgradeDomainCount(final int upgradeDomainCountValue) { - this.upgradeDomainCount = upgradeDomainCount; + this.upgradeDomainCount = upgradeDomainCountValue; } private UpgradeStatus upgradeStatus; /** * Specifies information about an update occurring on the deployment. + * @return The UpgradeStatus value. */ public UpgradeStatus getUpgradeStatus() { @@ -416,10 +459,11 @@ public UpgradeStatus getUpgradeStatus() /** * Specifies information about an update occurring on the deployment. + * @param upgradeStatusValue The UpgradeStatus value. */ - public void setUpgradeStatus(UpgradeStatus upgradeStatus) + public void setUpgradeStatus(final UpgradeStatus upgradeStatusValue) { - this.upgradeStatus = upgradeStatus; + this.upgradeStatus = upgradeStatusValue; } private URI uri; @@ -428,6 +472,7 @@ public void setUpgradeStatus(UpgradeStatus upgradeStatus) * The URL used to access the hosted service. For example, if the service * name is MyService you could access the access the service by calling: * http://MyService.cloudapp.net + * @return The Uri value. */ public URI getUri() { @@ -438,16 +483,18 @@ public URI getUri() * The URL used to access the hosted service. For example, if the service * name is MyService you could access the access the service by calling: * http://MyService.cloudapp.net + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } private ArrayList virtualIPAddresses; /** * The virtual IP addresses that are specified for thedeployment. + * @return The VirtualIPAddresses value. */ public ArrayList getVirtualIPAddresses() { @@ -456,16 +503,18 @@ public ArrayList getVirtualIPAddresses() /** * The virtual IP addresses that are specified for thedeployment. + * @param virtualIPAddressesValue The VirtualIPAddresses value. */ - public void setVirtualIPAddresses(ArrayList virtualIPAddresses) + public void setVirtualIPAddresses(final ArrayList virtualIPAddressesValue) { - this.virtualIPAddresses = virtualIPAddresses; + this.virtualIPAddresses = virtualIPAddressesValue; } private String virtualNetworkName; /** * The name of the Virtual Network that the virtual machine connects to. + * @return The VirtualNetworkName value. */ public String getVirtualNetworkName() { @@ -474,10 +523,11 @@ public String getVirtualNetworkName() /** * The name of the Virtual Network that the virtual machine connects to. + * @param virtualNetworkNameValue The VirtualNetworkName value. */ - public void setVirtualNetworkName(String virtualNetworkName) + public void setVirtualNetworkName(final String virtualNetworkNameValue) { - this.virtualNetworkName = virtualNetworkName; + this.virtualNetworkName = virtualNetworkNameValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentRollbackUpdateOrUpgradeParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentRollbackUpdateOrUpgradeParameters.java index 285f5df01c61f..7ed4dd845505a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentRollbackUpdateOrUpgradeParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentRollbackUpdateOrUpgradeParameters.java @@ -34,8 +34,9 @@ public class DeploymentRollbackUpdateOrUpgradeParameters * Specifies whether the rollback should proceed even when it will cause * local data to be lost from some role instances. True if the rollback * should proceed; otherwise false. + * @return The Force value. */ - public boolean getForce() + public boolean isForce() { return this.force; } @@ -44,16 +45,18 @@ public boolean getForce() * Specifies whether the rollback should proceed even when it will cause * local data to be lost from some role instances. True if the rollback * should proceed; otherwise false. + * @param forceValue The Force value. */ - public void setForce(boolean force) + public void setForce(final boolean forceValue) { - this.force = force; + this.force = forceValue; } private RollbackUpdateOrUpgradeMode mode; /** * Required. Specifies whether the rollback should proceed automatically. + * @return The Mode value. */ public RollbackUpdateOrUpgradeMode getMode() { @@ -62,9 +65,10 @@ public RollbackUpdateOrUpgradeMode getMode() /** * Required. Specifies whether the rollback should proceed automatically. + * @param modeValue The Mode value. */ - public void setMode(RollbackUpdateOrUpgradeMode mode) + public void setMode(final RollbackUpdateOrUpgradeMode modeValue) { - this.mode = mode; + this.mode = modeValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentSwapParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentSwapParameters.java index 3722a8047d862..0ada5850e6cb9 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentSwapParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentSwapParameters.java @@ -32,6 +32,7 @@ public class DeploymentSwapParameters /** * The optional name of the production deployment. + * @return The ProductionDeployment value. */ public String getProductionDeployment() { @@ -40,16 +41,18 @@ public String getProductionDeployment() /** * The optional name of the production deployment. + * @param productionDeploymentValue The ProductionDeployment value. */ - public void setProductionDeployment(String productionDeployment) + public void setProductionDeployment(final String productionDeploymentValue) { - this.productionDeployment = productionDeployment; + this.productionDeployment = productionDeploymentValue; } private String sourceDeployment; /** * Required. The name of the source deployment. + * @return The SourceDeployment value. */ public String getSourceDeployment() { @@ -58,9 +61,10 @@ public String getSourceDeployment() /** * Required. The name of the source deployment. + * @param sourceDeploymentValue The SourceDeployment value. */ - public void setSourceDeployment(String sourceDeployment) + public void setSourceDeployment(final String sourceDeploymentValue) { - this.sourceDeployment = sourceDeployment; + this.sourceDeployment = sourceDeploymentValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentUpdateStatusParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentUpdateStatusParameters.java index bda12ce99b978..a9e05a5c5ce57 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentUpdateStatusParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentUpdateStatusParameters.java @@ -32,6 +32,7 @@ public class DeploymentUpdateStatusParameters /** * Required. The new status of the deployment. + * @return The Status value. */ public UpdatedDeploymentStatus getStatus() { @@ -40,9 +41,10 @@ public UpdatedDeploymentStatus getStatus() /** * Required. The new status of the deployment. + * @param statusValue The Status value. */ - public void setStatus(UpdatedDeploymentStatus status) + public void setStatus(final UpdatedDeploymentStatus statusValue) { - this.status = status; + this.status = statusValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentUpgradeParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentUpgradeParameters.java index 78b69d7cffd85..78e1b50b3103d 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentUpgradeParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentUpgradeParameters.java @@ -35,6 +35,7 @@ public class DeploymentUpgradeParameters /** * Required. The service configuration file for the deployment. + * @return The Configuration value. */ public String getConfiguration() { @@ -43,10 +44,11 @@ public String getConfiguration() /** * Required. The service configuration file for the deployment. + * @param configurationValue The Configuration value. */ - public void setConfiguration(String configuration) + public void setConfiguration(final String configurationValue) { - this.configuration = configuration; + this.configuration = configurationValue; } private HashMap extendedProperties; @@ -61,6 +63,7 @@ public void setConfiguration(String configuration) * non-letter character, or entering a name that is identical to that of * another extended property owned by the same hosted service, will result * in a status code 400 (Bad Request) error. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -77,10 +80,11 @@ public HashMap getExtendedProperties() * non-letter character, or entering a name that is identical to that of * another extended property owned by the same hosted service, will result * in a status code 400 (Bad Request) error. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private ExtensionConfiguration extensionConfiguration; @@ -92,6 +96,7 @@ public void setExtendedProperties(HashMap extendedProperties) * can run as extensions to the cloud service. You must add an extension to * the cloud service by using Add Extension before it can be added to the * deployment. + * @return The ExtensionConfiguration value. */ public ExtensionConfiguration getExtensionConfiguration() { @@ -105,10 +110,11 @@ public ExtensionConfiguration getExtensionConfiguration() * can run as extensions to the cloud service. You must add an extension to * the cloud service by using Add Extension before it can be added to the * deployment. + * @param extensionConfigurationValue The ExtensionConfiguration value. */ - public void setExtensionConfiguration(ExtensionConfiguration extensionConfiguration) + public void setExtensionConfiguration(final ExtensionConfiguration extensionConfigurationValue) { - this.extensionConfiguration = extensionConfiguration; + this.extensionConfiguration = extensionConfigurationValue; } private boolean force; @@ -117,8 +123,9 @@ public void setExtensionConfiguration(ExtensionConfiguration extensionConfigurat * Required. Specifies whether the rollback should proceed even when it will * cause local data to be lost from some role instances. True if the * rollback should proceed; otherwise false. + * @return The Force value. */ - public boolean getForce() + public boolean isForce() { return this.force; } @@ -127,10 +134,11 @@ public boolean getForce() * Required. Specifies whether the rollback should proceed even when it will * cause local data to be lost from some role instances. True if the * rollback should proceed; otherwise false. + * @param forceValue The Force value. */ - public void setForce(boolean force) + public void setForce(final boolean forceValue) { - this.force = force; + this.force = forceValue; } private String label; @@ -140,6 +148,7 @@ public void setForce(boolean force) * characters in length. It is recommended that the label be unique within * the subscription. The name can be used identify the hosted service for * your tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -151,10 +160,11 @@ public String getLabel() * characters in length. It is recommended that the label be unique within * the subscription. The name can be used identify the hosted service for * your tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private DeploymentUpgradeMode mode; @@ -167,6 +177,7 @@ public void setLabel(String label) * default value is Auto. If set to Manual, WalkUpgradeDomain must be * called to apply the update. If set to Auto, the update is automatically * applied to each update domain in sequence. + * @return The Mode value. */ public DeploymentUpgradeMode getMode() { @@ -181,10 +192,11 @@ public DeploymentUpgradeMode getMode() * default value is Auto. If set to Manual, WalkUpgradeDomain must be * called to apply the update. If set to Auto, the update is automatically * applied to each update domain in sequence. + * @param modeValue The Mode value. */ - public void setMode(DeploymentUpgradeMode mode) + public void setMode(final DeploymentUpgradeMode modeValue) { - this.mode = mode; + this.mode = modeValue; } private URI packageUri; @@ -197,6 +209,7 @@ public void setMode(DeploymentUpgradeMode mode) * Signatures, see Delegating Access with a Shared Access Signature (REST * API) at * http://msdn.microsoft.com/en-us/library/windowsazure/ee395415.aspx. + * @return The PackageUri value. */ public URI getPackageUri() { @@ -211,16 +224,18 @@ public URI getPackageUri() * Signatures, see Delegating Access with a Shared Access Signature (REST * API) at * http://msdn.microsoft.com/en-us/library/windowsazure/ee395415.aspx. + * @param packageUriValue The PackageUri value. */ - public void setPackageUri(URI packageUri) + public void setPackageUri(final URI packageUriValue) { - this.packageUri = packageUri; + this.packageUri = packageUriValue; } private String roleToUpgrade; /** * Optional. The name of the specific role instance to update. + * @return The RoleToUpgrade value. */ public String getRoleToUpgrade() { @@ -229,10 +244,11 @@ public String getRoleToUpgrade() /** * Optional. The name of the specific role instance to update. + * @param roleToUpgradeValue The RoleToUpgrade value. */ - public void setRoleToUpgrade(String roleToUpgrade) + public void setRoleToUpgrade(final String roleToUpgradeValue) { - this.roleToUpgrade = roleToUpgrade; + this.roleToUpgrade = roleToUpgradeValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentWalkUpgradeDomainParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentWalkUpgradeDomainParameters.java index 35ae3bedc5c5a..f78cb3568ee00 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentWalkUpgradeDomainParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DeploymentWalkUpgradeDomainParameters.java @@ -34,6 +34,7 @@ public class DeploymentWalkUpgradeDomainParameters * Required. An integer value that identifies the update domain to update. * Update domains are identified with a zero-based index: the first update * domain has an ID of 0, the second has an ID of 1, and so on. + * @return The UpgradeDomain value. */ public int getUpgradeDomain() { @@ -44,9 +45,10 @@ public int getUpgradeDomain() * Required. An integer value that identifies the update domain to update. * Update domains are identified with a zero-based index: the first update * domain has an ID of 0, the second has an ID of 1, and so on. + * @param upgradeDomainValue The UpgradeDomain value. */ - public void setUpgradeDomain(int upgradeDomain) + public void setUpgradeDomain(final int upgradeDomainValue) { - this.upgradeDomain = upgradeDomain; + this.upgradeDomain = upgradeDomainValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DnsServer.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DnsServer.java index 32ad13777d2e1..3af2040c53f63 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DnsServer.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DnsServer.java @@ -34,6 +34,7 @@ public class DnsServer /** * The DNS server address. + * @return The Address value. */ public InetAddress getAddress() { @@ -42,16 +43,18 @@ public InetAddress getAddress() /** * The DNS server address. + * @param addressValue The Address value. */ - public void setAddress(InetAddress address) + public void setAddress(final InetAddress addressValue) { - this.address = address; + this.address = addressValue; } private String name; /** * The name of the DNS server. + * @return The Name value. */ public String getName() { @@ -60,9 +63,10 @@ public String getName() /** * The name of the DNS server. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DnsSettings.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DnsSettings.java index 876834837db89..59c70efc69b67 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DnsSettings.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DnsSettings.java @@ -34,6 +34,7 @@ public class DnsSettings /** * Contains a collection of objects that define the DNS server settings. + * @return The DnsServers value. */ public ArrayList getDnsServers() { @@ -42,10 +43,11 @@ public ArrayList getDnsServers() /** * Contains a collection of objects that define the DNS server settings. + * @param dnsServersValue The DnsServers value. */ - public void setDnsServers(ArrayList dnsServers) + public void setDnsServers(final ArrayList dnsServersValue) { - this.dnsServers = dnsServers; + this.dnsServers = dnsServersValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinCredentials.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinCredentials.java index 0fb2ebfabdc72..864ff121df3ce 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinCredentials.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinCredentials.java @@ -37,6 +37,7 @@ public class DomainJoinCredentials * is not specified, Username must specify the user principal name (UPN) * format (user@fully-qualified-DNS-domain) or the * fully-qualified-DNS-domain\\username format. Example: example.com + * @return The Domain value. */ public String getDomain() { @@ -49,16 +50,18 @@ public String getDomain() * is not specified, Username must specify the user principal name (UPN) * format (user@fully-qualified-DNS-domain) or the * fully-qualified-DNS-domain\\username format. Example: example.com + * @param domainValue The Domain value. */ - public void setDomain(String domain) + public void setDomain(final String domainValue) { - this.domain = domain; + this.domain = domainValue; } private String password; /** * Required. Specifies the password to use to join the domain. + * @return The Password value. */ public String getPassword() { @@ -67,10 +70,11 @@ public String getPassword() /** * Required. Specifies the password to use to join the domain. + * @param passwordValue The Password value. */ - public void setPassword(String password) + public void setPassword(final String passwordValue) { - this.password = password; + this.password = passwordValue; } private String userName; @@ -78,6 +82,7 @@ public void setPassword(String password) /** * Required. Specifies a user name in the domain that can be used to join * the domain. + * @return The UserName value. */ public String getUserName() { @@ -87,9 +92,10 @@ public String getUserName() /** * Required. Specifies a user name in the domain that can be used to join * the domain. + * @param userNameValue The UserName value. */ - public void setUserName(String userName) + public void setUserName(final String userNameValue) { - this.userName = userName; + this.userName = userNameValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinProvisioning.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinProvisioning.java index 4c2202caeea70..71287ff9d1a03 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinProvisioning.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinProvisioning.java @@ -32,6 +32,7 @@ public class DomainJoinProvisioning /** * The account infor for joining the domain. + * @return The AccountData value. */ public String getAccountData() { @@ -40,9 +41,10 @@ public String getAccountData() /** * The account infor for joining the domain. + * @param accountDataValue The AccountData value. */ - public void setAccountData(String accountData) + public void setAccountData(final String accountDataValue) { - this.accountData = accountData; + this.accountData = accountDataValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinSettings.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinSettings.java index 857c0ae8b3551..60812da278725 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinSettings.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/DomainJoinSettings.java @@ -35,6 +35,7 @@ public class DomainJoinSettings /** * Optional. Specifies the values to use to join the virtual machine to the * domain. + * @return The Credentials value. */ public DomainJoinCredentials getCredentials() { @@ -44,16 +45,18 @@ public DomainJoinCredentials getCredentials() /** * Optional. Specifies the values to use to join the virtual machine to the * domain. + * @param credentialsValue The Credentials value. */ - public void setCredentials(DomainJoinCredentials credentials) + public void setCredentials(final DomainJoinCredentials credentialsValue) { - this.credentials = credentials; + this.credentials = credentialsValue; } private String domainToJoin; /** * Optional. Specifies the domain to join. + * @return The DomainToJoin value. */ public String getDomainToJoin() { @@ -62,10 +65,11 @@ public String getDomainToJoin() /** * Optional. Specifies the domain to join. + * @param domainToJoinValue The DomainToJoin value. */ - public void setDomainToJoin(String domainToJoin) + public void setDomainToJoin(final String domainToJoinValue) { - this.domainToJoin = domainToJoin; + this.domainToJoin = domainToJoinValue; } private String ldapMachineObjectOU; @@ -76,6 +80,7 @@ public void setDomainToJoin(String domainToJoin) * computer account is created. This account is in Active Directory on a * domain controller in the domain to which the computer is being joined. * Example: OU=MyOu,OU=MyParentOu,DC=example.com,DC=MyCompany,DC=com + * @return The LdapMachineObjectOU value. */ public String getLdapMachineObjectOU() { @@ -88,16 +93,18 @@ public String getLdapMachineObjectOU() * computer account is created. This account is in Active Directory on a * domain controller in the domain to which the computer is being joined. * Example: OU=MyOu,OU=MyParentOu,DC=example.com,DC=MyCompany,DC=com + * @param ldapMachineObjectOUValue The LdapMachineObjectOU value. */ - public void setLdapMachineObjectOU(String ldapMachineObjectOU) + public void setLdapMachineObjectOU(final String ldapMachineObjectOUValue) { - this.ldapMachineObjectOU = ldapMachineObjectOU; + this.ldapMachineObjectOU = ldapMachineObjectOUValue; } private DomainJoinProvisioning provisioning; /** * Additional information for domain join provisioning. + * @return The Provisioning value. */ public DomainJoinProvisioning getProvisioning() { @@ -106,9 +113,10 @@ public DomainJoinProvisioning getProvisioning() /** * Additional information for domain join provisioning. + * @param provisioningValue The Provisioning value. */ - public void setProvisioning(DomainJoinProvisioning provisioning) + public void setProvisioning(final DomainJoinProvisioning provisioningValue) { - this.provisioning = provisioning; + this.provisioning = provisioningValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/EndpointAcl.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/EndpointAcl.java index 438a2fe842a6b..0857b3dbdc409 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/EndpointAcl.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/EndpointAcl.java @@ -34,6 +34,7 @@ public class EndpointAcl /** * The set of access control rules for the endpoint. + * @return The Rules value. */ public ArrayList getRules() { @@ -42,10 +43,11 @@ public ArrayList getRules() /** * The set of access control rules for the endpoint. + * @param rulesValue The Rules value. */ - public void setRules(ArrayList rules) + public void setRules(final ArrayList rulesValue) { - this.rules = rules; + this.rules = rulesValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ExtensionConfiguration.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ExtensionConfiguration.java index f4a2a8e18d1d5..f1b0c18a420d6 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ExtensionConfiguration.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ExtensionConfiguration.java @@ -35,6 +35,7 @@ public class ExtensionConfiguration /** * Optional. Specifies a list of extensions that are applied to all roles in * a deployment. + * @return The AllRoles value. */ public ArrayList getAllRoles() { @@ -44,10 +45,11 @@ public ArrayList getAllRoles() /** * Optional. Specifies a list of extensions that are applied to all roles in * a deployment. + * @param allRolesValue The AllRoles value. */ - public void setAllRoles(ArrayList allRoles) + public void setAllRoles(final ArrayList allRolesValue) { - this.allRoles = allRoles; + this.allRoles = allRolesValue; } private ArrayList namedRoles; @@ -55,6 +57,7 @@ public void setAllRoles(ArrayList allRoles) /** * Optional. Specifies a list of extensions that are applied to specific * roles in a deployment. + * @return The NamedRoles value. */ public ArrayList getNamedRoles() { @@ -64,10 +67,11 @@ public ArrayList getNamedRoles() /** * Optional. Specifies a list of extensions that are applied to specific * roles in a deployment. + * @param namedRolesValue The NamedRoles value. */ - public void setNamedRoles(ArrayList namedRoles) + public void setNamedRoles(final ArrayList namedRolesValue) { - this.namedRoles = namedRoles; + this.namedRoles = namedRolesValue; } /** @@ -93,6 +97,7 @@ public static class Extension * when the extension is added to the cloud service. You can find the * Id of an extension that was added to a cloud service by using List * Extensions. + * @return The Id value. */ public String getId() { @@ -104,10 +109,11 @@ public String getId() * when the extension is added to the cloud service. You can find the * Id of an extension that was added to a cloud service by using List * Extensions. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } } @@ -122,6 +128,7 @@ public static class NamedRole /** * Required. Represents an extension that is to be deployed to a role in * a cloud service. + * @return The Extensions value. */ public ArrayList getExtensions() { @@ -131,16 +138,18 @@ public ArrayList getExtensions() /** * Required. Represents an extension that is to be deployed to a role in * a cloud service. + * @param extensionsValue The Extensions value. */ - public void setExtensions(ArrayList extensions) + public void setExtensions(final ArrayList extensionsValue) { - this.extensions = extensions; + this.extensions = extensionsValue; } private String roleName; /** * Required. Specifies the name of the role. + * @return The RoleName value. */ public String getRoleName() { @@ -149,10 +158,11 @@ public String getRoleName() /** * Required. Specifies the name of the role. + * @param roleNameValue The RoleName value. */ - public void setRoleName(String roleName) + public void setRoleName(final String roleNameValue) { - this.roleName = roleName; + this.roleName = roleNameValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceAddExtensionParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceAddExtensionParameters.java index b85ba9a618dc2..32d7eaec0fd25 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceAddExtensionParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceAddExtensionParameters.java @@ -32,6 +32,7 @@ public class HostedServiceAddExtensionParameters /** * The identifier of the extension. + * @return The Id value. */ public String getId() { @@ -40,10 +41,11 @@ public String getId() /** * The identifier of the extension. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private String privateConfiguration; @@ -51,6 +53,7 @@ public void setId(String id) /** * The private configuration that is defined using the schema returned by * the List Available Extensions operation. + * @return The PrivateConfiguration value. */ public String getPrivateConfiguration() { @@ -60,10 +63,11 @@ public String getPrivateConfiguration() /** * The private configuration that is defined using the schema returned by * the List Available Extensions operation. + * @param privateConfigurationValue The PrivateConfiguration value. */ - public void setPrivateConfiguration(String privateConfiguration) + public void setPrivateConfiguration(final String privateConfigurationValue) { - this.privateConfiguration = privateConfiguration; + this.privateConfiguration = privateConfigurationValue; } private String providerNamespace; @@ -71,6 +75,7 @@ public void setPrivateConfiguration(String privateConfiguration) /** * The provider namespace of the extension. The provider namespace for * Windows Azure extensions is Microsoft.Windows.Azure.Extensions. + * @return The ProviderNamespace value. */ public String getProviderNamespace() { @@ -80,10 +85,11 @@ public String getProviderNamespace() /** * The provider namespace of the extension. The provider namespace for * Windows Azure extensions is Microsoft.Windows.Azure.Extensions. + * @param providerNamespaceValue The ProviderNamespace value. */ - public void setProviderNamespace(String providerNamespace) + public void setProviderNamespace(final String providerNamespaceValue) { - this.providerNamespace = providerNamespace; + this.providerNamespace = providerNamespaceValue; } private String publicConfiguration; @@ -91,6 +97,7 @@ public void setProviderNamespace(String providerNamespace) /** * The public configuration that is defined using the schema returned by the * List Available Extensions operation. + * @return The PublicConfiguration value. */ public String getPublicConfiguration() { @@ -100,10 +107,11 @@ public String getPublicConfiguration() /** * The public configuration that is defined using the schema returned by the * List Available Extensions operation. + * @param publicConfigurationValue The PublicConfiguration value. */ - public void setPublicConfiguration(String publicConfiguration) + public void setPublicConfiguration(final String publicConfigurationValue) { - this.publicConfiguration = publicConfiguration; + this.publicConfiguration = publicConfigurationValue; } private String thumbprint; @@ -113,6 +121,7 @@ public void setPublicConfiguration(String publicConfiguration) * configuration specified in PrivateConfiguration. If this element is not * specified, a certificate may be automatically generated and added to the * cloud service. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -124,10 +133,11 @@ public String getThumbprint() * configuration specified in PrivateConfiguration. If this element is not * specified, a certificate may be automatically generated and added to the * cloud service. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } private String thumbprintAlgorithm; @@ -135,6 +145,7 @@ public void setThumbprint(String thumbprint) /** * The thumbprint algorithm of the certificate that is used toencrypt the * configuration specified in PrivateConfiguration. + * @return The ThumbprintAlgorithm value. */ public String getThumbprintAlgorithm() { @@ -144,16 +155,18 @@ public String getThumbprintAlgorithm() /** * The thumbprint algorithm of the certificate that is used toencrypt the * configuration specified in PrivateConfiguration. + * @param thumbprintAlgorithmValue The ThumbprintAlgorithm value. */ - public void setThumbprintAlgorithm(String thumbprintAlgorithm) + public void setThumbprintAlgorithm(final String thumbprintAlgorithmValue) { - this.thumbprintAlgorithm = thumbprintAlgorithm; + this.thumbprintAlgorithm = thumbprintAlgorithmValue; } private String type; /** * Required. The type of the extension. + * @return The Type value. */ public String getType() { @@ -162,9 +175,10 @@ public String getType() /** * Required. The type of the extension. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceCheckNameAvailabilityResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceCheckNameAvailabilityResponse.java index fed36c09730b9..f0f8f753a8194 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceCheckNameAvailabilityResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceCheckNameAvailabilityResponse.java @@ -36,8 +36,9 @@ public class HostedServiceCheckNameAvailabilityResponse extends OperationRespons * A boolean value that indicates whether the name is available for you to * use. True if the name is available; otherwise false. The operation * returns false for reserved or profane words. + * @return The IsAvailable value. */ - public boolean getIsAvailable() + public boolean isAvailable() { return this.isAvailable; } @@ -46,16 +47,18 @@ public boolean getIsAvailable() * A boolean value that indicates whether the name is available for you to * use. True if the name is available; otherwise false. The operation * returns false for reserved or profane words. + * @param isAvailableValue The IsAvailable value. */ - public void setIsAvailable(boolean isAvailable) + public void setIsAvailable(final boolean isAvailableValue) { - this.isAvailable = isAvailable; + this.isAvailable = isAvailableValue; } private String reason; /** * Describes why the name cannot be used to create the cloud service. + * @return The Reason value. */ public String getReason() { @@ -64,9 +67,10 @@ public String getReason() /** * Describes why the name cannot be used to create the cloud service. + * @param reasonValue The Reason value. */ - public void setReason(String reason) + public void setReason(final String reasonValue) { - this.reason = reason; + this.reason = reasonValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceCreateParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceCreateParameters.java index 1277420d29bb8..0dd6e7d7e1e30 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceCreateParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceCreateParameters.java @@ -39,6 +39,7 @@ public class HostedServiceCreateParameters * the List Affinity Groups operation. Specify either Location or * AffinityGroup, but not both. To list available affinity groups, use the * List Affinity Groups operation. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -52,10 +53,11 @@ public String getAffinityGroup() * the List Affinity Groups operation. Specify either Location or * AffinityGroup, but not both. To list available affinity groups, use the * List Affinity Groups operation. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private String description; @@ -63,6 +65,7 @@ public void setAffinityGroup(String affinityGroup) /** * Optional. A description for the cloud service. The description can be up * to 1024 characters in length. + * @return The Description value. */ public String getDescription() { @@ -72,10 +75,11 @@ public String getDescription() /** * Optional. A description for the cloud service. The description can be up * to 1024 characters in length. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private HashMap extendedProperties; @@ -91,6 +95,7 @@ public void setDescription(String description) * extended property owned by the same service, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -108,10 +113,11 @@ public HashMap getExtendedProperties() * extended property owned by the same service, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private String label; @@ -120,6 +126,7 @@ public void setExtendedProperties(HashMap extendedProperties) * Required. A name for the cloud service. The name can be up to 100 * characters in length. The name can be used to identify the storage * account for your tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -137,10 +144,11 @@ public String getLabel() * Required. A name for the cloud service. The name can be up to 100 * characters in length. The name can be used to identify the storage * account for your tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String location; @@ -149,6 +157,7 @@ public void setLabel(String label) * Required if AffinityGroup is not specified. The location where the cloud * service will be created. Specify either Location or AffinityGroup, but * not both. To list available locations, use the List Locations operation. + * @return The Location value. */ public String getLocation() { @@ -159,10 +168,11 @@ public String getLocation() * Required if AffinityGroup is not specified. The location where the cloud * service will be created. Specify either Location or AffinityGroup, but * not both. To list available locations, use the List Locations operation. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private String serviceName; @@ -171,6 +181,7 @@ public void setLocation(String location) * Required. A name for the cloud service that is unique within Windows * Azure. This name is the DNS prefix name and can be used to access the * service. + * @return The ServiceName value. */ public String getServiceName() { @@ -181,10 +192,11 @@ public String getServiceName() * Required. A name for the cloud service that is unique within Windows * Azure. This name is the DNS prefix name and can be used to access the * service. + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetDetailedResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetDetailedResponse.java index b8dea6dff8d82..c1595fcb3facf 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetDetailedResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetDetailedResponse.java @@ -37,6 +37,7 @@ public class HostedServiceGetDetailedResponse extends HostedServiceGetResponse /** * The deployments that exist in the cloud service. + * @return The Deployments value. */ public ArrayList getDeployments() { @@ -45,10 +46,11 @@ public ArrayList getDeployments() /** * The deployments that exist in the cloud service. + * @param deploymentsValue The Deployments value. */ - public void setDeployments(ArrayList deployments) + public void setDeployments(final ArrayList deploymentsValue) { - this.deployments = deployments; + this.deployments = deploymentsValue; } /** @@ -70,6 +72,7 @@ public static class Deployment /** * The configuration file of the deployment. + * @return The Configuration value. */ public String getConfiguration() { @@ -78,16 +81,18 @@ public String getConfiguration() /** * The configuration file of the deployment. + * @param configurationValue The Configuration value. */ - public void setConfiguration(String configuration) + public void setConfiguration(final String configurationValue) { - this.configuration = configuration; + this.configuration = configurationValue; } private Calendar createdTime; /** * The time that the deployment was created. + * @return The CreatedTime value. */ public Calendar getCreatedTime() { @@ -96,16 +101,18 @@ public Calendar getCreatedTime() /** * The time that the deployment was created. + * @param createdTimeValue The CreatedTime value. */ - public void setCreatedTime(Calendar createdTime) + public void setCreatedTime(final Calendar createdTimeValue) { - this.createdTime = createdTime; + this.createdTime = createdTimeValue; } private DeploymentSlot deploymentSlot; /** * The deployment environment in which this deployment is running. + * @return The DeploymentSlot value. */ public DeploymentSlot getDeploymentSlot() { @@ -114,16 +121,18 @@ public DeploymentSlot getDeploymentSlot() /** * The deployment environment in which this deployment is running. + * @param deploymentSlotValue The DeploymentSlot value. */ - public void setDeploymentSlot(DeploymentSlot deploymentSlot) + public void setDeploymentSlot(final DeploymentSlot deploymentSlotValue) { - this.deploymentSlot = deploymentSlot; + this.deploymentSlot = deploymentSlotValue; } private DnsSettings dnsSettings; /** * The custom DNS settings that are specified for deployment. + * @return The DnsSettings value. */ public DnsSettings getDnsSettings() { @@ -132,10 +141,11 @@ public DnsSettings getDnsSettings() /** * The custom DNS settings that are specified for deployment. + * @param dnsSettingsValue The DnsSettings value. */ - public void setDnsSettings(DnsSettings dnsSettings) + public void setDnsSettings(final DnsSettings dnsSettingsValue) { - this.dnsSettings = dnsSettings; + this.dnsSettings = dnsSettingsValue; } private HashMap extendedProperties; @@ -151,6 +161,7 @@ public void setDnsSettings(DnsSettings dnsSettings) * identical to that of another extended property owned by the same * service, will result in a status code 400 (Bad Request) error. Each * extended property value has a maximum length of 255 characters. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -168,10 +179,11 @@ public HashMap getExtendedProperties() * identical to that of another extended property owned by the same * service, will result in a status code 400 (Bad Request) error. Each * extended property value has a maximum length of 255 characters. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private String label; @@ -179,6 +191,7 @@ public void setExtendedProperties(HashMap extendedProperties) /** * The user-supplied name of the deployment. This name can be used * identify the deployment for your tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -188,16 +201,18 @@ public String getLabel() /** * The user-supplied name of the deployment. This name can be used * identify the deployment for your tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String lastModifiedTime; /** * The last time that the deployment was modified. + * @return The LastModifiedTime value. */ public String getLastModifiedTime() { @@ -206,10 +221,11 @@ public String getLastModifiedTime() /** * The last time that the deployment was modified. + * @param lastModifiedTimeValue The LastModifiedTime value. */ - public void setLastModifiedTime(String lastModifiedTime) + public void setLastModifiedTime(final String lastModifiedTimeValue) { - this.lastModifiedTime = lastModifiedTime; + this.lastModifiedTime = lastModifiedTimeValue; } private boolean locked; @@ -218,8 +234,9 @@ public void setLastModifiedTime(String lastModifiedTime) * Indicates whether the deployment is locked for new write operations. * True if the deployment is locked because an existing operation is * updating the deployment; otherwise false. + * @return The Locked value. */ - public boolean getLocked() + public boolean isLocked() { return this.locked; } @@ -228,22 +245,29 @@ public boolean getLocked() * Indicates whether the deployment is locked for new write operations. * True if the deployment is locked because an existing operation is * updating the deployment; otherwise false. + * @param lockedValue The Locked value. */ - public void setLocked(boolean locked) + public void setLocked(final boolean lockedValue) { - this.locked = locked; + this.locked = lockedValue; } private String name; + /** + * @return The Name value. + */ public String getName() { return this.name; } - public void setName(String name) + /** + * @param nameValue The Name value. + */ + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private PersistentVMDowntime persistentVMDowntime; @@ -251,6 +275,7 @@ public void setName(String name) /** * Specifies information about when the virtual machine has been started * and stopped. + * @return The PersistentVMDowntime value. */ public PersistentVMDowntime getPersistentVMDowntime() { @@ -260,16 +285,18 @@ public PersistentVMDowntime getPersistentVMDowntime() /** * Specifies information about when the virtual machine has been started * and stopped. + * @param persistentVMDowntimeValue The PersistentVMDowntime value. */ - public void setPersistentVMDowntime(PersistentVMDowntime persistentVMDowntime) + public void setPersistentVMDowntime(final PersistentVMDowntime persistentVMDowntimeValue) { - this.persistentVMDowntime = persistentVMDowntime; + this.persistentVMDowntime = persistentVMDowntimeValue; } private String privateId; /** * The unique identifier for this deployment. + * @return The PrivateId value. */ public String getPrivateId() { @@ -278,16 +305,18 @@ public String getPrivateId() /** * The unique identifier for this deployment. + * @param privateIdValue The PrivateId value. */ - public void setPrivateId(String privateId) + public void setPrivateId(final String privateIdValue) { - this.privateId = privateId; + this.privateId = privateIdValue; } private ArrayList roleInstances; /** * The list of role instances in the deployment. + * @return The RoleInstances value. */ public ArrayList getRoleInstances() { @@ -296,16 +325,18 @@ public ArrayList getRoleInstances() /** * The list of role instances in the deployment. + * @param roleInstancesValue The RoleInstances value. */ - public void setRoleInstances(ArrayList roleInstances) + public void setRoleInstances(final ArrayList roleInstancesValue) { - this.roleInstances = roleInstances; + this.roleInstances = roleInstancesValue; } private ArrayList roles; /** * The list of roles in the deployment. + * @return The Roles value. */ public ArrayList getRoles() { @@ -314,10 +345,11 @@ public ArrayList getRoles() /** * The list of roles in the deployment. + * @param rolesValue The Roles value. */ - public void setRoles(ArrayList roles) + public void setRoles(final ArrayList rolesValue) { - this.roles = roles; + this.roles = rolesValue; } private String rollbackAllowed; @@ -325,6 +357,7 @@ public void setRoles(ArrayList roles) /** * Indicates whether the Rollback Update Or Upgrade operation is allowed * at this time. True if the operation is allowed; otherwise false. + * @return The RollbackAllowed value. */ public String getRollbackAllowed() { @@ -334,10 +367,11 @@ public String getRollbackAllowed() /** * Indicates whether the Rollback Update Or Upgrade operation is allowed * at this time. True if the operation is allowed; otherwise false. + * @param rollbackAllowedValue The RollbackAllowed value. */ - public void setRollbackAllowed(String rollbackAllowed) + public void setRollbackAllowed(final String rollbackAllowedValue) { - this.rollbackAllowed = rollbackAllowed; + this.rollbackAllowed = rollbackAllowedValue; } private String sdkVersion; @@ -347,6 +381,7 @@ public void setRollbackAllowed(String rollbackAllowed) * .cspkg that created this deployment. The first two numerical * components of the returned version represent the version of the SDK * used to create the package. + * @return The SdkVersion value. */ public String getSdkVersion() { @@ -358,16 +393,18 @@ public String getSdkVersion() * .cspkg that created this deployment. The first two numerical * components of the returned version represent the version of the SDK * used to create the package. + * @param sdkVersionValue The SdkVersion value. */ - public void setSdkVersion(String sdkVersion) + public void setSdkVersion(final String sdkVersionValue) { - this.sdkVersion = sdkVersion; + this.sdkVersion = sdkVersionValue; } private DeploymentStatus status; /** * The status of the deployment. + * @return The Status value. */ public DeploymentStatus getStatus() { @@ -376,16 +413,18 @@ public DeploymentStatus getStatus() /** * The status of the deployment. + * @param statusValue The Status value. */ - public void setStatus(DeploymentStatus status) + public void setStatus(final DeploymentStatus statusValue) { - this.status = status; + this.status = statusValue; } private int upgradeDomainCount; /** * The number of upgrade domains available to this cloud service. + * @return The UpgradeDomainCount value. */ public int getUpgradeDomainCount() { @@ -394,16 +433,18 @@ public int getUpgradeDomainCount() /** * The number of upgrade domains available to this cloud service. + * @param upgradeDomainCountValue The UpgradeDomainCount value. */ - public void setUpgradeDomainCount(int upgradeDomainCount) + public void setUpgradeDomainCount(final int upgradeDomainCountValue) { - this.upgradeDomainCount = upgradeDomainCount; + this.upgradeDomainCount = upgradeDomainCountValue; } private UpgradeStatus upgradeStatus; /** * Specifies information about an update occurring on the deployment. + * @return The UpgradeStatus value. */ public UpgradeStatus getUpgradeStatus() { @@ -412,10 +453,11 @@ public UpgradeStatus getUpgradeStatus() /** * Specifies information about an update occurring on the deployment. + * @param upgradeStatusValue The UpgradeStatus value. */ - public void setUpgradeStatus(UpgradeStatus upgradeStatus) + public void setUpgradeStatus(final UpgradeStatus upgradeStatusValue) { - this.upgradeStatus = upgradeStatus; + this.upgradeStatus = upgradeStatusValue; } private URI uri; @@ -424,6 +466,7 @@ public void setUpgradeStatus(UpgradeStatus upgradeStatus) * The URL used to access the hosted service. For example, if the * service name is MyService you could access the access the service by * calling: http://MyService.cloudapp.net + * @return The Uri value. */ public URI getUri() { @@ -434,16 +477,18 @@ public URI getUri() * The URL used to access the hosted service. For example, if the * service name is MyService you could access the access the service by * calling: http://MyService.cloudapp.net + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } private ArrayList virtualIPAddresses; /** * The virtual IP addresses that are specified for thedeployment. + * @return The VirtualIPAddresses value. */ public ArrayList getVirtualIPAddresses() { @@ -452,16 +497,18 @@ public ArrayList getVirtualIPAddresses() /** * The virtual IP addresses that are specified for thedeployment. + * @param virtualIPAddressesValue The VirtualIPAddresses value. */ - public void setVirtualIPAddresses(ArrayList virtualIPAddresses) + public void setVirtualIPAddresses(final ArrayList virtualIPAddressesValue) { - this.virtualIPAddresses = virtualIPAddresses; + this.virtualIPAddresses = virtualIPAddressesValue; } private String virtualNetworkName; /** * The name of the Virtual Network that the virtual machine connects to. + * @return The VirtualNetworkName value. */ public String getVirtualNetworkName() { @@ -470,10 +517,11 @@ public String getVirtualNetworkName() /** * The name of the Virtual Network that the virtual machine connects to. + * @param virtualNetworkNameValue The VirtualNetworkName value. */ - public void setVirtualNetworkName(String virtualNetworkName) + public void setVirtualNetworkName(final String virtualNetworkNameValue) { - this.virtualNetworkName = virtualNetworkName; + this.virtualNetworkName = virtualNetworkNameValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetExtensionResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetExtensionResponse.java index 67a01aec25de1..62962ed0ab06a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetExtensionResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetExtensionResponse.java @@ -34,6 +34,7 @@ public class HostedServiceGetExtensionResponse extends OperationResponse /** * The identifier of the extension. + * @return The Id value. */ public String getId() { @@ -42,10 +43,11 @@ public String getId() /** * The identifier of the extension. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private String providerNamespace; @@ -53,6 +55,7 @@ public void setId(String id) /** * The provider namespace of the extension. The provider namespace for * Windows Azure extensions is Microsoft.Windows.Azure.Extensions. + * @return The ProviderNamespace value. */ public String getProviderNamespace() { @@ -62,10 +65,11 @@ public String getProviderNamespace() /** * The provider namespace of the extension. The provider namespace for * Windows Azure extensions is Microsoft.Windows.Azure.Extensions. + * @param providerNamespaceValue The ProviderNamespace value. */ - public void setProviderNamespace(String providerNamespace) + public void setProviderNamespace(final String providerNamespaceValue) { - this.providerNamespace = providerNamespace; + this.providerNamespace = providerNamespaceValue; } private String publicConfiguration; @@ -73,6 +77,7 @@ public void setProviderNamespace(String providerNamespace) /** * The public configuration that is defined using the schema returned by the * List Available Extensions operation. + * @return The PublicConfiguration value. */ public String getPublicConfiguration() { @@ -82,10 +87,11 @@ public String getPublicConfiguration() /** * The public configuration that is defined using the schema returned by the * List Available Extensions operation. + * @param publicConfigurationValue The PublicConfiguration value. */ - public void setPublicConfiguration(String publicConfiguration) + public void setPublicConfiguration(final String publicConfigurationValue) { - this.publicConfiguration = publicConfiguration; + this.publicConfiguration = publicConfigurationValue; } private String thumbprint; @@ -95,6 +101,7 @@ public void setPublicConfiguration(String publicConfiguration) * configuration specified in PrivateConfiguration. If this element is not * specified, a certificate may be automatically generated and added to the * cloud service. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -106,10 +113,11 @@ public String getThumbprint() * configuration specified in PrivateConfiguration. If this element is not * specified, a certificate may be automatically generated and added to the * cloud service. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } private String thumbprintAlgorithm; @@ -117,6 +125,7 @@ public void setThumbprint(String thumbprint) /** * The thumbprint algorithm of the certificate that is used toencrypt the * configuration specified in PrivateConfiguration. + * @return The ThumbprintAlgorithm value. */ public String getThumbprintAlgorithm() { @@ -126,16 +135,18 @@ public String getThumbprintAlgorithm() /** * The thumbprint algorithm of the certificate that is used toencrypt the * configuration specified in PrivateConfiguration. + * @param thumbprintAlgorithmValue The ThumbprintAlgorithm value. */ - public void setThumbprintAlgorithm(String thumbprintAlgorithm) + public void setThumbprintAlgorithm(final String thumbprintAlgorithmValue) { - this.thumbprintAlgorithm = thumbprintAlgorithm; + this.thumbprintAlgorithm = thumbprintAlgorithmValue; } private String type; /** * Required. The type of the extension. + * @return The Type value. */ public String getType() { @@ -144,16 +155,18 @@ public String getType() /** * Required. The type of the extension. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } private String version; /** * The version of the extension. + * @return The Version value. */ public String getVersion() { @@ -162,9 +175,10 @@ public String getVersion() /** * The version of the extension. + * @param versionValue The Version value. */ - public void setVersion(String version) + public void setVersion(final String versionValue) { - this.version = version; + this.version = versionValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetResponse.java index 85ff39e3231b2..42a0f92c9466a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceGetResponse.java @@ -35,6 +35,7 @@ public class HostedServiceGetResponse extends OperationResponse /** * The properties that are assigned to the cloud service. + * @return The Properties value. */ public HostedServiceProperties getProperties() { @@ -43,10 +44,11 @@ public HostedServiceProperties getProperties() /** * The properties that are assigned to the cloud service. + * @param propertiesValue The Properties value. */ - public void setProperties(HostedServiceProperties properties) + public void setProperties(final HostedServiceProperties propertiesValue) { - this.properties = properties; + this.properties = propertiesValue; } private String serviceName; @@ -56,6 +58,7 @@ public void setProperties(HostedServiceProperties properties) * be used to access the cloud service. For example, if the cloud service * name is MyService you could access the access the cloud service by * calling: http://MyService.cloudapp.net + * @return The ServiceName value. */ public String getServiceName() { @@ -67,10 +70,11 @@ public String getServiceName() * be used to access the cloud service. For example, if the cloud service * name is MyService you could access the access the cloud service by * calling: http://MyService.cloudapp.net + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } private URI uri; @@ -78,6 +82,7 @@ public void setServiceName(String serviceName) /** * The Service Management API request URI used to performGet Hosted Service * Properties requests against the cloud service. + * @return The Uri value. */ public URI getUri() { @@ -87,9 +92,10 @@ public URI getUri() /** * The Service Management API request URI used to performGet Hosted Service * Properties requests against the cloud service. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListAvailableExtensionsResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListAvailableExtensionsResponse.java index c78e5112d0ea9..77a506996fd55 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListAvailableExtensionsResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListAvailableExtensionsResponse.java @@ -36,6 +36,7 @@ public class HostedServiceListAvailableExtensionsResponse extends OperationRespo /** * The extensions that are available to add to your cloud service. + * @return The ExtensionImages value. */ public ArrayList getExtensionImages() { @@ -44,10 +45,11 @@ public ArrayList ge /** * The extensions that are available to add to your cloud service. + * @param extensionImagesValue The ExtensionImages value. */ - public void setExtensionImages(ArrayList extensionImages) + public void setExtensionImages(final ArrayList extensionImagesValue) { - this.extensionImages = extensionImages; + this.extensionImages = extensionImagesValue; } /** @@ -79,6 +81,7 @@ public static class ExtensionImage /** * The description of the extension. + * @return The Description value. */ public String getDescription() { @@ -87,10 +90,11 @@ public String getDescription() /** * The description of the extension. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private HostingResources hostingResources; @@ -98,6 +102,7 @@ public void setDescription(String description) /** * The type of resource that supports the extension. This value can be * WebRole, WorkerRole, or WebRole|WorkerRole. + * @return The HostingResources value. */ public HostingResources getHostingResources() { @@ -107,16 +112,18 @@ public HostingResources getHostingResources() /** * The type of resource that supports the extension. This value can be * WebRole, WorkerRole, or WebRole|WorkerRole. + * @param hostingResourcesValue The HostingResources value. */ - public void setHostingResources(HostingResources hostingResources) + public void setHostingResources(final HostingResources hostingResourcesValue) { - this.hostingResources = hostingResources; + this.hostingResources = hostingResourcesValue; } private String label; /** * The label that is used to identify the extension. + * @return The Label value. */ public String getLabel() { @@ -125,16 +132,18 @@ public String getLabel() /** * The label that is used to identify the extension. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String privateConfigurationSchema; /** * The schema of the private configuration. + * @return The PrivateConfigurationSchema value. */ public String getPrivateConfigurationSchema() { @@ -143,10 +152,12 @@ public String getPrivateConfigurationSchema() /** * The schema of the private configuration. + * @param privateConfigurationSchemaValue The PrivateConfigurationSchema + * value. */ - public void setPrivateConfigurationSchema(String privateConfigurationSchema) + public void setPrivateConfigurationSchema(final String privateConfigurationSchemaValue) { - this.privateConfigurationSchema = privateConfigurationSchema; + this.privateConfigurationSchema = privateConfigurationSchemaValue; } private String providerNamespace; @@ -154,6 +165,7 @@ public void setPrivateConfigurationSchema(String privateConfigurationSchema) /** * The provider namespace of the extension. The provider namespace for * Windows Azure extensions is Microsoft.Windows.Azure.Extensions. + * @return The ProviderNamespace value. */ public String getProviderNamespace() { @@ -163,16 +175,18 @@ public String getProviderNamespace() /** * The provider namespace of the extension. The provider namespace for * Windows Azure extensions is Microsoft.Windows.Azure.Extensions. + * @param providerNamespaceValue The ProviderNamespace value. */ - public void setProviderNamespace(String providerNamespace) + public void setProviderNamespace(final String providerNamespaceValue) { - this.providerNamespace = providerNamespace; + this.providerNamespace = providerNamespaceValue; } private String publicConfigurationSchema; /** * The schema of the public configuration. + * @return The PublicConfigurationSchema value. */ public String getPublicConfigurationSchema() { @@ -181,10 +195,12 @@ public String getPublicConfigurationSchema() /** * The schema of the public configuration. + * @param publicConfigurationSchemaValue The PublicConfigurationSchema + * value. */ - public void setPublicConfigurationSchema(String publicConfigurationSchema) + public void setPublicConfigurationSchema(final String publicConfigurationSchemaValue) { - this.publicConfigurationSchema = publicConfigurationSchema; + this.publicConfigurationSchema = publicConfigurationSchemaValue; } private String thumbprintAlgorithm; @@ -192,6 +208,7 @@ public void setPublicConfigurationSchema(String publicConfigurationSchema) /** * The thumbprint algorithm of the certificate that is used for * encryption. + * @return The ThumbprintAlgorithm value. */ public String getThumbprintAlgorithm() { @@ -201,16 +218,18 @@ public String getThumbprintAlgorithm() /** * The thumbprint algorithm of the certificate that is used for * encryption. + * @param thumbprintAlgorithmValue The ThumbprintAlgorithm value. */ - public void setThumbprintAlgorithm(String thumbprintAlgorithm) + public void setThumbprintAlgorithm(final String thumbprintAlgorithmValue) { - this.thumbprintAlgorithm = thumbprintAlgorithm; + this.thumbprintAlgorithm = thumbprintAlgorithmValue; } private String type; /** * Required. The type of the extension. + * @return The Type value. */ public String getType() { @@ -219,16 +238,18 @@ public String getType() /** * Required. The type of the extension. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } private String version; /** * The version of the extension. + * @return The Version value. */ public String getVersion() { @@ -237,10 +258,11 @@ public String getVersion() /** * The version of the extension. + * @param versionValue The Version value. */ - public void setVersion(String version) + public void setVersion(final String versionValue) { - this.version = version; + this.version = versionValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListExtensionsResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListExtensionsResponse.java index 108aa00e725fc..b69be3873b71c 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListExtensionsResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListExtensionsResponse.java @@ -36,6 +36,7 @@ public class HostedServiceListExtensionsResponse extends OperationResponse imple /** * The extensions that were added to a cloud service. + * @return The Extensions value. */ public ArrayList getExtensions() { @@ -44,10 +45,11 @@ public ArrayList getExtensions() /** * The extensions that were added to a cloud service. + * @param extensionsValue The Extensions value. */ - public void setExtensions(ArrayList extensions) + public void setExtensions(final ArrayList extensionsValue) { - this.extensions = extensions; + this.extensions = extensionsValue; } /** @@ -79,6 +81,7 @@ public static class Extension /** * The identifier of the extension. + * @return The Id value. */ public String getId() { @@ -87,10 +90,11 @@ public String getId() /** * The identifier of the extension. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private String providerNamespace; @@ -98,6 +102,7 @@ public void setId(String id) /** * The provider namespace of the extension. The provider namespace for * Windows Azure extensions is Microsoft.Windows.Azure.Extensions. + * @return The ProviderNamespace value. */ public String getProviderNamespace() { @@ -107,10 +112,11 @@ public String getProviderNamespace() /** * The provider namespace of the extension. The provider namespace for * Windows Azure extensions is Microsoft.Windows.Azure.Extensions. + * @param providerNamespaceValue The ProviderNamespace value. */ - public void setProviderNamespace(String providerNamespace) + public void setProviderNamespace(final String providerNamespaceValue) { - this.providerNamespace = providerNamespace; + this.providerNamespace = providerNamespaceValue; } private String publicConfiguration; @@ -118,6 +124,7 @@ public void setProviderNamespace(String providerNamespace) /** * The public configuration that is defined using the schema returned by * the List Available Extensions operation. + * @return The PublicConfiguration value. */ public String getPublicConfiguration() { @@ -127,10 +134,11 @@ public String getPublicConfiguration() /** * The public configuration that is defined using the schema returned by * the List Available Extensions operation. + * @param publicConfigurationValue The PublicConfiguration value. */ - public void setPublicConfiguration(String publicConfiguration) + public void setPublicConfiguration(final String publicConfigurationValue) { - this.publicConfiguration = publicConfiguration; + this.publicConfiguration = publicConfigurationValue; } private String thumbprint; @@ -140,6 +148,7 @@ public void setPublicConfiguration(String publicConfiguration) * configuration specified in PrivateConfiguration. If this element is * not specified, a certificate may be automatically generated and * added to the cloud service. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -151,10 +160,11 @@ public String getThumbprint() * configuration specified in PrivateConfiguration. If this element is * not specified, a certificate may be automatically generated and * added to the cloud service. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } private String thumbprintAlgorithm; @@ -162,6 +172,7 @@ public void setThumbprint(String thumbprint) /** * The thumbprint algorithm of the certificate that is used toencrypt * the configuration specified in PrivateConfiguration. + * @return The ThumbprintAlgorithm value. */ public String getThumbprintAlgorithm() { @@ -171,16 +182,18 @@ public String getThumbprintAlgorithm() /** * The thumbprint algorithm of the certificate that is used toencrypt * the configuration specified in PrivateConfiguration. + * @param thumbprintAlgorithmValue The ThumbprintAlgorithm value. */ - public void setThumbprintAlgorithm(String thumbprintAlgorithm) + public void setThumbprintAlgorithm(final String thumbprintAlgorithmValue) { - this.thumbprintAlgorithm = thumbprintAlgorithm; + this.thumbprintAlgorithm = thumbprintAlgorithmValue; } private String type; /** * Required. The type of the extension. + * @return The Type value. */ public String getType() { @@ -189,16 +202,18 @@ public String getType() /** * Required. The type of the extension. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } private String version; /** * The version of the extension. + * @return The Version value. */ public String getVersion() { @@ -207,10 +222,11 @@ public String getVersion() /** * The version of the extension. + * @param versionValue The Version value. */ - public void setVersion(String version) + public void setVersion(final String versionValue) { - this.version = version; + this.version = versionValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListResponse.java index 722da876e9085..09f7b8bf6bc81 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceListResponse.java @@ -37,6 +37,7 @@ public class HostedServiceListResponse extends OperationResponse implements Iter /** * The hosted services associated with your subscription. + * @return The HostedServices value. */ public ArrayList getHostedServices() { @@ -45,10 +46,11 @@ public ArrayList getHostedServices() /** * The hosted services associated with your subscription. + * @param hostedServicesValue The HostedServices value. */ - public void setHostedServices(ArrayList hostedServices) + public void setHostedServices(final ArrayList hostedServicesValue) { - this.hostedServices = hostedServices; + this.hostedServices = hostedServicesValue; } /** @@ -79,6 +81,7 @@ public static class HostedService /** * The properties that are assigned to the cloud service. + * @return The Properties value. */ public HostedServiceProperties getProperties() { @@ -87,10 +90,11 @@ public HostedServiceProperties getProperties() /** * The properties that are assigned to the cloud service. + * @param propertiesValue The Properties value. */ - public void setProperties(HostedServiceProperties properties) + public void setProperties(final HostedServiceProperties propertiesValue) { - this.properties = properties; + this.properties = propertiesValue; } private String serviceName; @@ -100,6 +104,7 @@ public void setProperties(HostedServiceProperties properties) * can be used to access the cloud service. For example, if the cloud * service name is MyService you could access the cloud service by * calling: http://MyService.cloudapp.net + * @return The ServiceName value. */ public String getServiceName() { @@ -111,10 +116,11 @@ public String getServiceName() * can be used to access the cloud service. For example, if the cloud * service name is MyService you could access the cloud service by * calling: http://MyService.cloudapp.net + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } private URI uri; @@ -122,6 +128,7 @@ public void setServiceName(String serviceName) /** * The Service Management API request URI used to perform Get Hosted * Service Properties requests against the cloud service. + * @return The Uri value. */ public URI getUri() { @@ -131,10 +138,11 @@ public URI getUri() /** * The Service Management API request URI used to perform Get Hosted * Service Properties requests against the cloud service. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceProperties.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceProperties.java index 8ea6ea3f082e5..406e419612abb 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceProperties.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceProperties.java @@ -37,6 +37,7 @@ public class HostedServiceProperties * The affinity group with which this cloud service is associated, if any. * If the service is associated with an affinity group, the Location * element is not returned. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -47,10 +48,11 @@ public String getAffinityGroup() * The affinity group with which this cloud service is associated, if any. * If the service is associated with an affinity group, the Location * element is not returned. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private Calendar dateCreated; @@ -60,6 +62,7 @@ public void setAffinityGroup(String affinityGroup) * [4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitHour]:[2DigitMinute]:[2DigitSecond]Z * format. The date 2011-05-11T16:15:26Z is an example that could * bereturned by the DateCreated or DateLastModified elements. + * @return The DateCreated value. */ public Calendar getDateCreated() { @@ -71,10 +74,11 @@ public Calendar getDateCreated() * [4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitHour]:[2DigitMinute]:[2DigitSecond]Z * format. The date 2011-05-11T16:15:26Z is an example that could * bereturned by the DateCreated or DateLastModified elements. + * @param dateCreatedValue The DateCreated value. */ - public void setDateCreated(Calendar dateCreated) + public void setDateCreated(final Calendar dateCreatedValue) { - this.dateCreated = dateCreated; + this.dateCreated = dateCreatedValue; } private Calendar dateLastModified; @@ -84,6 +88,7 @@ public void setDateCreated(Calendar dateCreated) * [4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitHour]:[2DigitMinute]:[2DigitSecond]Z * format. The date 2011-05-11T16:15:26Z is an example that could be * returned by the DateCreated or DateLastModified elements. + * @return The DateLastModified value. */ public Calendar getDateLastModified() { @@ -95,16 +100,18 @@ public Calendar getDateLastModified() * [4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitHour]:[2DigitMinute]:[2DigitSecond]Z * format. The date 2011-05-11T16:15:26Z is an example that could be * returned by the DateCreated or DateLastModified elements. + * @param dateLastModifiedValue The DateLastModified value. */ - public void setDateLastModified(Calendar dateLastModified) + public void setDateLastModified(final Calendar dateLastModifiedValue) { - this.dateLastModified = dateLastModified; + this.dateLastModified = dateLastModifiedValue; } private String description; /** * The description for the cloud service. + * @return The Description value. */ public String getDescription() { @@ -113,10 +120,11 @@ public String getDescription() /** * The description for the cloud service. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private HashMap extendedProperties; @@ -132,6 +140,7 @@ public void setDescription(String description) * extended property owned by the same service, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -149,10 +158,11 @@ public HashMap getExtendedProperties() * extended property owned by the same service, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private String label; @@ -160,6 +170,7 @@ public void setExtendedProperties(HashMap extendedProperties) /** * The user-supplied name of the cloud service. This name can be used * identify the service for your tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -169,10 +180,11 @@ public String getLabel() /** * The user-supplied name of the cloud service. This name can be used * identify the service for your tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String location; @@ -181,6 +193,7 @@ public void setLabel(String label) * The geo-location of the cloud service in Windows Azure, if the service is * not associated with an affinity group. If a location has been specified, * the AffinityGroup element is not returned. + * @return The Location value. */ public String getLocation() { @@ -191,16 +204,18 @@ public String getLocation() * The geo-location of the cloud service in Windows Azure, if the service is * not associated with an affinity group. If a location has been specified, * the AffinityGroup element is not returned. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private HostedServiceStatus status; /** * The status of the cloud service. + * @return The Status value. */ public HostedServiceStatus getStatus() { @@ -209,10 +224,11 @@ public HostedServiceStatus getStatus() /** * The status of the cloud service. + * @param statusValue The Status value. */ - public void setStatus(HostedServiceStatus status) + public void setStatus(final HostedServiceStatus statusValue) { - this.status = status; + this.status = statusValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceUpdateParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceUpdateParameters.java index 6ba6e898d8fde..2e19342e23868 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceUpdateParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/HostedServiceUpdateParameters.java @@ -36,6 +36,7 @@ public class HostedServiceUpdateParameters * Optional. A description for the cloud service. The description may be up * to 1024 characters in length. You must specify a value for either Label * or Description, or for both. + * @return The Description value. */ public String getDescription() { @@ -46,10 +47,11 @@ public String getDescription() * Optional. A description for the cloud service. The description may be up * to 1024 characters in length. You must specify a value for either Label * or Description, or for both. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private HashMap extendedProperties; @@ -65,6 +67,7 @@ public void setDescription(String description) * extended property owned by the same service, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -82,10 +85,11 @@ public HashMap getExtendedProperties() * extended property owned by the same service, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private String label; @@ -96,6 +100,7 @@ public void setExtendedProperties(HashMap extendedProperties) * Description, or for both. It is recommended that the label be unique * within the subscription. The name can be used identify the service for * your tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -108,10 +113,11 @@ public String getLabel() * Description, or for both. It is recommended that the label be unique * within the subscription. The name can be used identify the service for * your tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/InputEndpoint.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/InputEndpoint.java index 7e21d71d5ada6..a947c597e5668 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/InputEndpoint.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/InputEndpoint.java @@ -34,24 +34,27 @@ public class InputEndpoint /** * Specifies whether direct server return is enabled for the endpoint. + * @return The EnableDirectServerReturn value. */ - public Boolean getEnableDirectServerReturn() + public Boolean isEnableDirectServerReturn() { return this.enableDirectServerReturn; } /** * Specifies whether direct server return is enabled for the endpoint. + * @param enableDirectServerReturnValue The EnableDirectServerReturn value. */ - public void setEnableDirectServerReturn(Boolean enableDirectServerReturn) + public void setEnableDirectServerReturn(final Boolean enableDirectServerReturnValue) { - this.enableDirectServerReturn = enableDirectServerReturn; + this.enableDirectServerReturn = enableDirectServerReturnValue; } private EndpointAcl endpointAcl; /** * Specifies the list of access control rules for the endpoint. + * @return The EndpointAcl value. */ public EndpointAcl getEndpointAcl() { @@ -60,10 +63,11 @@ public EndpointAcl getEndpointAcl() /** * Specifies the list of access control rules for the endpoint. + * @param endpointAclValue The EndpointAcl value. */ - public void setEndpointAcl(EndpointAcl endpointAcl) + public void setEndpointAcl(final EndpointAcl endpointAclValue) { - this.endpointAcl = endpointAcl; + this.endpointAcl = endpointAclValue; } private String loadBalancedEndpointSetName; @@ -72,6 +76,7 @@ public void setEndpointAcl(EndpointAcl endpointAcl) * Specifies a name for a set of load-balanced endpoints. Specifying this * name in multiple endpoints adds them all to the set. This element is * only listed for Virtual Machine deployments. + * @return The LoadBalancedEndpointSetName value. */ public String getLoadBalancedEndpointSetName() { @@ -82,10 +87,12 @@ public String getLoadBalancedEndpointSetName() * Specifies a name for a set of load-balanced endpoints. Specifying this * name in multiple endpoints adds them all to the set. This element is * only listed for Virtual Machine deployments. + * @param loadBalancedEndpointSetNameValue The LoadBalancedEndpointSetName + * value. */ - public void setLoadBalancedEndpointSetName(String loadBalancedEndpointSetName) + public void setLoadBalancedEndpointSetName(final String loadBalancedEndpointSetNameValue) { - this.loadBalancedEndpointSetName = loadBalancedEndpointSetName; + this.loadBalancedEndpointSetName = loadBalancedEndpointSetNameValue; } private LoadBalancerProbe loadBalancerProbe; @@ -94,6 +101,7 @@ public void setLoadBalancedEndpointSetName(String loadBalancedEndpointSetName) * Contains properties that specify the endpoint settings which the Windows * Azure load balancer uses to monitor the availability of this virtual * machine before forwarding traffic to the endpoint. + * @return The LoadBalancerProbe value. */ public LoadBalancerProbe getLoadBalancerProbe() { @@ -104,10 +112,11 @@ public LoadBalancerProbe getLoadBalancerProbe() * Contains properties that specify the endpoint settings which the Windows * Azure load balancer uses to monitor the availability of this virtual * machine before forwarding traffic to the endpoint. + * @param loadBalancerProbeValue The LoadBalancerProbe value. */ - public void setLoadBalancerProbe(LoadBalancerProbe loadBalancerProbe) + public void setLoadBalancerProbe(final LoadBalancerProbe loadBalancerProbeValue) { - this.loadBalancerProbe = loadBalancerProbe; + this.loadBalancerProbe = loadBalancerProbeValue; } private Integer localPort; @@ -116,6 +125,7 @@ public void setLoadBalancerProbe(LoadBalancerProbe loadBalancerProbe) * Specifies the internal port on which the virtual machine is listening to * serve the endpoint. This element is only listed for Virtual Machine * deployments. + * @return The LocalPort value. */ public Integer getLocalPort() { @@ -126,10 +136,11 @@ public Integer getLocalPort() * Specifies the internal port on which the virtual machine is listening to * serve the endpoint. This element is only listed for Virtual Machine * deployments. + * @param localPortValue The LocalPort value. */ - public void setLocalPort(Integer localPort) + public void setLocalPort(final Integer localPortValue) { - this.localPort = localPort; + this.localPort = localPortValue; } private String name; @@ -137,6 +148,7 @@ public void setLocalPort(Integer localPort) /** * Specifies the name for the external endpoint. This element is only listed * for Virtual Machine deployments. + * @return The Name value. */ public String getName() { @@ -146,16 +158,18 @@ public String getName() /** * Specifies the name for the external endpoint. This element is only listed * for Virtual Machine deployments. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private Integer port; /** * The size of the role instance. + * @return The Port value. */ public Integer getPort() { @@ -164,16 +178,18 @@ public Integer getPort() /** * The size of the role instance. + * @param portValue The Port value. */ - public void setPort(Integer port) + public void setPort(final Integer portValue) { - this.port = port; + this.port = portValue; } private String protocol; /** * Specifies the transport protocol for the endpoint. + * @return The Protocol value. */ public String getProtocol() { @@ -182,16 +198,18 @@ public String getProtocol() /** * Specifies the transport protocol for the endpoint. + * @param protocolValue The Protocol value. */ - public void setProtocol(String protocol) + public void setProtocol(final String protocolValue) { - this.protocol = protocol; + this.protocol = protocolValue; } private InetAddress virtualIPAddress; /** * The ip of the role instance. + * @return The VirtualIPAddress value. */ public InetAddress getVirtualIPAddress() { @@ -200,9 +218,10 @@ public InetAddress getVirtualIPAddress() /** * The ip of the role instance. + * @param virtualIPAddressValue The VirtualIPAddress value. */ - public void setVirtualIPAddress(InetAddress virtualIPAddress) + public void setVirtualIPAddress(final InetAddress virtualIPAddressValue) { - this.virtualIPAddress = virtualIPAddress; + this.virtualIPAddress = virtualIPAddressValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/InstanceEndpoint.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/InstanceEndpoint.java index 0abcecccc92fd..2f3ee1acbc35c 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/InstanceEndpoint.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/InstanceEndpoint.java @@ -36,6 +36,7 @@ public class InstanceEndpoint * Specifies the internal port on which the virtual machine is listening to * serve the endpoint. This element is only listed for Virtual Machine * deployments. + * @return The LocalPort value. */ public Integer getLocalPort() { @@ -46,10 +47,11 @@ public Integer getLocalPort() * Specifies the internal port on which the virtual machine is listening to * serve the endpoint. This element is only listed for Virtual Machine * deployments. + * @param localPortValue The LocalPort value. */ - public void setLocalPort(Integer localPort) + public void setLocalPort(final Integer localPortValue) { - this.localPort = localPort; + this.localPort = localPortValue; } private String name; @@ -57,6 +59,7 @@ public void setLocalPort(Integer localPort) /** * Specifies the name for the external endpoint. This element is only listed * for Virtual Machine deployments. + * @return The Name value. */ public String getName() { @@ -66,16 +69,18 @@ public String getName() /** * Specifies the name for the external endpoint. This element is only listed * for Virtual Machine deployments. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private int port; /** * The external port of the role instance endpoint. + * @return The Port value. */ public int getPort() { @@ -84,16 +89,18 @@ public int getPort() /** * The external port of the role instance endpoint. + * @param portValue The Port value. */ - public void setPort(int port) + public void setPort(final int portValue) { - this.port = port; + this.port = portValue; } private String protocol; /** * Specifies the transport protocol for the endpoint. + * @return The Protocol value. */ public String getProtocol() { @@ -102,16 +109,18 @@ public String getProtocol() /** * Specifies the transport protocol for the endpoint. + * @param protocolValue The Protocol value. */ - public void setProtocol(String protocol) + public void setProtocol(final String protocolValue) { - this.protocol = protocol; + this.protocol = protocolValue; } private InetAddress virtualIPAddress; /** * The Virtual IP of the role endpoint. + * @return The VirtualIPAddress value. */ public InetAddress getVirtualIPAddress() { @@ -120,9 +129,10 @@ public InetAddress getVirtualIPAddress() /** * The Virtual IP of the role endpoint. + * @param virtualIPAddressValue The VirtualIPAddress value. */ - public void setVirtualIPAddress(InetAddress virtualIPAddress) + public void setVirtualIPAddress(final InetAddress virtualIPAddressValue) { - this.virtualIPAddress = virtualIPAddress; + this.virtualIPAddress = virtualIPAddressValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/LoadBalancerProbe.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/LoadBalancerProbe.java index d5be6c941f8c5..1857c7342a7c8 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/LoadBalancerProbe.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/LoadBalancerProbe.java @@ -35,6 +35,7 @@ public class LoadBalancerProbe /** * Specifies the interval for the load balancer probe in seconds. The * minimum value is 5 seconds. If not specified, the default is 15 seconds. + * @return The IntervalInSeconds value. */ public Integer getIntervalInSeconds() { @@ -44,10 +45,11 @@ public Integer getIntervalInSeconds() /** * Specifies the interval for the load balancer probe in seconds. The * minimum value is 5 seconds. If not specified, the default is 15 seconds. + * @param intervalInSecondsValue The IntervalInSeconds value. */ - public void setIntervalInSeconds(Integer intervalInSeconds) + public void setIntervalInSeconds(final Integer intervalInSecondsValue) { - this.intervalInSeconds = intervalInSeconds; + this.intervalInSeconds = intervalInSecondsValue; } private String path; @@ -56,6 +58,7 @@ public void setIntervalInSeconds(Integer intervalInSeconds) * Specifies the relative path name to inspect to determine the virtual * machine availability status. If Protocol is set to TCP, this value must * be NULL. + * @return The Path value. */ public String getPath() { @@ -66,10 +69,11 @@ public String getPath() * Specifies the relative path name to inspect to determine the virtual * machine availability status. If Protocol is set to TCP, this value must * be NULL. + * @param pathValue The Path value. */ - public void setPath(String path) + public void setPath(final String pathValue) { - this.path = path; + this.path = pathValue; } private int port; @@ -77,6 +81,7 @@ public void setPath(String path) /** * Specifies the port to use to inspect the virtual machine availability * status. + * @return The Port value. */ public int getPort() { @@ -86,10 +91,11 @@ public int getPort() /** * Specifies the port to use to inspect the virtual machine availability * status. + * @param portValue The Port value. */ - public void setPort(int port) + public void setPort(final int portValue) { - this.port = port; + this.port = portValue; } private LoadBalancerProbeTransportProtocol protocol; @@ -97,6 +103,7 @@ public void setPort(int port) /** * Specifies the protocol to use to inspect the virtual machine availability * status. + * @return The Protocol value. */ public LoadBalancerProbeTransportProtocol getProtocol() { @@ -106,10 +113,11 @@ public LoadBalancerProbeTransportProtocol getProtocol() /** * Specifies the protocol to use to inspect the virtual machine availability * status. + * @param protocolValue The Protocol value. */ - public void setProtocol(LoadBalancerProbeTransportProtocol protocol) + public void setProtocol(final LoadBalancerProbeTransportProtocol protocolValue) { - this.protocol = protocol; + this.protocol = protocolValue; } private Integer timeoutInSeconds; @@ -117,6 +125,7 @@ public void setProtocol(LoadBalancerProbeTransportProtocol protocol) /** * Specifies the timeout for the load balancer probe in seconds. The minimum * value is 11 seconds. If not specified, the default is 31 seconds. + * @return The TimeoutInSeconds value. */ public Integer getTimeoutInSeconds() { @@ -126,9 +135,10 @@ public Integer getTimeoutInSeconds() /** * Specifies the timeout for the load balancer probe in seconds. The minimum * value is 11 seconds. If not specified, the default is 31 seconds. + * @param timeoutInSecondsValue The TimeoutInSeconds value. */ - public void setTimeoutInSeconds(Integer timeoutInSeconds) + public void setTimeoutInSeconds(final Integer timeoutInSecondsValue) { - this.timeoutInSeconds = timeoutInSeconds; + this.timeoutInSeconds = timeoutInSecondsValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OSVirtualHardDisk.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OSVirtualHardDisk.java index b2a6742e1066b..f0830f96620f4 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OSVirtualHardDisk.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OSVirtualHardDisk.java @@ -36,6 +36,7 @@ public class OSVirtualHardDisk /** * Specifies the friendly name an operating system image in the image * repository. + * @return The DiskLabel value. */ public String getDiskLabel() { @@ -45,16 +46,18 @@ public String getDiskLabel() /** * Specifies the friendly name an operating system image in the image * repository. + * @param diskLabelValue The DiskLabel value. */ - public void setDiskLabel(String diskLabel) + public void setDiskLabel(final String diskLabelValue) { - this.diskLabel = diskLabel; + this.diskLabel = diskLabelValue; } private String diskName; /** * Specifies the name an operating system image in the image repository. + * @return The DiskName value. */ public String getDiskName() { @@ -63,10 +66,11 @@ public String getDiskName() /** * Specifies the name an operating system image in the image repository. + * @param diskNameValue The DiskName value. */ - public void setDiskName(String diskName) + public void setDiskName(final String diskNameValue) { - this.diskName = diskName; + this.diskName = diskNameValue; } private VirtualHardDiskHostCaching hostCaching; @@ -74,6 +78,7 @@ public void setDiskName(String diskName) /** * Specifies the platform caching behavior of the operating system disk blob * for read/write efficiency. + * @return The HostCaching value. */ public VirtualHardDiskHostCaching getHostCaching() { @@ -83,10 +88,11 @@ public VirtualHardDiskHostCaching getHostCaching() /** * Specifies the platform caching behavior of the operating system disk blob * for read/write efficiency. + * @param hostCachingValue The HostCaching value. */ - public void setHostCaching(VirtualHardDiskHostCaching hostCaching) + public void setHostCaching(final VirtualHardDiskHostCaching hostCachingValue) { - this.hostCaching = hostCaching; + this.hostCaching = hostCachingValue; } private URI mediaLink; @@ -94,6 +100,7 @@ public void setHostCaching(VirtualHardDiskHostCaching hostCaching) /** * Specifies the location of the operating system disk in Windows Azure * storage. + * @return The MediaLink value. */ public URI getMediaLink() { @@ -103,16 +110,18 @@ public URI getMediaLink() /** * Specifies the location of the operating system disk in Windows Azure * storage. + * @param mediaLinkValue The MediaLink value. */ - public void setMediaLink(URI mediaLink) + public void setMediaLink(final URI mediaLinkValue) { - this.mediaLink = mediaLink; + this.mediaLink = mediaLinkValue; } private String operatingSystem; /** * The operating system running in the virtual machine. + * @return The OperatingSystem value. */ public String getOperatingSystem() { @@ -121,10 +130,11 @@ public String getOperatingSystem() /** * The operating system running in the virtual machine. + * @param operatingSystemValue The OperatingSystem value. */ - public void setOperatingSystem(String operatingSystem) + public void setOperatingSystem(final String operatingSystemValue) { - this.operatingSystem = operatingSystem; + this.operatingSystem = operatingSystemValue; } private String sourceImageName; @@ -132,6 +142,7 @@ public void setOperatingSystem(String operatingSystem) /** * Specifies the name of the source image that was used to provision the * virtual machine. + * @return The SourceImageName value. */ public String getSourceImageName() { @@ -141,9 +152,10 @@ public String getSourceImageName() /** * Specifies the name of the source image that was used to provision the * virtual machine. + * @param sourceImageNameValue The SourceImageName value. */ - public void setSourceImageName(String sourceImageName) + public void setSourceImageName(final String sourceImageNameValue) { - this.sourceImageName = sourceImageName; + this.sourceImageName = sourceImageNameValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OperatingSystemListFamiliesResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OperatingSystemListFamiliesResponse.java index 43ca7b0f8073c..c7fa174179984 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OperatingSystemListFamiliesResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OperatingSystemListFamiliesResponse.java @@ -36,6 +36,7 @@ public class OperatingSystemListFamiliesResponse extends OperationResponse imple /** * The operating system families that are valid for your subscription. + * @return The OperatingSystemFamilies value. */ public ArrayList getOperatingSystemFamilies() { @@ -44,10 +45,11 @@ public ArrayList getO /** * The operating system families that are valid for your subscription. + * @param operatingSystemFamiliesValue The OperatingSystemFamilies value. */ - public void setOperatingSystemFamilies(ArrayList operatingSystemFamilies) + public void setOperatingSystemFamilies(final ArrayList operatingSystemFamiliesValue) { - this.operatingSystemFamilies = operatingSystemFamilies; + this.operatingSystemFamilies = operatingSystemFamiliesValue; } /** @@ -91,8 +93,9 @@ public static class OperatingSystem * service. In this case you will either need to manually configure * your service to run on a newer version, or configure your service to * use auto-upgrade to manage operating system upgrades. + * @return The IsActive value. */ - public boolean getIsActive() + public boolean isActive() { return this.isActive; } @@ -111,10 +114,11 @@ public boolean getIsActive() * service. In this case you will either need to manually configure * your service to run on a newer version, or configure your service to * use auto-upgrade to manage operating system upgrades. + * @param isActiveValue The IsActive value. */ - public void setIsActive(boolean isActive) + public void setIsActive(final boolean isActiveValue) { - this.isActive = isActive; + this.isActive = isActiveValue; } private boolean isDefault; @@ -127,8 +131,9 @@ public void setIsActive(boolean isActive) * exactly one default operating system version at any given time, for * which the IsDefault element is set to true; for all other versions, * IsDefault is set to false. + * @return The IsDefault value. */ - public boolean getIsDefault() + public boolean isDefault() { return this.isDefault; } @@ -141,16 +146,18 @@ public boolean getIsDefault() * exactly one default operating system version at any given time, for * which the IsDefault element is set to true; for all other versions, * IsDefault is set to false. + * @param isDefaultValue The IsDefault value. */ - public void setIsDefault(boolean isDefault) + public void setIsDefault(final boolean isDefaultValue) { - this.isDefault = isDefault; + this.isDefault = isDefaultValue; } private String label; /** * The label of the operating system version. + * @return The Label value. */ public String getLabel() { @@ -159,10 +166,11 @@ public String getLabel() /** * The label of the operating system version. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String version; @@ -173,6 +181,7 @@ public void setLabel(String label) * particular version of the Windows Azure guest operating system. See * Configuring Settings for the Windows Azure Guest OS for additional * details. + * @return The Version value. */ public String getVersion() { @@ -185,10 +194,11 @@ public String getVersion() * particular version of the Windows Azure guest operating system. See * Configuring Settings for the Windows Azure Guest OS for additional * details. + * @param versionValue The Version value. */ - public void setVersion(String version) + public void setVersion(final String versionValue) { - this.version = version; + this.version = versionValue; } } @@ -201,6 +211,7 @@ public static class OperatingSystemFamily /** * The label of the operating system family. + * @return The Label value. */ public String getLabel() { @@ -209,10 +220,11 @@ public String getLabel() /** * The label of the operating system family. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private int name; @@ -223,6 +235,7 @@ public void setLabel(String label) * that is substantially compatible with Windows Server 2008 SP2. A * value of 2 corresponds to the Windows Azure guest operating system * that is substantially compatible with Windows Server 2008 R2. + * @return The Name value. */ public int getName() { @@ -235,10 +248,11 @@ public int getName() * that is substantially compatible with Windows Server 2008 SP2. A * value of 2 corresponds to the Windows Azure guest operating system * that is substantially compatible with Windows Server 2008 R2. + * @param nameValue The Name value. */ - public void setName(int name) + public void setName(final int nameValue) { - this.name = name; + this.name = nameValue; } private ArrayList operatingSystems; @@ -246,6 +260,7 @@ public void setName(int name) /** * The available operating systems in your subscription belonging to * this family. + * @return The OperatingSystems value. */ public ArrayList getOperatingSystems() { @@ -255,10 +270,11 @@ public ArrayList getOperati /** * The available operating systems in your subscription belonging to * this family. + * @param operatingSystemsValue The OperatingSystems value. */ - public void setOperatingSystems(ArrayList operatingSystems) + public void setOperatingSystems(final ArrayList operatingSystemsValue) { - this.operatingSystems = operatingSystems; + this.operatingSystems = operatingSystemsValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OperatingSystemListResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OperatingSystemListResponse.java index 2726437de0014..4f50d32656506 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OperatingSystemListResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/OperatingSystemListResponse.java @@ -36,6 +36,7 @@ public class OperatingSystemListResponse extends OperationResponse implements It /** * The operating systems that are valid for your subscription. + * @return The OperatingSystems value. */ public ArrayList getOperatingSystems() { @@ -44,10 +45,11 @@ public ArrayList getOperatingSystem /** * The operating systems that are valid for your subscription. + * @param operatingSystemsValue The OperatingSystems value. */ - public void setOperatingSystems(ArrayList operatingSystems) + public void setOperatingSystems(final ArrayList operatingSystemsValue) { - this.operatingSystems = operatingSystems; + this.operatingSystems = operatingSystemsValue; } /** @@ -82,6 +84,7 @@ public static class OperatingSystem * that is substantially compatible with Windows Server 2008 SP2. A * value of 2 corresponds to the Windows Azure guest operating system * that is substantially compatible with Windows Server 2008 R2. + * @return The Family value. */ public int getFamily() { @@ -94,16 +97,18 @@ public int getFamily() * that is substantially compatible with Windows Server 2008 SP2. A * value of 2 corresponds to the Windows Azure guest operating system * that is substantially compatible with Windows Server 2008 R2. + * @param familyValue The Family value. */ - public void setFamily(int family) + public void setFamily(final int familyValue) { - this.family = family; + this.family = familyValue; } private String familyLabel; /** * The label of the operating system family. + * @return The FamilyLabel value. */ public String getFamilyLabel() { @@ -112,10 +117,11 @@ public String getFamilyLabel() /** * The label of the operating system family. + * @param familyLabelValue The FamilyLabel value. */ - public void setFamilyLabel(String familyLabel) + public void setFamilyLabel(final String familyLabelValue) { - this.familyLabel = familyLabel; + this.familyLabel = familyLabelValue; } private boolean isActive; @@ -134,8 +140,9 @@ public void setFamilyLabel(String familyLabel) * service. In this case you will either need to manually configure * your service to run on a newer version, or configure your service to * use auto-upgrade to manage operating system upgrades. + * @return The IsActive value. */ - public boolean getIsActive() + public boolean isActive() { return this.isActive; } @@ -154,10 +161,11 @@ public boolean getIsActive() * service. In this case you will either need to manually configure * your service to run on a newer version, or configure your service to * use auto-upgrade to manage operating system upgrades. + * @param isActiveValue The IsActive value. */ - public void setIsActive(boolean isActive) + public void setIsActive(final boolean isActiveValue) { - this.isActive = isActive; + this.isActive = isActiveValue; } private boolean isDefault; @@ -170,8 +178,9 @@ public void setIsActive(boolean isActive) * exactly one default operating system version at any given time, for * which the IsDefault element is set to true; for all other versions, * IsDefault is set to false. + * @return The IsDefault value. */ - public boolean getIsDefault() + public boolean isDefault() { return this.isDefault; } @@ -184,16 +193,18 @@ public boolean getIsDefault() * exactly one default operating system version at any given time, for * which the IsDefault element is set to true; for all other versions, * IsDefault is set to false. + * @param isDefaultValue The IsDefault value. */ - public void setIsDefault(boolean isDefault) + public void setIsDefault(final boolean isDefaultValue) { - this.isDefault = isDefault; + this.isDefault = isDefaultValue; } private String label; /** * The label of the operating system version. + * @return The Label value. */ public String getLabel() { @@ -202,10 +213,11 @@ public String getLabel() /** * The label of the operating system version. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String version; @@ -216,6 +228,7 @@ public void setLabel(String label) * particular version of the Windows Azure guest operating system. See * Configuring Settings for the Windows Azure Guest OS for additional * details. + * @return The Version value. */ public String getVersion() { @@ -228,10 +241,11 @@ public String getVersion() * particular version of the Windows Azure guest operating system. See * Configuring Settings for the Windows Azure Guest OS for additional * details. + * @param versionValue The Version value. */ - public void setVersion(String version) + public void setVersion(final String versionValue) { - this.version = version; + this.version = versionValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/PersistentVMDowntime.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/PersistentVMDowntime.java index fab0ea3c8b008..fd800cf23315f 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/PersistentVMDowntime.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/PersistentVMDowntime.java @@ -35,6 +35,7 @@ public class PersistentVMDowntime /** * The time that the virtual machine was stopped. + * @return The EndTime value. */ public Calendar getEndTime() { @@ -43,16 +44,18 @@ public Calendar getEndTime() /** * The time that the virtual machine was stopped. + * @param endTimeValue The EndTime value. */ - public void setEndTime(Calendar endTime) + public void setEndTime(final Calendar endTimeValue) { - this.endTime = endTime; + this.endTime = endTimeValue; } private Calendar startTime; /** * The time that the virtual machine was started. + * @return The StartTime value. */ public Calendar getStartTime() { @@ -61,16 +64,18 @@ public Calendar getStartTime() /** * The time that the virtual machine was started. + * @param startTimeValue The StartTime value. */ - public void setStartTime(Calendar startTime) + public void setStartTime(final Calendar startTimeValue) { - this.startTime = startTime; + this.startTime = startTimeValue; } private String status; /** * The status of the virtual machine. + * @return The Status value. */ public String getStatus() { @@ -79,9 +84,10 @@ public String getStatus() /** * The status of the virtual machine. + * @param statusValue The Status value. */ - public void setStatus(String status) + public void setStatus(final String statusValue) { - this.status = status; + this.status = statusValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/Role.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/Role.java index 0738551de0b13..b4fe02580ab3a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/Role.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/Role.java @@ -34,6 +34,7 @@ public class Role /** * The name of the role. + * @return The AvailabilitySetName value. */ public String getAvailabilitySetName() { @@ -42,10 +43,11 @@ public String getAvailabilitySetName() /** * The name of the role. + * @param availabilitySetNameValue The AvailabilitySetName value. */ - public void setAvailabilitySetName(String availabilitySetName) + public void setAvailabilitySetName(final String availabilitySetNameValue) { - this.availabilitySetName = availabilitySetName; + this.availabilitySetName = availabilitySetNameValue; } private ArrayList configurationSets; @@ -53,6 +55,7 @@ public void setAvailabilitySetName(String availabilitySetName) /** * A collection of values that represents system or application * configuration settings. + * @return The ConfigurationSets value. */ public ArrayList getConfigurationSets() { @@ -62,10 +65,11 @@ public ArrayList getConfigurationSets() /** * A collection of values that represents system or application * configuration settings. + * @param configurationSetsValue The ConfigurationSets value. */ - public void setConfigurationSets(ArrayList configurationSets) + public void setConfigurationSets(final ArrayList configurationSetsValue) { - this.configurationSets = configurationSets; + this.configurationSets = configurationSetsValue; } private ArrayList dataVirtualHardDisks; @@ -73,6 +77,7 @@ public void setConfigurationSets(ArrayList configurationSets) /** * Contains the parameters Windows Azure uses to create a data disk for a * virtual machine. + * @return The DataVirtualHardDisks value. */ public ArrayList getDataVirtualHardDisks() { @@ -82,10 +87,11 @@ public ArrayList getDataVirtualHardDisks() /** * Contains the parameters Windows Azure uses to create a data disk for a * virtual machine. + * @param dataVirtualHardDisksValue The DataVirtualHardDisks value. */ - public void setDataVirtualHardDisks(ArrayList dataVirtualHardDisks) + public void setDataVirtualHardDisks(final ArrayList dataVirtualHardDisksValue) { - this.dataVirtualHardDisks = dataVirtualHardDisks; + this.dataVirtualHardDisks = dataVirtualHardDisksValue; } private String defaultWinRmCertificateThumbprint; @@ -93,6 +99,7 @@ public void setDataVirtualHardDisks(ArrayList dataVirtualHa /** * The read-only thumbprint of the certificate that is used with the HTTPS * listener for WinRM. + * @return The DefaultWinRmCertificateThumbprint value. */ public String getDefaultWinRmCertificateThumbprint() { @@ -102,16 +109,19 @@ public String getDefaultWinRmCertificateThumbprint() /** * The read-only thumbprint of the certificate that is used with the HTTPS * listener for WinRM. + * @param defaultWinRmCertificateThumbprintValue The + * DefaultWinRmCertificateThumbprint value. */ - public void setDefaultWinRmCertificateThumbprint(String defaultWinRmCertificateThumbprint) + public void setDefaultWinRmCertificateThumbprint(final String defaultWinRmCertificateThumbprintValue) { - this.defaultWinRmCertificateThumbprint = defaultWinRmCertificateThumbprint; + this.defaultWinRmCertificateThumbprint = defaultWinRmCertificateThumbprintValue; } private String label; /** * The friendly name for the role. + * @return The Label value. */ public String getLabel() { @@ -120,10 +130,11 @@ public String getLabel() /** * The friendly name for the role. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String oSVersion; @@ -131,6 +142,7 @@ public void setLabel(String label) /** * The version of the operating system on which the role instances are * running. + * @return The OSVersion value. */ public String getOSVersion() { @@ -140,10 +152,11 @@ public String getOSVersion() /** * The version of the operating system on which the role instances are * running. + * @param oSVersionValue The OSVersion value. */ - public void setOSVersion(String oSVersion) + public void setOSVersion(final String oSVersionValue) { - this.oSVersion = oSVersion; + this.oSVersion = oSVersionValue; } private OSVirtualHardDisk oSVirtualHardDisk; @@ -151,6 +164,7 @@ public void setOSVersion(String oSVersion) /** * Contains the parameters Windows Azure uses to create the operating system * disk for the virtual machine. + * @return The OSVirtualHardDisk value. */ public OSVirtualHardDisk getOSVirtualHardDisk() { @@ -160,16 +174,18 @@ public OSVirtualHardDisk getOSVirtualHardDisk() /** * Contains the parameters Windows Azure uses to create the operating system * disk for the virtual machine. + * @param oSVirtualHardDiskValue The OSVirtualHardDisk value. */ - public void setOSVirtualHardDisk(OSVirtualHardDisk oSVirtualHardDisk) + public void setOSVirtualHardDisk(final OSVirtualHardDisk oSVirtualHardDiskValue) { - this.oSVirtualHardDisk = oSVirtualHardDisk; + this.oSVirtualHardDisk = oSVirtualHardDiskValue; } private String roleName; /** * The name of the role. + * @return The RoleName value. */ public String getRoleName() { @@ -178,28 +194,31 @@ public String getRoleName() /** * The name of the role. + * @param roleNameValue The RoleName value. */ - public void setRoleName(String roleName) + public void setRoleName(final String roleNameValue) { - this.roleName = roleName; + this.roleName = roleNameValue; } - private VirtualMachineRoleSize roleSize; + private String roleSize; /** * The size of the role instance. + * @return The RoleSize value. */ - public VirtualMachineRoleSize getRoleSize() + public String getRoleSize() { return this.roleSize; } /** * The size of the role instance. + * @param roleSizeValue The RoleSize value. */ - public void setRoleSize(VirtualMachineRoleSize roleSize) + public void setRoleSize(final String roleSizeValue) { - this.roleSize = roleSize; + this.roleSize = roleSizeValue; } private String roleType; @@ -207,6 +226,7 @@ public void setRoleSize(VirtualMachineRoleSize roleSize) /** * Specifies the type of the role. This element is only listed for Virtual * Machine deployments and by default is PersistentVMRole. + * @return The RoleType value. */ public String getRoleType() { @@ -216,10 +236,11 @@ public String getRoleType() /** * Specifies the type of the role. This element is only listed for Virtual * Machine deployments and by default is PersistentVMRole. + * @param roleTypeValue The RoleType value. */ - public void setRoleType(String roleType) + public void setRoleType(final String roleTypeValue) { - this.roleType = roleType; + this.roleType = roleTypeValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/RoleInstance.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/RoleInstance.java index 65ba525aefb86..f9c295fd650f5 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/RoleInstance.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/RoleInstance.java @@ -36,6 +36,7 @@ public class RoleInstance /** * The DNS host name of the service in which the role instance is running. * This element is only listed for Virtual Machine deployments. + * @return The HostName value. */ public String getHostName() { @@ -45,16 +46,18 @@ public String getHostName() /** * The DNS host name of the service in which the role instance is running. * This element is only listed for Virtual Machine deployments. + * @param hostNameValue The HostName value. */ - public void setHostName(String hostName) + public void setHostName(final String hostNameValue) { - this.hostName = hostName; + this.hostName = hostNameValue; } private ArrayList instanceEndpoints; /** * The list of instance endpoints for the role. + * @return The InstanceEndpoints value. */ public ArrayList getInstanceEndpoints() { @@ -63,10 +66,11 @@ public ArrayList getInstanceEndpoints() /** * The list of instance endpoints for the role. + * @param instanceEndpointsValue The InstanceEndpoints value. */ - public void setInstanceEndpoints(ArrayList instanceEndpoints) + public void setInstanceEndpoints(final ArrayList instanceEndpointsValue) { - this.instanceEndpoints = instanceEndpoints; + this.instanceEndpoints = instanceEndpointsValue; } private String instanceErrorCode; @@ -74,6 +78,7 @@ public void setInstanceEndpoints(ArrayList instanceEndpoints) /** * An error code that can be provided to WindowsAzure support to assist in * resolution of errors. Typicallythis field will be empty. + * @return The InstanceErrorCode value. */ public String getInstanceErrorCode() { @@ -83,10 +88,11 @@ public String getInstanceErrorCode() /** * An error code that can be provided to WindowsAzure support to assist in * resolution of errors. Typicallythis field will be empty. + * @param instanceErrorCodeValue The InstanceErrorCode value. */ - public void setInstanceErrorCode(String instanceErrorCode) + public void setInstanceErrorCode(final String instanceErrorCodeValue) { - this.instanceErrorCode = instanceErrorCode; + this.instanceErrorCode = instanceErrorCodeValue; } private Integer instanceFaultDomain; @@ -95,6 +101,7 @@ public void setInstanceErrorCode(String instanceErrorCode) * The fault domain that this role instance belongs to. Role instances that * are part of the same fault domain may all be vulnerable to the failure * of the same piece of shared hardware. + * @return The InstanceFaultDomain value. */ public Integer getInstanceFaultDomain() { @@ -105,10 +112,11 @@ public Integer getInstanceFaultDomain() * The fault domain that this role instance belongs to. Role instances that * are part of the same fault domain may all be vulnerable to the failure * of the same piece of shared hardware. + * @param instanceFaultDomainValue The InstanceFaultDomain value. */ - public void setInstanceFaultDomain(Integer instanceFaultDomain) + public void setInstanceFaultDomain(final Integer instanceFaultDomainValue) { - this.instanceFaultDomain = instanceFaultDomain; + this.instanceFaultDomain = instanceFaultDomainValue; } private String instanceName; @@ -116,6 +124,7 @@ public void setInstanceFaultDomain(Integer instanceFaultDomain) /** * TThe name of the specific role instance, if an instance of the role is * running. + * @return The InstanceName value. */ public String getInstanceName() { @@ -125,28 +134,31 @@ public String getInstanceName() /** * TThe name of the specific role instance, if an instance of the role is * running. + * @param instanceNameValue The InstanceName value. */ - public void setInstanceName(String instanceName) + public void setInstanceName(final String instanceNameValue) { - this.instanceName = instanceName; + this.instanceName = instanceNameValue; } - private VirtualMachineRoleSize instanceSize; + private String instanceSize; /** * The size of the role instance. + * @return The InstanceSize value. */ - public VirtualMachineRoleSize getInstanceSize() + public String getInstanceSize() { return this.instanceSize; } /** * The size of the role instance. + * @param instanceSizeValue The InstanceSize value. */ - public void setInstanceSize(VirtualMachineRoleSize instanceSize) + public void setInstanceSize(final String instanceSizeValue) { - this.instanceSize = instanceSize; + this.instanceSize = instanceSizeValue; } private String instanceStateDetails; @@ -155,6 +167,7 @@ public void setInstanceSize(VirtualMachineRoleSize instanceSize) * The instance state is returned as a string that, when present, provides a * snapshot of the state of the virtual machine at the time the operation * was called. + * @return The InstanceStateDetails value. */ public String getInstanceStateDetails() { @@ -165,16 +178,18 @@ public String getInstanceStateDetails() * The instance state is returned as a string that, when present, provides a * snapshot of the state of the virtual machine at the time the operation * was called. + * @param instanceStateDetailsValue The InstanceStateDetails value. */ - public void setInstanceStateDetails(String instanceStateDetails) + public void setInstanceStateDetails(final String instanceStateDetailsValue) { - this.instanceStateDetails = instanceStateDetails; + this.instanceStateDetails = instanceStateDetailsValue; } private String instanceStatus; /** * The current status of this instance. + * @return The InstanceStatus value. */ public String getInstanceStatus() { @@ -183,10 +198,11 @@ public String getInstanceStatus() /** * The current status of this instance. + * @param instanceStatusValue The InstanceStatus value. */ - public void setInstanceStatus(String instanceStatus) + public void setInstanceStatus(final String instanceStatusValue) { - this.instanceStatus = instanceStatus; + this.instanceStatus = instanceStatusValue; } private Integer instanceUpgradeDomain; @@ -195,6 +211,7 @@ public void setInstanceStatus(String instanceStatus) * The update domain that this role instance belongs to. During an Upgrade * Deployment, all roles in the same update domain are updated at the same * time. + * @return The InstanceUpgradeDomain value. */ public Integer getInstanceUpgradeDomain() { @@ -205,16 +222,18 @@ public Integer getInstanceUpgradeDomain() * The update domain that this role instance belongs to. During an Upgrade * Deployment, all roles in the same update domain are updated at the same * time. + * @param instanceUpgradeDomainValue The InstanceUpgradeDomain value. */ - public void setInstanceUpgradeDomain(Integer instanceUpgradeDomain) + public void setInstanceUpgradeDomain(final Integer instanceUpgradeDomainValue) { - this.instanceUpgradeDomain = instanceUpgradeDomain; + this.instanceUpgradeDomain = instanceUpgradeDomainValue; } private InetAddress iPAddress; /** * The IP address of the role instance (DIP). + * @return The IPAddress value. */ public InetAddress getIPAddress() { @@ -223,16 +242,18 @@ public InetAddress getIPAddress() /** * The IP address of the role instance (DIP). + * @param iPAddressValue The IPAddress value. */ - public void setIPAddress(InetAddress iPAddress) + public void setIPAddress(final InetAddress iPAddressValue) { - this.iPAddress = iPAddress; + this.iPAddress = iPAddressValue; } private RoleInstancePowerState powerState; /** * The running state of the role instance. + * @return The PowerState value. */ public RoleInstancePowerState getPowerState() { @@ -241,10 +262,11 @@ public RoleInstancePowerState getPowerState() /** * The running state of the role instance. + * @param powerStateValue The PowerState value. */ - public void setPowerState(RoleInstancePowerState powerState) + public void setPowerState(final RoleInstancePowerState powerStateValue) { - this.powerState = powerState; + this.powerState = powerStateValue; } private String remoteAccessCertificateThumbprint; @@ -253,6 +275,7 @@ public void setPowerState(RoleInstancePowerState powerState) * The thumbprint of the RDP server certificate (in Windows) or SSH server * certificate (in Linux). The thumbprint is only used for Virtual Machines * that have been created from an image. + * @return The RemoteAccessCertificateThumbprint value. */ public String getRemoteAccessCertificateThumbprint() { @@ -263,16 +286,19 @@ public String getRemoteAccessCertificateThumbprint() * The thumbprint of the RDP server certificate (in Windows) or SSH server * certificate (in Linux). The thumbprint is only used for Virtual Machines * that have been created from an image. + * @param remoteAccessCertificateThumbprintValue The + * RemoteAccessCertificateThumbprint value. */ - public void setRemoteAccessCertificateThumbprint(String remoteAccessCertificateThumbprint) + public void setRemoteAccessCertificateThumbprint(final String remoteAccessCertificateThumbprintValue) { - this.remoteAccessCertificateThumbprint = remoteAccessCertificateThumbprint; + this.remoteAccessCertificateThumbprint = remoteAccessCertificateThumbprintValue; } private String roleName; /** * The name of the role. + * @return The RoleName value. */ public String getRoleName() { @@ -281,10 +307,11 @@ public String getRoleName() /** * The name of the role. + * @param roleNameValue The RoleName value. */ - public void setRoleName(String roleName) + public void setRoleName(final String roleNameValue) { - this.roleName = roleName; + this.roleName = roleNameValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateCreateParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateCreateParameters.java index 4682c86e830a6..20e319499d052 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateCreateParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateCreateParameters.java @@ -33,6 +33,7 @@ public class ServiceCertificateCreateParameters /** * The service certificate format. Windows Azure supports the pfx and cer * file formats. + * @return The CertificateFormat value. */ public CertificateFormat getCertificateFormat() { @@ -42,16 +43,18 @@ public CertificateFormat getCertificateFormat() /** * The service certificate format. Windows Azure supports the pfx and cer * file formats. + * @param certificateFormatValue The CertificateFormat value. */ - public void setCertificateFormat(CertificateFormat certificateFormat) + public void setCertificateFormat(final CertificateFormat certificateFormatValue) { - this.certificateFormat = certificateFormat; + this.certificateFormat = certificateFormatValue; } private byte[] data; /** * The pfx or .cer file. + * @return The Data value. */ public byte[] getData() { @@ -60,10 +63,11 @@ public byte[] getData() /** * The pfx or .cer file. + * @param dataValue The Data value. */ - public void setData(byte[] data) + public void setData(final byte[] dataValue) { - this.data = data; + this.data = dataValue; } private String password; @@ -71,6 +75,7 @@ public void setData(byte[] data) /** * The password for a .pfx certificate. A .cer certificate does not require * a password. + * @return The Password value. */ public String getPassword() { @@ -80,9 +85,10 @@ public String getPassword() /** * The password for a .pfx certificate. A .cer certificate does not require * a password. + * @param passwordValue The Password value. */ - public void setPassword(String password) + public void setPassword(final String passwordValue) { - this.password = password; + this.password = passwordValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateDeleteParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateDeleteParameters.java index a702aa21ab0a3..1db75bebc7c0a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateDeleteParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateDeleteParameters.java @@ -32,6 +32,7 @@ public class ServiceCertificateDeleteParameters /** * The DNS prefix name of your service. + * @return The ServiceName value. */ public String getServiceName() { @@ -40,16 +41,18 @@ public String getServiceName() /** * The DNS prefix name of your service. + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } private String thumbprint; /** * The hexadecimal representation of the thumbprint. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -58,16 +61,18 @@ public String getThumbprint() /** * The hexadecimal representation of the thumbprint. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } private String thumbprintAlgorithm; /** * The algorithm for the certificate's thumbprint. + * @return The ThumbprintAlgorithm value. */ public String getThumbprintAlgorithm() { @@ -76,9 +81,10 @@ public String getThumbprintAlgorithm() /** * The algorithm for the certificate's thumbprint. + * @param thumbprintAlgorithmValue The ThumbprintAlgorithm value. */ - public void setThumbprintAlgorithm(String thumbprintAlgorithm) + public void setThumbprintAlgorithm(final String thumbprintAlgorithmValue) { - this.thumbprintAlgorithm = thumbprintAlgorithm; + this.thumbprintAlgorithm = thumbprintAlgorithmValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateGetParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateGetParameters.java index 5532e26d095f3..4f4a04a92b30e 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateGetParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateGetParameters.java @@ -32,6 +32,7 @@ public class ServiceCertificateGetParameters /** * The DNS prefix name of your service. + * @return The ServiceName value. */ public String getServiceName() { @@ -40,16 +41,18 @@ public String getServiceName() /** * The DNS prefix name of your service. + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } private String thumbprint; /** * The hexadecimal representation of the thumbprint. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -58,16 +61,18 @@ public String getThumbprint() /** * The hexadecimal representation of the thumbprint. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } private String thumbprintAlgorithm; /** * The algorithm for the certificate's thumbprint. + * @return The ThumbprintAlgorithm value. */ public String getThumbprintAlgorithm() { @@ -76,9 +81,10 @@ public String getThumbprintAlgorithm() /** * The algorithm for the certificate's thumbprint. + * @param thumbprintAlgorithmValue The ThumbprintAlgorithm value. */ - public void setThumbprintAlgorithm(String thumbprintAlgorithm) + public void setThumbprintAlgorithm(final String thumbprintAlgorithmValue) { - this.thumbprintAlgorithm = thumbprintAlgorithm; + this.thumbprintAlgorithm = thumbprintAlgorithmValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateGetResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateGetResponse.java index 695143285bb11..b0f9e7be82b6a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateGetResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateGetResponse.java @@ -35,6 +35,7 @@ public class ServiceCertificateGetResponse extends OperationResponse /** * The public portion of the X.509 service certificate as a form of the .cer * file. + * @return The Data value. */ public byte[] getData() { @@ -44,9 +45,10 @@ public byte[] getData() /** * The public portion of the X.509 service certificate as a form of the .cer * file. + * @param dataValue The Data value. */ - public void setData(byte[] data) + public void setData(final byte[] dataValue) { - this.data = data; + this.data = dataValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateListResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateListResponse.java index 2211d3a63a2c7..778807aebfc4b 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateListResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/ServiceCertificateListResponse.java @@ -37,6 +37,7 @@ public class ServiceCertificateListResponse extends OperationResponse implements /** * The service certificates that are valid for your subscription. + * @return The Certificates value. */ public ArrayList getCertificates() { @@ -45,10 +46,11 @@ public ArrayList getCertificates() /** * The service certificates that are valid for your subscription. + * @param certificatesValue The Certificates value. */ - public void setCertificates(ArrayList certificates) + public void setCertificates(final ArrayList certificatesValue) { - this.certificates = certificates; + this.certificates = certificatesValue; } /** @@ -80,6 +82,7 @@ public static class Certificate /** * The Service Management API request URI used to perform Get Service * Certificate requests against the certificate store. + * @return The CertificateUri value. */ public URI getCertificateUri() { @@ -89,16 +92,18 @@ public URI getCertificateUri() /** * The Service Management API request URI used to perform Get Service * Certificate requests against the certificate store. + * @param certificateUriValue The CertificateUri value. */ - public void setCertificateUri(URI certificateUri) + public void setCertificateUri(final URI certificateUriValue) { - this.certificateUri = certificateUri; + this.certificateUri = certificateUriValue; } private byte[] data; /** * The public part of the service certificate as a .cer file. + * @return The Data value. */ public byte[] getData() { @@ -107,16 +112,18 @@ public byte[] getData() /** * The public part of the service certificate as a .cer file. + * @param dataValue The Data value. */ - public void setData(byte[] data) + public void setData(final byte[] dataValue) { - this.data = data; + this.data = dataValue; } private String thumbprint; /** * The X509 certificate thumb print property of the service certificate. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -125,10 +132,11 @@ public String getThumbprint() /** * The X509 certificate thumb print property of the service certificate. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } private String thumbprintAlgorithm; @@ -136,6 +144,7 @@ public void setThumbprint(String thumbprint) /** * The algorithm that was used to hash the service certificate. * Currently SHA-1 is the only supported algorithm. + * @return The ThumbprintAlgorithm value. */ public String getThumbprintAlgorithm() { @@ -145,10 +154,11 @@ public String getThumbprintAlgorithm() /** * The algorithm that was used to hash the service certificate. * Currently SHA-1 is the only supported algorithm. + * @param thumbprintAlgorithmValue The ThumbprintAlgorithm value. */ - public void setThumbprintAlgorithm(String thumbprintAlgorithm) + public void setThumbprintAlgorithm(final String thumbprintAlgorithmValue) { - this.thumbprintAlgorithm = thumbprintAlgorithm; + this.thumbprintAlgorithm = thumbprintAlgorithmValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettingKeyPair.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettingKeyPair.java index 99cca3dc92014..d26a18bac4ae3 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettingKeyPair.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettingKeyPair.java @@ -33,6 +33,7 @@ public class SshSettingKeyPair /** * Required. Specifies the SHA1 fingerprint of an X509 certificate * associated with the hosted service that includes the SSH keypair. + * @return The Fingerprint value. */ public String getFingerprint() { @@ -42,10 +43,11 @@ public String getFingerprint() /** * Required. Specifies the SHA1 fingerprint of an X509 certificate * associated with the hosted service that includes the SSH keypair. + * @param fingerprintValue The Fingerprint value. */ - public void setFingerprint(String fingerprint) + public void setFingerprint(final String fingerprintValue) { - this.fingerprint = fingerprint; + this.fingerprint = fingerprintValue; } private String path; @@ -56,6 +58,7 @@ public void setFingerprint(String fingerprint) * keys are written to it. The SSH public key is stored in the same * directory and has the same name as the private key file with .pub * suffix. Example: /home/user/.ssh/id_rsa + * @return The Path value. */ public String getPath() { @@ -68,9 +71,10 @@ public String getPath() * keys are written to it. The SSH public key is stored in the same * directory and has the same name as the private key file with .pub * suffix. Example: /home/user/.ssh/id_rsa + * @param pathValue The Path value. */ - public void setPath(String path) + public void setPath(final String pathValue) { - this.path = path; + this.path = pathValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettingPublicKey.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettingPublicKey.java index 99fe95ddb681f..b076b18a5f2de 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettingPublicKey.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettingPublicKey.java @@ -33,6 +33,7 @@ public class SshSettingPublicKey /** * Required. Specifies the SHA1 fingerprint of an X509 certificate * associated with the hosted service that includes the SSH public key. + * @return The Fingerprint value. */ public String getFingerprint() { @@ -42,10 +43,11 @@ public String getFingerprint() /** * Required. Specifies the SHA1 fingerprint of an X509 certificate * associated with the hosted service that includes the SSH public key. + * @param fingerprintValue The Fingerprint value. */ - public void setFingerprint(String fingerprint) + public void setFingerprint(final String fingerprintValue) { - this.fingerprint = fingerprint; + this.fingerprint = fingerprintValue; } private String path; @@ -55,6 +57,7 @@ public void setFingerprint(String fingerprint) * which stores the SSH public key. If the file already exists, the * specified key is appended to the file. * Example:/home/user/.ssh/authorized_keys + * @return The Path value. */ public String getPath() { @@ -66,9 +69,10 @@ public String getPath() * which stores the SSH public key. If the file already exists, the * specified key is appended to the file. * Example:/home/user/.ssh/authorized_keys + * @param pathValue The Path value. */ - public void setPath(String path) + public void setPath(final String pathValue) { - this.path = path; + this.path = pathValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettings.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettings.java index a2fe1467306bb..be4d67703cf11 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettings.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/SshSettings.java @@ -36,6 +36,7 @@ public class SshSettings /** * Optional. Specifies the collection of SSH public keys. + * @return The KeyPairs value. */ public ArrayList getKeyPairs() { @@ -44,16 +45,18 @@ public ArrayList getKeyPairs() /** * Optional. Specifies the collection of SSH public keys. + * @param keyPairsValue The KeyPairs value. */ - public void setKeyPairs(ArrayList keyPairs) + public void setKeyPairs(final ArrayList keyPairsValue) { - this.keyPairs = keyPairs; + this.keyPairs = keyPairsValue; } private ArrayList publicKeys; /** * Optional. Specifies the collection of SSH public keys. + * @return The PublicKeys value. */ public ArrayList getPublicKeys() { @@ -62,10 +65,11 @@ public ArrayList getPublicKeys() /** * Optional. Specifies the collection of SSH public keys. + * @param publicKeysValue The PublicKeys value. */ - public void setPublicKeys(ArrayList publicKeys) + public void setPublicKeys(final ArrayList publicKeysValue) { - this.publicKeys = publicKeys; + this.publicKeys = publicKeysValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/StoredCertificateSettings.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/StoredCertificateSettings.java index b209f3e129a9f..4b8a85b4ab5c2 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/StoredCertificateSettings.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/StoredCertificateSettings.java @@ -37,6 +37,7 @@ public class StoredCertificateSettings /** * Required. Specifies the name of the certificate store from which retrieve * certificate. For example, “My”. + * @return The StoreName value. */ public String getStoreName() { @@ -46,10 +47,11 @@ public String getStoreName() /** * Required. Specifies the name of the certificate store from which retrieve * certificate. For example, “My”. + * @param storeNameValue The StoreName value. */ - public void setStoreName(String storeName) + public void setStoreName(final String storeNameValue) { - this.storeName = storeName; + this.storeName = storeNameValue; } private String thumbprint; @@ -57,6 +59,7 @@ public void setStoreName(String storeName) /** * Required. Specifies the thumbprint of the certificate to be provisioned. * The thumbprint must specify an existing service certificate. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -66,9 +69,10 @@ public String getThumbprint() /** * Required. Specifies the thumbprint of the certificate to be provisioned. * The thumbprint must specify an existing service certificate. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/UpgradeStatus.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/UpgradeStatus.java index 0f5623a883380..bd0507e35420e 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/UpgradeStatus.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/UpgradeStatus.java @@ -34,6 +34,7 @@ public class UpgradeStatus * An integer value that identifies the current upgrade domain. Upgrade * domains are identified with a zero-based index: the first upgrade domain * has an ID of 0, the second has an ID of 1, and so on. + * @return The CurrentUpgradeDomain value. */ public int getCurrentUpgradeDomain() { @@ -44,16 +45,18 @@ public int getCurrentUpgradeDomain() * An integer value that identifies the current upgrade domain. Upgrade * domains are identified with a zero-based index: the first upgrade domain * has an ID of 0, the second has an ID of 1, and so on. + * @param currentUpgradeDomainValue The CurrentUpgradeDomain value. */ - public void setCurrentUpgradeDomain(int currentUpgradeDomain) + public void setCurrentUpgradeDomain(final int currentUpgradeDomainValue) { - this.currentUpgradeDomain = currentUpgradeDomain; + this.currentUpgradeDomain = currentUpgradeDomainValue; } private UpgradeDomainState currentUpgradeDomainState; /** * The current state of the upgrade. Possible values are Before and During + * @return The CurrentUpgradeDomainState value. */ public UpgradeDomainState getCurrentUpgradeDomainState() { @@ -62,16 +65,18 @@ public UpgradeDomainState getCurrentUpgradeDomainState() /** * The current state of the upgrade. Possible values are Before and During + * @param currentUpgradeDomainStateValue The CurrentUpgradeDomainState value. */ - public void setCurrentUpgradeDomainState(UpgradeDomainState currentUpgradeDomainState) + public void setCurrentUpgradeDomainState(final UpgradeDomainState currentUpgradeDomainStateValue) { - this.currentUpgradeDomainState = currentUpgradeDomainState; + this.currentUpgradeDomainState = currentUpgradeDomainStateValue; } private DeploymentUpgradeType upgradeType; /** * The type of the upgrade. Possible values are Auto and Manual. + * @return The UpgradeType value. */ public DeploymentUpgradeType getUpgradeType() { @@ -80,9 +85,10 @@ public DeploymentUpgradeType getUpgradeType() /** * The type of the upgrade. Possible values are Auto and Manual. + * @param upgradeTypeValue The UpgradeType value. */ - public void setUpgradeType(DeploymentUpgradeType upgradeType) + public void setUpgradeType(final DeploymentUpgradeType upgradeTypeValue) { - this.upgradeType = upgradeType; + this.upgradeType = upgradeTypeValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualIPAddress.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualIPAddress.java index 40cea85c9cd53..3e098d7eb2cad 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualIPAddress.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualIPAddress.java @@ -34,6 +34,7 @@ public class VirtualIPAddress /** * The virtual IP address of the deployment. + * @return The Address value. */ public InetAddress getAddress() { @@ -42,34 +43,38 @@ public InetAddress getAddress() /** * The virtual IP address of the deployment. + * @param addressValue The Address value. */ - public void setAddress(InetAddress address) + public void setAddress(final InetAddress addressValue) { - this.address = address; + this.address = addressValue; } private Boolean isDnsProgrammed; /** * Indicates whether the IP address is DNS programmed. + * @return The IsDnsProgrammed value. */ - public Boolean getIsDnsProgrammed() + public Boolean isDnsProgrammed() { return this.isDnsProgrammed; } /** * Indicates whether the IP address is DNS programmed. + * @param isDnsProgrammedValue The IsDnsProgrammed value. */ - public void setIsDnsProgrammed(Boolean isDnsProgrammed) + public void setIsDnsProgrammed(final Boolean isDnsProgrammedValue) { - this.isDnsProgrammed = isDnsProgrammed; + this.isDnsProgrammed = isDnsProgrammedValue; } private String name; /** * The name of the virtual IP. + * @return The Name value. */ public String getName() { @@ -78,9 +83,10 @@ public String getName() /** * The name of the virtual IP. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCaptureParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCaptureParameters.java index b0948a5619dc8..87a59b64eb5cf 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCaptureParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCaptureParameters.java @@ -37,6 +37,7 @@ public class VirtualMachineCaptureParameters * Reprovision – this value causes the virtual machine to be redeployed * after the image is captured by using the specified information in * ProvisioningConfiguration. + * @return The PostCaptureAction value. */ public PostCaptureAction getPostCaptureAction() { @@ -50,10 +51,11 @@ public PostCaptureAction getPostCaptureAction() * Reprovision – this value causes the virtual machine to be redeployed * after the image is captured by using the specified information in * ProvisioningConfiguration. + * @param postCaptureActionValue The PostCaptureAction value. */ - public void setPostCaptureAction(PostCaptureAction postCaptureAction) + public void setPostCaptureAction(final PostCaptureAction postCaptureActionValue) { - this.postCaptureAction = postCaptureAction; + this.postCaptureAction = postCaptureActionValue; } private ConfigurationSet provisioningConfiguration; @@ -62,6 +64,7 @@ public void setPostCaptureAction(PostCaptureAction postCaptureAction) * Optional. Provides information to be used to redeploy the virtual machine * after the image has been captured. This element is only used when the * PostCaptureAction is set to Reprovision. + * @return The ProvisioningConfiguration value. */ public ConfigurationSet getProvisioningConfiguration() { @@ -72,10 +75,11 @@ public ConfigurationSet getProvisioningConfiguration() * Optional. Provides information to be used to redeploy the virtual machine * after the image has been captured. This element is only used when the * PostCaptureAction is set to Reprovision. + * @param provisioningConfigurationValue The ProvisioningConfiguration value. */ - public void setProvisioningConfiguration(ConfigurationSet provisioningConfiguration) + public void setProvisioningConfiguration(final ConfigurationSet provisioningConfigurationValue) { - this.provisioningConfiguration = provisioningConfiguration; + this.provisioningConfiguration = provisioningConfigurationValue; } private String targetImageLabel; @@ -84,6 +88,7 @@ public void setProvisioningConfiguration(ConfigurationSet provisioningConfigurat * Required. Specifies the friendly name of the captured image. This is the * value that appears in the Name column for the image in the Windows Azure * Management Portal. + * @return The TargetImageLabel value. */ public String getTargetImageLabel() { @@ -94,16 +99,18 @@ public String getTargetImageLabel() * Required. Specifies the friendly name of the captured image. This is the * value that appears in the Name column for the image in the Windows Azure * Management Portal. + * @param targetImageLabelValue The TargetImageLabel value. */ - public void setTargetImageLabel(String targetImageLabel) + public void setTargetImageLabel(final String targetImageLabelValue) { - this.targetImageLabel = targetImageLabel; + this.targetImageLabel = targetImageLabelValue; } private String targetImageName; /** * Required. Specifies the image name of the captured image. + * @return The TargetImageName value. */ public String getTargetImageName() { @@ -112,9 +119,10 @@ public String getTargetImageName() /** * Required. Specifies the image name of the captured image. + * @param targetImageNameValue The TargetImageName value. */ - public void setTargetImageName(String targetImageName) + public void setTargetImageName(final String targetImageNameValue) { - this.targetImageName = targetImageName; + this.targetImageName = targetImageNameValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCreateDeploymentParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCreateDeploymentParameters.java index 8e33497328a41..ce1f13fa8fe03 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCreateDeploymentParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCreateDeploymentParameters.java @@ -35,6 +35,7 @@ public class VirtualMachineCreateDeploymentParameters /** * Required. Specifies the environment in which to deploy the virtual * machine. Possible values are: Staging, Production. + * @return The DeploymentSlot value. */ public DeploymentSlot getDeploymentSlot() { @@ -44,16 +45,18 @@ public DeploymentSlot getDeploymentSlot() /** * Required. Specifies the environment in which to deploy the virtual * machine. Possible values are: Staging, Production. + * @param deploymentSlotValue The DeploymentSlot value. */ - public void setDeploymentSlot(DeploymentSlot deploymentSlot) + public void setDeploymentSlot(final DeploymentSlot deploymentSlotValue) { - this.deploymentSlot = deploymentSlot; + this.deploymentSlot = deploymentSlotValue; } private DnsSettings dnsSettings; /** * Optional. Contains a list of DNS servers to associate with themachine. + * @return The DnsSettings value. */ public DnsSettings getDnsSettings() { @@ -62,10 +65,11 @@ public DnsSettings getDnsSettings() /** * Optional. Contains a list of DNS servers to associate with themachine. + * @param dnsSettingsValue The DnsSettings value. */ - public void setDnsSettings(DnsSettings dnsSettings) + public void setDnsSettings(final DnsSettings dnsSettingsValue) { - this.dnsSettings = dnsSettings; + this.dnsSettings = dnsSettingsValue; } private String label; @@ -75,6 +79,7 @@ public void setDnsSettings(DnsSettings dnsSettings) * characters in length. It is recommended that the label be unique within * the subscription. The name can be used identify the hosted service for * tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -86,10 +91,11 @@ public String getLabel() * characters in length. It is recommended that the label be unique within * the subscription. The name can be used identify the hosted service for * tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String name; @@ -97,6 +103,7 @@ public void setLabel(String label) /** * Required. A name for the deployment. The deployment name must be unique * among other deployments for the hosted service. + * @return The Name value. */ public String getName() { @@ -106,10 +113,11 @@ public String getName() /** * Required. A name for the deployment. The deployment name must be unique * among other deployments for the hosted service. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String reservedIPName; @@ -118,6 +126,7 @@ public void setName(String name) * Optional and Preview Only. Specifies the name of an existing reserved IP * to which the deployment will belong. Reserved IPs are created by calling * the Create Reserved IP operation. + * @return The ReservedIPName value. */ public String getReservedIPName() { @@ -128,10 +137,11 @@ public String getReservedIPName() * Optional and Preview Only. Specifies the name of an existing reserved IP * to which the deployment will belong. Reserved IPs are created by calling * the Create Reserved IP operation. + * @param reservedIPNameValue The ReservedIPName value. */ - public void setReservedIPName(String reservedIPName) + public void setReservedIPName(final String reservedIPNameValue) { - this.reservedIPName = reservedIPName; + this.reservedIPName = reservedIPNameValue; } private ArrayList roles; @@ -139,6 +149,7 @@ public void setReservedIPName(String reservedIPName) /** * Required. Contains the provisioning details for the new virtual machine * deployment. + * @return The Roles value. */ public ArrayList getRoles() { @@ -148,10 +159,11 @@ public ArrayList getRoles() /** * Required. Contains the provisioning details for the new virtual machine * deployment. + * @param rolesValue The Roles value. */ - public void setRoles(ArrayList roles) + public void setRoles(final ArrayList rolesValue) { - this.roles = roles; + this.roles = rolesValue; } private String virtualNetworkName; @@ -160,6 +172,7 @@ public void setRoles(ArrayList roles) * Optional. Specifies the name of an existing virtual network to which the * deployment will belong. Virtual networks are created by calling the Set * Network Configuration operation. + * @return The VirtualNetworkName value. */ public String getVirtualNetworkName() { @@ -170,10 +183,11 @@ public String getVirtualNetworkName() * Optional. Specifies the name of an existing virtual network to which the * deployment will belong. Virtual networks are created by calling the Set * Network Configuration operation. + * @param virtualNetworkNameValue The VirtualNetworkName value. */ - public void setVirtualNetworkName(String virtualNetworkName) + public void setVirtualNetworkName(final String virtualNetworkNameValue) { - this.virtualNetworkName = virtualNetworkName; + this.virtualNetworkName = virtualNetworkNameValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCreateParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCreateParameters.java index 4c5de13d1bbdb..be0f6fd0f25e7 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCreateParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineCreateParameters.java @@ -38,6 +38,7 @@ public class VirtualMachineCreateParameters * the Windows Azure environment. Virtual machines specified in the same * availability set are allocated to different nodes to maximize * availability. + * @return The AvailabilitySetName value. */ public String getAvailabilitySetName() { @@ -50,10 +51,11 @@ public String getAvailabilitySetName() * the Windows Azure environment. Virtual machines specified in the same * availability set are allocated to different nodes to maximize * availability. + * @param availabilitySetNameValue The AvailabilitySetName value. */ - public void setAvailabilitySetName(String availabilitySetName) + public void setAvailabilitySetName(final String availabilitySetNameValue) { - this.availabilitySetName = availabilitySetName; + this.availabilitySetName = availabilitySetNameValue; } private ArrayList configurationSets; @@ -61,6 +63,7 @@ public void setAvailabilitySetName(String availabilitySetName) /** * Contains the collection of configuration sets that contain system and * application configuration settings. + * @return The ConfigurationSets value. */ public ArrayList getConfigurationSets() { @@ -70,10 +73,11 @@ public ArrayList getConfigurationSets() /** * Contains the collection of configuration sets that contain system and * application configuration settings. + * @param configurationSetsValue The ConfigurationSets value. */ - public void setConfigurationSets(ArrayList configurationSets) + public void setConfigurationSets(final ArrayList configurationSetsValue) { - this.configurationSets = configurationSets; + this.configurationSets = configurationSetsValue; } private ArrayList dataVirtualHardDisks; @@ -81,6 +85,7 @@ public void setConfigurationSets(ArrayList configurationSets) /** * Contains the parameters Windows Azure used to create the data disk for * the virtual machine. + * @return The DataVirtualHardDisks value. */ public ArrayList getDataVirtualHardDisks() { @@ -90,10 +95,11 @@ public ArrayList getDataVirtualHardDisks() /** * Contains the parameters Windows Azure used to create the data disk for * the virtual machine. + * @param dataVirtualHardDisksValue The DataVirtualHardDisks value. */ - public void setDataVirtualHardDisks(ArrayList dataVirtualHardDisks) + public void setDataVirtualHardDisks(final ArrayList dataVirtualHardDisksValue) { - this.dataVirtualHardDisks = dataVirtualHardDisks; + this.dataVirtualHardDisks = dataVirtualHardDisksValue; } private OSVirtualHardDisk oSVirtualHardDisk; @@ -101,6 +107,7 @@ public void setDataVirtualHardDisks(ArrayList dataVirtualHa /** * Contains the parameters Windows Azure used to create the operating system * disk for the virtual machine. + * @return The OSVirtualHardDisk value. */ public OSVirtualHardDisk getOSVirtualHardDisk() { @@ -110,10 +117,11 @@ public OSVirtualHardDisk getOSVirtualHardDisk() /** * Contains the parameters Windows Azure used to create the operating system * disk for the virtual machine. + * @param oSVirtualHardDiskValue The OSVirtualHardDisk value. */ - public void setOSVirtualHardDisk(OSVirtualHardDisk oSVirtualHardDisk) + public void setOSVirtualHardDisk(final OSVirtualHardDisk oSVirtualHardDiskValue) { - this.oSVirtualHardDisk = oSVirtualHardDisk; + this.oSVirtualHardDisk = oSVirtualHardDiskValue; } private String roleName; @@ -121,6 +129,7 @@ public void setOSVirtualHardDisk(OSVirtualHardDisk oSVirtualHardDisk) /** * Required. Specifies the name for the virtual machine. The name must be * unique within the deployment. + * @return The RoleName value. */ public String getRoleName() { @@ -130,28 +139,31 @@ public String getRoleName() /** * Required. Specifies the name for the virtual machine. The name must be * unique within the deployment. + * @param roleNameValue The RoleName value. */ - public void setRoleName(String roleName) + public void setRoleName(final String roleNameValue) { - this.roleName = roleName; + this.roleName = roleNameValue; } - private VirtualMachineRoleSize roleSize; + private String roleSize; /** * The size of the virtual machine. + * @return The RoleSize value. */ - public VirtualMachineRoleSize getRoleSize() + public String getRoleSize() { return this.roleSize; } /** * The size of the virtual machine. + * @param roleSizeValue The RoleSize value. */ - public void setRoleSize(VirtualMachineRoleSize roleSize) + public void setRoleSize(final String roleSizeValue) { - this.roleSize = roleSize; + this.roleSize = roleSizeValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDataDiskParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDataDiskParameters.java index bbb544515c2a0..a6a026eb8e5db 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDataDiskParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDataDiskParameters.java @@ -37,6 +37,7 @@ public class VirtualMachineDiskCreateDataDiskParameters * disk, either by directly referencing a media using the MediaLink element * or specifying the target disk size, you can use the DiskLabel element to * customize the name property of the target data disk. + * @return The DiskLabel value. */ public String getDiskLabel() { @@ -48,10 +49,11 @@ public String getDiskLabel() * disk, either by directly referencing a media using the MediaLink element * or specifying the target disk size, you can use the DiskLabel element to * customize the name property of the target data disk. + * @param diskLabelValue The DiskLabel value. */ - public void setDiskLabel(String diskLabel) + public void setDiskLabel(final String diskLabelValue) { - this.diskLabel = diskLabel; + this.diskLabel = diskLabelValue; } private String diskName; @@ -60,6 +62,7 @@ public void setDiskLabel(String diskLabel) * Optional. Specifies the name of the disk. Windows Azure uses the * specified disk to create the data disk for the machine and populates * this field with the disk name. + * @return The DiskName value. */ public String getDiskName() { @@ -70,10 +73,11 @@ public String getDiskName() * Optional. Specifies the name of the disk. Windows Azure uses the * specified disk to create the data disk for the machine and populates * this field with the disk name. + * @param diskNameValue The DiskName value. */ - public void setDiskName(String diskName) + public void setDiskName(final String diskNameValue) { - this.diskName = diskName; + this.diskName = diskNameValue; } private VirtualHardDiskHostCaching hostCaching; @@ -83,6 +87,7 @@ public void setDiskName(String diskName) * read/write efficiency. The default vault is ReadOnly. Possible values * are: None, ReadOnly, ReadWrite. Warning: Setting this property impacts * the consistency of the disk. + * @return The HostCaching value. */ public VirtualHardDiskHostCaching getHostCaching() { @@ -94,10 +99,11 @@ public VirtualHardDiskHostCaching getHostCaching() * read/write efficiency. The default vault is ReadOnly. Possible values * are: None, ReadOnly, ReadWrite. Warning: Setting this property impacts * the consistency of the disk. + * @param hostCachingValue The HostCaching value. */ - public void setHostCaching(VirtualHardDiskHostCaching hostCaching) + public void setHostCaching(final VirtualHardDiskHostCaching hostCachingValue) { - this.hostCaching = hostCaching; + this.hostCaching = hostCachingValue; } private double logicalDiskSizeInGB; @@ -108,6 +114,7 @@ public void setHostCaching(VirtualHardDiskHostCaching hostCaching) * role call by specifying the value for this property. Windows Azure * creates the empty disk based on size preference and attaches the newly * created disk to the Role. + * @return The LogicalDiskSizeInGB value. */ public double getLogicalDiskSizeInGB() { @@ -120,10 +127,11 @@ public double getLogicalDiskSizeInGB() * role call by specifying the value for this property. Windows Azure * creates the empty disk based on size preference and attaches the newly * created disk to the Role. + * @param logicalDiskSizeInGBValue The LogicalDiskSizeInGB value. */ - public void setLogicalDiskSizeInGB(double logicalDiskSizeInGB) + public void setLogicalDiskSizeInGB(final double logicalDiskSizeInGBValue) { - this.logicalDiskSizeInGB = logicalDiskSizeInGB; + this.logicalDiskSizeInGB = logicalDiskSizeInGBValue; } private Integer logicalUnitNumber; @@ -132,6 +140,7 @@ public void setLogicalDiskSizeInGB(double logicalDiskSizeInGB) * Optional. Specifies the Logical Unit Number (LUN) for the disk. The LUN * specifies the slot in which the data drive appears when mounted for * usage by the virtual machine. Valid LUN values are 0 through 15. + * @return The LogicalUnitNumber value. */ public Integer getLogicalUnitNumber() { @@ -142,10 +151,11 @@ public Integer getLogicalUnitNumber() * Optional. Specifies the Logical Unit Number (LUN) for the disk. The LUN * specifies the slot in which the data drive appears when mounted for * usage by the virtual machine. Valid LUN values are 0 through 15. + * @param logicalUnitNumberValue The LogicalUnitNumber value. */ - public void setLogicalUnitNumber(Integer logicalUnitNumber) + public void setLogicalUnitNumber(final Integer logicalUnitNumberValue) { - this.logicalUnitNumber = logicalUnitNumber; + this.logicalUnitNumber = logicalUnitNumberValue; } private URI mediaLinkUri; @@ -156,6 +166,7 @@ public void setLogicalUnitNumber(Integer logicalUnitNumber) * to the storage account in the subscription specified by the * SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -168,10 +179,11 @@ public URI getMediaLinkUri() * to the storage account in the subscription specified by the * SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private URI sourceMediaLinkUri; @@ -179,6 +191,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * Optional. Specifies the location of a blob in account storage which is * mounted as a data disk when the virtual machine is created. + * @return The SourceMediaLinkUri value. */ public URI getSourceMediaLinkUri() { @@ -188,9 +201,10 @@ public URI getSourceMediaLinkUri() /** * Optional. Specifies the location of a blob in account storage which is * mounted as a data disk when the virtual machine is created. + * @param sourceMediaLinkUriValue The SourceMediaLinkUri value. */ - public void setSourceMediaLinkUri(URI sourceMediaLinkUri) + public void setSourceMediaLinkUri(final URI sourceMediaLinkUriValue) { - this.sourceMediaLinkUri = sourceMediaLinkUri; + this.sourceMediaLinkUri = sourceMediaLinkUriValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDiskParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDiskParameters.java index 929bed8e00ec3..84659d4196dc8 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDiskParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDiskParameters.java @@ -34,6 +34,7 @@ public class VirtualMachineDiskCreateDiskParameters /** * Required. Specifies the friendly name of the disk. + * @return The Label value. */ public String getLabel() { @@ -42,10 +43,11 @@ public String getLabel() /** * Required. Specifies the friendly name of the disk. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private URI mediaLinkUri; @@ -55,6 +57,7 @@ public void setLabel(String label) * The blob location must belong to a storage account in the subscription * specified by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -66,10 +69,11 @@ public URI getMediaLinkUri() * The blob location must belong to a storage account in the subscription * specified by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -77,6 +81,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * Required. Specifies a name for the disk. Windows Azure uses the name to * identify the disk when creating virtual machines from the disk. + * @return The Name value. */ public String getName() { @@ -86,10 +91,11 @@ public String getName() /** * Required. Specifies a name for the disk. Windows Azure uses the name to * identify the disk when creating virtual machines from the disk. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystemType; @@ -97,6 +103,7 @@ public void setName(String name) /** * Required. The operating system type of the disk. Possible values are: * Linux, Windows. + * @return The OperatingSystemType value. */ public String getOperatingSystemType() { @@ -106,9 +113,10 @@ public String getOperatingSystemType() /** * Required. The operating system type of the disk. Possible values are: * Linux, Windows. + * @param operatingSystemTypeValue The OperatingSystemType value. */ - public void setOperatingSystemType(String operatingSystemType) + public void setOperatingSystemType(final String operatingSystemTypeValue) { - this.operatingSystemType = operatingSystemType; + this.operatingSystemType = operatingSystemTypeValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDiskResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDiskResponse.java index 2a84073f50894..59c4c593fff3a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDiskResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskCreateDiskResponse.java @@ -38,6 +38,7 @@ public class VirtualMachineDiskCreateDiskResponse extends OperationResponse * is derived from storage account that contains the blob in which the * media is located. If the storage account does not belong to an affinity * group the value is NULL. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -49,34 +50,38 @@ public String getAffinityGroup() * is derived from storage account that contains the blob in which the * media is located. If the storage account does not belong to an affinity * group the value is NULL. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private Boolean isPremium; /** * Specifies whether the comtained image is a premium image + * @return The IsPremium value. */ - public Boolean getIsPremium() + public Boolean isPremium() { return this.isPremium; } /** * Specifies whether the comtained image is a premium image + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(Boolean isPremium) + public void setIsPremium(final Boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; /** * The friendly name of the disk + * @return The Label value. */ public String getLabel() { @@ -85,10 +90,11 @@ public String getLabel() /** * The friendly name of the disk + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String location; @@ -98,6 +104,7 @@ public void setLabel(String label) * derived from storage account that contains the blob in which the disk is * located. If the storage account belongs to an affinity group the value * is NULL. + * @return The Location value. */ public String getLocation() { @@ -109,16 +116,18 @@ public String getLocation() * derived from storage account that contains the blob in which the disk is * located. If the storage account belongs to an affinity group the value * is NULL. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private double logicalSizeInGB; /** * The size, in GB, of the disk. + * @return The LogicalSizeInGB value. */ public double getLogicalSizeInGB() { @@ -127,10 +136,11 @@ public double getLogicalSizeInGB() /** * The size, in GB, of the disk. + * @param logicalSizeInGBValue The LogicalSizeInGB value. */ - public void setLogicalSizeInGB(double logicalSizeInGB) + public void setLogicalSizeInGB(final double logicalSizeInGBValue) { - this.logicalSizeInGB = logicalSizeInGB; + this.logicalSizeInGB = logicalSizeInGBValue; } private URI mediaLinkUri; @@ -140,6 +150,7 @@ public void setLogicalSizeInGB(double logicalSizeInGB) * disk is located. The blob location belongs to a storage account in the * subscription specified by the SubscriptionId value in the operation * call. Example: http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -151,10 +162,11 @@ public URI getMediaLinkUri() * disk is located. The blob location belongs to a storage account in the * subscription specified by the SubscriptionId value in the operation * call. Example: http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -162,6 +174,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * The name of the disk. This is the name that is used when creating one or * more virtual machines using the disk. + * @return The Name value. */ public String getName() { @@ -171,16 +184,18 @@ public String getName() /** * The name of the disk. This is the name that is used when creating one or * more virtual machines using the disk. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystem; /** * The Operating System type for the disk. + * @return The OperatingSystem value. */ public String getOperatingSystem() { @@ -189,10 +204,11 @@ public String getOperatingSystem() /** * The Operating System type for the disk. + * @param operatingSystemValue The OperatingSystem value. */ - public void setOperatingSystem(String operatingSystem) + public void setOperatingSystem(final String operatingSystemValue) { - this.operatingSystem = operatingSystem; + this.operatingSystem = operatingSystemValue; } private String sourceImageName; @@ -201,6 +217,7 @@ public void setOperatingSystem(String operatingSystem) * The name of the OS Image from which the disk was created. This property * is populated automatically when a disk is created from an OS image by * calling the Add Role, Create Deployment, or Provision Disk operations. + * @return The SourceImageName value. */ public String getSourceImageName() { @@ -211,10 +228,11 @@ public String getSourceImageName() * The name of the OS Image from which the disk was created. This property * is populated automatically when a disk is created from an OS image by * calling the Add Role, Create Deployment, or Provision Disk operations. + * @param sourceImageNameValue The SourceImageName value. */ - public void setSourceImageName(String sourceImageName) + public void setSourceImageName(final String sourceImageNameValue) { - this.sourceImageName = sourceImageName; + this.sourceImageName = sourceImageNameValue; } private VirtualMachineDiskCreateDiskResponse.VirtualMachineDiskUsageDetails usageDetails; @@ -223,6 +241,7 @@ public void setSourceImageName(String sourceImageName) * Contains properties that specify a virtual machine that currently using * the disk. A disk cannot be deleted as long as it is attached to a * virtual machine. + * @return The UsageDetails value. */ public VirtualMachineDiskCreateDiskResponse.VirtualMachineDiskUsageDetails getUsageDetails() { @@ -233,10 +252,11 @@ public VirtualMachineDiskCreateDiskResponse.VirtualMachineDiskUsageDetails getUs * Contains properties that specify a virtual machine that currently using * the disk. A disk cannot be deleted as long as it is attached to a * virtual machine. + * @param usageDetailsValue The UsageDetails value. */ - public void setUsageDetails(VirtualMachineDiskCreateDiskResponse.VirtualMachineDiskUsageDetails usageDetails) + public void setUsageDetails(final VirtualMachineDiskCreateDiskResponse.VirtualMachineDiskUsageDetails usageDetailsValue) { - this.usageDetails = usageDetails; + this.usageDetails = usageDetailsValue; } /** @@ -250,6 +270,7 @@ public static class VirtualMachineDiskUsageDetails /** * The deployment in which the disk is being used. + * @return The DeploymentName value. */ public String getDeploymentName() { @@ -258,16 +279,18 @@ public String getDeploymentName() /** * The deployment in which the disk is being used. + * @param deploymentNameValue The DeploymentName value. */ - public void setDeploymentName(String deploymentName) + public void setDeploymentName(final String deploymentNameValue) { - this.deploymentName = deploymentName; + this.deploymentName = deploymentNameValue; } private String hostedServiceName; /** * The hosted service in which the disk is being used. + * @return The HostedServiceName value. */ public String getHostedServiceName() { @@ -276,16 +299,18 @@ public String getHostedServiceName() /** * The hosted service in which the disk is being used. + * @param hostedServiceNameValue The HostedServiceName value. */ - public void setHostedServiceName(String hostedServiceName) + public void setHostedServiceName(final String hostedServiceNameValue) { - this.hostedServiceName = hostedServiceName; + this.hostedServiceName = hostedServiceNameValue; } private String roleName; /** * The virtual machine that the disk is attached to. + * @return The RoleName value. */ public String getRoleName() { @@ -294,10 +319,11 @@ public String getRoleName() /** * The virtual machine that the disk is attached to. + * @param roleNameValue The RoleName value. */ - public void setRoleName(String roleName) + public void setRoleName(final String roleNameValue) { - this.roleName = roleName; + this.roleName = roleNameValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskGetDataDiskResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskGetDataDiskResponse.java index 9d38a7290f0e7..0889c5d18608a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskGetDataDiskResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskGetDataDiskResponse.java @@ -35,6 +35,7 @@ public class VirtualMachineDiskGetDataDiskResponse extends OperationResponse /** * The description of the data disk. + * @return The DiskLabel value. */ public String getDiskLabel() { @@ -43,16 +44,18 @@ public String getDiskLabel() /** * The description of the data disk. + * @param diskLabelValue The DiskLabel value. */ - public void setDiskLabel(String diskLabel) + public void setDiskLabel(final String diskLabelValue) { - this.diskLabel = diskLabel; + this.diskLabel = diskLabelValue; } private String diskName; /** * The name of the data disk. + * @return The DiskName value. */ public String getDiskName() { @@ -61,10 +64,11 @@ public String getDiskName() /** * The name of the data disk. + * @param diskNameValue The DiskName value. */ - public void setDiskName(String diskName) + public void setDiskName(final String diskNameValue) { - this.diskName = diskName; + this.diskName = diskNameValue; } private VirtualHardDiskHostCaching hostCaching; @@ -72,6 +76,7 @@ public void setDiskName(String diskName) /** * The current value of the platform caching behavior of data disk blob for * read/write efficiency. Possible values are: None, ReadOnly, ReadWrite. + * @return The HostCaching value. */ public VirtualHardDiskHostCaching getHostCaching() { @@ -81,16 +86,18 @@ public VirtualHardDiskHostCaching getHostCaching() /** * The current value of the platform caching behavior of data disk blob for * read/write efficiency. Possible values are: None, ReadOnly, ReadWrite. + * @param hostCachingValue The HostCaching value. */ - public void setHostCaching(VirtualHardDiskHostCaching hostCaching) + public void setHostCaching(final VirtualHardDiskHostCaching hostCachingValue) { - this.hostCaching = hostCaching; + this.hostCaching = hostCachingValue; } private double logicalDiskSizeInGB; /** * The size, in GB, of the data disk. + * @return The LogicalDiskSizeInGB value. */ public double getLogicalDiskSizeInGB() { @@ -99,10 +106,11 @@ public double getLogicalDiskSizeInGB() /** * The size, in GB, of the data disk. + * @param logicalDiskSizeInGBValue The LogicalDiskSizeInGB value. */ - public void setLogicalDiskSizeInGB(double logicalDiskSizeInGB) + public void setLogicalDiskSizeInGB(final double logicalDiskSizeInGBValue) { - this.logicalDiskSizeInGB = logicalDiskSizeInGB; + this.logicalDiskSizeInGB = logicalDiskSizeInGBValue; } private Integer logicalUnitNumber; @@ -111,6 +119,7 @@ public void setLogicalDiskSizeInGB(double logicalDiskSizeInGB) * The Logical Unit Number (LUN) for the disk. The LUN specifies the slot in * which the data drive appears when mounted for usage by the virtual * machine. + * @return The LogicalUnitNumber value. */ public Integer getLogicalUnitNumber() { @@ -121,10 +130,11 @@ public Integer getLogicalUnitNumber() * The Logical Unit Number (LUN) for the disk. The LUN specifies the slot in * which the data drive appears when mounted for usage by the virtual * machine. + * @param logicalUnitNumberValue The LogicalUnitNumber value. */ - public void setLogicalUnitNumber(Integer logicalUnitNumber) + public void setLogicalUnitNumber(final Integer logicalUnitNumberValue) { - this.logicalUnitNumber = logicalUnitNumber; + this.logicalUnitNumber = logicalUnitNumberValue; } private URI mediaLinkUri; @@ -133,6 +143,7 @@ public void setLogicalUnitNumber(Integer logicalUnitNumber) * The location of physical blob backing the data disk. The blob location is * in storage account in the subscription specified by the SubscriptionId * value in the operation call. + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -143,9 +154,10 @@ public URI getMediaLinkUri() * The location of physical blob backing the data disk. The blob location is * in storage account in the subscription specified by the SubscriptionId * value in the operation call. + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskGetDiskResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskGetDiskResponse.java index 515d1ad48b277..8546c7a68505a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskGetDiskResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskGetDiskResponse.java @@ -38,6 +38,7 @@ public class VirtualMachineDiskGetDiskResponse extends OperationResponse * is derived from storage account that contains the blob in which the * media is located. If the storage account does not belong to an affinity * group the value is NULL. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -49,28 +50,31 @@ public String getAffinityGroup() * is derived from storage account that contains the blob in which the * media is located. If the storage account does not belong to an affinity * group the value is NULL. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private Boolean isCorrupted; /** * Specifies thether the disk is known to be corrupt. + * @return The IsCorrupted value. */ - public Boolean getIsCorrupted() + public Boolean isCorrupted() { return this.isCorrupted; } /** * Specifies thether the disk is known to be corrupt. + * @param isCorruptedValue The IsCorrupted value. */ - public void setIsCorrupted(Boolean isCorrupted) + public void setIsCorrupted(final Boolean isCorruptedValue) { - this.isCorrupted = isCorrupted; + this.isCorrupted = isCorruptedValue; } private Boolean isPremium; @@ -78,8 +82,9 @@ public void setIsCorrupted(Boolean isCorrupted) /** * Specifies whether or not the disk contains a premium virtual machine * image. + * @return The IsPremium value. */ - public Boolean getIsPremium() + public Boolean isPremium() { return this.isPremium; } @@ -87,16 +92,18 @@ public Boolean getIsPremium() /** * Specifies whether or not the disk contains a premium virtual machine * image. + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(Boolean isPremium) + public void setIsPremium(final Boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; /** * The friendly name of the disk. + * @return The Label value. */ public String getLabel() { @@ -105,10 +112,11 @@ public String getLabel() /** * The friendly name of the disk. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String location; @@ -118,6 +126,7 @@ public void setLabel(String label) * derived from storage account that contains the blob in which the disk is * located. If the storage account belongs to an affinity group the value * is NULL. + * @return The Location value. */ public String getLocation() { @@ -129,16 +138,18 @@ public String getLocation() * derived from storage account that contains the blob in which the disk is * located. If the storage account belongs to an affinity group the value * is NULL. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private double logicalSizeInGB; /** * The size, in GB, of the disk. + * @return The LogicalSizeInGB value. */ public double getLogicalSizeInGB() { @@ -147,10 +158,11 @@ public double getLogicalSizeInGB() /** * The size, in GB, of the disk. + * @param logicalSizeInGBValue The LogicalSizeInGB value. */ - public void setLogicalSizeInGB(double logicalSizeInGB) + public void setLogicalSizeInGB(final double logicalSizeInGBValue) { - this.logicalSizeInGB = logicalSizeInGB; + this.logicalSizeInGB = logicalSizeInGBValue; } private URI mediaLinkUri; @@ -160,6 +172,7 @@ public void setLogicalSizeInGB(double logicalSizeInGB) * disk is located. The blob location belongs to a storage account in the * subscription specified by the SubscriptionId value in the operation * call. Example: http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -171,10 +184,11 @@ public URI getMediaLinkUri() * disk is located. The blob location belongs to a storage account in the * subscription specified by the SubscriptionId value in the operation * call. Example: http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -182,6 +196,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * The name of the disk. This is the name that is used when creating one or * more virtual machines using the disk. + * @return The Name value. */ public String getName() { @@ -191,10 +206,11 @@ public String getName() /** * The name of the disk. This is the name that is used when creating one or * more virtual machines using the disk. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystemType; @@ -202,6 +218,7 @@ public void setName(String name) /** * The operating system type of the OS image. Possible Values are: Linux, * Windows, NULL. + * @return The OperatingSystemType value. */ public String getOperatingSystemType() { @@ -211,10 +228,11 @@ public String getOperatingSystemType() /** * The operating system type of the OS image. Possible Values are: Linux, * Windows, NULL. + * @param operatingSystemTypeValue The OperatingSystemType value. */ - public void setOperatingSystemType(String operatingSystemType) + public void setOperatingSystemType(final String operatingSystemTypeValue) { - this.operatingSystemType = operatingSystemType; + this.operatingSystemType = operatingSystemTypeValue; } private String sourceImageName; @@ -223,6 +241,7 @@ public void setOperatingSystemType(String operatingSystemType) * The name of the OS Image from which the disk was created. This property * is populated automatically when a disk is created from an OS image by * calling the Add Role, Create Deployment, or Provision Disk operations. + * @return The SourceImageName value. */ public String getSourceImageName() { @@ -233,10 +252,11 @@ public String getSourceImageName() * The name of the OS Image from which the disk was created. This property * is populated automatically when a disk is created from an OS image by * calling the Add Role, Create Deployment, or Provision Disk operations. + * @param sourceImageNameValue The SourceImageName value. */ - public void setSourceImageName(String sourceImageName) + public void setSourceImageName(final String sourceImageNameValue) { - this.sourceImageName = sourceImageName; + this.sourceImageName = sourceImageNameValue; } private VirtualMachineDiskGetDiskResponse.VirtualMachineDiskUsageDetails usageDetails; @@ -245,6 +265,7 @@ public void setSourceImageName(String sourceImageName) * Contains properties that specify a virtual machine that currently using * the disk. A disk cannot be deleted as long as it is attached to a * virtual machine. + * @return The UsageDetails value. */ public VirtualMachineDiskGetDiskResponse.VirtualMachineDiskUsageDetails getUsageDetails() { @@ -255,10 +276,11 @@ public VirtualMachineDiskGetDiskResponse.VirtualMachineDiskUsageDetails getUsage * Contains properties that specify a virtual machine that currently using * the disk. A disk cannot be deleted as long as it is attached to a * virtual machine. + * @param usageDetailsValue The UsageDetails value. */ - public void setUsageDetails(VirtualMachineDiskGetDiskResponse.VirtualMachineDiskUsageDetails usageDetails) + public void setUsageDetails(final VirtualMachineDiskGetDiskResponse.VirtualMachineDiskUsageDetails usageDetailsValue) { - this.usageDetails = usageDetails; + this.usageDetails = usageDetailsValue; } /** @@ -272,6 +294,7 @@ public static class VirtualMachineDiskUsageDetails /** * The deployment in which the disk is being used. + * @return The DeploymentName value. */ public String getDeploymentName() { @@ -280,16 +303,18 @@ public String getDeploymentName() /** * The deployment in which the disk is being used. + * @param deploymentNameValue The DeploymentName value. */ - public void setDeploymentName(String deploymentName) + public void setDeploymentName(final String deploymentNameValue) { - this.deploymentName = deploymentName; + this.deploymentName = deploymentNameValue; } private String hostedServiceName; /** * The hosted service in which the disk is being used. + * @return The HostedServiceName value. */ public String getHostedServiceName() { @@ -298,16 +323,18 @@ public String getHostedServiceName() /** * The hosted service in which the disk is being used. + * @param hostedServiceNameValue The HostedServiceName value. */ - public void setHostedServiceName(String hostedServiceName) + public void setHostedServiceName(final String hostedServiceNameValue) { - this.hostedServiceName = hostedServiceName; + this.hostedServiceName = hostedServiceNameValue; } private String roleName; /** * The virtual machine that the disk is attached to. + * @return The RoleName value. */ public String getRoleName() { @@ -316,10 +343,11 @@ public String getRoleName() /** * The virtual machine that the disk is attached to. + * @param roleNameValue The RoleName value. */ - public void setRoleName(String roleName) + public void setRoleName(final String roleNameValue) { - this.roleName = roleName; + this.roleName = roleNameValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskListResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskListResponse.java index be51544247740..9f71c5602cb1a 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskListResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskListResponse.java @@ -37,6 +37,7 @@ public class VirtualMachineDiskListResponse extends OperationResponse implements /** * The virtual machine disks associated with your subscription. + * @return The Disks value. */ public ArrayList getDisks() { @@ -45,10 +46,11 @@ public ArrayList getDisks() /** * The virtual machine disks associated with your subscription. + * @param disksValue The Disks value. */ - public void setDisks(ArrayList disks) + public void setDisks(final ArrayList disksValue) { - this.disks = disks; + this.disks = disksValue; } /** @@ -82,6 +84,7 @@ public static class VirtualMachineDisk * value is derived from storage account that contains the blob in * which the media is located. If the storage account does not belong * to an affinity group the value is NULL. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -93,28 +96,31 @@ public String getAffinityGroup() * value is derived from storage account that contains the blob in * which the media is located. If the storage account does not belong * to an affinity group the value is NULL. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private Boolean isCorrupted; /** * Specifies thether the disk is known to be corrupt. + * @return The IsCorrupted value. */ - public Boolean getIsCorrupted() + public Boolean isCorrupted() { return this.isCorrupted; } /** * Specifies thether the disk is known to be corrupt. + * @param isCorruptedValue The IsCorrupted value. */ - public void setIsCorrupted(Boolean isCorrupted) + public void setIsCorrupted(final Boolean isCorruptedValue) { - this.isCorrupted = isCorrupted; + this.isCorrupted = isCorruptedValue; } private Boolean isPremium; @@ -122,8 +128,9 @@ public void setIsCorrupted(Boolean isCorrupted) /** * Specifies whether or not the disk contains a premium virtual machine * image. + * @return The IsPremium value. */ - public Boolean getIsPremium() + public Boolean isPremium() { return this.isPremium; } @@ -131,16 +138,18 @@ public Boolean getIsPremium() /** * Specifies whether or not the disk contains a premium virtual machine * image. + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(Boolean isPremium) + public void setIsPremium(final Boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; /** * The friendly name of the disk. + * @return The Label value. */ public String getLabel() { @@ -149,10 +158,11 @@ public String getLabel() /** * The friendly name of the disk. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String location; @@ -162,6 +172,7 @@ public void setLabel(String label) * derived from storage account that contains the blob in which the * disk is located. If the storage account belongs to an affinity group * the value is NULL. + * @return The Location value. */ public String getLocation() { @@ -173,16 +184,18 @@ public String getLocation() * derived from storage account that contains the blob in which the * disk is located. If the storage account belongs to an affinity group * the value is NULL. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private double logicalSizeInGB; /** * The size, in GB, of the disk. + * @return The LogicalSizeInGB value. */ public double getLogicalSizeInGB() { @@ -191,10 +204,11 @@ public double getLogicalSizeInGB() /** * The size, in GB, of the disk. + * @param logicalSizeInGBValue The LogicalSizeInGB value. */ - public void setLogicalSizeInGB(double logicalSizeInGB) + public void setLogicalSizeInGB(final double logicalSizeInGBValue) { - this.logicalSizeInGB = logicalSizeInGB; + this.logicalSizeInGB = logicalSizeInGBValue; } private URI mediaLinkUri; @@ -205,6 +219,7 @@ public void setLogicalSizeInGB(double logicalSizeInGB) * the subscription specified by the SubscriptionId value in the * operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -217,10 +232,11 @@ public URI getMediaLinkUri() * the subscription specified by the SubscriptionId value in the * operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -228,6 +244,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * The name of the disk. This is the name that is used when creating one * or more virtual machines using the disk. + * @return The Name value. */ public String getName() { @@ -237,10 +254,11 @@ public String getName() /** * The name of the disk. This is the name that is used when creating one * or more virtual machines using the disk. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystemType; @@ -248,6 +266,7 @@ public void setName(String name) /** * The operating system type of the OS image. Possible Values are: * Linux, Windows, NULL. + * @return The OperatingSystemType value. */ public String getOperatingSystemType() { @@ -257,10 +276,11 @@ public String getOperatingSystemType() /** * The operating system type of the OS image. Possible Values are: * Linux, Windows, NULL. + * @param operatingSystemTypeValue The OperatingSystemType value. */ - public void setOperatingSystemType(String operatingSystemType) + public void setOperatingSystemType(final String operatingSystemTypeValue) { - this.operatingSystemType = operatingSystemType; + this.operatingSystemType = operatingSystemTypeValue; } private String sourceImageName; @@ -270,6 +290,7 @@ public void setOperatingSystemType(String operatingSystemType) * property is populated automatically when a disk is created from an * OS image by calling the Add Role, Create Deployment, or Provision * Disk operations. + * @return The SourceImageName value. */ public String getSourceImageName() { @@ -281,10 +302,11 @@ public String getSourceImageName() * property is populated automatically when a disk is created from an * OS image by calling the Add Role, Create Deployment, or Provision * Disk operations. + * @param sourceImageNameValue The SourceImageName value. */ - public void setSourceImageName(String sourceImageName) + public void setSourceImageName(final String sourceImageNameValue) { - this.sourceImageName = sourceImageName; + this.sourceImageName = sourceImageNameValue; } private VirtualMachineDiskListResponse.VirtualMachineDiskUsageDetails usageDetails; @@ -293,6 +315,7 @@ public void setSourceImageName(String sourceImageName) * Contains properties that specify a virtual machine that currently * using the disk. A disk cannot be deleted as long as it is attached * to a virtual machine. + * @return The UsageDetails value. */ public VirtualMachineDiskListResponse.VirtualMachineDiskUsageDetails getUsageDetails() { @@ -303,10 +326,11 @@ public VirtualMachineDiskListResponse.VirtualMachineDiskUsageDetails getUsageDet * Contains properties that specify a virtual machine that currently * using the disk. A disk cannot be deleted as long as it is attached * to a virtual machine. + * @param usageDetailsValue The UsageDetails value. */ - public void setUsageDetails(VirtualMachineDiskListResponse.VirtualMachineDiskUsageDetails usageDetails) + public void setUsageDetails(final VirtualMachineDiskListResponse.VirtualMachineDiskUsageDetails usageDetailsValue) { - this.usageDetails = usageDetails; + this.usageDetails = usageDetailsValue; } } @@ -321,6 +345,7 @@ public static class VirtualMachineDiskUsageDetails /** * The deployment in which the disk is being used. + * @return The DeploymentName value. */ public String getDeploymentName() { @@ -329,16 +354,18 @@ public String getDeploymentName() /** * The deployment in which the disk is being used. + * @param deploymentNameValue The DeploymentName value. */ - public void setDeploymentName(String deploymentName) + public void setDeploymentName(final String deploymentNameValue) { - this.deploymentName = deploymentName; + this.deploymentName = deploymentNameValue; } private String hostedServiceName; /** * The hosted service in which the disk is being used. + * @return The HostedServiceName value. */ public String getHostedServiceName() { @@ -347,16 +374,18 @@ public String getHostedServiceName() /** * The hosted service in which the disk is being used. + * @param hostedServiceNameValue The HostedServiceName value. */ - public void setHostedServiceName(String hostedServiceName) + public void setHostedServiceName(final String hostedServiceNameValue) { - this.hostedServiceName = hostedServiceName; + this.hostedServiceName = hostedServiceNameValue; } private String roleName; /** * The virtual machine that the disk is attached to. + * @return The RoleName value. */ public String getRoleName() { @@ -365,10 +394,11 @@ public String getRoleName() /** * The virtual machine that the disk is attached to. + * @param roleNameValue The RoleName value. */ - public void setRoleName(String roleName) + public void setRoleName(final String roleNameValue) { - this.roleName = roleName; + this.roleName = roleNameValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDataDiskParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDataDiskParameters.java index 37268ff119906..46cd98af204e9 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDataDiskParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDataDiskParameters.java @@ -37,6 +37,7 @@ public class VirtualMachineDiskUpdateDataDiskParameters * disk, either by directly referencing a media using the MediaLink element * or specifying the target disk size, you can use the DiskLabel element to * customize the name property of the target data disk. + * @return The DiskLabel value. */ public String getDiskLabel() { @@ -48,10 +49,11 @@ public String getDiskLabel() * disk, either by directly referencing a media using the MediaLink element * or specifying the target disk size, you can use the DiskLabel element to * customize the name property of the target data disk. + * @param diskLabelValue The DiskLabel value. */ - public void setDiskLabel(String diskLabel) + public void setDiskLabel(final String diskLabelValue) { - this.diskLabel = diskLabel; + this.diskLabel = diskLabelValue; } private String diskName; @@ -60,6 +62,7 @@ public void setDiskLabel(String diskLabel) * Optional. Specifies the name of the disk. Windows Azure uses the * specified disk to create the data disk for the machine and populates * this field with the disk name. + * @return The DiskName value. */ public String getDiskName() { @@ -70,10 +73,11 @@ public String getDiskName() * Optional. Specifies the name of the disk. Windows Azure uses the * specified disk to create the data disk for the machine and populates * this field with the disk name. + * @param diskNameValue The DiskName value. */ - public void setDiskName(String diskName) + public void setDiskName(final String diskNameValue) { - this.diskName = diskName; + this.diskName = diskNameValue; } private VirtualHardDiskHostCaching hostCaching; @@ -83,6 +87,7 @@ public void setDiskName(String diskName) * read/write efficiency. The default vault is ReadOnly. Possible values * are: None, ReadOnly, ReadWrite. Warning: Setting this property impacts * the consistency of the disk. + * @return The HostCaching value. */ public VirtualHardDiskHostCaching getHostCaching() { @@ -94,10 +99,11 @@ public VirtualHardDiskHostCaching getHostCaching() * read/write efficiency. The default vault is ReadOnly. Possible values * are: None, ReadOnly, ReadWrite. Warning: Setting this property impacts * the consistency of the disk. + * @param hostCachingValue The HostCaching value. */ - public void setHostCaching(VirtualHardDiskHostCaching hostCaching) + public void setHostCaching(final VirtualHardDiskHostCaching hostCachingValue) { - this.hostCaching = hostCaching; + this.hostCaching = hostCachingValue; } private double logicalDiskSizeInGB; @@ -108,6 +114,7 @@ public void setHostCaching(VirtualHardDiskHostCaching hostCaching) * role call by specifying the value for this property. Windows Azure * creates the empty disk based on size preference and attaches the newly * created disk to the Role. + * @return The LogicalDiskSizeInGB value. */ public double getLogicalDiskSizeInGB() { @@ -120,10 +127,11 @@ public double getLogicalDiskSizeInGB() * role call by specifying the value for this property. Windows Azure * creates the empty disk based on size preference and attaches the newly * created disk to the Role. + * @param logicalDiskSizeInGBValue The LogicalDiskSizeInGB value. */ - public void setLogicalDiskSizeInGB(double logicalDiskSizeInGB) + public void setLogicalDiskSizeInGB(final double logicalDiskSizeInGBValue) { - this.logicalDiskSizeInGB = logicalDiskSizeInGB; + this.logicalDiskSizeInGB = logicalDiskSizeInGBValue; } private Integer logicalUnitNumber; @@ -132,6 +140,7 @@ public void setLogicalDiskSizeInGB(double logicalDiskSizeInGB) * Optional. Specifies the Logical Unit Number (LUN) for the disk. The LUN * specifies the slot in which the data drive appears when mounted for * usage by the virtual machine. Valid LUN values are 0 through 15. + * @return The LogicalUnitNumber value. */ public Integer getLogicalUnitNumber() { @@ -142,10 +151,11 @@ public Integer getLogicalUnitNumber() * Optional. Specifies the Logical Unit Number (LUN) for the disk. The LUN * specifies the slot in which the data drive appears when mounted for * usage by the virtual machine. Valid LUN values are 0 through 15. + * @param logicalUnitNumberValue The LogicalUnitNumber value. */ - public void setLogicalUnitNumber(Integer logicalUnitNumber) + public void setLogicalUnitNumber(final Integer logicalUnitNumberValue) { - this.logicalUnitNumber = logicalUnitNumber; + this.logicalUnitNumber = logicalUnitNumberValue; } private URI mediaLinkUri; @@ -156,6 +166,7 @@ public void setLogicalUnitNumber(Integer logicalUnitNumber) * to the storage account in the subscription specified by the * SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -168,9 +179,10 @@ public URI getMediaLinkUri() * to the storage account in the subscription specified by the * SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDiskParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDiskParameters.java index 7e7dc355cbb60..1365f96028097 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDiskParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDiskParameters.java @@ -36,8 +36,9 @@ public class VirtualMachineDiskUpdateDiskParameters * Optional. Specifies whether the disk contains an operation system. * Note: Only a disk with an operating system installed can be mounted as * OS Drive. + * @return The HasOperatingSystem value. */ - public Boolean getHasOperatingSystem() + public Boolean isHasOperatingSystem() { return this.hasOperatingSystem; } @@ -46,16 +47,18 @@ public Boolean getHasOperatingSystem() * Optional. Specifies whether the disk contains an operation system. * Note: Only a disk with an operating system installed can be mounted as * OS Drive. + * @param hasOperatingSystemValue The HasOperatingSystem value. */ - public void setHasOperatingSystem(Boolean hasOperatingSystem) + public void setHasOperatingSystem(final Boolean hasOperatingSystemValue) { - this.hasOperatingSystem = hasOperatingSystem; + this.hasOperatingSystem = hasOperatingSystemValue; } private String label; /** * Required. Specifies the friendly name of the disk. + * @return The Label value. */ public String getLabel() { @@ -64,10 +67,11 @@ public String getLabel() /** * Required. Specifies the friendly name of the disk. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private URI mediaLinkUri; @@ -77,6 +81,7 @@ public void setLabel(String label) * The blob location must belong to a storage account in the subscription * specified by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -88,10 +93,11 @@ public URI getMediaLinkUri() * The blob location must belong to a storage account in the subscription * specified by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -99,6 +105,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * Required. Specifies a name for the disk. Windows Azure uses the name to * identify the disk when creating virtual machines from the disk. + * @return The Name value. */ public String getName() { @@ -108,10 +115,11 @@ public String getName() /** * Required. Specifies a name for the disk. Windows Azure uses the name to * identify the disk when creating virtual machines from the disk. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystemType; @@ -119,6 +127,7 @@ public void setName(String name) /** * Optional. The operating system type of the disk. Possible values are: * Linux, Windows. + * @return The OperatingSystemType value. */ public String getOperatingSystemType() { @@ -128,9 +137,10 @@ public String getOperatingSystemType() /** * Optional. The operating system type of the disk. Possible values are: * Linux, Windows. + * @param operatingSystemTypeValue The OperatingSystemType value. */ - public void setOperatingSystemType(String operatingSystemType) + public void setOperatingSystemType(final String operatingSystemTypeValue) { - this.operatingSystemType = operatingSystemType; + this.operatingSystemType = operatingSystemTypeValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDiskResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDiskResponse.java index 8ebd5d5cbdc04..fb00eb0969382 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDiskResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineDiskUpdateDiskResponse.java @@ -38,6 +38,7 @@ public class VirtualMachineDiskUpdateDiskResponse extends OperationResponse * is derived from storage account that contains the blob in which the * media is located. If the storage account does not belong to an affinity * group the value is NULL. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -49,34 +50,38 @@ public String getAffinityGroup() * is derived from storage account that contains the blob in which the * media is located. If the storage account does not belong to an affinity * group the value is NULL. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private Boolean isPremium; /** * Specifies whether the comtained image is a premium image + * @return The IsPremium value. */ - public Boolean getIsPremium() + public Boolean isPremium() { return this.isPremium; } /** * Specifies whether the comtained image is a premium image + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(Boolean isPremium) + public void setIsPremium(final Boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; /** * The friendly name of the disk + * @return The Label value. */ public String getLabel() { @@ -85,10 +90,11 @@ public String getLabel() /** * The friendly name of the disk + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String location; @@ -98,6 +104,7 @@ public void setLabel(String label) * derived from storage account that contains the blob in which the disk is * located. If the storage account belongs to an affinity group the value * is NULL. + * @return The Location value. */ public String getLocation() { @@ -109,16 +116,18 @@ public String getLocation() * derived from storage account that contains the blob in which the disk is * located. If the storage account belongs to an affinity group the value * is NULL. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private double logicalSizeInGB; /** * The size, in GB, of the disk. + * @return The LogicalSizeInGB value. */ public double getLogicalSizeInGB() { @@ -127,10 +136,11 @@ public double getLogicalSizeInGB() /** * The size, in GB, of the disk. + * @param logicalSizeInGBValue The LogicalSizeInGB value. */ - public void setLogicalSizeInGB(double logicalSizeInGB) + public void setLogicalSizeInGB(final double logicalSizeInGBValue) { - this.logicalSizeInGB = logicalSizeInGB; + this.logicalSizeInGB = logicalSizeInGBValue; } private URI mediaLinkUri; @@ -140,6 +150,7 @@ public void setLogicalSizeInGB(double logicalSizeInGB) * disk is located. The blob location belongs to a storage account in the * subscription specified by the SubscriptionId value in the operation * call. Example: http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -151,10 +162,11 @@ public URI getMediaLinkUri() * disk is located. The blob location belongs to a storage account in the * subscription specified by the SubscriptionId value in the operation * call. Example: http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -162,6 +174,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * The name of the disk. This is the name that is used when creating one or * more virtual machines using the disk. + * @return The Name value. */ public String getName() { @@ -171,16 +184,18 @@ public String getName() /** * The name of the disk. This is the name that is used when creating one or * more virtual machines using the disk. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystem; /** * The Operating System type for the disk. + * @return The OperatingSystem value. */ public String getOperatingSystem() { @@ -189,9 +204,10 @@ public String getOperatingSystem() /** * The Operating System type for the disk. + * @param operatingSystemValue The OperatingSystem value. */ - public void setOperatingSystem(String operatingSystem) + public void setOperatingSystem(final String operatingSystemValue) { - this.operatingSystem = operatingSystem; + this.operatingSystem = operatingSystemValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineGetRemoteDesktopFileResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineGetRemoteDesktopFileResponse.java index 84937171c313e..6e03ec27ec8cc 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineGetRemoteDesktopFileResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineGetRemoteDesktopFileResponse.java @@ -35,6 +35,7 @@ public class VirtualMachineGetRemoteDesktopFileResponse extends OperationRespons /** * A Remote Desktop Protocol (.rdp) file that can be used to establish a * remote desktop session to the virtual machine + * @return The RemoteDesktopFile value. */ public byte[] getRemoteDesktopFile() { @@ -44,9 +45,10 @@ public byte[] getRemoteDesktopFile() /** * A Remote Desktop Protocol (.rdp) file that can be used to establish a * remote desktop session to the virtual machine + * @param remoteDesktopFileValue The RemoteDesktopFile value. */ - public void setRemoteDesktopFile(byte[] remoteDesktopFile) + public void setRemoteDesktopFile(final byte[] remoteDesktopFileValue) { - this.remoteDesktopFile = remoteDesktopFile; + this.remoteDesktopFile = remoteDesktopFileValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineGetResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineGetResponse.java index be53d1398382f..9ed43db8d1842 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineGetResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineGetResponse.java @@ -38,6 +38,7 @@ public class VirtualMachineGetResponse extends OperationResponse * value controls the virtual machine allocation in the Windows Azure * environment. Virtual machines specified in the same availability set are * allocated to different nodes to maximize availability. + * @return The AvailabilitySetName value. */ public String getAvailabilitySetName() { @@ -49,10 +50,11 @@ public String getAvailabilitySetName() * value controls the virtual machine allocation in the Windows Azure * environment. Virtual machines specified in the same availability set are * allocated to different nodes to maximize availability. + * @param availabilitySetNameValue The AvailabilitySetName value. */ - public void setAvailabilitySetName(String availabilitySetName) + public void setAvailabilitySetName(final String availabilitySetNameValue) { - this.availabilitySetName = availabilitySetName; + this.availabilitySetName = availabilitySetNameValue; } private ArrayList configurationSets; @@ -60,6 +62,7 @@ public void setAvailabilitySetName(String availabilitySetName) /** * Contains the collection of configuration sets that contain system and * application configuration settings. + * @return The ConfigurationSets value. */ public ArrayList getConfigurationSets() { @@ -69,10 +72,11 @@ public ArrayList getConfigurationSets() /** * Contains the collection of configuration sets that contain system and * application configuration settings. + * @param configurationSetsValue The ConfigurationSets value. */ - public void setConfigurationSets(ArrayList configurationSets) + public void setConfigurationSets(final ArrayList configurationSetsValue) { - this.configurationSets = configurationSets; + this.configurationSets = configurationSetsValue; } private ArrayList dataVirtualHardDisks; @@ -80,6 +84,7 @@ public void setConfigurationSets(ArrayList configurationSets) /** * Contains the parameters Windows Azure used to create the data disk for * the virtual machine. + * @return The DataVirtualHardDisks value. */ public ArrayList getDataVirtualHardDisks() { @@ -89,10 +94,11 @@ public ArrayList getDataVirtualHardDisks() /** * Contains the parameters Windows Azure used to create the data disk for * the virtual machine. + * @param dataVirtualHardDisksValue The DataVirtualHardDisks value. */ - public void setDataVirtualHardDisks(ArrayList dataVirtualHardDisks) + public void setDataVirtualHardDisks(final ArrayList dataVirtualHardDisksValue) { - this.dataVirtualHardDisks = dataVirtualHardDisks; + this.dataVirtualHardDisks = dataVirtualHardDisksValue; } private String defaultWinRmCertificateThumbprint; @@ -100,6 +106,7 @@ public void setDataVirtualHardDisks(ArrayList dataVirtualHa /** * The read-only thumbprint of the certificate that is used with the HTTPS * listener for WinRM. + * @return The DefaultWinRmCertificateThumbprint value. */ public String getDefaultWinRmCertificateThumbprint() { @@ -109,10 +116,12 @@ public String getDefaultWinRmCertificateThumbprint() /** * The read-only thumbprint of the certificate that is used with the HTTPS * listener for WinRM. + * @param defaultWinRmCertificateThumbprintValue The + * DefaultWinRmCertificateThumbprint value. */ - public void setDefaultWinRmCertificateThumbprint(String defaultWinRmCertificateThumbprint) + public void setDefaultWinRmCertificateThumbprint(final String defaultWinRmCertificateThumbprintValue) { - this.defaultWinRmCertificateThumbprint = defaultWinRmCertificateThumbprint; + this.defaultWinRmCertificateThumbprint = defaultWinRmCertificateThumbprintValue; } private String osVersion; @@ -120,6 +129,7 @@ public void setDefaultWinRmCertificateThumbprint(String defaultWinRmCertificateT /** * The version of the operating system on which the role instances are * running. + * @return The OsVersion value. */ public String getOsVersion() { @@ -129,10 +139,11 @@ public String getOsVersion() /** * The version of the operating system on which the role instances are * running. + * @param osVersionValue The OsVersion value. */ - public void setOsVersion(String osVersion) + public void setOsVersion(final String osVersionValue) { - this.osVersion = osVersion; + this.osVersion = osVersionValue; } private OSVirtualHardDisk oSVirtualHardDisk; @@ -140,6 +151,7 @@ public void setOsVersion(String osVersion) /** * Contains the parameters Windows Azure used to create the operating system * disk for the virtual machine. + * @return The OSVirtualHardDisk value. */ public OSVirtualHardDisk getOSVirtualHardDisk() { @@ -149,16 +161,18 @@ public OSVirtualHardDisk getOSVirtualHardDisk() /** * Contains the parameters Windows Azure used to create the operating system * disk for the virtual machine. + * @param oSVirtualHardDiskValue The OSVirtualHardDisk value. */ - public void setOSVirtualHardDisk(OSVirtualHardDisk oSVirtualHardDisk) + public void setOSVirtualHardDisk(final OSVirtualHardDisk oSVirtualHardDiskValue) { - this.oSVirtualHardDisk = oSVirtualHardDisk; + this.oSVirtualHardDisk = oSVirtualHardDiskValue; } private String roleName; /** * The name for the virtual machine. The name is unique within Windows Azure. + * @return The RoleName value. */ public String getRoleName() { @@ -167,28 +181,31 @@ public String getRoleName() /** * The name for the virtual machine. The name is unique within Windows Azure. + * @param roleNameValue The RoleName value. */ - public void setRoleName(String roleName) + public void setRoleName(final String roleNameValue) { - this.roleName = roleName; + this.roleName = roleNameValue; } - private VirtualMachineRoleSize roleSize; + private String roleSize; /** * The size of the virtual machine. + * @return The RoleSize value. */ - public VirtualMachineRoleSize getRoleSize() + public String getRoleSize() { return this.roleSize; } /** * The size of the virtual machine. + * @param roleSizeValue The RoleSize value. */ - public void setRoleSize(VirtualMachineRoleSize roleSize) + public void setRoleSize(final String roleSizeValue) { - this.roleSize = roleSize; + this.roleSize = roleSizeValue; } private VirtualMachineRoleType roleType; @@ -196,6 +213,7 @@ public void setRoleSize(VirtualMachineRoleSize roleSize) /** * The type of the role for the virtual machine. The only supported value is * PersistentVMRole. + * @return The RoleType value. */ public VirtualMachineRoleType getRoleType() { @@ -205,10 +223,11 @@ public VirtualMachineRoleType getRoleType() /** * The type of the role for the virtual machine. The only supported value is * PersistentVMRole. + * @param roleTypeValue The RoleType value. */ - public void setRoleType(VirtualMachineRoleType roleType) + public void setRoleType(final VirtualMachineRoleType roleTypeValue) { - this.roleType = roleType; + this.roleType = roleTypeValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageCreateParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageCreateParameters.java index f0db6d6fdfa1c..a4c92e7979af8 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageCreateParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageCreateParameters.java @@ -35,6 +35,7 @@ public class VirtualMachineImageCreateParameters /** * Optional. Specifies the description of the OS image. + * @return The Description value. */ public String getDescription() { @@ -43,10 +44,11 @@ public String getDescription() /** * Optional. Specifies the description of the OS image. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String eula; @@ -55,6 +57,7 @@ public void setDescription(String description) * Optional. Specifies the End User License Agreement that is associated * with the image. The value for this element is a string, but it is * recommended that the value be a URL that points to a EULA. + * @return The Eula value. */ public String getEula() { @@ -65,10 +68,11 @@ public String getEula() * Optional. Specifies the End User License Agreement that is associated * with the image. The value for this element is a string, but it is * recommended that the value be a URL that points to a EULA. + * @param eulaValue The Eula value. */ - public void setEula(String eula) + public void setEula(final String eulaValue) { - this.eula = eula; + this.eula = eulaValue; } private URI iconUri; @@ -76,6 +80,7 @@ public void setEula(String eula) /** * Optional. Specifies the Uri to the icon that is displayed for the image * in the Management Portal. + * @return The IconUri value. */ public URI getIconUri() { @@ -85,16 +90,18 @@ public URI getIconUri() /** * Optional. Specifies the Uri to the icon that is displayed for the image * in the Management Portal. + * @param iconUriValue The IconUri value. */ - public void setIconUri(URI iconUri) + public void setIconUri(final URI iconUriValue) { - this.iconUri = iconUri; + this.iconUri = iconUriValue; } private String imageFamily; /** * Optional. Specifies a value that can be used to group OS images. + * @return The ImageFamily value. */ public String getImageFamily() { @@ -103,10 +110,11 @@ public String getImageFamily() /** * Optional. Specifies a value that can be used to group OS images. + * @param imageFamilyValue The ImageFamily value. */ - public void setImageFamily(String imageFamily) + public void setImageFamily(final String imageFamilyValue) { - this.imageFamily = imageFamily; + this.imageFamily = imageFamilyValue; } private boolean isPremium; @@ -114,8 +122,9 @@ public void setImageFamily(String imageFamily) /** * Indicates if the image contains software or associated services that will * incur charges above the core price for the virtual machine. + * @return The IsPremium value. */ - public boolean getIsPremium() + public boolean isPremium() { return this.isPremium; } @@ -123,16 +132,18 @@ public boolean getIsPremium() /** * Indicates if the image contains software or associated services that will * incur charges above the core price for the virtual machine. + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(boolean isPremium) + public void setIsPremium(final boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; /** * Required. Specifies the friendly name of the image. + * @return The Label value. */ public String getLabel() { @@ -141,10 +152,11 @@ public String getLabel() /** * Required. Specifies the friendly name of the image. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String language; @@ -152,6 +164,7 @@ public void setLabel(String label) /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @return The Language value. */ public String getLanguage() { @@ -161,10 +174,11 @@ public String getLanguage() /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @param languageValue The Language value. */ - public void setLanguage(String language) + public void setLanguage(final String languageValue) { - this.language = language; + this.language = languageValue; } private URI mediaLinkUri; @@ -174,6 +188,7 @@ public void setLanguage(String language) * The blob location must belong to a storage account in the subscription * specified by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -185,10 +200,11 @@ public URI getMediaLinkUri() * The blob location must belong to a storage account in the subscription * specified by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -196,6 +212,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * Required. Specifies a name that Windows Azure uses to identify the image * when creating one or more virtual machines. + * @return The Name value. */ public String getName() { @@ -205,10 +222,11 @@ public String getName() /** * Required. Specifies a name that Windows Azure uses to identify the image * when creating one or more virtual machines. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystemType; @@ -216,6 +234,7 @@ public void setName(String name) /** * Required. The operating system type of the OS image. Possible values are: * Linux, Windows. + * @return The OperatingSystemType value. */ public String getOperatingSystemType() { @@ -225,10 +244,11 @@ public String getOperatingSystemType() /** * Required. The operating system type of the OS image. Possible values are: * Linux, Windows. + * @param operatingSystemTypeValue The OperatingSystemType value. */ - public void setOperatingSystemType(String operatingSystemType) + public void setOperatingSystemType(final String operatingSystemTypeValue) { - this.operatingSystemType = operatingSystemType; + this.operatingSystemType = operatingSystemTypeValue; } private URI privacyUri; @@ -236,6 +256,7 @@ public void setOperatingSystemType(String operatingSystemType) /** * Optional. Specifies the URI that points to a document that contains the * privacy policy related to the OS image. + * @return The PrivacyUri value. */ public URI getPrivacyUri() { @@ -245,10 +266,11 @@ public URI getPrivacyUri() /** * Optional. Specifies the URI that points to a document that contains the * privacy policy related to the OS image. + * @param privacyUriValue The PrivacyUri value. */ - public void setPrivacyUri(URI privacyUri) + public void setPrivacyUri(final URI privacyUriValue) { - this.privacyUri = privacyUri; + this.privacyUri = privacyUriValue; } private Calendar publishedDate; @@ -256,6 +278,7 @@ public void setPrivacyUri(URI privacyUri) /** * Optional. Specifies the date when the OS image was added to the image * repository. + * @return The PublishedDate value. */ public Calendar getPublishedDate() { @@ -265,19 +288,21 @@ public Calendar getPublishedDate() /** * Optional. Specifies the date when the OS image was added to the image * repository. + * @param publishedDateValue The PublishedDate value. */ - public void setPublishedDate(Calendar publishedDate) + public void setPublishedDate(final Calendar publishedDateValue) { - this.publishedDate = publishedDate; + this.publishedDate = publishedDateValue; } - private VirtualMachineRoleSize recommendedVMSize; + private String recommendedVMSize; /** * Optional. Specifies the size to use for the virtual machine that is * created from the OS image. + * @return The RecommendedVMSize value. */ - public VirtualMachineRoleSize getRecommendedVMSize() + public String getRecommendedVMSize() { return this.recommendedVMSize; } @@ -285,28 +310,31 @@ public VirtualMachineRoleSize getRecommendedVMSize() /** * Optional. Specifies the size to use for the virtual machine that is * created from the OS image. + * @param recommendedVMSizeValue The RecommendedVMSize value. */ - public void setRecommendedVMSize(VirtualMachineRoleSize recommendedVMSize) + public void setRecommendedVMSize(final String recommendedVMSizeValue) { - this.recommendedVMSize = recommendedVMSize; + this.recommendedVMSize = recommendedVMSizeValue; } private boolean showInGui; /** * Specifies whether the image should appear in the image gallery. + * @return The ShowInGui value. */ - public boolean getShowInGui() + public boolean isShowInGui() { return this.showInGui; } /** * Specifies whether the image should appear in the image gallery. + * @param showInGuiValue The ShowInGui value. */ - public void setShowInGui(boolean showInGui) + public void setShowInGui(final boolean showInGuiValue) { - this.showInGui = showInGui; + this.showInGui = showInGuiValue; } private URI smallIconUri; @@ -315,6 +343,7 @@ public void setShowInGui(boolean showInGui) * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @return The SmallIconUri value. */ public URI getSmallIconUri() { @@ -325,9 +354,10 @@ public URI getSmallIconUri() * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @param smallIconUriValue The SmallIconUri value. */ - public void setSmallIconUri(URI smallIconUri) + public void setSmallIconUri(final URI smallIconUriValue) { - this.smallIconUri = smallIconUri; + this.smallIconUri = smallIconUriValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageCreateResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageCreateResponse.java index 682b341d80059..eba108e521cb9 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageCreateResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageCreateResponse.java @@ -37,6 +37,7 @@ public class VirtualMachineImageCreateResponse extends OperationResponse /** * The repository classification of the image. All user images have the * category User. + * @return The Category value. */ public String getCategory() { @@ -46,16 +47,18 @@ public String getCategory() /** * The repository classification of the image. All user images have the * category User. + * @param categoryValue The Category value. */ - public void setCategory(String category) + public void setCategory(final String categoryValue) { - this.category = category; + this.category = categoryValue; } private String description; /** * Specifies the description of the OS image. + * @return The Description value. */ public String getDescription() { @@ -64,10 +67,11 @@ public String getDescription() /** * Specifies the description of the OS image. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String eula; @@ -76,6 +80,7 @@ public void setDescription(String description) * Specifies the End User License Agreement that is associated with the * image. The value for this element is a string, but it is recommended * that the value be a URL that points to a EULA. + * @return The Eula value. */ public String getEula() { @@ -86,10 +91,11 @@ public String getEula() * Specifies the End User License Agreement that is associated with the * image. The value for this element is a string, but it is recommended * that the value be a URL that points to a EULA. + * @param eulaValue The Eula value. */ - public void setEula(String eula) + public void setEula(final String eulaValue) { - this.eula = eula; + this.eula = eulaValue; } private URI iconUri; @@ -97,6 +103,7 @@ public void setEula(String eula) /** * Specifies the Uri to the icon that is displayed for the image in the * Management Portal. + * @return The IconUri value. */ public URI getIconUri() { @@ -106,16 +113,18 @@ public URI getIconUri() /** * Specifies the Uri to the icon that is displayed for the image in the * Management Portal. + * @param iconUriValue The IconUri value. */ - public void setIconUri(URI iconUri) + public void setIconUri(final URI iconUriValue) { - this.iconUri = iconUri; + this.iconUri = iconUriValue; } private String imageFamily; /** * Specifies a value that can be used to group OS images. + * @return The ImageFamily value. */ public String getImageFamily() { @@ -124,10 +133,11 @@ public String getImageFamily() /** * Specifies a value that can be used to group OS images. + * @param imageFamilyValue The ImageFamily value. */ - public void setImageFamily(String imageFamily) + public void setImageFamily(final String imageFamilyValue) { - this.imageFamily = imageFamily; + this.imageFamily = imageFamilyValue; } private Boolean isPremium; @@ -135,8 +145,9 @@ public void setImageFamily(String imageFamily) /** * Indicates if the image contains software or associated services that will * incur charges above the core price for the virtual machine. + * @return The IsPremium value. */ - public Boolean getIsPremium() + public Boolean isPremium() { return this.isPremium; } @@ -144,16 +155,18 @@ public Boolean getIsPremium() /** * Indicates if the image contains software or associated services that will * incur charges above the core price for the virtual machine. + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(Boolean isPremium) + public void setIsPremium(final Boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; /** * Specifies the friendly name of the image. + * @return The Label value. */ public String getLabel() { @@ -162,10 +175,11 @@ public String getLabel() /** * Specifies the friendly name of the image. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String language; @@ -173,6 +187,7 @@ public void setLabel(String label) /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @return The Language value. */ public String getLanguage() { @@ -182,10 +197,11 @@ public String getLanguage() /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @param languageValue The Language value. */ - public void setLanguage(String language) + public void setLanguage(final String languageValue) { - this.language = language; + this.language = languageValue; } private String location; @@ -197,6 +213,7 @@ public void setLanguage(String language) * value is NULL. If the version is set to 2012-08-01 or later, the * locations are returned for platform images; otherwise, this value is * NULL for platform images. + * @return The Location value. */ public String getLocation() { @@ -210,16 +227,18 @@ public String getLocation() * value is NULL. If the version is set to 2012-08-01 or later, the * locations are returned for platform images; otherwise, this value is * NULL for platform images. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private double logicalSizeInGB; /** * The size, in GB, of the image. + * @return The LogicalSizeInGB value. */ public double getLogicalSizeInGB() { @@ -228,10 +247,11 @@ public double getLogicalSizeInGB() /** * The size, in GB, of the image. + * @param logicalSizeInGBValue The LogicalSizeInGB value. */ - public void setLogicalSizeInGB(double logicalSizeInGB) + public void setLogicalSizeInGB(final double logicalSizeInGBValue) { - this.logicalSizeInGB = logicalSizeInGB; + this.logicalSizeInGB = logicalSizeInGBValue; } private URI mediaLinkUri; @@ -241,6 +261,7 @@ public void setLogicalSizeInGB(double logicalSizeInGB) * location must belong to a storage account in the subscription specified * by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -252,10 +273,11 @@ public URI getMediaLinkUri() * location must belong to a storage account in the subscription specified * by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -263,6 +285,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * Specifies a name that Windows Azure uses to identify the image when * creating one or more virtual machines. + * @return The Name value. */ public String getName() { @@ -272,10 +295,11 @@ public String getName() /** * Specifies a name that Windows Azure uses to identify the image when * creating one or more virtual machines. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystemType; @@ -283,6 +307,7 @@ public void setName(String name) /** * The operating system type of the OS image. Possible values are: Linux, * Windows. + * @return The OperatingSystemType value. */ public String getOperatingSystemType() { @@ -292,10 +317,11 @@ public String getOperatingSystemType() /** * The operating system type of the OS image. Possible values are: Linux, * Windows. + * @param operatingSystemTypeValue The OperatingSystemType value. */ - public void setOperatingSystemType(String operatingSystemType) + public void setOperatingSystemType(final String operatingSystemTypeValue) { - this.operatingSystemType = operatingSystemType; + this.operatingSystemType = operatingSystemTypeValue; } private URI privacyUri; @@ -303,6 +329,7 @@ public void setOperatingSystemType(String operatingSystemType) /** * Specifies the URI that points to a document that contains the privacy * policy related to the OS image. + * @return The PrivacyUri value. */ public URI getPrivacyUri() { @@ -312,16 +339,18 @@ public URI getPrivacyUri() /** * Specifies the URI that points to a document that contains the privacy * policy related to the OS image. + * @param privacyUriValue The PrivacyUri value. */ - public void setPrivacyUri(URI privacyUri) + public void setPrivacyUri(final URI privacyUriValue) { - this.privacyUri = privacyUri; + this.privacyUri = privacyUriValue; } private Calendar publishedDate; /** * Specifies the date when the OS image was added to the image repository. + * @return The PublishedDate value. */ public Calendar getPublishedDate() { @@ -330,16 +359,18 @@ public Calendar getPublishedDate() /** * Specifies the date when the OS image was added to the image repository. + * @param publishedDateValue The PublishedDate value. */ - public void setPublishedDate(Calendar publishedDate) + public void setPublishedDate(final Calendar publishedDateValue) { - this.publishedDate = publishedDate; + this.publishedDate = publishedDateValue; } private String publisherName; /** * Specifies the name of the publisher of the image. + * @return The PublisherName value. */ public String getPublisherName() { @@ -348,19 +379,21 @@ public String getPublisherName() /** * Specifies the name of the publisher of the image. + * @param publisherNameValue The PublisherName value. */ - public void setPublisherName(String publisherName) + public void setPublisherName(final String publisherNameValue) { - this.publisherName = publisherName; + this.publisherName = publisherNameValue; } - private VirtualMachineRoleSize recommendedVMSize; + private String recommendedVMSize; /** * Specifies the size to use for the virtual machine that is created from * the OS image. + * @return The RecommendedVMSize value. */ - public VirtualMachineRoleSize getRecommendedVMSize() + public String getRecommendedVMSize() { return this.recommendedVMSize; } @@ -368,28 +401,31 @@ public VirtualMachineRoleSize getRecommendedVMSize() /** * Specifies the size to use for the virtual machine that is created from * the OS image. + * @param recommendedVMSizeValue The RecommendedVMSize value. */ - public void setRecommendedVMSize(VirtualMachineRoleSize recommendedVMSize) + public void setRecommendedVMSize(final String recommendedVMSizeValue) { - this.recommendedVMSize = recommendedVMSize; + this.recommendedVMSize = recommendedVMSizeValue; } private Boolean showInGui; /** * Specifies whether the image should appear in the image gallery. + * @return The ShowInGui value. */ - public Boolean getShowInGui() + public Boolean isShowInGui() { return this.showInGui; } /** * Specifies whether the image should appear in the image gallery. + * @param showInGuiValue The ShowInGui value. */ - public void setShowInGui(Boolean showInGui) + public void setShowInGui(final Boolean showInGuiValue) { - this.showInGui = showInGui; + this.showInGui = showInGuiValue; } private URI smallIconUri; @@ -398,6 +434,7 @@ public void setShowInGui(Boolean showInGui) * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @return The SmallIconUri value. */ public URI getSmallIconUri() { @@ -408,9 +445,10 @@ public URI getSmallIconUri() * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @param smallIconUriValue The SmallIconUri value. */ - public void setSmallIconUri(URI smallIconUri) + public void setSmallIconUri(final URI smallIconUriValue) { - this.smallIconUri = smallIconUri; + this.smallIconUri = smallIconUriValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageGetResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageGetResponse.java index d594eb30a8983..6e08202391f0f 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageGetResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageGetResponse.java @@ -40,6 +40,7 @@ public class VirtualMachineImageGetResponse extends OperationResponse * is located. If the storage account does not belong to an affinity group * the value is NULL and the element is not displayed in the response. * This value is NULL for platform images. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -52,10 +53,11 @@ public String getAffinityGroup() * is located. If the storage account does not belong to an affinity group * the value is NULL and the element is not displayed in the response. * This value is NULL for platform images. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private String category; @@ -63,6 +65,7 @@ public void setAffinityGroup(String affinityGroup) /** * The repository classification of the image. All user images have the * category User. + * @return The Category value. */ public String getCategory() { @@ -72,16 +75,18 @@ public String getCategory() /** * The repository classification of the image. All user images have the * category User. + * @param categoryValue The Category value. */ - public void setCategory(String category) + public void setCategory(final String categoryValue) { - this.category = category; + this.category = categoryValue; } private String description; /** * Specifies the description of the image. + * @return The Description value. */ public String getDescription() { @@ -90,10 +95,11 @@ public String getDescription() /** * Specifies the description of the image. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String eula; @@ -102,6 +108,7 @@ public void setDescription(String description) * Specifies the End User License Agreement that is associated with the * image. The value for this element is a string, but it is recommended * that the value be a URL that points to a EULA. + * @return The Eula value. */ public String getEula() { @@ -112,16 +119,18 @@ public String getEula() * Specifies the End User License Agreement that is associated with the * image. The value for this element is a string, but it is recommended * that the value be a URL that points to a EULA. + * @param eulaValue The Eula value. */ - public void setEula(String eula) + public void setEula(final String eulaValue) { - this.eula = eula; + this.eula = eulaValue; } private URI iconUri; /** * Provides the URI to the icon for this Operating System Image. + * @return The IconUri value. */ public URI getIconUri() { @@ -130,16 +139,18 @@ public URI getIconUri() /** * Provides the URI to the icon for this Operating System Image. + * @param iconUriValue The IconUri value. */ - public void setIconUri(URI iconUri) + public void setIconUri(final URI iconUriValue) { - this.iconUri = iconUri; + this.iconUri = iconUriValue; } private String imageFamily; /** * Specifies a value that can be used to group images. + * @return The ImageFamily value. */ public String getImageFamily() { @@ -148,10 +159,11 @@ public String getImageFamily() /** * Specifies a value that can be used to group images. + * @param imageFamilyValue The ImageFamily value. */ - public void setImageFamily(String imageFamily) + public void setImageFamily(final String imageFamilyValue) { - this.imageFamily = imageFamily; + this.imageFamily = imageFamilyValue; } private Boolean isPremium; @@ -160,8 +172,9 @@ public void setImageFamily(String imageFamily) * Indicates whether the image contains software or associated services that * will incur charges above the core price for the virtual machine. For * additional details, see the PricingDetailLink element. + * @return The IsPremium value. */ - public Boolean getIsPremium() + public Boolean isPremium() { return this.isPremium; } @@ -170,16 +183,18 @@ public Boolean getIsPremium() * Indicates whether the image contains software or associated services that * will incur charges above the core price for the virtual machine. For * additional details, see the PricingDetailLink element. + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(Boolean isPremium) + public void setIsPremium(final Boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; /** * An identifier for the image. + * @return The Label value. */ public String getLabel() { @@ -188,10 +203,11 @@ public String getLabel() /** * An identifier for the image. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String language; @@ -199,6 +215,7 @@ public void setLabel(String label) /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @return The Language value. */ public String getLanguage() { @@ -208,10 +225,11 @@ public String getLanguage() /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @param languageValue The Language value. */ - public void setLanguage(String language) + public void setLanguage(final String languageValue) { - this.language = language; + this.language = languageValue; } private String location; @@ -223,6 +241,7 @@ public void setLanguage(String language) * value is NULL. If the version is set to 2012-08-01 or later, the * locations are returned for platform images; otherwise, this value is * NULL for platform images. + * @return The Location value. */ public String getLocation() { @@ -236,16 +255,18 @@ public String getLocation() * value is NULL. If the version is set to 2012-08-01 or later, the * locations are returned for platform images; otherwise, this value is * NULL for platform images. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private double logicalSizeInGB; /** * The size, in GB, of the image. + * @return The LogicalSizeInGB value. */ public double getLogicalSizeInGB() { @@ -254,10 +275,11 @@ public double getLogicalSizeInGB() /** * The size, in GB, of the image. + * @param logicalSizeInGBValue The LogicalSizeInGB value. */ - public void setLogicalSizeInGB(double logicalSizeInGB) + public void setLogicalSizeInGB(final double logicalSizeInGBValue) { - this.logicalSizeInGB = logicalSizeInGB; + this.logicalSizeInGB = logicalSizeInGBValue; } private URI mediaLinkUri; @@ -267,6 +289,7 @@ public void setLogicalSizeInGB(double logicalSizeInGB) * belongs to a storage account in the subscription specified by the * SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/myimage.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -278,10 +301,11 @@ public URI getMediaLinkUri() * belongs to a storage account in the subscription specified by the * SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/myimage.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -289,6 +313,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * The name of the operating system image. This is the name that is used * when creating one or more virtual machines using the image. + * @return The Name value. */ public String getName() { @@ -298,10 +323,11 @@ public String getName() /** * The name of the operating system image. This is the name that is used * when creating one or more virtual machines using the image. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystemType; @@ -309,6 +335,7 @@ public void setName(String name) /** * The operating system type of the OS image. Possible values are: Linux, * Windows. + * @return The OperatingSystemType value. */ public String getOperatingSystemType() { @@ -318,10 +345,11 @@ public String getOperatingSystemType() /** * The operating system type of the OS image. Possible values are: Linux, * Windows. + * @param operatingSystemTypeValue The OperatingSystemType value. */ - public void setOperatingSystemType(String operatingSystemType) + public void setOperatingSystemType(final String operatingSystemTypeValue) { - this.operatingSystemType = operatingSystemType; + this.operatingSystemType = operatingSystemTypeValue; } private URI privacyUri; @@ -329,6 +357,7 @@ public void setOperatingSystemType(String operatingSystemType) /** * Specifies the URI that points to a document that contains the privacy * policy related to the image. + * @return The PrivacyUri value. */ public URI getPrivacyUri() { @@ -338,16 +367,18 @@ public URI getPrivacyUri() /** * Specifies the URI that points to a document that contains the privacy * policy related to the image. + * @param privacyUriValue The PrivacyUri value. */ - public void setPrivacyUri(URI privacyUri) + public void setPrivacyUri(final URI privacyUriValue) { - this.privacyUri = privacyUri; + this.privacyUri = privacyUriValue; } private Calendar publishedDate; /** * Specifies the date when the image was added to the image repository. + * @return The PublishedDate value. */ public Calendar getPublishedDate() { @@ -356,16 +387,18 @@ public Calendar getPublishedDate() /** * Specifies the date when the image was added to the image repository. + * @param publishedDateValue The PublishedDate value. */ - public void setPublishedDate(Calendar publishedDate) + public void setPublishedDate(final Calendar publishedDateValue) { - this.publishedDate = publishedDate; + this.publishedDate = publishedDateValue; } private String publisherName; /** * The name of the publisher of this OS Image in Windows Azure. + * @return The PublisherName value. */ public String getPublisherName() { @@ -374,19 +407,21 @@ public String getPublisherName() /** * The name of the publisher of this OS Image in Windows Azure. + * @param publisherNameValue The PublisherName value. */ - public void setPublisherName(String publisherName) + public void setPublisherName(final String publisherNameValue) { - this.publisherName = publisherName; + this.publisherName = publisherNameValue; } - private VirtualMachineRoleSize recommendedVMSize; + private String recommendedVMSize; /** * Optional. Specifies the size to use for the virtual machine that is * created from the OS image. + * @return The RecommendedVMSize value. */ - public VirtualMachineRoleSize getRecommendedVMSize() + public String getRecommendedVMSize() { return this.recommendedVMSize; } @@ -394,28 +429,31 @@ public VirtualMachineRoleSize getRecommendedVMSize() /** * Optional. Specifies the size to use for the virtual machine that is * created from the OS image. + * @param recommendedVMSizeValue The RecommendedVMSize value. */ - public void setRecommendedVMSize(VirtualMachineRoleSize recommendedVMSize) + public void setRecommendedVMSize(final String recommendedVMSizeValue) { - this.recommendedVMSize = recommendedVMSize; + this.recommendedVMSize = recommendedVMSizeValue; } private Boolean showInGui; /** * Indicates whther the image should be shown in the windows azure portal. + * @return The ShowInGui value. */ - public Boolean getShowInGui() + public Boolean isShowInGui() { return this.showInGui; } /** * Indicates whther the image should be shown in the windows azure portal. + * @param showInGuiValue The ShowInGui value. */ - public void setShowInGui(Boolean showInGui) + public void setShowInGui(final Boolean showInGuiValue) { - this.showInGui = showInGui; + this.showInGui = showInGuiValue; } private URI smallIconUri; @@ -424,6 +462,7 @@ public void setShowInGui(Boolean showInGui) * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @return The SmallIconUri value. */ public URI getSmallIconUri() { @@ -434,9 +473,10 @@ public URI getSmallIconUri() * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @param smallIconUriValue The SmallIconUri value. */ - public void setSmallIconUri(URI smallIconUri) + public void setSmallIconUri(final URI smallIconUriValue) { - this.smallIconUri = smallIconUri; + this.smallIconUri = smallIconUriValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageListResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageListResponse.java index 9a31f3da7d020..cf0ab5e04e8b7 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageListResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageListResponse.java @@ -38,6 +38,7 @@ public class VirtualMachineImageListResponse extends OperationResponse implement /** * The virtual machine images associated with your subscription. + * @return The Images value. */ public ArrayList getImages() { @@ -46,10 +47,11 @@ public ArrayList getImages( /** * The virtual machine images associated with your subscription. + * @param imagesValue The Images value. */ - public void setImages(ArrayList images) + public void setImages(final ArrayList imagesValue) { - this.images = images; + this.images = imagesValue; } /** @@ -84,6 +86,7 @@ public static class VirtualMachineImage * media is located. If the storage account does not belong to an * affinity group the value is NULL and the element is not displayed in * the response. This value is NULL for platform images. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -96,10 +99,11 @@ public String getAffinityGroup() * media is located. If the storage account does not belong to an * affinity group the value is NULL and the element is not displayed in * the response. This value is NULL for platform images. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private String category; @@ -107,6 +111,7 @@ public void setAffinityGroup(String affinityGroup) /** * The repository classification of the image. All user images have the * category User. + * @return The Category value. */ public String getCategory() { @@ -116,16 +121,18 @@ public String getCategory() /** * The repository classification of the image. All user images have the * category User. + * @param categoryValue The Category value. */ - public void setCategory(String category) + public void setCategory(final String categoryValue) { - this.category = category; + this.category = categoryValue; } private String description; /** * Specifies the description of the image. + * @return The Description value. */ public String getDescription() { @@ -134,10 +141,11 @@ public String getDescription() /** * Specifies the description of the image. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String eula; @@ -146,6 +154,7 @@ public void setDescription(String description) * Specifies the End User License Agreement that is associated with the * image. The value for this element is a string, but it is recommended * that the value be a URL that points to a EULA. + * @return The Eula value. */ public String getEula() { @@ -156,16 +165,18 @@ public String getEula() * Specifies the End User License Agreement that is associated with the * image. The value for this element is a string, but it is recommended * that the value be a URL that points to a EULA. + * @param eulaValue The Eula value. */ - public void setEula(String eula) + public void setEula(final String eulaValue) { - this.eula = eula; + this.eula = eulaValue; } private String imageFamily; /** * Specifies a value that can be used to group images. + * @return The ImageFamily value. */ public String getImageFamily() { @@ -174,10 +185,11 @@ public String getImageFamily() /** * Specifies a value that can be used to group images. + * @param imageFamilyValue The ImageFamily value. */ - public void setImageFamily(String imageFamily) + public void setImageFamily(final String imageFamilyValue) { - this.imageFamily = imageFamily; + this.imageFamily = imageFamilyValue; } private Boolean isPremium; @@ -186,8 +198,9 @@ public void setImageFamily(String imageFamily) * Indicates whether the image contains software or associated services * that will incur charges above the core price for the virtual * machine. For additional details, see the PricingDetailLink element. + * @return The IsPremium value. */ - public Boolean getIsPremium() + public Boolean isPremium() { return this.isPremium; } @@ -196,16 +209,18 @@ public Boolean getIsPremium() * Indicates whether the image contains software or associated services * that will incur charges above the core price for the virtual * machine. For additional details, see the PricingDetailLink element. + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(Boolean isPremium) + public void setIsPremium(final Boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; /** * An identifier for the image. + * @return The Label value. */ public String getLabel() { @@ -214,10 +229,11 @@ public String getLabel() /** * An identifier for the image. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String language; @@ -225,6 +241,7 @@ public void setLabel(String label) /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @return The Language value. */ public String getLanguage() { @@ -234,10 +251,11 @@ public String getLanguage() /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @param languageValue The Language value. */ - public void setLanguage(String language) + public void setLanguage(final String languageValue) { - this.language = language; + this.language = languageValue; } private String location; @@ -249,6 +267,7 @@ public void setLanguage(String language) * group the value is NULL. If the version is set to 2012-08-01 or * later, the locations are returned for platform images; otherwise, * this value is NULL for platform images. + * @return The Location value. */ public String getLocation() { @@ -262,16 +281,18 @@ public String getLocation() * group the value is NULL. If the version is set to 2012-08-01 or * later, the locations are returned for platform images; otherwise, * this value is NULL for platform images. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private double logicalSizeInGB; /** * The size, in GB, of the image. + * @return The LogicalSizeInGB value. */ public double getLogicalSizeInGB() { @@ -280,10 +301,11 @@ public double getLogicalSizeInGB() /** * The size, in GB, of the image. + * @param logicalSizeInGBValue The LogicalSizeInGB value. */ - public void setLogicalSizeInGB(double logicalSizeInGB) + public void setLogicalSizeInGB(final double logicalSizeInGBValue) { - this.logicalSizeInGB = logicalSizeInGB; + this.logicalSizeInGB = logicalSizeInGBValue; } private URI mediaLinkUri; @@ -293,6 +315,7 @@ public void setLogicalSizeInGB(double logicalSizeInGB) * belongs to a storage account in the subscription specified by the * SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/myimage.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -304,10 +327,11 @@ public URI getMediaLinkUri() * belongs to a storage account in the subscription specified by the * SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/myimage.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -315,6 +339,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * The name of the operating system image. This is the name that is used * when creating one or more virtual machines using the image. + * @return The Name value. */ public String getName() { @@ -324,10 +349,11 @@ public String getName() /** * The name of the operating system image. This is the name that is used * when creating one or more virtual machines using the image. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystemType; @@ -335,6 +361,7 @@ public void setName(String name) /** * The operating system type of the OS image. Possible values are: * Linux, Windows. + * @return The OperatingSystemType value. */ public String getOperatingSystemType() { @@ -344,10 +371,11 @@ public String getOperatingSystemType() /** * The operating system type of the OS image. Possible values are: * Linux, Windows. + * @param operatingSystemTypeValue The OperatingSystemType value. */ - public void setOperatingSystemType(String operatingSystemType) + public void setOperatingSystemType(final String operatingSystemTypeValue) { - this.operatingSystemType = operatingSystemType; + this.operatingSystemType = operatingSystemTypeValue; } private URI pricingDetailUri; @@ -357,6 +385,7 @@ public void setOperatingSystemType(String operatingSystemType) * contains the pricing details for a virtual machine that is created * from the image. The PricingDetailLink element is only available * using version 2012-12-01 or higher. + * @return The PricingDetailUri value. */ public URI getPricingDetailUri() { @@ -368,10 +397,11 @@ public URI getPricingDetailUri() * contains the pricing details for a virtual machine that is created * from the image. The PricingDetailLink element is only available * using version 2012-12-01 or higher. + * @param pricingDetailUriValue The PricingDetailUri value. */ - public void setPricingDetailUri(URI pricingDetailUri) + public void setPricingDetailUri(final URI pricingDetailUriValue) { - this.pricingDetailUri = pricingDetailUri; + this.pricingDetailUri = pricingDetailUriValue; } private URI privacyUri; @@ -379,6 +409,7 @@ public void setPricingDetailUri(URI pricingDetailUri) /** * Specifies the URI that points to a document that contains the privacy * policy related to the image. + * @return The PrivacyUri value. */ public URI getPrivacyUri() { @@ -388,16 +419,18 @@ public URI getPrivacyUri() /** * Specifies the URI that points to a document that contains the privacy * policy related to the image. + * @param privacyUriValue The PrivacyUri value. */ - public void setPrivacyUri(URI privacyUri) + public void setPrivacyUri(final URI privacyUriValue) { - this.privacyUri = privacyUri; + this.privacyUri = privacyUriValue; } private Calendar publishedDate; /** * Specifies the date when the image was added to the image repository. + * @return The PublishedDate value. */ public Calendar getPublishedDate() { @@ -406,16 +439,18 @@ public Calendar getPublishedDate() /** * Specifies the date when the image was added to the image repository. + * @param publishedDateValue The PublishedDate value. */ - public void setPublishedDate(Calendar publishedDate) + public void setPublishedDate(final Calendar publishedDateValue) { - this.publishedDate = publishedDate; + this.publishedDate = publishedDateValue; } private String publisherName; /** * The name of the publisher of this OS Image in Windows Azure. + * @return The PublisherName value. */ public String getPublisherName() { @@ -424,19 +459,21 @@ public String getPublisherName() /** * The name of the publisher of this OS Image in Windows Azure. + * @param publisherNameValue The PublisherName value. */ - public void setPublisherName(String publisherName) + public void setPublisherName(final String publisherNameValue) { - this.publisherName = publisherName; + this.publisherName = publisherNameValue; } - private VirtualMachineRoleSize recommendedVMSize; + private String recommendedVMSize; /** * Optional. Specifies the size to use for the virtual machine that is * created from the OS image. + * @return The RecommendedVMSize value. */ - public VirtualMachineRoleSize getRecommendedVMSize() + public String getRecommendedVMSize() { return this.recommendedVMSize; } @@ -444,10 +481,11 @@ public VirtualMachineRoleSize getRecommendedVMSize() /** * Optional. Specifies the size to use for the virtual machine that is * created from the OS image. + * @param recommendedVMSizeValue The RecommendedVMSize value. */ - public void setRecommendedVMSize(VirtualMachineRoleSize recommendedVMSize) + public void setRecommendedVMSize(final String recommendedVMSizeValue) { - this.recommendedVMSize = recommendedVMSize; + this.recommendedVMSize = recommendedVMSizeValue; } private URI smallIconUri; @@ -457,6 +495,7 @@ public void setRecommendedVMSize(VirtualMachineRoleSize recommendedVMSize) * is presented in the Windows Azure Management Portal. The * SmallIconUri element is only available using version 2013-03-01 or * higher. + * @return The SmallIconUri value. */ public URI getSmallIconUri() { @@ -468,10 +507,11 @@ public URI getSmallIconUri() * is presented in the Windows Azure Management Portal. The * SmallIconUri element is only available using version 2013-03-01 or * higher. + * @param smallIconUriValue The SmallIconUri value. */ - public void setSmallIconUri(URI smallIconUri) + public void setSmallIconUri(final URI smallIconUriValue) { - this.smallIconUri = smallIconUri; + this.smallIconUri = smallIconUriValue; } } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageUpdateParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageUpdateParameters.java index c8b8576d93271..40d91f795b920 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageUpdateParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageUpdateParameters.java @@ -35,6 +35,7 @@ public class VirtualMachineImageUpdateParameters /** * Optional. Specifies the description of the OS image. + * @return The Description value. */ public String getDescription() { @@ -43,10 +44,11 @@ public String getDescription() /** * Optional. Specifies the description of the OS image. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String eula; @@ -55,6 +57,7 @@ public void setDescription(String description) * Optional. Specifies the End User License Agreement that is associated * with the image. The value for this element is a string, but it is * recommended that the value be a URL that points to a EULA. + * @return The Eula value. */ public String getEula() { @@ -65,10 +68,11 @@ public String getEula() * Optional. Specifies the End User License Agreement that is associated * with the image. The value for this element is a string, but it is * recommended that the value be a URL that points to a EULA. + * @param eulaValue The Eula value. */ - public void setEula(String eula) + public void setEula(final String eulaValue) { - this.eula = eula; + this.eula = eulaValue; } private URI iconUri; @@ -76,6 +80,7 @@ public void setEula(String eula) /** * Optional. Specifies the Uri to the icon that is displayed for the image * in the Management Portal. + * @return The IconUri value. */ public URI getIconUri() { @@ -85,16 +90,18 @@ public URI getIconUri() /** * Optional. Specifies the Uri to the icon that is displayed for the image * in the Management Portal. + * @param iconUriValue The IconUri value. */ - public void setIconUri(URI iconUri) + public void setIconUri(final URI iconUriValue) { - this.iconUri = iconUri; + this.iconUri = iconUriValue; } private String imageFamily; /** * Optional. Specifies a value that can be used to group OS images. + * @return The ImageFamily value. */ public String getImageFamily() { @@ -103,10 +110,11 @@ public String getImageFamily() /** * Optional. Specifies a value that can be used to group OS images. + * @param imageFamilyValue The ImageFamily value. */ - public void setImageFamily(String imageFamily) + public void setImageFamily(final String imageFamilyValue) { - this.imageFamily = imageFamily; + this.imageFamily = imageFamilyValue; } private boolean isPremium; @@ -114,8 +122,9 @@ public void setImageFamily(String imageFamily) /** * Indicates if the image contains software or associated services that will * incur charges above the core price for the virtual machine. + * @return The IsPremium value. */ - public boolean getIsPremium() + public boolean isPremium() { return this.isPremium; } @@ -123,10 +132,11 @@ public boolean getIsPremium() /** * Indicates if the image contains software or associated services that will * incur charges above the core price for the virtual machine. + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(boolean isPremium) + public void setIsPremium(final boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; @@ -135,6 +145,7 @@ public void setIsPremium(boolean isPremium) * Required. Specifies the friendly name of the image to be updated. You * cannot use this operation to update images provided by the Windows Azure * platform. + * @return The Label value. */ public String getLabel() { @@ -145,10 +156,11 @@ public String getLabel() * Required. Specifies the friendly name of the image to be updated. You * cannot use this operation to update images provided by the Windows Azure * platform. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String language; @@ -156,6 +168,7 @@ public void setLabel(String label) /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @return The Language value. */ public String getLanguage() { @@ -165,10 +178,11 @@ public String getLanguage() /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @param languageValue The Language value. */ - public void setLanguage(String language) + public void setLanguage(final String languageValue) { - this.language = language; + this.language = languageValue; } private URI privacyUri; @@ -176,6 +190,7 @@ public void setLanguage(String language) /** * Optional. Specifies the URI that points to a document that contains the * privacy policy related to the OS image. + * @return The PrivacyUri value. */ public URI getPrivacyUri() { @@ -185,10 +200,11 @@ public URI getPrivacyUri() /** * Optional. Specifies the URI that points to a document that contains the * privacy policy related to the OS image. + * @param privacyUriValue The PrivacyUri value. */ - public void setPrivacyUri(URI privacyUri) + public void setPrivacyUri(final URI privacyUriValue) { - this.privacyUri = privacyUri; + this.privacyUri = privacyUriValue; } private Calendar publishedDate; @@ -196,6 +212,7 @@ public void setPrivacyUri(URI privacyUri) /** * Optional. Specifies the date when the OS image was added to the image * repository. + * @return The PublishedDate value. */ public Calendar getPublishedDate() { @@ -205,19 +222,21 @@ public Calendar getPublishedDate() /** * Optional. Specifies the date when the OS image was added to the image * repository. + * @param publishedDateValue The PublishedDate value. */ - public void setPublishedDate(Calendar publishedDate) + public void setPublishedDate(final Calendar publishedDateValue) { - this.publishedDate = publishedDate; + this.publishedDate = publishedDateValue; } - private VirtualMachineRoleSize recommendedVMSize; + private String recommendedVMSize; /** * Optional. Specifies the size to use for the virtual machine that is * created from the OS image. + * @return The RecommendedVMSize value. */ - public VirtualMachineRoleSize getRecommendedVMSize() + public String getRecommendedVMSize() { return this.recommendedVMSize; } @@ -225,10 +244,11 @@ public VirtualMachineRoleSize getRecommendedVMSize() /** * Optional. Specifies the size to use for the virtual machine that is * created from the OS image. + * @param recommendedVMSizeValue The RecommendedVMSize value. */ - public void setRecommendedVMSize(VirtualMachineRoleSize recommendedVMSize) + public void setRecommendedVMSize(final String recommendedVMSizeValue) { - this.recommendedVMSize = recommendedVMSize; + this.recommendedVMSize = recommendedVMSizeValue; } private URI smallIconUri; @@ -237,6 +257,7 @@ public void setRecommendedVMSize(VirtualMachineRoleSize recommendedVMSize) * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @return The SmallIconUri value. */ public URI getSmallIconUri() { @@ -247,9 +268,10 @@ public URI getSmallIconUri() * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @param smallIconUriValue The SmallIconUri value. */ - public void setSmallIconUri(URI smallIconUri) + public void setSmallIconUri(final URI smallIconUriValue) { - this.smallIconUri = smallIconUri; + this.smallIconUri = smallIconUriValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageUpdateResponse.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageUpdateResponse.java index 738d81c662446..5aefb5fd90676 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageUpdateResponse.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineImageUpdateResponse.java @@ -37,6 +37,7 @@ public class VirtualMachineImageUpdateResponse extends OperationResponse /** * The repository classification of the image. All user images have the * category User. + * @return The Category value. */ public String getCategory() { @@ -46,16 +47,18 @@ public String getCategory() /** * The repository classification of the image. All user images have the * category User. + * @param categoryValue The Category value. */ - public void setCategory(String category) + public void setCategory(final String categoryValue) { - this.category = category; + this.category = categoryValue; } private String description; /** * Specifies the description of the OS image. + * @return The Description value. */ public String getDescription() { @@ -64,10 +67,11 @@ public String getDescription() /** * Specifies the description of the OS image. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String eula; @@ -76,6 +80,7 @@ public void setDescription(String description) * Specifies the End User License Agreement that is associated with the * image. The value for this element is a string, but it is recommended * that the value be a URL that points to a EULA. + * @return The Eula value. */ public String getEula() { @@ -86,10 +91,11 @@ public String getEula() * Specifies the End User License Agreement that is associated with the * image. The value for this element is a string, but it is recommended * that the value be a URL that points to a EULA. + * @param eulaValue The Eula value. */ - public void setEula(String eula) + public void setEula(final String eulaValue) { - this.eula = eula; + this.eula = eulaValue; } private URI iconUri; @@ -97,6 +103,7 @@ public void setEula(String eula) /** * Specifies the Uri to the icon that is displayed for the image in the * Management Portal. + * @return The IconUri value. */ public URI getIconUri() { @@ -106,16 +113,18 @@ public URI getIconUri() /** * Specifies the Uri to the icon that is displayed for the image in the * Management Portal. + * @param iconUriValue The IconUri value. */ - public void setIconUri(URI iconUri) + public void setIconUri(final URI iconUriValue) { - this.iconUri = iconUri; + this.iconUri = iconUriValue; } private String imageFamily; /** * Specifies a value that can be used to group OS images. + * @return The ImageFamily value. */ public String getImageFamily() { @@ -124,10 +133,11 @@ public String getImageFamily() /** * Specifies a value that can be used to group OS images. + * @param imageFamilyValue The ImageFamily value. */ - public void setImageFamily(String imageFamily) + public void setImageFamily(final String imageFamilyValue) { - this.imageFamily = imageFamily; + this.imageFamily = imageFamilyValue; } private Boolean isPremium; @@ -135,8 +145,9 @@ public void setImageFamily(String imageFamily) /** * Indicates if the image contains software or associated services that will * incur charges above the core price for the virtual machine. + * @return The IsPremium value. */ - public Boolean getIsPremium() + public Boolean isPremium() { return this.isPremium; } @@ -144,16 +155,18 @@ public Boolean getIsPremium() /** * Indicates if the image contains software or associated services that will * incur charges above the core price for the virtual machine. + * @param isPremiumValue The IsPremium value. */ - public void setIsPremium(Boolean isPremium) + public void setIsPremium(final Boolean isPremiumValue) { - this.isPremium = isPremium; + this.isPremium = isPremiumValue; } private String label; /** * Specifies the friendly name of the image. + * @return The Label value. */ public String getLabel() { @@ -162,10 +175,11 @@ public String getLabel() /** * Specifies the friendly name of the image. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String language; @@ -173,6 +187,7 @@ public void setLabel(String label) /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @return The Language value. */ public String getLanguage() { @@ -182,10 +197,11 @@ public String getLanguage() /** * Specifies the language of the image. The Language element is only * available using version 2013-03-01 or higher. + * @param languageValue The Language value. */ - public void setLanguage(String language) + public void setLanguage(final String languageValue) { - this.language = language; + this.language = languageValue; } private String location; @@ -197,6 +213,7 @@ public void setLanguage(String language) * value is NULL. If the version is set to 2012-08-01 or later, the * locations are returned for platform images; otherwise, this value is * NULL for platform images. + * @return The Location value. */ public String getLocation() { @@ -210,16 +227,18 @@ public String getLocation() * value is NULL. If the version is set to 2012-08-01 or later, the * locations are returned for platform images; otherwise, this value is * NULL for platform images. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private double logicalSizeInGB; /** * The size, in GB, of the image. + * @return The LogicalSizeInGB value. */ public double getLogicalSizeInGB() { @@ -228,10 +247,11 @@ public double getLogicalSizeInGB() /** * The size, in GB, of the image. + * @param logicalSizeInGBValue The LogicalSizeInGB value. */ - public void setLogicalSizeInGB(double logicalSizeInGB) + public void setLogicalSizeInGB(final double logicalSizeInGBValue) { - this.logicalSizeInGB = logicalSizeInGB; + this.logicalSizeInGB = logicalSizeInGBValue; } private URI mediaLinkUri; @@ -241,6 +261,7 @@ public void setLogicalSizeInGB(double logicalSizeInGB) * location must belong to a storage account in the subscription specified * by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @return The MediaLinkUri value. */ public URI getMediaLinkUri() { @@ -252,10 +273,11 @@ public URI getMediaLinkUri() * location must belong to a storage account in the subscription specified * by the SubscriptionId value in the operation call. Example: * http://example.blob.core.windows.net/disks/mydisk.vhd + * @param mediaLinkUriValue The MediaLinkUri value. */ - public void setMediaLinkUri(URI mediaLinkUri) + public void setMediaLinkUri(final URI mediaLinkUriValue) { - this.mediaLinkUri = mediaLinkUri; + this.mediaLinkUri = mediaLinkUriValue; } private String name; @@ -263,6 +285,7 @@ public void setMediaLinkUri(URI mediaLinkUri) /** * Specifies a name that Windows Azure uses to identify the image when * creating one or more virtual machines. + * @return The Name value. */ public String getName() { @@ -272,10 +295,11 @@ public String getName() /** * Specifies a name that Windows Azure uses to identify the image when * creating one or more virtual machines. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String operatingSystemType; @@ -283,6 +307,7 @@ public void setName(String name) /** * The operating system type of the OS image. Possible values are: Linux, * Windows. + * @return The OperatingSystemType value. */ public String getOperatingSystemType() { @@ -292,10 +317,11 @@ public String getOperatingSystemType() /** * The operating system type of the OS image. Possible values are: Linux, * Windows. + * @param operatingSystemTypeValue The OperatingSystemType value. */ - public void setOperatingSystemType(String operatingSystemType) + public void setOperatingSystemType(final String operatingSystemTypeValue) { - this.operatingSystemType = operatingSystemType; + this.operatingSystemType = operatingSystemTypeValue; } private URI privacyUri; @@ -303,6 +329,7 @@ public void setOperatingSystemType(String operatingSystemType) /** * Specifies the URI that points to a document that contains the privacy * policy related to the OS image. + * @return The PrivacyUri value. */ public URI getPrivacyUri() { @@ -312,16 +339,18 @@ public URI getPrivacyUri() /** * Specifies the URI that points to a document that contains the privacy * policy related to the OS image. + * @param privacyUriValue The PrivacyUri value. */ - public void setPrivacyUri(URI privacyUri) + public void setPrivacyUri(final URI privacyUriValue) { - this.privacyUri = privacyUri; + this.privacyUri = privacyUriValue; } private Calendar publishedDate; /** * Specifies the date when the OS image was added to the image repository. + * @return The PublishedDate value. */ public Calendar getPublishedDate() { @@ -330,16 +359,18 @@ public Calendar getPublishedDate() /** * Specifies the date when the OS image was added to the image repository. + * @param publishedDateValue The PublishedDate value. */ - public void setPublishedDate(Calendar publishedDate) + public void setPublishedDate(final Calendar publishedDateValue) { - this.publishedDate = publishedDate; + this.publishedDate = publishedDateValue; } private String publisherName; /** * Specifies the name of the publisher of the image. + * @return The PublisherName value. */ public String getPublisherName() { @@ -348,19 +379,21 @@ public String getPublisherName() /** * Specifies the name of the publisher of the image. + * @param publisherNameValue The PublisherName value. */ - public void setPublisherName(String publisherName) + public void setPublisherName(final String publisherNameValue) { - this.publisherName = publisherName; + this.publisherName = publisherNameValue; } - private VirtualMachineRoleSize recommendedVMSize; + private String recommendedVMSize; /** * Specifies the size to use for the virtual machine that is created from * the OS image. + * @return The RecommendedVMSize value. */ - public VirtualMachineRoleSize getRecommendedVMSize() + public String getRecommendedVMSize() { return this.recommendedVMSize; } @@ -368,28 +401,31 @@ public VirtualMachineRoleSize getRecommendedVMSize() /** * Specifies the size to use for the virtual machine that is created from * the OS image. + * @param recommendedVMSizeValue The RecommendedVMSize value. */ - public void setRecommendedVMSize(VirtualMachineRoleSize recommendedVMSize) + public void setRecommendedVMSize(final String recommendedVMSizeValue) { - this.recommendedVMSize = recommendedVMSize; + this.recommendedVMSize = recommendedVMSizeValue; } private Boolean showInGui; /** * Specifies whether the image should appear in the image gallery. + * @return The ShowInGui value. */ - public Boolean getShowInGui() + public Boolean isShowInGui() { return this.showInGui; } /** * Specifies whether the image should appear in the image gallery. + * @param showInGuiValue The ShowInGui value. */ - public void setShowInGui(Boolean showInGui) + public void setShowInGui(final Boolean showInGuiValue) { - this.showInGui = showInGui; + this.showInGui = showInGuiValue; } private URI smallIconUri; @@ -398,6 +434,7 @@ public void setShowInGui(Boolean showInGui) * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @return The SmallIconUri value. */ public URI getSmallIconUri() { @@ -408,9 +445,10 @@ public URI getSmallIconUri() * Specifies the URI to the small icon that is displayed when the image is * presented in the Windows Azure Management Portal. The SmallIconUri * element is only available using version 2013-03-01 or higher. + * @param smallIconUriValue The SmallIconUri value. */ - public void setSmallIconUri(URI smallIconUri) + public void setSmallIconUri(final URI smallIconUriValue) { - this.smallIconUri = smallIconUri; + this.smallIconUri = smallIconUriValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineRoleSize.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineRoleSize.java index a1ac3aa0fdbe4..b2cf5797fb7a7 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineRoleSize.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineRoleSize.java @@ -26,25 +26,25 @@ /** * The size of a virtual machine. */ -public enum VirtualMachineRoleSize +public class VirtualMachineRoleSize { - Small, + public static final String Small = "Small"; - ExtraSmall, + public static final String ExtraSmall = "ExtraSmall"; - Large, + public static final String Large = "Large"; - Medium, + public static final String Medium = "Medium"; - ExtraLarge, + public static final String ExtraLarge = "ExtraLarge"; - A5, + public static final String A5 = "A5"; - A6, + public static final String A6 = "A6"; - A7, + public static final String A7 = "A7"; - A8, + public static final String A8 = "A8"; - A9, + public static final String A9 = "A9"; } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineShutdownParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineShutdownParameters.java index 3c2f702f6c578..124af49824cd5 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineShutdownParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineShutdownParameters.java @@ -32,6 +32,7 @@ public class VirtualMachineShutdownParameters /** * The state of the vm after shotdown (stopped or stopped and deallocated) + * @return The PostShutdownAction value. */ public PostShutdownAction getPostShutdownAction() { @@ -40,9 +41,10 @@ public PostShutdownAction getPostShutdownAction() /** * The state of the vm after shotdown (stopped or stopped and deallocated) + * @param postShutdownActionValue The PostShutdownAction value. */ - public void setPostShutdownAction(PostShutdownAction postShutdownAction) + public void setPostShutdownAction(final PostShutdownAction postShutdownActionValue) { - this.postShutdownAction = postShutdownAction; + this.postShutdownAction = postShutdownActionValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineShutdownRolesParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineShutdownRolesParameters.java index 48fa31a05f3b0..7976987474ec4 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineShutdownRolesParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineShutdownRolesParameters.java @@ -35,6 +35,7 @@ public class VirtualMachineShutdownRolesParameters /** * The state of the roles after shutdown. Possible values include Stopped * or StoppedDeallocated + * @return The PostShutdownAction value. */ public PostShutdownAction getPostShutdownAction() { @@ -44,16 +45,18 @@ public PostShutdownAction getPostShutdownAction() /** * The state of the roles after shutdown. Possible values include Stopped * or StoppedDeallocated + * @param postShutdownActionValue The PostShutdownAction value. */ - public void setPostShutdownAction(PostShutdownAction postShutdownAction) + public void setPostShutdownAction(final PostShutdownAction postShutdownActionValue) { - this.postShutdownAction = postShutdownAction; + this.postShutdownAction = postShutdownActionValue; } private ArrayList roles; /** * The set of roles to shut down. + * @return The Roles value. */ public ArrayList getRoles() { @@ -62,10 +65,11 @@ public ArrayList getRoles() /** * The set of roles to shut down. + * @param rolesValue The Roles value. */ - public void setRoles(ArrayList roles) + public void setRoles(final ArrayList rolesValue) { - this.roles = roles; + this.roles = rolesValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineStartRolesParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineStartRolesParameters.java index 75bdde6326289..3a80f054cdc15 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineStartRolesParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineStartRolesParameters.java @@ -34,6 +34,7 @@ public class VirtualMachineStartRolesParameters /** * The set of roles to shut down. + * @return The Roles value. */ public ArrayList getRoles() { @@ -42,10 +43,11 @@ public ArrayList getRoles() /** * The set of roles to shut down. + * @param rolesValue The Roles value. */ - public void setRoles(ArrayList roles) + public void setRoles(final ArrayList rolesValue) { - this.roles = roles; + this.roles = rolesValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineUpdateLoadBalancedSetParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineUpdateLoadBalancedSetParameters.java index 4d45f7c0b6004..4f8537ea3a425 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineUpdateLoadBalancedSetParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineUpdateLoadBalancedSetParameters.java @@ -35,6 +35,7 @@ public class VirtualMachineUpdateLoadBalancedSetParameters /** * A list of load balanced InputEndpoints to update. + * @return The LoadBalancedEndpoints value. */ public ArrayList getLoadBalancedEndpoints() { @@ -43,10 +44,11 @@ public ArrayList ge /** * A list of load balanced InputEndpoints to update. + * @param loadBalancedEndpointsValue The LoadBalancedEndpoints value. */ - public void setLoadBalancedEndpoints(ArrayList loadBalancedEndpoints) + public void setLoadBalancedEndpoints(final ArrayList loadBalancedEndpointsValue) { - this.loadBalancedEndpoints = loadBalancedEndpoints; + this.loadBalancedEndpoints = loadBalancedEndpointsValue; } /** @@ -69,8 +71,9 @@ public static class InputEndpoint /** * Optional. A Boolean specifying whether this endpoint uses Direct * Server Return + * @return The EnableDirectServerReturn value. */ - public Boolean getEnableDirectServerReturn() + public Boolean isEnableDirectServerReturn() { return this.enableDirectServerReturn; } @@ -78,10 +81,12 @@ public Boolean getEnableDirectServerReturn() /** * Optional. A Boolean specifying whether this endpoint uses Direct * Server Return + * @param enableDirectServerReturnValue The EnableDirectServerReturn + * value. */ - public void setEnableDirectServerReturn(Boolean enableDirectServerReturn) + public void setEnableDirectServerReturn(final Boolean enableDirectServerReturnValue) { - this.enableDirectServerReturn = enableDirectServerReturn; + this.enableDirectServerReturn = enableDirectServerReturnValue; } private String loadBalancedEndpointSetName; @@ -93,6 +98,7 @@ public void setEnableDirectServerReturn(Boolean enableDirectServerReturn) * deployment (at least one role in the deployment must have an * endpoint whose LoadBalancedEndpointSetName matches this) otherwise * a BadRequest error will be returned. + * @return The LoadBalancedEndpointSetName value. */ public String getLoadBalancedEndpointSetName() { @@ -106,10 +112,12 @@ public String getLoadBalancedEndpointSetName() * deployment (at least one role in the deployment must have an * endpoint whose LoadBalancedEndpointSetName matches this) otherwise * a BadRequest error will be returned. + * @param loadBalancedEndpointSetNameValue The + * LoadBalancedEndpointSetName value. */ - public void setLoadBalancedEndpointSetName(String loadBalancedEndpointSetName) + public void setLoadBalancedEndpointSetName(final String loadBalancedEndpointSetNameValue) { - this.loadBalancedEndpointSetName = loadBalancedEndpointSetName; + this.loadBalancedEndpointSetName = loadBalancedEndpointSetNameValue; } private LoadBalancerProbe loadBalancerProbe; @@ -120,6 +128,7 @@ public void setLoadBalancedEndpointSetName(String loadBalancedEndpointSetName) * forwarding traffic to this endpoint. If not specified the probe * settings (if any) from the existing load balanced endpoint * definition will be retained. + * @return The LoadBalancerProbe value. */ public LoadBalancerProbe getLoadBalancerProbe() { @@ -132,10 +141,11 @@ public LoadBalancerProbe getLoadBalancerProbe() * forwarding traffic to this endpoint. If not specified the probe * settings (if any) from the existing load balanced endpoint * definition will be retained. + * @param loadBalancerProbeValue The LoadBalancerProbe value. */ - public void setLoadBalancerProbe(LoadBalancerProbe loadBalancerProbe) + public void setLoadBalancerProbe(final LoadBalancerProbe loadBalancerProbeValue) { - this.loadBalancerProbe = loadBalancerProbe; + this.loadBalancerProbe = loadBalancerProbeValue; } private Integer localPort; @@ -148,6 +158,7 @@ public void setLoadBalancerProbe(LoadBalancerProbe loadBalancerProbe) * load balanced endpoint specify this as 0 (zero) and if you need to * change those use UpdateRole. In case of port conflict with a local * port (or probe port) on a role a BadRequestwill be returned. + * @return The LocalPort value. */ public Integer getLocalPort() { @@ -162,10 +173,11 @@ public Integer getLocalPort() * load balanced endpoint specify this as 0 (zero) and if you need to * change those use UpdateRole. In case of port conflict with a local * port (or probe port) on a role a BadRequestwill be returned. + * @param localPortValue The LocalPort value. */ - public void setLocalPort(Integer localPort) + public void setLocalPort(final Integer localPortValue) { - this.localPort = localPort; + this.localPort = localPortValue; } private String name; @@ -173,6 +185,7 @@ public void setLocalPort(Integer localPort) /** * Optional. The name of the InputEndpoint. The name is ignored if * specified + * @return The Name value. */ public String getName() { @@ -182,10 +195,11 @@ public String getName() /** * Optional. The name of the InputEndpoint. The name is ignored if * specified + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private Integer port; @@ -194,6 +208,7 @@ public void setName(String name) * An integer specifying the public port for this endpoint. Allowed * values are between 1 and 65535 inclusive. A unqiue Port and Protocol * combination must be specified for each InputEndpoint in the list. + * @return The Port value. */ public Integer getPort() { @@ -204,16 +219,18 @@ public Integer getPort() * An integer specifying the public port for this endpoint. Allowed * values are between 1 and 65535 inclusive. A unqiue Port and Protocol * combination must be specified for each InputEndpoint in the list. + * @param portValue The Port value. */ - public void setPort(Integer port) + public void setPort(final Integer portValue) { - this.port = port; + this.port = portValue; } private String protocol; /** * Specifies the transport protocol for the endpoint. + * @return The Protocol value. */ public String getProtocol() { @@ -222,10 +239,11 @@ public String getProtocol() /** * Specifies the transport protocol for the endpoint. + * @param protocolValue The Protocol value. */ - public void setProtocol(String protocol) + public void setProtocol(final String protocolValue) { - this.protocol = protocol; + this.protocol = protocolValue; } private ArrayList rules; @@ -235,6 +253,7 @@ public void setProtocol(String protocol) * network traffic reaching to this endpoint. NOTES: (1) To remove the * ACLs from a load-balanced endpoint just omit this element. (2) ACLs * are set as specified. There is no merge done with existing ACLs. + * @return The Rules value. */ public ArrayList getRules() { @@ -246,16 +265,18 @@ public ArrayList getRules() * network traffic reaching to this endpoint. NOTES: (1) To remove the * ACLs from a load-balanced endpoint just omit this element. (2) ACLs * are set as specified. There is no merge done with existing ACLs. + * @param rulesValue The Rules value. */ - public void setRules(ArrayList rules) + public void setRules(final ArrayList rulesValue) { - this.rules = rules; + this.rules = rulesValue; } private InetAddress virtualIPAddress; /** * The virtual IP address of the endpoint. + * @return The VirtualIPAddress value. */ public InetAddress getVirtualIPAddress() { @@ -264,10 +285,11 @@ public InetAddress getVirtualIPAddress() /** * The virtual IP address of the endpoint. + * @param virtualIPAddressValue The VirtualIPAddress value. */ - public void setVirtualIPAddress(InetAddress virtualIPAddress) + public void setVirtualIPAddress(final InetAddress virtualIPAddressValue) { - this.virtualIPAddress = virtualIPAddress; + this.virtualIPAddress = virtualIPAddressValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineUpdateParameters.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineUpdateParameters.java index 32c97cef848b5..d555f19fb73ee 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineUpdateParameters.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineUpdateParameters.java @@ -38,6 +38,7 @@ public class VirtualMachineUpdateParameters * the Windows Azure environment. Virtual machines specified in the same * availability set are allocated to different nodes to maximize * availability. + * @return The AvailabilitySetName value. */ public String getAvailabilitySetName() { @@ -50,10 +51,11 @@ public String getAvailabilitySetName() * the Windows Azure environment. Virtual machines specified in the same * availability set are allocated to different nodes to maximize * availability. + * @param availabilitySetNameValue The AvailabilitySetName value. */ - public void setAvailabilitySetName(String availabilitySetName) + public void setAvailabilitySetName(final String availabilitySetNameValue) { - this.availabilitySetName = availabilitySetName; + this.availabilitySetName = availabilitySetNameValue; } private ArrayList configurationSets; @@ -61,6 +63,7 @@ public void setAvailabilitySetName(String availabilitySetName) /** * Contains the collection of configuration sets that contain system and * application configuration settings. + * @return The ConfigurationSets value. */ public ArrayList getConfigurationSets() { @@ -70,10 +73,11 @@ public ArrayList getConfigurationSets() /** * Contains the collection of configuration sets that contain system and * application configuration settings. + * @param configurationSetsValue The ConfigurationSets value. */ - public void setConfigurationSets(ArrayList configurationSets) + public void setConfigurationSets(final ArrayList configurationSetsValue) { - this.configurationSets = configurationSets; + this.configurationSets = configurationSetsValue; } private ArrayList dataVirtualHardDisks; @@ -81,6 +85,7 @@ public void setConfigurationSets(ArrayList configurationSets) /** * Contains the parameters Windows Azure used to create the data disk for * the virtual machine. + * @return The DataVirtualHardDisks value. */ public ArrayList getDataVirtualHardDisks() { @@ -90,16 +95,18 @@ public ArrayList getDataVirtualHardDisks() /** * Contains the parameters Windows Azure used to create the data disk for * the virtual machine. + * @param dataVirtualHardDisksValue The DataVirtualHardDisks value. */ - public void setDataVirtualHardDisks(ArrayList dataVirtualHardDisks) + public void setDataVirtualHardDisks(final ArrayList dataVirtualHardDisksValue) { - this.dataVirtualHardDisks = dataVirtualHardDisks; + this.dataVirtualHardDisks = dataVirtualHardDisksValue; } private String label; /** * Optional. Specifies the friendly name for the virtual machine. + * @return The Label value. */ public String getLabel() { @@ -108,10 +115,11 @@ public String getLabel() /** * Optional. Specifies the friendly name for the virtual machine. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private OSVirtualHardDisk oSVirtualHardDisk; @@ -119,6 +127,7 @@ public void setLabel(String label) /** * Contains the parameters Windows Azure used to create the operating system * disk for the virtual machine. + * @return The OSVirtualHardDisk value. */ public OSVirtualHardDisk getOSVirtualHardDisk() { @@ -128,10 +137,11 @@ public OSVirtualHardDisk getOSVirtualHardDisk() /** * Contains the parameters Windows Azure used to create the operating system * disk for the virtual machine. + * @param oSVirtualHardDiskValue The OSVirtualHardDisk value. */ - public void setOSVirtualHardDisk(OSVirtualHardDisk oSVirtualHardDisk) + public void setOSVirtualHardDisk(final OSVirtualHardDisk oSVirtualHardDiskValue) { - this.oSVirtualHardDisk = oSVirtualHardDisk; + this.oSVirtualHardDisk = oSVirtualHardDiskValue; } private String roleName; @@ -139,6 +149,7 @@ public void setOSVirtualHardDisk(OSVirtualHardDisk oSVirtualHardDisk) /** * Required. Specifies the name for the virtual machine. The name must be * unique within the deployment. + * @return The RoleName value. */ public String getRoleName() { @@ -148,28 +159,31 @@ public String getRoleName() /** * Required. Specifies the name for the virtual machine. The name must be * unique within the deployment. + * @param roleNameValue The RoleName value. */ - public void setRoleName(String roleName) + public void setRoleName(final String roleNameValue) { - this.roleName = roleName; + this.roleName = roleNameValue; } - private VirtualMachineRoleSize roleSize; + private String roleSize; /** * The size of the virtual machine. + * @return The RoleSize value. */ - public VirtualMachineRoleSize getRoleSize() + public String getRoleSize() { return this.roleSize; } /** * The size of the virtual machine. + * @param roleSizeValue The RoleSize value. */ - public void setRoleSize(VirtualMachineRoleSize roleSize) + public void setRoleSize(final String roleSizeValue) { - this.roleSize = roleSize; + this.roleSize = roleSizeValue; } /** diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/WindowsRemoteManagementListener.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/WindowsRemoteManagementListener.java index 452d62c00d514..fec59756a8cf1 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/WindowsRemoteManagementListener.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/WindowsRemoteManagementListener.java @@ -36,6 +36,7 @@ public class WindowsRemoteManagementListener * thumbprint of the service certificate that is used to provision the * WinRM HTTPS listener. If this value is not specified, a self-signed * certificate is generated and used for the virtual machine. + * @return The CertificateThumbprint value. */ public String getCertificateThumbprint() { @@ -48,10 +49,11 @@ public String getCertificateThumbprint() * thumbprint of the service certificate that is used to provision the * WinRM HTTPS listener. If this value is not specified, a self-signed * certificate is generated and used for the virtual machine. + * @param certificateThumbprintValue The CertificateThumbprint value. */ - public void setCertificateThumbprint(String certificateThumbprint) + public void setCertificateThumbprint(final String certificateThumbprintValue) { - this.certificateThumbprint = certificateThumbprint; + this.certificateThumbprint = certificateThumbprintValue; } private VirtualMachineWindowsRemoteManagementListenerType listenerType; @@ -59,6 +61,7 @@ public void setCertificateThumbprint(String certificateThumbprint) /** * Specifies the type of listener. This value can be Http or Https. The * value is case sensitive. + * @return The ListenerType value. */ public VirtualMachineWindowsRemoteManagementListenerType getListenerType() { @@ -68,9 +71,10 @@ public VirtualMachineWindowsRemoteManagementListenerType getListenerType() /** * Specifies the type of listener. This value can be Http or Https. The * value is case sensitive. + * @param listenerTypeValue The ListenerType value. */ - public void setListenerType(VirtualMachineWindowsRemoteManagementListenerType listenerType) + public void setListenerType(final VirtualMachineWindowsRemoteManagementListenerType listenerTypeValue) { - this.listenerType = listenerType; + this.listenerType = listenerTypeValue; } } diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/WindowsRemoteManagementSettings.java b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/WindowsRemoteManagementSettings.java index c9d9c832ea54d..9805031d6d663 100644 --- a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/WindowsRemoteManagementSettings.java +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/WindowsRemoteManagementSettings.java @@ -36,6 +36,7 @@ public class WindowsRemoteManagementSettings /** * Required. Contains a collection of information for enabling remote * Windows PowerShell. + * @return The Listeners value. */ public ArrayList getListeners() { @@ -45,10 +46,11 @@ public ArrayList getListeners() /** * Required. Contains a collection of information for enabling remote * Windows PowerShell. + * @param listenersValue The Listeners value. */ - public void setListeners(ArrayList listeners) + public void setListeners(final ArrayList listenersValue) { - this.listeners = listeners; + this.listeners = listenersValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/AlertsClient.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/AlertsClient.java index ddcc62e576a5c..706e8192c755f 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/AlertsClient.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/AlertsClient.java @@ -31,6 +31,7 @@ public interface AlertsClient extends FilterableService { /** * Optional base uri parameter for Azure REST. + * @return The BaseUri value. */ URI getBaseUri(); @@ -41,16 +42,19 @@ public interface AlertsClient extends FilterableService * Azure Service ManagementAPI use mutual authentication of management * certificates over SSL to ensure that a request made to the service is * secure. No anonymous requests are allowed. + * @return The Credentials value. */ SubscriptionCloudCredentials getCredentials(); /** * Operations for managing the alert incidents. + * @return The IncidentsOperations value. */ IncidentOperations getIncidentsOperations(); /** * Operations for managing the alert rules. + * @return The RulesOperations value. */ RuleOperations getRulesOperations(); } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/AlertsClientImpl.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/AlertsClientImpl.java index 572db22d1f543..3cef2e0de70af 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/AlertsClientImpl.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/AlertsClientImpl.java @@ -38,6 +38,7 @@ public class AlertsClientImpl extends ServiceClient implements Ale /** * Optional base uri parameter for Azure REST. + * @return The BaseUri value. */ public URI getBaseUri() { @@ -53,6 +54,7 @@ public URI getBaseUri() * Azure Service ManagementAPI use mutual authentication of management * certificates over SSL to ensure that a request made to the service is * secure. No anonymous requests are allowed. + * @return The Credentials value. */ public SubscriptionCloudCredentials getCredentials() { @@ -63,6 +65,7 @@ public SubscriptionCloudCredentials getCredentials() /** * Operations for managing the alert incidents. + * @return The IncidentsOperations value. */ public IncidentOperations getIncidentsOperations() { @@ -73,6 +76,7 @@ public IncidentOperations getIncidentsOperations() /** * Operations for managing the alert rules. + * @return The RulesOperations value. */ public RuleOperations getRulesOperations() { @@ -132,6 +136,8 @@ public AlertsClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorS * The Windows Azure Service ManagementAPI use mutual authentication of * management certificates over SSL to ensure that a request made to the * service is secure. No anonymous requests are allowed. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. */ @Inject public AlertsClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService, @Named(ManagementConfiguration.SUBSCRIPTION_CLOUD_CREDENTIALS) SubscriptionCloudCredentials credentials) throws java.net.URISyntaxException diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/IncidentOperations.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/IncidentOperations.java index 34136ef56989b..24d58ed4c9979 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/IncidentOperations.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/IncidentOperations.java @@ -38,6 +38,12 @@ public interface IncidentOperations /** * * @param incidentId The id of the incident to retrieve. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Incident operation response. */ IncidentGetResponse get(String incidentId) throws IOException, ServiceException, ParseException; @@ -51,6 +57,12 @@ public interface IncidentOperations /** * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List incidents operation response. */ IncidentListResponse listActiveForSubscription() throws IOException, ServiceException, ParseException; @@ -65,6 +77,12 @@ public interface IncidentOperations * * @param ruleId The rule id. * @param isActive A boolean to retrieve only active or resolved incidents. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List incidents operation response. */ IncidentListResponse listForRule(String ruleId, boolean isActive) throws IOException, ServiceException, ParseException; diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/IncidentOperationsImpl.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/IncidentOperationsImpl.java index 25ddd73b2a7a5..07c05c5cd4719 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/IncidentOperationsImpl.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/IncidentOperationsImpl.java @@ -26,7 +26,6 @@ import com.microsoft.windowsazure.core.ServiceOperations; import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.management.monitoring.alerts.models.Incident; -import com.microsoft.windowsazure.management.monitoring.alerts.models.IncidentCollection; import com.microsoft.windowsazure.management.monitoring.alerts.models.IncidentGetResponse; import com.microsoft.windowsazure.management.monitoring.alerts.models.IncidentListResponse; import com.microsoft.windowsazure.tracing.CloudTracing; @@ -65,6 +64,7 @@ public class IncidentOperationsImpl implements ServiceOperations 0) + { + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + } + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -241,6 +253,12 @@ public IncidentListResponse call() throws Exception /** * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List incidents operation response. */ @Override @@ -271,49 +289,45 @@ public IncidentListResponse listActiveForSubscription() throws IOException, Serv // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - IncidentListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new IncidentListResponse(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode responseDoc = objectMapper.readTree(responseContent); - - if (responseDoc != null) - { - JsonNode incidentCollectionValue = responseDoc.get("IncidentCollection"); - if (incidentCollectionValue != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - IncidentCollection incidentCollectionInstance = new IncidentCollection(); - result.setIncidentCollection(incidentCollectionInstance); - - ArrayNode valueArray = ((ArrayNode) incidentCollectionValue.get("Value")); + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + IncidentListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new IncidentListResponse(); + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode responseDoc = objectMapper.readTree(responseContent); + + if (responseDoc != null) + { + ArrayNode valueArray = ((ArrayNode) responseDoc.get("Value")); if (valueArray != null) { for (JsonNode valueValue : valueArray) { Incident incidentInstance = new Incident(); - incidentCollectionInstance.getValue().add(incidentInstance); + result.getValue().add(incidentInstance); JsonNode idValue = valueValue.get("Id"); if (idValue != null) @@ -363,19 +377,26 @@ public IncidentListResponse listActiveForSubscription() throws IOException, Serv } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -400,6 +421,12 @@ public IncidentListResponse call() throws Exception * * @param ruleId The rule id. * @param isActive A boolean to retrieve only active or resolved incidents. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List incidents operation response. */ @Override @@ -436,49 +463,45 @@ public IncidentListResponse listForRule(String ruleId, boolean isActive) throws // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - IncidentListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new IncidentListResponse(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode responseDoc = objectMapper.readTree(responseContent); - - if (responseDoc != null) - { - JsonNode incidentCollectionValue = responseDoc.get("IncidentCollection"); - if (incidentCollectionValue != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - IncidentCollection incidentCollectionInstance = new IncidentCollection(); - result.setIncidentCollection(incidentCollectionInstance); - - ArrayNode valueArray = ((ArrayNode) incidentCollectionValue.get("Value")); + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + IncidentListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new IncidentListResponse(); + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode responseDoc = objectMapper.readTree(responseContent); + + if (responseDoc != null) + { + ArrayNode valueArray = ((ArrayNode) responseDoc.get("Value")); if (valueArray != null) { for (JsonNode valueValue : valueArray) { Incident incidentInstance = new Incident(); - incidentCollectionInstance.getValue().add(incidentInstance); + result.getValue().add(incidentInstance); JsonNode idValue = valueValue.get("Id"); if (idValue != null) @@ -528,18 +551,25 @@ public IncidentListResponse listForRule(String ruleId, boolean isActive) throws } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/RuleOperations.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/RuleOperations.java index dad8e26b2608b..1bf476c2fa52d 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/RuleOperations.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/RuleOperations.java @@ -29,7 +29,6 @@ import com.microsoft.windowsazure.management.monitoring.alerts.models.RuleGetResponse; import com.microsoft.windowsazure.management.monitoring.alerts.models.RuleListResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.Future; @@ -41,10 +40,14 @@ public interface RuleOperations /** * * @param parameters The rule to create or update. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse createOrUpdate(RuleCreateOrUpdateParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException; + OperationResponse createOrUpdate(RuleCreateOrUpdateParameters parameters) throws IOException, ServiceException; /** * @@ -57,6 +60,10 @@ public interface RuleOperations /** * * @param ruleId The id of the rule to delete. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -73,6 +80,12 @@ public interface RuleOperations /** * * @param ruleId The id of the rule to retrieve. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Rule operation response. */ RuleGetResponse get(String ruleId) throws IOException, ServiceException, ParseException; @@ -87,6 +100,12 @@ public interface RuleOperations /** * List the alert rules within a subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List Rules operation response. */ RuleListResponse list() throws IOException, ServiceException, ParseException; diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/RuleOperationsImpl.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/RuleOperationsImpl.java index 82e86b92fd055..39952f1d5b90c 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/RuleOperationsImpl.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/RuleOperationsImpl.java @@ -31,7 +31,6 @@ import com.microsoft.windowsazure.management.monitoring.alerts.models.ConditionOperator; import com.microsoft.windowsazure.management.monitoring.alerts.models.Rule; import com.microsoft.windowsazure.management.monitoring.alerts.models.RuleAction; -import com.microsoft.windowsazure.management.monitoring.alerts.models.RuleCollection; import com.microsoft.windowsazure.management.monitoring.alerts.models.RuleCreateOrUpdateParameters; import com.microsoft.windowsazure.management.monitoring.alerts.models.RuleEmailAction; import com.microsoft.windowsazure.management.monitoring.alerts.models.RuleGetResponse; @@ -42,7 +41,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -81,6 +79,7 @@ public class RuleOperationsImpl implements ServiceOperations, /** * Gets a reference to the * microsoft.windowsazure.management.monitoring.alerts.AlertsClientImpl. + * @return The Client value. */ public AlertsClientImpl getClient() { @@ -108,11 +107,15 @@ public OperationResponse call() throws Exception /** * * @param parameters The rule to create or update. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse createOrUpdate(RuleCreateOrUpdateParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException + public OperationResponse createOrUpdate(RuleCreateOrUpdateParameters parameters) throws IOException, ServiceException { // Validate if (parameters == null) @@ -255,40 +258,50 @@ public OperationResponse createOrUpdate(RuleCreateOrUpdateParameters parameters) // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_CREATED) - { - ServiceException ex = ServiceException.createFromJson(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_CREATED) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -312,6 +325,10 @@ public OperationResponse call() throws Exception /** * * @param ruleId The id of the rule to delete. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -348,40 +365,50 @@ public OperationResponse delete(String ruleId) throws IOException, ServiceExcept // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -404,6 +431,12 @@ public RuleGetResponse call() throws Exception /** * * @param ruleId The id of the rule to retrieve. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Rule operation response. */ @Override @@ -439,43 +472,42 @@ public RuleGetResponse get(String ruleId) throws IOException, ServiceException, // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - RuleGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new RuleGetResponse(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode responseDoc = objectMapper.readTree(responseContent); - - if (responseDoc != null) - { - JsonNode ruleValue = responseDoc.get("Rule"); - if (ruleValue != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + RuleGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new RuleGetResponse(); + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode responseDoc = objectMapper.readTree(responseContent); + + if (responseDoc != null) { Rule ruleInstance = new Rule(); result.setRule(ruleInstance); - JsonNode idValue = ruleValue.get("Id"); + JsonNode idValue = responseDoc.get("Id"); if (idValue != null) { String idInstance; @@ -483,7 +515,7 @@ public RuleGetResponse get(String ruleId) throws IOException, ServiceException, ruleInstance.setId(idInstance); } - JsonNode nameValue = ruleValue.get("Name"); + JsonNode nameValue = responseDoc.get("Name"); if (nameValue != null) { String nameInstance; @@ -491,7 +523,7 @@ public RuleGetResponse get(String ruleId) throws IOException, ServiceException, ruleInstance.setName(nameInstance); } - JsonNode descriptionValue = ruleValue.get("Description"); + JsonNode descriptionValue = responseDoc.get("Description"); if (descriptionValue != null) { String descriptionInstance; @@ -499,7 +531,7 @@ public RuleGetResponse get(String ruleId) throws IOException, ServiceException, ruleInstance.setDescription(descriptionInstance); } - JsonNode isEnabledValue = ruleValue.get("IsEnabled"); + JsonNode isEnabledValue = responseDoc.get("IsEnabled"); if (isEnabledValue != null) { boolean isEnabledInstance; @@ -507,11 +539,11 @@ public RuleGetResponse get(String ruleId) throws IOException, ServiceException, ruleInstance.setIsEnabled(isEnabledInstance); } - JsonNode conditionValue = ruleValue.get("Condition"); + JsonNode conditionValue = responseDoc.get("Condition"); if (conditionValue != null) { String typeName = conditionValue.get("odata.type").getTextValue(); - if (typeName.equals("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.ThresholdRuleCondition")) + if (typeName == "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.ThresholdRuleCondition") { ThresholdRuleCondition thresholdRuleConditionInstance = new ThresholdRuleCondition(); @@ -519,7 +551,7 @@ public RuleGetResponse get(String ruleId) throws IOException, ServiceException, if (dataSourceValue != null) { String typeName2 = dataSourceValue.get("odata.type").getTextValue(); - if (typeName2.equals("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleMetricDataSource")) + if (typeName2 == "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleMetricDataSource") { RuleMetricDataSource ruleMetricDataSourceInstance = new RuleMetricDataSource(); @@ -577,13 +609,13 @@ public RuleGetResponse get(String ruleId) throws IOException, ServiceException, } } - ArrayNode actionsArray = ((ArrayNode) ruleValue.get("Actions")); + ArrayNode actionsArray = ((ArrayNode) responseDoc.get("Actions")); if (actionsArray != null) { for (JsonNode actionsValue : actionsArray) { String typeName3 = actionsValue.get("odata.type").getTextValue(); - if (typeName3.equals("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleEmailAction")) + if (typeName3 == "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleEmailAction") { RuleEmailAction ruleEmailActionInstance = new RuleEmailAction(); @@ -608,7 +640,7 @@ public RuleGetResponse get(String ruleId) throws IOException, ServiceException, } } - JsonNode lastUpdatedTimeValue = ruleValue.get("LastUpdatedTime"); + JsonNode lastUpdatedTimeValue = responseDoc.get("LastUpdatedTime"); if (lastUpdatedTimeValue != null) { Calendar lastUpdatedTimeInstance; @@ -619,19 +651,26 @@ public RuleGetResponse get(String ruleId) throws IOException, ServiceException, ruleInstance.setLastUpdatedTime(lastUpdatedTimeInstance); } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -654,6 +693,12 @@ public RuleListResponse call() throws Exception /** * List the alert rules within a subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List Rules operation response. */ @Override @@ -684,49 +729,45 @@ public RuleListResponse list() throws IOException, ServiceException, ParseExcept // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - RuleListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new RuleListResponse(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode responseDoc = objectMapper.readTree(responseContent); - - if (responseDoc != null) - { - JsonNode ruleCollectionValue = responseDoc.get("RuleCollection"); - if (ruleCollectionValue != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - RuleCollection ruleCollectionInstance = new RuleCollection(); - result.setRuleCollection(ruleCollectionInstance); - - ArrayNode valueArray = ((ArrayNode) ruleCollectionValue.get("Value")); + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + RuleListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new RuleListResponse(); + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode responseDoc = objectMapper.readTree(responseContent); + + if (responseDoc != null) + { + ArrayNode valueArray = ((ArrayNode) responseDoc.get("Value")); if (valueArray != null) { for (JsonNode valueValue : valueArray) { Rule ruleInstance = new Rule(); - ruleCollectionInstance.getValue().add(ruleInstance); + result.getValue().add(ruleInstance); JsonNode idValue = valueValue.get("Id"); if (idValue != null) @@ -764,7 +805,7 @@ public RuleListResponse list() throws IOException, ServiceException, ParseExcept if (conditionValue != null) { String typeName = conditionValue.get("odata.type").getTextValue(); - if (typeName.equals("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.ThresholdRuleCondition")) + if (typeName == "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.ThresholdRuleCondition") { ThresholdRuleCondition thresholdRuleConditionInstance = new ThresholdRuleCondition(); @@ -772,7 +813,7 @@ public RuleListResponse list() throws IOException, ServiceException, ParseExcept if (dataSourceValue != null) { String typeName2 = dataSourceValue.get("odata.type").getTextValue(); - if (typeName2.equals("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleMetricDataSource")) + if (typeName2 == "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleMetricDataSource") { RuleMetricDataSource ruleMetricDataSourceInstance = new RuleMetricDataSource(); @@ -836,7 +877,7 @@ public RuleListResponse list() throws IOException, ServiceException, ParseExcept for (JsonNode actionsValue : actionsArray) { String typeName3 = actionsValue.get("odata.type").getTextValue(); - if (typeName3.equals("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleEmailAction")) + if (typeName3 == "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleEmailAction") { RuleEmailAction ruleEmailActionInstance = new RuleEmailAction(); @@ -874,18 +915,25 @@ public RuleListResponse list() throws IOException, ServiceException, ParseExcept } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/Incident.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/Incident.java index af816a54aee06..f1e9589453ad1 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/Incident.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/Incident.java @@ -34,6 +34,7 @@ public class Incident /** * The time at which the incident got activated. + * @return The ActivatedTime value. */ public Calendar getActivatedTime() { @@ -42,16 +43,18 @@ public Calendar getActivatedTime() /** * The time at which the incident got activated. + * @param activatedTimeValue The ActivatedTime value. */ - public void setActivatedTime(Calendar activatedTime) + public void setActivatedTime(final Calendar activatedTimeValue) { - this.activatedTime = activatedTime; + this.activatedTime = activatedTimeValue; } private String id; /** * Incident identifier. + * @return The Id value. */ public String getId() { @@ -60,16 +63,18 @@ public String getId() /** * Incident identifier. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private boolean isActive; /** * A boolean to indicate whether the incident is active or resolved. + * @return The IsActive value. */ public boolean isActive() { @@ -78,10 +83,11 @@ public boolean isActive() /** * A boolean to indicate whether the incident is active or resolved. + * @param isActiveValue The IsActive value. */ - public void setIsActive(boolean isActive) + public void setIsActive(final boolean isActiveValue) { - this.isActive = isActive; + this.isActive = isActiveValue; } private Calendar resolvedTime; @@ -89,6 +95,7 @@ public void setIsActive(boolean isActive) /** * The time at which the incident got resolved. If null, it means the * incident is still active. + * @return The ResolvedTime value. */ public Calendar getResolvedTime() { @@ -98,16 +105,18 @@ public Calendar getResolvedTime() /** * The time at which the incident got resolved. If null, it means the * incident is still active. + * @param resolvedTimeValue The ResolvedTime value. */ - public void setResolvedTime(Calendar resolvedTime) + public void setResolvedTime(final Calendar resolvedTimeValue) { - this.resolvedTime = resolvedTime; + this.resolvedTime = resolvedTimeValue; } private String ruleId; /** * Rule identifier that is associated with the incident. + * @return The RuleId value. */ public String getRuleId() { @@ -116,9 +125,10 @@ public String getRuleId() /** * Rule identifier that is associated with the incident. + * @param ruleIdValue The RuleId value. */ - public void setRuleId(String ruleId) + public void setRuleId(final String ruleIdValue) { - this.ruleId = ruleId; + this.ruleId = ruleIdValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentCollection.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentCollection.java index 3a6db363e7257..f7c599829d3d5 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentCollection.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentCollection.java @@ -34,6 +34,7 @@ public class IncidentCollection /** * Incident collection. + * @return The Value value. */ public ArrayList getValue() { @@ -42,10 +43,11 @@ public ArrayList getValue() /** * Incident collection. + * @param valueValue The Value value. */ - public void setValue(ArrayList value) + public void setValue(final ArrayList valueValue) { - this.value = value; + this.value = valueValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentGetResponse.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentGetResponse.java index 151598409c3aa..5b71b4ef158a5 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentGetResponse.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentGetResponse.java @@ -34,6 +34,7 @@ public class IncidentGetResponse extends OperationResponse /** * The retrieved incident. + * @return The Incident value. */ public Incident getIncident() { @@ -42,9 +43,10 @@ public Incident getIncident() /** * The retrieved incident. + * @param incidentValue The Incident value. */ - public void setIncident(Incident incident) + public void setIncident(final Incident incidentValue) { - this.incident = incident; + this.incident = incidentValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentListResponse.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentListResponse.java index 4987782c1a61f..6e733386e9d8d 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentListResponse.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/IncidentListResponse.java @@ -24,27 +24,50 @@ package com.microsoft.windowsazure.management.monitoring.alerts.models; import com.microsoft.windowsazure.core.OperationResponse; +import java.util.ArrayList; +import java.util.Iterator; /** * The List incidents operation response. */ -public class IncidentListResponse extends OperationResponse +public class IncidentListResponse extends OperationResponse implements Iterable { - private IncidentCollection incidentCollection; + private ArrayList value; /** - * The retrieved incidents. + * Incident collection. + * @return The Value value. */ - public IncidentCollection getIncidentCollection() + public ArrayList getValue() { - return this.incidentCollection; + return this.value; } /** - * The retrieved incidents. + * Incident collection. + * @param valueValue The Value value. */ - public void setIncidentCollection(IncidentCollection incidentCollection) + public void setValue(final ArrayList valueValue) { - this.incidentCollection = incidentCollection; + this.value = valueValue; + } + + /** + * Initializes a new instance of the IncidentListResponse class. + * + */ + public IncidentListResponse() + { + super(); + this.value = new ArrayList(); + } + + /** + * Gets the sequence of Value. + * + */ + public Iterator iterator() + { + return this.getValue().iterator(); } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/Rule.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/Rule.java index cc78e76a720bb..7d12509c8265c 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/Rule.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/Rule.java @@ -35,6 +35,7 @@ public class Rule /** * Rule actions. + * @return The Actions value. */ public ArrayList getActions() { @@ -43,16 +44,18 @@ public ArrayList getActions() /** * Rule actions. + * @param actionsValue The Actions value. */ - public void setActions(ArrayList actions) + public void setActions(final ArrayList actionsValue) { - this.actions = actions; + this.actions = actionsValue; } private RuleCondition condition; /** * Rule condition. + * @return The Condition value. */ public RuleCondition getCondition() { @@ -61,16 +64,18 @@ public RuleCondition getCondition() /** * Rule condition. + * @param conditionValue The Condition value. */ - public void setCondition(RuleCondition condition) + public void setCondition(final RuleCondition conditionValue) { - this.condition = condition; + this.condition = conditionValue; } private String description; /** * Rule description. + * @return The Description value. */ public String getDescription() { @@ -79,16 +84,18 @@ public String getDescription() /** * Rule description. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String id; /** * Rule identifier. + * @return The Id value. */ public String getId() { @@ -97,16 +104,18 @@ public String getId() /** * Rule identifier. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private boolean isEnabled; /** * A flag that determines whether the rule is enabled or disabled. + * @return The IsEnabled value. */ public boolean isEnabled() { @@ -115,16 +124,18 @@ public boolean isEnabled() /** * A flag that determines whether the rule is enabled or disabled. + * @param isEnabledValue The IsEnabled value. */ - public void setIsEnabled(boolean isEnabled) + public void setIsEnabled(final boolean isEnabledValue) { - this.isEnabled = isEnabled; + this.isEnabled = isEnabledValue; } private Calendar lastUpdatedTime; /** * Rule last updated time. + * @return The LastUpdatedTime value. */ public Calendar getLastUpdatedTime() { @@ -133,16 +144,18 @@ public Calendar getLastUpdatedTime() /** * Rule last updated time. + * @param lastUpdatedTimeValue The LastUpdatedTime value. */ - public void setLastUpdatedTime(Calendar lastUpdatedTime) + public void setLastUpdatedTime(final Calendar lastUpdatedTimeValue) { - this.lastUpdatedTime = lastUpdatedTime; + this.lastUpdatedTime = lastUpdatedTimeValue; } private String name; /** * Rule name. + * @return The Name value. */ public String getName() { @@ -151,10 +164,11 @@ public String getName() /** * Rule name. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleCollection.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleCollection.java index 8d3f1851be8ba..d2e4950d704db 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleCollection.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleCollection.java @@ -34,6 +34,7 @@ public class RuleCollection /** * Rule collection. + * @return The Value value. */ public ArrayList getValue() { @@ -42,10 +43,11 @@ public ArrayList getValue() /** * Rule collection. + * @param valueValue The Value value. */ - public void setValue(ArrayList value) + public void setValue(final ArrayList valueValue) { - this.value = value; + this.value = valueValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleCreateOrUpdateParameters.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleCreateOrUpdateParameters.java index 4aad6bc69c9a3..71166a388a929 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleCreateOrUpdateParameters.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleCreateOrUpdateParameters.java @@ -32,6 +32,7 @@ public class RuleCreateOrUpdateParameters /** * The rule to create or update. + * @return The Rule value. */ public Rule getRule() { @@ -40,9 +41,10 @@ public Rule getRule() /** * The rule to create or update. + * @param ruleValue The Rule value. */ - public void setRule(Rule rule) + public void setRule(final Rule ruleValue) { - this.rule = rule; + this.rule = ruleValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleEmailAction.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleEmailAction.java index 3d0563f7ae6b6..71f5175e2d149 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleEmailAction.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleEmailAction.java @@ -34,6 +34,7 @@ public class RuleEmailAction extends RuleAction /** * The email address of an adminstrative user. + * @return The CustomEmails value. */ public ArrayList getCustomEmails() { @@ -42,10 +43,11 @@ public ArrayList getCustomEmails() /** * The email address of an adminstrative user. + * @param customEmailsValue The CustomEmails value. */ - public void setCustomEmails(ArrayList customEmails) + public void setCustomEmails(final ArrayList customEmailsValue) { - this.customEmails = customEmails; + this.customEmails = customEmailsValue; } private boolean sendToServiceOwners; @@ -53,6 +55,7 @@ public void setCustomEmails(ArrayList customEmails) /** * This indicates if email is sent to sevice adminstrator and * co-administrators. + * @return The SendToServiceOwners value. */ public boolean isSendToServiceOwners() { @@ -62,10 +65,11 @@ public boolean isSendToServiceOwners() /** * This indicates if email is sent to sevice adminstrator and * co-administrators. + * @param sendToServiceOwnersValue The SendToServiceOwners value. */ - public void setSendToServiceOwners(boolean sendToServiceOwners) + public void setSendToServiceOwners(final boolean sendToServiceOwnersValue) { - this.sendToServiceOwners = sendToServiceOwners; + this.sendToServiceOwners = sendToServiceOwnersValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleGetResponse.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleGetResponse.java index f21d40408f37b..c4c21b1909566 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleGetResponse.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleGetResponse.java @@ -34,6 +34,7 @@ public class RuleGetResponse extends OperationResponse /** * The retrieved rule. + * @return The Rule value. */ public Rule getRule() { @@ -42,9 +43,10 @@ public Rule getRule() /** * The retrieved rule. + * @param ruleValue The Rule value. */ - public void setRule(Rule rule) + public void setRule(final Rule ruleValue) { - this.rule = rule; + this.rule = ruleValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleListResponse.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleListResponse.java index d3877763fb99c..0c7a02a5cd4bb 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleListResponse.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleListResponse.java @@ -24,27 +24,50 @@ package com.microsoft.windowsazure.management.monitoring.alerts.models; import com.microsoft.windowsazure.core.OperationResponse; +import java.util.ArrayList; +import java.util.Iterator; /** * The List Rules operation response. */ -public class RuleListResponse extends OperationResponse +public class RuleListResponse extends OperationResponse implements Iterable { - private RuleCollection ruleCollection; + private ArrayList value; /** - * The retrieved rules. + * Alert rules collection. + * @return The Value value. */ - public RuleCollection getRuleCollection() + public ArrayList getValue() { - return this.ruleCollection; + return this.value; } /** - * The retrieved rules. + * Alert rules collection. + * @param valueValue The Value value. */ - public void setRuleCollection(RuleCollection ruleCollection) + public void setValue(final ArrayList valueValue) { - this.ruleCollection = ruleCollection; + this.value = valueValue; + } + + /** + * Initializes a new instance of the RuleListResponse class. + * + */ + public RuleListResponse() + { + super(); + this.value = new ArrayList(); + } + + /** + * Gets the sequence of Value. + * + */ + public Iterator iterator() + { + return this.getValue().iterator(); } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleMetricDataSource.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleMetricDataSource.java index 5e33ff8e9592b..9ddfd30a94a63 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleMetricDataSource.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/RuleMetricDataSource.java @@ -32,6 +32,7 @@ public class RuleMetricDataSource extends RuleDataSource /** * Metric name. + * @return The MetricName value. */ public String getMetricName() { @@ -40,10 +41,11 @@ public String getMetricName() /** * Metric name. + * @param metricNameValue The MetricName value. */ - public void setMetricName(String metricName) + public void setMetricName(final String metricNameValue) { - this.metricName = metricName; + this.metricName = metricNameValue; } private String metricNamespace; @@ -51,6 +53,7 @@ public void setMetricName(String metricName) /** * Metric namespace. When creating a rule on endpoint monitoring metrics, * WindowsAzure.Availability namespace is required. + * @return The MetricNamespace value. */ public String getMetricNamespace() { @@ -60,16 +63,18 @@ public String getMetricNamespace() /** * Metric namespace. When creating a rule on endpoint monitoring metrics, * WindowsAzure.Availability namespace is required. + * @param metricNamespaceValue The MetricNamespace value. */ - public void setMetricNamespace(String metricNamespace) + public void setMetricNamespace(final String metricNamespaceValue) { - this.metricNamespace = metricNamespace; + this.metricNamespace = metricNamespaceValue; } private String resourceId; /** * Metric resource id. + * @return The ResourceId value. */ public String getResourceId() { @@ -78,9 +83,10 @@ public String getResourceId() /** * Metric resource id. + * @param resourceIdValue The ResourceId value. */ - public void setResourceId(String resourceId) + public void setResourceId(final String resourceIdValue) { - this.resourceId = resourceId; + this.resourceId = resourceIdValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/ThresholdRuleCondition.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/ThresholdRuleCondition.java index 8410a303794cb..46dc9d958475b 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/ThresholdRuleCondition.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/ThresholdRuleCondition.java @@ -34,6 +34,7 @@ public class ThresholdRuleCondition extends RuleCondition /** * Condition data source. + * @return The DataSource value. */ public RuleDataSource getDataSource() { @@ -42,16 +43,18 @@ public RuleDataSource getDataSource() /** * Condition data source. + * @param dataSourceValue The DataSource value. */ - public void setDataSource(RuleDataSource dataSource) + public void setDataSource(final RuleDataSource dataSourceValue) { - this.dataSource = dataSource; + this.dataSource = dataSourceValue; } private ConditionOperator operator; /** * Condition operator. + * @return The Operator value. */ public ConditionOperator getOperator() { @@ -60,16 +63,18 @@ public ConditionOperator getOperator() /** * Condition operator. + * @param operatorValue The Operator value. */ - public void setOperator(ConditionOperator operator) + public void setOperator(final ConditionOperator operatorValue) { - this.operator = operator; + this.operator = operatorValue; } private double threshold; /** * Condition threshold. + * @return The Threshold value. */ public double getThreshold() { @@ -78,10 +83,11 @@ public double getThreshold() /** * Condition threshold. + * @param thresholdValue The Threshold value. */ - public void setThreshold(double threshold) + public void setThreshold(final double thresholdValue) { - this.threshold = threshold; + this.threshold = thresholdValue; } private Duration windowSize; @@ -89,6 +95,7 @@ public void setThreshold(double threshold) /** * The time period over which the alert rule is evaluated. Condition window * size depends on the metric. + * @return The WindowSize value. */ public Duration getWindowSize() { @@ -98,9 +105,10 @@ public Duration getWindowSize() /** * The time period over which the alert rule is evaluated. Condition window * size depends on the metric. + * @param windowSizeValue The WindowSize value. */ - public void setWindowSize(Duration windowSize) + public void setWindowSize(final Duration windowSizeValue) { - this.windowSize = windowSize; + this.windowSize = windowSizeValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/AutoscaleClient.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/AutoscaleClient.java index 26572839ff433..825a4cf8ccc85 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/AutoscaleClient.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/AutoscaleClient.java @@ -31,6 +31,7 @@ public interface AutoscaleClient extends FilterableService { /** * Optional base uri parameter. + * @return The BaseUri value. */ URI getBaseUri(); @@ -41,11 +42,13 @@ public interface AutoscaleClient extends FilterableService * Azure Service ManagementAPI use mutual authentication of management * certificates over SSL to ensure that a request made to the service is * secure. No anonymous requests are allowed. + * @return The Credentials value. */ SubscriptionCloudCredentials getCredentials(); /** * Operations for managing the autoscale settings. + * @return The SettingsOperations value. */ SettingOperations getSettingsOperations(); } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/AutoscaleClientImpl.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/AutoscaleClientImpl.java index ace2f1794f43b..ca939f891af02 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/AutoscaleClientImpl.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/AutoscaleClientImpl.java @@ -38,6 +38,7 @@ public class AutoscaleClientImpl extends ServiceClient implemen /** * Optional base uri parameter. + * @return The BaseUri value. */ public URI getBaseUri() { @@ -53,6 +54,7 @@ public URI getBaseUri() * Azure Service ManagementAPI use mutual authentication of management * certificates over SSL to ensure that a request made to the service is * secure. No anonymous requests are allowed. + * @return The Credentials value. */ public SubscriptionCloudCredentials getCredentials() { @@ -63,6 +65,7 @@ public SubscriptionCloudCredentials getCredentials() /** * Operations for managing the autoscale settings. + * @return The SettingsOperations value. */ public SettingOperations getSettingsOperations() { @@ -121,6 +124,8 @@ public AutoscaleClientImpl(HttpClientBuilder httpBuilder, ExecutorService execut * The Windows Azure Service ManagementAPI use mutual authentication of * management certificates over SSL to ensure that a request made to the * service is secure. No anonymous requests are allowed. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. */ @Inject public AutoscaleClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService, @Named(ManagementConfiguration.SUBSCRIPTION_CLOUD_CREDENTIALS) SubscriptionCloudCredentials credentials) throws java.net.URISyntaxException diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/SettingOperations.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/SettingOperations.java index 06a69937f9ae3..62a543204b4eb 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/SettingOperations.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/SettingOperations.java @@ -28,7 +28,6 @@ import com.microsoft.windowsazure.management.monitoring.autoscale.models.AutoscaleSettingCreateOrUpdateParameters; import com.microsoft.windowsazure.management.monitoring.autoscale.models.AutoscaleSettingGetResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.Future; @@ -41,10 +40,14 @@ public interface SettingOperations * * @param resourceId The resource ID. * @param parameters Parameters supplied to the operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse createOrUpdate(String resourceId, AutoscaleSettingCreateOrUpdateParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException; + OperationResponse createOrUpdate(String resourceId, AutoscaleSettingCreateOrUpdateParameters parameters) throws IOException, ServiceException; /** * @@ -58,6 +61,10 @@ public interface SettingOperations /** * * @param resourceId The resource ID. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -74,6 +81,12 @@ public interface SettingOperations /** * * @param resourceId The resource ID. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/SettingOperationsImpl.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/SettingOperationsImpl.java index 57e56de455323..4643d4bbdc912 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/SettingOperationsImpl.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/SettingOperationsImpl.java @@ -49,7 +49,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -88,6 +87,7 @@ public class SettingOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_CREATED) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -402,6 +416,10 @@ public OperationResponse call() throws Exception /** * * @param resourceId The resource ID. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -438,40 +456,50 @@ public OperationResponse delete(String resourceId) throws IOException, ServiceEx // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -495,6 +523,12 @@ public AutoscaleSettingGetResponse call() throws Exception /** * * @param resourceId The resource ID. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @@ -531,43 +565,42 @@ public AutoscaleSettingGetResponse get(String resourceId) throws IOException, Se // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - AutoscaleSettingGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new AutoscaleSettingGetResponse(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode responseDoc = objectMapper.readTree(responseContent); - - if (responseDoc != null) - { - JsonNode settingValue = responseDoc.get("Setting"); - if (settingValue != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + AutoscaleSettingGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new AutoscaleSettingGetResponse(); + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode responseDoc = objectMapper.readTree(responseContent); + + if (responseDoc != null) { AutoscaleSetting settingInstance = new AutoscaleSetting(); result.setSetting(settingInstance); - ArrayNode profilesArray = ((ArrayNode) settingValue.get("Profiles")); + ArrayNode profilesArray = ((ArrayNode) responseDoc.get("Profiles")); if (profilesArray != null) { for (JsonNode profilesValue : profilesArray) @@ -838,7 +871,7 @@ public AutoscaleSettingGetResponse get(String resourceId) throws IOException, Se } } - JsonNode enabledValue = settingValue.get("Enabled"); + JsonNode enabledValue = responseDoc.get("Enabled"); if (enabledValue != null) { boolean enabledInstance; @@ -846,18 +879,25 @@ public AutoscaleSettingGetResponse get(String resourceId) throws IOException, Se settingInstance.setEnabled(enabledInstance); } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleProfile.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleProfile.java index de38d2a36e67c..4387725659531 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleProfile.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleProfile.java @@ -34,6 +34,7 @@ public class AutoscaleProfile /** * The number of instances that can be used in the scaling action. + * @return The Capacity value. */ public ScaleCapacity getCapacity() { @@ -42,10 +43,11 @@ public ScaleCapacity getCapacity() /** * The number of instances that can be used in the scaling action. + * @param capacityValue The Capacity value. */ - public void setCapacity(ScaleCapacity capacity) + public void setCapacity(final ScaleCapacity capacityValue) { - this.capacity = capacity; + this.capacity = capacityValue; } private TimeWindow fixedDate; @@ -53,6 +55,7 @@ public void setCapacity(ScaleCapacity capacity) /** * A specific date for the scaling action. This element is not used if the * Recurrence element is used. + * @return The FixedDate value. */ public TimeWindow getFixedDate() { @@ -62,16 +65,18 @@ public TimeWindow getFixedDate() /** * A specific date for the scaling action. This element is not used if the * Recurrence element is used. + * @param fixedDateValue The FixedDate value. */ - public void setFixedDate(TimeWindow fixedDate) + public void setFixedDate(final TimeWindow fixedDateValue) { - this.fixedDate = fixedDate; + this.fixedDate = fixedDateValue; } private String name; /** * The name of the profile. + * @return The Name value. */ public String getName() { @@ -80,10 +85,11 @@ public String getName() /** * The name of the profile. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private Recurrence recurrence; @@ -91,6 +97,7 @@ public void setName(String name) /** * The frequency and schedule for the scaling action. This element is not * used if the FixedDate element is used. + * @return The Recurrence value. */ public Recurrence getRecurrence() { @@ -100,10 +107,11 @@ public Recurrence getRecurrence() /** * The frequency and schedule for the scaling action. This element is not * used if the FixedDate element is used. + * @param recurrenceValue The Recurrence value. */ - public void setRecurrence(Recurrence recurrence) + public void setRecurrence(final Recurrence recurrenceValue) { - this.recurrence = recurrence; + this.recurrence = recurrenceValue; } private ArrayList rules; @@ -111,6 +119,7 @@ public void setRecurrence(Recurrence recurrence) /** * A collection of rules that provide the triggers and parameters for the * scaling action. + * @return The Rules value. */ public ArrayList getRules() { @@ -120,10 +129,11 @@ public ArrayList getRules() /** * A collection of rules that provide the triggers and parameters for the * scaling action. + * @param rulesValue The Rules value. */ - public void setRules(ArrayList rules) + public void setRules(final ArrayList rulesValue) { - this.rules = rules; + this.rules = rulesValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSetting.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSetting.java index 4b56cada66b82..842e9a3702e74 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSetting.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSetting.java @@ -32,26 +32,38 @@ public class AutoscaleSetting { private boolean enabled; + /** + * @return The Enabled value. + */ public boolean isEnabled() { return this.enabled; } - public void setEnabled(boolean enabled) + /** + * @param enabledValue The Enabled value. + */ + public void setEnabled(final boolean enabledValue) { - this.enabled = enabled; + this.enabled = enabledValue; } private ArrayList profiles; + /** + * @return The Profiles value. + */ public ArrayList getProfiles() { return this.profiles; } - public void setProfiles(ArrayList profiles) + /** + * @param profilesValue The Profiles value. + */ + public void setProfiles(final ArrayList profilesValue) { - this.profiles = profiles; + this.profiles = profilesValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSettingCreateOrUpdateParameters.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSettingCreateOrUpdateParameters.java index 31ce7cdc15688..a2c20be9b1c85 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSettingCreateOrUpdateParameters.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSettingCreateOrUpdateParameters.java @@ -32,6 +32,7 @@ public class AutoscaleSettingCreateOrUpdateParameters /** * The setting to create or update. + * @return The Setting value. */ public AutoscaleSetting getSetting() { @@ -40,9 +41,10 @@ public AutoscaleSetting getSetting() /** * The setting to create or update. + * @param settingValue The Setting value. */ - public void setSetting(AutoscaleSetting setting) + public void setSetting(final AutoscaleSetting settingValue) { - this.setting = setting; + this.setting = settingValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSettingGetResponse.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSettingGetResponse.java index 36ca396d73a61..08b3fd37d3300 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSettingGetResponse.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/AutoscaleSettingGetResponse.java @@ -32,13 +32,19 @@ public class AutoscaleSettingGetResponse extends OperationResponse { private AutoscaleSetting setting; + /** + * @return The Setting value. + */ public AutoscaleSetting getSetting() { return this.setting; } - public void setSetting(AutoscaleSetting setting) + /** + * @param settingValue The Setting value. + */ + public void setSetting(final AutoscaleSetting settingValue) { - this.setting = setting; + this.setting = settingValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/MetricTrigger.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/MetricTrigger.java index 5d19ef2373ce3..2d8431cc8f66d 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/MetricTrigger.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/MetricTrigger.java @@ -34,6 +34,7 @@ public class MetricTrigger /** * The name of the metric. + * @return The MetricName value. */ public String getMetricName() { @@ -42,16 +43,18 @@ public String getMetricName() /** * The name of the metric. + * @param metricNameValue The MetricName value. */ - public void setMetricName(String metricName) + public void setMetricName(final String metricNameValue) { - this.metricName = metricName; + this.metricName = metricNameValue; } private String metricNamespace; /** * The namespace of the metric. + * @return The MetricNamespace value. */ public String getMetricNamespace() { @@ -60,16 +63,18 @@ public String getMetricNamespace() /** * The namespace of the metric. + * @param metricNamespaceValue The MetricNamespace value. */ - public void setMetricNamespace(String metricNamespace) + public void setMetricNamespace(final String metricNamespaceValue) { - this.metricNamespace = metricNamespace; + this.metricNamespace = metricNamespaceValue; } private String metricSource; /** * The metric source. + * @return The MetricSource value. */ public String getMetricSource() { @@ -78,16 +83,18 @@ public String getMetricSource() /** * The metric source. + * @param metricSourceValue The MetricSource value. */ - public void setMetricSource(String metricSource) + public void setMetricSource(final String metricSourceValue) { - this.metricSource = metricSource; + this.metricSource = metricSourceValue; } private ComparisonOperationType operator; /** * The operator that is used to evaluate the metric. + * @return The Operator value. */ public ComparisonOperationType getOperator() { @@ -96,16 +103,18 @@ public ComparisonOperationType getOperator() /** * The operator that is used to evaluate the metric. + * @param operatorValue The Operator value. */ - public void setOperator(ComparisonOperationType operator) + public void setOperator(final ComparisonOperationType operatorValue) { - this.operator = operator; + this.operator = operatorValue; } private MetricStatisticType statistic; /** * How the metrics from multiple instances are combined. + * @return The Statistic value. */ public MetricStatisticType getStatistic() { @@ -114,16 +123,18 @@ public MetricStatisticType getStatistic() /** * How the metrics from multiple instances are combined. + * @param statisticValue The Statistic value. */ - public void setStatistic(MetricStatisticType statistic) + public void setStatistic(final MetricStatisticType statisticValue) { - this.statistic = statistic; + this.statistic = statisticValue; } private double threshold; /** * The percentage of usage that triggers the scaling operation. + * @return The Threshold value. */ public double getThreshold() { @@ -132,16 +143,18 @@ public double getThreshold() /** * The percentage of usage that triggers the scaling operation. + * @param thresholdValue The Threshold value. */ - public void setThreshold(double threshold) + public void setThreshold(final double thresholdValue) { - this.threshold = threshold; + this.threshold = thresholdValue; } private TimeAggregationType timeAggregation; /** * How the data that is collected should be combined over time. + * @return The TimeAggregation value. */ public TimeAggregationType getTimeAggregation() { @@ -150,16 +163,18 @@ public TimeAggregationType getTimeAggregation() /** * How the data that is collected should be combined over time. + * @param timeAggregationValue The TimeAggregation value. */ - public void setTimeAggregation(TimeAggregationType timeAggregation) + public void setTimeAggregation(final TimeAggregationType timeAggregationValue) { - this.timeAggregation = timeAggregation; + this.timeAggregation = timeAggregationValue; } private Duration timeGrain; /** * The frequency of data collection. + * @return The TimeGrain value. */ public Duration getTimeGrain() { @@ -168,16 +183,18 @@ public Duration getTimeGrain() /** * The frequency of data collection. + * @param timeGrainValue The TimeGrain value. */ - public void setTimeGrain(Duration timeGrain) + public void setTimeGrain(final Duration timeGrainValue) { - this.timeGrain = timeGrain; + this.timeGrain = timeGrainValue; } private Duration timeWindow; /** * The range of time in which instance data is collected. + * @return The TimeWindow value. */ public Duration getTimeWindow() { @@ -186,9 +203,10 @@ public Duration getTimeWindow() /** * The range of time in which instance data is collected. + * @param timeWindowValue The TimeWindow value. */ - public void setTimeWindow(Duration timeWindow) + public void setTimeWindow(final Duration timeWindowValue) { - this.timeWindow = timeWindow; + this.timeWindow = timeWindowValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/Recurrence.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/Recurrence.java index 815d27ff9676f..79235935d4007 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/Recurrence.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/Recurrence.java @@ -27,25 +27,37 @@ public class Recurrence { private RecurrenceFrequency frequency; + /** + * @return The Frequency value. + */ public RecurrenceFrequency getFrequency() { return this.frequency; } - public void setFrequency(RecurrenceFrequency frequency) + /** + * @param frequencyValue The Frequency value. + */ + public void setFrequency(final RecurrenceFrequency frequencyValue) { - this.frequency = frequency; + this.frequency = frequencyValue; } private RecurrentSchedule schedule; + /** + * @return The Schedule value. + */ public RecurrentSchedule getSchedule() { return this.schedule; } - public void setSchedule(RecurrentSchedule schedule) + /** + * @param scheduleValue The Schedule value. + */ + public void setSchedule(final RecurrentSchedule scheduleValue) { - this.schedule = schedule; + this.schedule = scheduleValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/RecurrentSchedule.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/RecurrentSchedule.java index 60a0b05935d57..5351d3e21fd91 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/RecurrentSchedule.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/RecurrentSchedule.java @@ -29,50 +29,74 @@ public class RecurrentSchedule { private ArrayList days; + /** + * @return The Days value. + */ public ArrayList getDays() { return this.days; } - public void setDays(ArrayList days) + /** + * @param daysValue The Days value. + */ + public void setDays(final ArrayList daysValue) { - this.days = days; + this.days = daysValue; } private ArrayList hours; + /** + * @return The Hours value. + */ public ArrayList getHours() { return this.hours; } - public void setHours(ArrayList hours) + /** + * @param hoursValue The Hours value. + */ + public void setHours(final ArrayList hoursValue) { - this.hours = hours; + this.hours = hoursValue; } private ArrayList minutes; + /** + * @return The Minutes value. + */ public ArrayList getMinutes() { return this.minutes; } - public void setMinutes(ArrayList minutes) + /** + * @param minutesValue The Minutes value. + */ + public void setMinutes(final ArrayList minutesValue) { - this.minutes = minutes; + this.minutes = minutesValue; } private String timeZone; + /** + * @return The TimeZone value. + */ public String getTimeZone() { return this.timeZone; } - public void setTimeZone(String timeZone) + /** + * @param timeZoneValue The TimeZone value. + */ + public void setTimeZone(final String timeZoneValue) { - this.timeZone = timeZone; + this.timeZone = timeZoneValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleAction.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleAction.java index dfcc3d4aeff79..af71787b960c3 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleAction.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleAction.java @@ -34,6 +34,7 @@ public class ScaleAction /** * The cooldown interval for scaling action. + * @return The Cooldown value. */ public Duration getCooldown() { @@ -42,16 +43,18 @@ public Duration getCooldown() /** * The cooldown interval for scaling action. + * @param cooldownValue The Cooldown value. */ - public void setCooldown(Duration cooldown) + public void setCooldown(final Duration cooldownValue) { - this.cooldown = cooldown; + this.cooldown = cooldownValue; } private ScaleDirection direction; /** * The direction of scaling. + * @return The Direction value. */ public ScaleDirection getDirection() { @@ -60,16 +63,18 @@ public ScaleDirection getDirection() /** * The direction of scaling. + * @param directionValue The Direction value. */ - public void setDirection(ScaleDirection direction) + public void setDirection(final ScaleDirection directionValue) { - this.direction = direction; + this.direction = directionValue; } private ScaleType type; /** * The type of scaling. + * @return The Type value. */ public ScaleType getType() { @@ -78,16 +83,18 @@ public ScaleType getType() /** * The type of scaling. + * @param typeValue The Type value. */ - public void setType(ScaleType type) + public void setType(final ScaleType typeValue) { - this.type = type; + this.type = typeValue; } private String value; /** * The rate of scaling. + * @return The Value value. */ public String getValue() { @@ -96,9 +103,10 @@ public String getValue() /** * The rate of scaling. + * @param valueValue The Value value. */ - public void setValue(String value) + public void setValue(final String valueValue) { - this.value = value; + this.value = valueValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleCapacity.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleCapacity.java index d4fb813fbe9d5..090dcd9e1a887 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleCapacity.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleCapacity.java @@ -32,6 +32,7 @@ public class ScaleCapacity /** * The default number of instances that are available for the scaling action. + * @return The Default value. */ public String getDefault() { @@ -40,8 +41,9 @@ public String getDefault() /** * The default number of instances that are available for the scaling action. + * @param defaultValue The Default value. */ - public void setDefault(String defaultValue) + public void setDefault(final String defaultValue) { this.defaultValue = defaultValue; } @@ -50,6 +52,7 @@ public void setDefault(String defaultValue) /** * The maximum number of instances that are available for the scaling action. + * @return The Maximum value. */ public String getMaximum() { @@ -58,16 +61,18 @@ public String getMaximum() /** * The maximum number of instances that are available for the scaling action. + * @param maximumValue The Maximum value. */ - public void setMaximum(String maximum) + public void setMaximum(final String maximumValue) { - this.maximum = maximum; + this.maximum = maximumValue; } private String minimum; /** * The minimum number of instances that are available for the scaling action. + * @return The Minimum value. */ public String getMinimum() { @@ -76,9 +81,10 @@ public String getMinimum() /** * The minimum number of instances that are available for the scaling action. + * @param minimumValue The Minimum value. */ - public void setMinimum(String minimum) + public void setMinimum(final String minimumValue) { - this.minimum = minimum; + this.minimum = minimumValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleRule.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleRule.java index 23c8a935f39a1..849c814d82b97 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleRule.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/ScaleRule.java @@ -32,6 +32,7 @@ public class ScaleRule /** * The metrics that are used to determine when a scaling action occurs. + * @return The MetricTrigger value. */ public MetricTrigger getMetricTrigger() { @@ -40,16 +41,18 @@ public MetricTrigger getMetricTrigger() /** * The metrics that are used to determine when a scaling action occurs. + * @param metricTriggerValue The MetricTrigger value. */ - public void setMetricTrigger(MetricTrigger metricTrigger) + public void setMetricTrigger(final MetricTrigger metricTriggerValue) { - this.metricTrigger = metricTrigger; + this.metricTrigger = metricTriggerValue; } private ScaleAction scaleAction; /** * The parameters for the scaling action. + * @return The ScaleAction value. */ public ScaleAction getScaleAction() { @@ -58,9 +61,10 @@ public ScaleAction getScaleAction() /** * The parameters for the scaling action. + * @param scaleActionValue The ScaleAction value. */ - public void setScaleAction(ScaleAction scaleAction) + public void setScaleAction(final ScaleAction scaleActionValue) { - this.scaleAction = scaleAction; + this.scaleAction = scaleActionValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/TimeWindow.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/TimeWindow.java index a98467685d0a4..41528f186eed9 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/TimeWindow.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/TimeWindow.java @@ -34,6 +34,7 @@ public class TimeWindow /** * The end of the time window. + * @return The End value. */ public Calendar getEnd() { @@ -42,16 +43,18 @@ public Calendar getEnd() /** * The end of the time window. + * @param endValue The End value. */ - public void setEnd(Calendar end) + public void setEnd(final Calendar endValue) { - this.end = end; + this.end = endValue; } private Calendar start; /** * The start of the time window. + * @return The Start value. */ public Calendar getStart() { @@ -60,16 +63,18 @@ public Calendar getStart() /** * The start of the time window. + * @param startValue The Start value. */ - public void setStart(Calendar start) + public void setStart(final Calendar startValue) { - this.start = start; + this.start = startValue; } private String timeZone; /** * The time zone information. + * @return The TimeZone value. */ public String getTimeZone() { @@ -78,9 +83,10 @@ public String getTimeZone() /** * The time zone information. + * @param timeZoneValue The TimeZone value. */ - public void setTimeZone(String timeZone) + public void setTimeZone(final String timeZoneValue) { - this.timeZone = timeZone; + this.timeZone = timeZoneValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricDefinitionOperations.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricDefinitionOperations.java index 8cf96025e649e..7954c9d01b809 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricDefinitionOperations.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricDefinitionOperations.java @@ -43,6 +43,14 @@ public interface MetricDefinitionOperations * @param metricNamespace The namespace of the metrics.The value is either * null or WindowsAzure.Availability.WindowsAzure.Availability returns the * metric definitions for endpoint monitoring metrics + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List Metric Definitions operation response. */ MetricDefinitionListResponse list(String resourceId, ArrayList metricNames, String metricNamespace) throws IOException, ServiceException, URISyntaxException, ParseException; diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricDefinitionOperationsImpl.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricDefinitionOperationsImpl.java index 433a14d2be092..f21d8a67d14a0 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricDefinitionOperationsImpl.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricDefinitionOperationsImpl.java @@ -35,7 +35,6 @@ import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; -import java.net.URLEncoder; import java.text.ParseException; import java.util.ArrayList; import java.util.HashMap; @@ -66,6 +65,7 @@ public class MetricDefinitionOperationsImpl implements ServiceOperations me } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/monitoring/metricdefinitions/query?"; - url = url + "&resourceId=" + URLEncoder.encode(resourceId, "UTF-8"); - if (metricNamespace != null) - { - url = url + "&namespace=" + URLEncoder.encode(metricNamespace, "UTF-8"); - } - if (metricNames != null && metricNames.size() > 0) - { - url = url + "&names=" + URLEncoder.encode(CommaStringBuilder.join(metricNames), "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/monitoring/metricdefinitions/query?&resourceId=" + resourceId + "&namespace=" + metricNamespace + "&names=" + CommaStringBuilder.join(metricNames); // Create HTTP transport objects HttpGet httpRequest = new HttpGet(url); @@ -151,43 +150,42 @@ public MetricDefinitionListResponse list(String resourceId, ArrayList me // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - MetricDefinitionListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new MetricDefinitionListResponse(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode responseDoc = objectMapper.readTree(responseContent); - - if (responseDoc != null) - { - JsonNode metricDefinitionCollectionValue = responseDoc.get("MetricDefinitionCollection"); - if (metricDefinitionCollectionValue != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + MetricDefinitionListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new MetricDefinitionListResponse(); + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode responseDoc = objectMapper.readTree(responseContent); + + if (responseDoc != null) { MetricDefinitionCollection metricDefinitionCollectionInstance = new MetricDefinitionCollection(); result.setMetricDefinitionCollection(metricDefinitionCollectionInstance); - ArrayNode valueArray = ((ArrayNode) metricDefinitionCollectionValue.get("Value")); + ArrayNode valueArray = ((ArrayNode) responseDoc.get("Value")); if (valueArray != null) { for (JsonNode valueValue : valueArray) @@ -287,18 +285,25 @@ public MetricDefinitionListResponse list(String resourceId, ArrayList me } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricSettingOperations.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricSettingOperations.java index 4b1c291852e4c..69a381d63b730 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricSettingOperations.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricSettingOperations.java @@ -28,7 +28,6 @@ import com.microsoft.windowsazure.management.monitoring.metrics.models.MetricSettingListResponse; import com.microsoft.windowsazure.management.monitoring.metrics.models.MetricSettingsPutParameters; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.concurrent.Future; @@ -40,10 +39,14 @@ public interface MetricSettingOperations * for the resource. * * @param parameters Metric settings to be created or updated. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse createOrUpdate(MetricSettingsPutParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException; + OperationResponse createOrUpdate(MetricSettingsPutParameters parameters) throws IOException, ServiceException; /** * The Put Metric Settings operation creates or updates the metric settings @@ -61,6 +64,14 @@ public interface MetricSettingOperations * * @param resourceId The id of the resource. * @param metricNamespace The namespace of the metrics. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The list metric settings operation response. */ MetricSettingListResponse list(String resourceId, String metricNamespace) throws IOException, ServiceException, URISyntaxException, ParseException; diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricSettingOperationsImpl.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricSettingOperationsImpl.java index 20bf9bb8b3489..5181128926e3c 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricSettingOperationsImpl.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricSettingOperationsImpl.java @@ -37,10 +37,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URLEncoder; import java.text.ParseException; import java.util.HashMap; import java.util.concurrent.Callable; @@ -72,6 +70,7 @@ public class MetricSettingOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -295,6 +308,14 @@ public MetricSettingListResponse call() throws Exception * * @param resourceId The id of the resource. * @param metricNamespace The namespace of the metrics. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The list metric settings operation response. */ @Override @@ -323,9 +344,7 @@ public MetricSettingListResponse list(String resourceId, String metricNamespace) } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/monitoring/metricsettings?"; - url = url + "&resourceId=" + URLEncoder.encode(resourceId, "UTF-8"); - url = url + "&namespace=" + URLEncoder.encode(metricNamespace, "UTF-8"); + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/monitoring/metricsettings?&resourceId=" + resourceId + "&namespace=" + metricNamespace; // Create HTTP transport objects HttpGet httpRequest = new HttpGet(url); @@ -336,43 +355,42 @@ public MetricSettingListResponse list(String resourceId, String metricNamespace) // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - MetricSettingListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new MetricSettingListResponse(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode responseDoc = objectMapper.readTree(responseContent); - - if (responseDoc != null) - { - JsonNode metricSettingCollectionValue = responseDoc.get("MetricSettingCollection"); - if (metricSettingCollectionValue != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + MetricSettingListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new MetricSettingListResponse(); + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode responseDoc = objectMapper.readTree(responseContent); + + if (responseDoc != null) { MetricSettingCollection metricSettingCollectionInstance = new MetricSettingCollection(); result.setMetricSettingCollection(metricSettingCollectionInstance); - ArrayNode valueArray = ((ArrayNode) metricSettingCollectionValue.get("Value")); + ArrayNode valueArray = ((ArrayNode) responseDoc.get("Value")); if (valueArray != null) { for (JsonNode valueValue : valueArray) @@ -400,7 +418,7 @@ public MetricSettingListResponse list(String resourceId, String metricNamespace) if (valueValue2 != null) { String typeName = valueValue2.get("odata.type").getTextValue(); - if (typeName.equals("Microsoft.WindowsAzure.Management.Monitoring.Metrics.Models.AvailabilityMetricSettingValue")) + if (typeName == "Microsoft.WindowsAzure.Management.Monitoring.Metrics.Models.AvailabilityMetricSettingValue") { AvailabilityMetricSettingValue availabilityMetricSettingValueInstance = new AvailabilityMetricSettingValue(); @@ -477,18 +495,25 @@ public MetricSettingListResponse list(String resourceId, String metricNamespace) } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricValueOperations.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricValueOperations.java index 39aafa089e3e6..efc94d5996bf9 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricValueOperations.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricValueOperations.java @@ -45,6 +45,14 @@ public interface MetricValueOperations * @param timeGrain The time grain of the metrics. * @param startTime The start time (in UTC) of the metrics. * @param endTime The end time (in UTC) of the metrics. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The List Metric values operation response. */ MetricValueListResponse list(String resourceId, ArrayList metricNames, String metricNamespace, Duration timeGrain, Calendar startTime, Calendar endTime) throws IOException, ServiceException, URISyntaxException, ParseException; diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricValueOperationsImpl.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricValueOperationsImpl.java index 606d6a80ea68d..acefcb9fe0efe 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricValueOperationsImpl.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricValueOperationsImpl.java @@ -35,7 +35,6 @@ import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; -import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -69,6 +68,7 @@ public class MetricValueOperationsImpl implements ServiceOperations metricN simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmZ"); simpleDateFormat2.setTimeZone(TimeZone.getTimeZone("UTC")); - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/monitoring/metricvalues/query?"; - url = url + "&resourceId=" + URLEncoder.encode(resourceId, "UTF-8"); - if (metricNamespace != null) - { - url = url + "&namespace=" + URLEncoder.encode(metricNamespace, "UTF-8"); - } - url = url + "&names=" + URLEncoder.encode(CommaStringBuilder.join(metricNames), "UTF-8"); - url = url + "&timeGrain=" + URLEncoder.encode(TimeSpan8601Converter.format(timeGrain), "UTF-8"); - url = url + "&startTime=" + URLEncoder.encode(simpleDateFormat.format(startTime.getTime()), "UTF-8"); - url = url + "&endTime=" + URLEncoder.encode(simpleDateFormat2.format(endTime.getTime()), "UTF-8"); + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/monitoring/metricvalues/query?&resourceId=" + resourceId + "&namespace=" + metricNamespace + "&names=" + CommaStringBuilder.join(metricNames) + "&timeGrain=" + TimeSpan8601Converter.format(timeGrain) + "&startTime=" + simpleDateFormat.format(startTime.getTime()) + "&endTime=" + simpleDateFormat2.format(endTime.getTime()); // Create HTTP transport objects HttpGet httpRequest = new HttpGet(url); @@ -169,43 +168,42 @@ public MetricValueListResponse list(String resourceId, ArrayList metricN // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - MetricValueListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new MetricValueListResponse(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode responseDoc = objectMapper.readTree(responseContent); - - if (responseDoc != null) - { - JsonNode metricValueSetCollectionValue = responseDoc.get("MetricValueSetCollection"); - if (metricValueSetCollectionValue != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromJson(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + MetricValueListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new MetricValueListResponse(); + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode responseDoc = objectMapper.readTree(responseContent); + + if (responseDoc != null) { MetricValueSetCollection metricValueSetCollectionInstance = new MetricValueSetCollection(); result.setMetricValueSetCollection(metricValueSetCollectionInstance); - ArrayNode valueArray = ((ArrayNode) metricValueSetCollectionValue.get("Value")); + ArrayNode valueArray = ((ArrayNode) responseDoc.get("Value")); if (valueArray != null) { for (JsonNode valueValue : valueArray) @@ -354,18 +352,25 @@ public MetricValueListResponse list(String resourceId, ArrayList metricN } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricsClient.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricsClient.java index 837820766da76..39ac23571dada 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricsClient.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricsClient.java @@ -31,17 +31,28 @@ public interface MetricsClient extends FilterableService { /** * Optional base uri parameter. + * @return The BaseUri value. */ URI getBaseUri(); /** * Windows Azure subscription id. + * @return The Credentials value. */ SubscriptionCloudCredentials getCredentials(); + /** + * @return The MetricDefinitionsOperations value. + */ MetricDefinitionOperations getMetricDefinitionsOperations(); + /** + * @return The MetricSettingsOperations value. + */ MetricSettingOperations getMetricSettingsOperations(); + /** + * @return The MetricValuesOperations value. + */ MetricValueOperations getMetricValuesOperations(); } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricsClientImpl.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricsClientImpl.java index 7007222403aee..59a92f2f74398 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricsClientImpl.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/MetricsClientImpl.java @@ -38,6 +38,7 @@ public class MetricsClientImpl extends ServiceClient implements M /** * Optional base uri parameter. + * @return The BaseUri value. */ public URI getBaseUri() { @@ -48,6 +49,7 @@ public URI getBaseUri() /** * Windows Azure subscription id. + * @return The Credentials value. */ public SubscriptionCloudCredentials getCredentials() { @@ -56,6 +58,9 @@ public SubscriptionCloudCredentials getCredentials() private MetricDefinitionOperations metricDefinitions; + /** + * @return The MetricDefinitionsOperations value. + */ public MetricDefinitionOperations getMetricDefinitionsOperations() { return this.metricDefinitions; @@ -63,6 +68,9 @@ public MetricDefinitionOperations getMetricDefinitionsOperations() private MetricSettingOperations metricSettings; + /** + * @return The MetricSettingsOperations value. + */ public MetricSettingOperations getMetricSettingsOperations() { return this.metricSettings; @@ -70,6 +78,9 @@ public MetricSettingOperations getMetricSettingsOperations() private MetricValueOperations metricValues; + /** + * @return The MetricValuesOperations value. + */ public MetricValueOperations getMetricValuesOperations() { return this.metricValues; @@ -119,6 +130,8 @@ public MetricsClientImpl(HttpClientBuilder httpBuilder, ExecutorService executor * @param httpBuilder The HTTP client builder. * @param executorService The executor service. * @param credentials Windows Azure subscription id. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. */ @Inject public MetricsClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService, @Named(ManagementConfiguration.SUBSCRIPTION_CLOUD_CREDENTIALS) SubscriptionCloudCredentials credentials) throws java.net.URISyntaxException diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/AvailabilityMetricSettingValue.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/AvailabilityMetricSettingValue.java index 5a97a6050fdc3..4dfe336fc9962 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/AvailabilityMetricSettingValue.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/AvailabilityMetricSettingValue.java @@ -34,6 +34,7 @@ public class AvailabilityMetricSettingValue extends MetricSettingValue /** * The locations from which the Urls can be monitored. + * @return The AvailableLocations value. */ public ArrayList getAvailableLocations() { @@ -42,16 +43,18 @@ public ArrayList getAvailableLocations() /** * The locations from which the Urls can be monitored. + * @param availableLocationsValue The AvailableLocations value. */ - public void setAvailableLocations(ArrayList availableLocations) + public void setAvailableLocations(final ArrayList availableLocationsValue) { - this.availableLocations = availableLocations; + this.availableLocations = availableLocationsValue; } private ArrayList endpoints; /** * The configuration for Urls to be monitored using endpoint monitoiring. + * @return The Endpoints value. */ public ArrayList getEndpoints() { @@ -60,10 +63,11 @@ public ArrayList getEndpoints() /** * The configuration for Urls to be monitored using endpoint monitoiring. + * @param endpointsValue The Endpoints value. */ - public void setEndpoints(ArrayList endpoints) + public void setEndpoints(final ArrayList endpointsValue) { - this.endpoints = endpoints; + this.endpoints = endpointsValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/EndpointConfig.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/EndpointConfig.java index 319ffa9b14c3c..94fe5032d55cf 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/EndpointConfig.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/EndpointConfig.java @@ -34,6 +34,7 @@ public class EndpointConfig /** * The config id for endpoint monitoring config. + * @return The ConfigId value. */ public String getConfigId() { @@ -42,16 +43,18 @@ public String getConfigId() /** * The config id for endpoint monitoring config. + * @param configIdValue The ConfigId value. */ - public void setConfigId(String configId) + public void setConfigId(final String configIdValue) { - this.configId = configId; + this.configId = configIdValue; } private String location; /** * The location from which the endpoint is monitored. + * @return The Location value. */ public String getLocation() { @@ -60,16 +63,18 @@ public String getLocation() /** * The location from which the endpoint is monitored. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private String name; /** * The friendly name for the url for which endpoint monitoring is configured. + * @return The Name value. */ public String getName() { @@ -78,16 +83,18 @@ public String getName() /** * The friendly name for the url for which endpoint monitoring is configured. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private URI url; /** * The Url to be monitored. + * @return The Url value. */ public URI getUrl() { @@ -96,9 +103,10 @@ public URI getUrl() /** * The Url to be monitored. + * @param urlValue The Url value. */ - public void setUrl(URI url) + public void setUrl(final URI urlValue) { - this.url = url; + this.url = urlValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricAvailability.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricAvailability.java index f596ec1649c23..c0098e399420e 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricAvailability.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricAvailability.java @@ -35,6 +35,7 @@ public class MetricAvailability /** * The retention period for the metric at the specified timegrain. + * @return The Retention value. */ public Duration getRetention() { @@ -43,16 +44,18 @@ public Duration getRetention() /** * The retention period for the metric at the specified timegrain. + * @param retentionValue The Retention value. */ - public void setRetention(Duration retention) + public void setRetention(final Duration retentionValue) { - this.retention = retention; + this.retention = retentionValue; } private Duration timeGrain; /** * The time grain specifies the aggregation interval for the metric. + * @return The TimeGrain value. */ public Duration getTimeGrain() { @@ -61,9 +64,10 @@ public Duration getTimeGrain() /** * The time grain specifies the aggregation interval for the metric. + * @param timeGrainValue The TimeGrain value. */ - public void setTimeGrain(Duration timeGrain) + public void setTimeGrain(final Duration timeGrainValue) { - this.timeGrain = timeGrain; + this.timeGrain = timeGrainValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinition.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinition.java index 25f73452875aa..3cedcf372ae57 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinition.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinition.java @@ -35,6 +35,7 @@ public class MetricDefinition /** * Metric display name. + * @return The DisplayName value. */ public String getDisplayName() { @@ -43,10 +44,11 @@ public String getDisplayName() /** * Metric display name. + * @param displayNameValue The DisplayName value. */ - public void setDisplayName(String displayName) + public void setDisplayName(final String displayNameValue) { - this.displayName = displayName; + this.displayName = displayNameValue; } private boolean isAlertable; @@ -54,6 +56,7 @@ public void setDisplayName(String displayName) /** * Specifies if the metric is alertable. Alerts can be defined on a metric * only if this property is true. + * @return The IsAlertable value. */ public boolean isAlertable() { @@ -63,10 +66,11 @@ public boolean isAlertable() /** * Specifies if the metric is alertable. Alerts can be defined on a metric * only if this property is true. + * @param isAlertableValue The IsAlertable value. */ - public void setIsAlertable(boolean isAlertable) + public void setIsAlertable(final boolean isAlertableValue) { - this.isAlertable = isAlertable; + this.isAlertable = isAlertableValue; } private ArrayList metricAvailabilities; @@ -74,6 +78,7 @@ public void setIsAlertable(boolean isAlertable) /** * Metric availability specifies the time grain (aggregation interval) and * the retention period for the metric in a timegrain. + * @return The MetricAvailabilities value. */ public ArrayList getMetricAvailabilities() { @@ -83,16 +88,18 @@ public ArrayList getMetricAvailabilities() /** * Metric availability specifies the time grain (aggregation interval) and * the retention period for the metric in a timegrain. + * @param metricAvailabilitiesValue The MetricAvailabilities value. */ - public void setMetricAvailabilities(ArrayList metricAvailabilities) + public void setMetricAvailabilities(final ArrayList metricAvailabilitiesValue) { - this.metricAvailabilities = metricAvailabilities; + this.metricAvailabilities = metricAvailabilitiesValue; } private Duration minimumAlertableTimeWindow; /** * Specifies the minimum alertable time window for the metric. + * @return The MinimumAlertableTimeWindow value. */ public Duration getMinimumAlertableTimeWindow() { @@ -101,16 +108,19 @@ public Duration getMinimumAlertableTimeWindow() /** * Specifies the minimum alertable time window for the metric. + * @param minimumAlertableTimeWindowValue The MinimumAlertableTimeWindow + * value. */ - public void setMinimumAlertableTimeWindow(Duration minimumAlertableTimeWindow) + public void setMinimumAlertableTimeWindow(final Duration minimumAlertableTimeWindowValue) { - this.minimumAlertableTimeWindow = minimumAlertableTimeWindow; + this.minimumAlertableTimeWindow = minimumAlertableTimeWindowValue; } private String name; /** * Get the metric name. + * @return The Name value. */ public String getName() { @@ -119,16 +129,18 @@ public String getName() /** * Get the metric name. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String namespace; /** * Get the metric namespace. + * @return The Namespace value. */ public String getNamespace() { @@ -137,10 +149,11 @@ public String getNamespace() /** * Get the metric namespace. + * @param namespaceValue The Namespace value. */ - public void setNamespace(String namespace) + public void setNamespace(final String namespaceValue) { - this.namespace = namespace; + this.namespace = namespaceValue; } private String primaryAggregation; @@ -149,6 +162,7 @@ public void setNamespace(String namespace) * Metric primary aggregation specifies the default type for the metrics. * This indicates if the metric is of type average, total, minimum or * maximum. + * @return The PrimaryAggregation value. */ public String getPrimaryAggregation() { @@ -159,10 +173,11 @@ public String getPrimaryAggregation() * Metric primary aggregation specifies the default type for the metrics. * This indicates if the metric is of type average, total, minimum or * maximum. + * @param primaryAggregationValue The PrimaryAggregation value. */ - public void setPrimaryAggregation(String primaryAggregation) + public void setPrimaryAggregation(final String primaryAggregationValue) { - this.primaryAggregation = primaryAggregation; + this.primaryAggregation = primaryAggregationValue; } private String resourceIdSuffix; @@ -170,6 +185,7 @@ public void setPrimaryAggregation(String primaryAggregation) /** * Metric resource id suffix specfies the sub-resource path within the the * resource for the metric. + * @return The ResourceIdSuffix value. */ public String getResourceIdSuffix() { @@ -179,16 +195,18 @@ public String getResourceIdSuffix() /** * Metric resource id suffix specfies the sub-resource path within the the * resource for the metric. + * @param resourceIdSuffixValue The ResourceIdSuffix value. */ - public void setResourceIdSuffix(String resourceIdSuffix) + public void setResourceIdSuffix(final String resourceIdSuffixValue) { - this.resourceIdSuffix = resourceIdSuffix; + this.resourceIdSuffix = resourceIdSuffixValue; } private String unit; /** * The unit for the metric. + * @return The Unit value. */ public String getUnit() { @@ -197,10 +215,11 @@ public String getUnit() /** * The unit for the metric. + * @param unitValue The Unit value. */ - public void setUnit(String unit) + public void setUnit(final String unitValue) { - this.unit = unit; + this.unit = unitValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinitionCollection.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinitionCollection.java index 17eaae59400a8..c66ca29625697 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinitionCollection.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinitionCollection.java @@ -34,6 +34,7 @@ public class MetricDefinitionCollection /** * The values for the metric definitions. + * @return The Value value. */ public ArrayList getValue() { @@ -42,10 +43,11 @@ public ArrayList getValue() /** * The values for the metric definitions. + * @param valueValue The Value value. */ - public void setValue(ArrayList value) + public void setValue(final ArrayList valueValue) { - this.value = value; + this.value = valueValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinitionListResponse.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinitionListResponse.java index 2a919a97b02d5..72d0417f513a0 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinitionListResponse.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricDefinitionListResponse.java @@ -34,6 +34,7 @@ public class MetricDefinitionListResponse extends OperationResponse /** * The retrieved metric definitions. + * @return The MetricDefinitionCollection value. */ public MetricDefinitionCollection getMetricDefinitionCollection() { @@ -42,9 +43,11 @@ public MetricDefinitionCollection getMetricDefinitionCollection() /** * The retrieved metric definitions. + * @param metricDefinitionCollectionValue The MetricDefinitionCollection + * value. */ - public void setMetricDefinitionCollection(MetricDefinitionCollection metricDefinitionCollection) + public void setMetricDefinitionCollection(final MetricDefinitionCollection metricDefinitionCollectionValue) { - this.metricDefinitionCollection = metricDefinitionCollection; + this.metricDefinitionCollection = metricDefinitionCollectionValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSetting.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSetting.java index 37b1d2f8e82c1..4ea57e7b4e5a9 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSetting.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSetting.java @@ -33,6 +33,7 @@ public class MetricSetting /** * The metric settings namespace. For endpoint monitoring metrics the * namespace value is WindowsAzure.Availability + * @return The Namespace value. */ public String getNamespace() { @@ -42,16 +43,18 @@ public String getNamespace() /** * The metric settings namespace. For endpoint monitoring metrics the * namespace value is WindowsAzure.Availability + * @param namespaceValue The Namespace value. */ - public void setNamespace(String namespace) + public void setNamespace(final String namespaceValue) { - this.namespace = namespace; + this.namespace = namespaceValue; } private String resourceId; /** * The resource id of the service. + * @return The ResourceId value. */ public String getResourceId() { @@ -60,16 +63,18 @@ public String getResourceId() /** * The resource id of the service. + * @param resourceIdValue The ResourceId value. */ - public void setResourceId(String resourceId) + public void setResourceId(final String resourceIdValue) { - this.resourceId = resourceId; + this.resourceId = resourceIdValue; } private MetricSettingValue value; /** * The metric settings value. + * @return The Value value. */ public MetricSettingValue getValue() { @@ -78,9 +83,10 @@ public MetricSettingValue getValue() /** * The metric settings value. + * @param valueValue The Value value. */ - public void setValue(MetricSettingValue value) + public void setValue(final MetricSettingValue valueValue) { - this.value = value; + this.value = valueValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingCollection.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingCollection.java index dc1c512ef2c22..9a1238dc27fc9 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingCollection.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingCollection.java @@ -34,6 +34,7 @@ public class MetricSettingCollection /** * The collection. + * @return The Value value. */ public ArrayList getValue() { @@ -42,10 +43,11 @@ public ArrayList getValue() /** * The collection. + * @param valueValue The Value value. */ - public void setValue(ArrayList value) + public void setValue(final ArrayList valueValue) { - this.value = value; + this.value = valueValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingListResponse.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingListResponse.java index 94a454a00d7fd..34ad20156bea9 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingListResponse.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingListResponse.java @@ -34,6 +34,7 @@ public class MetricSettingListResponse extends OperationResponse /** * The retrieved metric settings. + * @return The MetricSettingCollection value. */ public MetricSettingCollection getMetricSettingCollection() { @@ -42,9 +43,10 @@ public MetricSettingCollection getMetricSettingCollection() /** * The retrieved metric settings. + * @param metricSettingCollectionValue The MetricSettingCollection value. */ - public void setMetricSettingCollection(MetricSettingCollection metricSettingCollection) + public void setMetricSettingCollection(final MetricSettingCollection metricSettingCollectionValue) { - this.metricSettingCollection = metricSettingCollection; + this.metricSettingCollection = metricSettingCollectionValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingsPutParameters.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingsPutParameters.java index a7c267c2b0424..6cf89924262e0 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingsPutParameters.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricSettingsPutParameters.java @@ -32,6 +32,7 @@ public class MetricSettingsPutParameters /** * Required. The metric setting. + * @return The MetricSetting value. */ public MetricSetting getMetricSetting() { @@ -40,9 +41,10 @@ public MetricSetting getMetricSetting() /** * Required. The metric setting. + * @param metricSettingValue The MetricSetting value. */ - public void setMetricSetting(MetricSetting metricSetting) + public void setMetricSetting(final MetricSetting metricSettingValue) { - this.metricSetting = metricSetting; + this.metricSetting = metricSettingValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValue.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValue.java index bd77f99472404..d1ce136a21fb5 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValue.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValue.java @@ -34,6 +34,7 @@ public class MetricValue /** * Specifies annotation for the metric. + * @return The Annotation value. */ public String getAnnotation() { @@ -42,16 +43,18 @@ public String getAnnotation() /** * Specifies annotation for the metric. + * @param annotationValue The Annotation value. */ - public void setAnnotation(String annotation) + public void setAnnotation(final String annotationValue) { - this.annotation = annotation; + this.annotation = annotationValue; } private Double average; /** * Specifies the average value in the time interval. + * @return The Average value. */ public Double getAverage() { @@ -60,10 +63,11 @@ public Double getAverage() /** * Specifies the average value in the time interval. + * @param averageValue The Average value. */ - public void setAverage(Double average) + public void setAverage(final Double averageValue) { - this.average = average; + this.average = averageValue; } private Integer count; @@ -71,6 +75,7 @@ public void setAverage(Double average) /** * Specifies the sample count in the time interval. Can be used to determine * the number of values that contributed to the average value. + * @return The Count value. */ public Integer getCount() { @@ -80,16 +85,18 @@ public Integer getCount() /** * Specifies the sample count in the time interval. Can be used to determine * the number of values that contributed to the average value. + * @param countValue The Count value. */ - public void setCount(Integer count) + public void setCount(final Integer countValue) { - this.count = count; + this.count = countValue; } private Double maximum; /** * Specifies the maximum value in the time interval. + * @return The Maximum value. */ public Double getMaximum() { @@ -98,16 +105,18 @@ public Double getMaximum() /** * Specifies the maximum value in the time interval. + * @param maximumValue The Maximum value. */ - public void setMaximum(Double maximum) + public void setMaximum(final Double maximumValue) { - this.maximum = maximum; + this.maximum = maximumValue; } private Double minimum; /** * Specifies the minimum value in the time interval. + * @return The Minimum value. */ public Double getMinimum() { @@ -116,16 +125,18 @@ public Double getMinimum() /** * Specifies the minimum value in the time interval. + * @param minimumValue The Minimum value. */ - public void setMinimum(Double minimum) + public void setMinimum(final Double minimumValue) { - this.minimum = minimum; + this.minimum = minimumValue; } private Calendar timestamp; /** * The timestamp for the metric value. + * @return The Timestamp value. */ public Calendar getTimestamp() { @@ -134,16 +145,18 @@ public Calendar getTimestamp() /** * The timestamp for the metric value. + * @param timestampValue The Timestamp value. */ - public void setTimestamp(Calendar timestamp) + public void setTimestamp(final Calendar timestampValue) { - this.timestamp = timestamp; + this.timestamp = timestampValue; } private Double total; /** * Specifies the total value in the time interval. + * @return The Total value. */ public Double getTotal() { @@ -152,9 +165,10 @@ public Double getTotal() /** * Specifies the total value in the time interval. + * @param totalValue The Total value. */ - public void setTotal(Double total) + public void setTotal(final Double totalValue) { - this.total = total; + this.total = totalValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueListResponse.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueListResponse.java index 29086db9985a8..7546e8bfcbba8 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueListResponse.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueListResponse.java @@ -34,6 +34,7 @@ public class MetricValueListResponse extends OperationResponse /** * The retrieved metric value sets. + * @return The MetricValueSetCollection value. */ public MetricValueSetCollection getMetricValueSetCollection() { @@ -42,9 +43,10 @@ public MetricValueSetCollection getMetricValueSetCollection() /** * The retrieved metric value sets. + * @param metricValueSetCollectionValue The MetricValueSetCollection value. */ - public void setMetricValueSetCollection(MetricValueSetCollection metricValueSetCollection) + public void setMetricValueSetCollection(final MetricValueSetCollection metricValueSetCollectionValue) { - this.metricValueSetCollection = metricValueSetCollection; + this.metricValueSetCollection = metricValueSetCollectionValue; } } diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueSet.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueSet.java index bada8a4b88d80..77c1bc45893c9 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueSet.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueSet.java @@ -36,6 +36,7 @@ public class MetricValueSet /** * Metric display name. + * @return The DisplayName value. */ public String getDisplayName() { @@ -44,16 +45,18 @@ public String getDisplayName() /** * Metric display name. + * @param displayNameValue The DisplayName value. */ - public void setDisplayName(String displayName) + public void setDisplayName(final String displayNameValue) { - this.displayName = displayName; + this.displayName = displayNameValue; } private Calendar endTime; /** * The end time in UTC for the metric queried. + * @return The EndTime value. */ public Calendar getEndTime() { @@ -62,16 +65,18 @@ public Calendar getEndTime() /** * The end time in UTC for the metric queried. + * @param endTimeValue The EndTime value. */ - public void setEndTime(Calendar endTime) + public void setEndTime(final Calendar endTimeValue) { - this.endTime = endTime; + this.endTime = endTimeValue; } private ArrayList metricValues; /** * Metric values. + * @return The MetricValues value. */ public ArrayList getMetricValues() { @@ -80,16 +85,18 @@ public ArrayList getMetricValues() /** * Metric values. + * @param metricValuesValue The MetricValues value. */ - public void setMetricValues(ArrayList metricValues) + public void setMetricValues(final ArrayList metricValuesValue) { - this.metricValues = metricValues; + this.metricValues = metricValuesValue; } private String name; /** * Metric name. + * @return The Name value. */ public String getName() { @@ -98,16 +105,18 @@ public String getName() /** * Metric name. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String namespace; /** * Metric namespace. + * @return The Namespace value. */ public String getNamespace() { @@ -116,16 +125,18 @@ public String getNamespace() /** * Metric namespace. + * @param namespaceValue The Namespace value. */ - public void setNamespace(String namespace) + public void setNamespace(final String namespaceValue) { - this.namespace = namespace; + this.namespace = namespaceValue; } private String primaryAggregation; /** * Metric primary aggregation. + * @return The PrimaryAggregation value. */ public String getPrimaryAggregation() { @@ -134,16 +145,18 @@ public String getPrimaryAggregation() /** * Metric primary aggregation. + * @param primaryAggregationValue The PrimaryAggregation value. */ - public void setPrimaryAggregation(String primaryAggregation) + public void setPrimaryAggregation(final String primaryAggregationValue) { - this.primaryAggregation = primaryAggregation; + this.primaryAggregation = primaryAggregationValue; } private Calendar startTime; /** * The start time in UTC for the metric queried. + * @return The StartTime value. */ public Calendar getStartTime() { @@ -152,16 +165,18 @@ public Calendar getStartTime() /** * The start time in UTC for the metric queried. + * @param startTimeValue The StartTime value. */ - public void setStartTime(Calendar startTime) + public void setStartTime(final Calendar startTimeValue) { - this.startTime = startTime; + this.startTime = startTimeValue; } private Duration timeGrain; /** * The time grain specifies the aggregation period of the metric value. + * @return The TimeGrain value. */ public Duration getTimeGrain() { @@ -170,16 +185,18 @@ public Duration getTimeGrain() /** * The time grain specifies the aggregation period of the metric value. + * @param timeGrainValue The TimeGrain value. */ - public void setTimeGrain(Duration timeGrain) + public void setTimeGrain(final Duration timeGrainValue) { - this.timeGrain = timeGrain; + this.timeGrain = timeGrainValue; } private String unit; /** * Metric unit. + * @return The Unit value. */ public String getUnit() { @@ -188,10 +205,11 @@ public String getUnit() /** * Metric unit. + * @param unitValue The Unit value. */ - public void setUnit(String unit) + public void setUnit(final String unitValue) { - this.unit = unit; + this.unit = unitValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueSetCollection.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueSetCollection.java index 4c5dd21c3ab50..73a9bf85c2555 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueSetCollection.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/MetricValueSetCollection.java @@ -34,6 +34,7 @@ public class MetricValueSetCollection /** * The collection. + * @return The Value value. */ public ArrayList getValue() { @@ -42,10 +43,11 @@ public ArrayList getValue() /** * The collection. + * @param valueValue The Value value. */ - public void setValue(ArrayList value) + public void setValue(final ArrayList valueValue) { - this.value = value; + this.value = valueValue; } /** diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/NameConfig.java b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/NameConfig.java index e8ec651e0b75e..ae140aae61f5a 100644 --- a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/NameConfig.java +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/NameConfig.java @@ -32,6 +32,7 @@ public class NameConfig /** * Availability metric name config display name. + * @return The DisplayName value. */ public String getDisplayName() { @@ -40,16 +41,18 @@ public String getDisplayName() /** * Availability metric name config display name. + * @param displayNameValue The DisplayName value. */ - public void setDisplayName(String displayName) + public void setDisplayName(final String displayNameValue) { - this.displayName = displayName; + this.displayName = displayNameValue; } private String name; /** * Availability metric name config name. + * @return The Name value. */ public String getName() { @@ -58,9 +61,10 @@ public String getName() /** * Availability metric name config name. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/JobCollectionOperations.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/JobCollectionOperations.java index 6cdc04cf39ced..6fa5b07e344ae 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/JobCollectionOperations.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/JobCollectionOperations.java @@ -33,11 +33,9 @@ import com.microsoft.windowsazure.management.scheduler.models.JobCollectionUpdateResponse; import com.microsoft.windowsazure.management.scheduler.models.SchedulerOperationStatusResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -51,9 +49,19 @@ public interface JobCollectionOperations * @param jobCollectionName The name of the job collection to create. * @param parameters Parameters supplied to the Create Job Collection * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The Create Job Collection operation response. */ - JobCollectionCreateResponse beginCreating(String cloudServiceName, String jobCollectionName, JobCollectionCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + JobCollectionCreateResponse beginCreating(String cloudServiceName, String jobCollectionName, JobCollectionCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * Create a job collection. @@ -72,6 +80,10 @@ public interface JobCollectionOperations * * @param cloudServiceName The name of the cloud service. * @param jobCollectionName The name of the job collection to delete. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -95,9 +107,19 @@ public interface JobCollectionOperations * @param jobCollectionName The name of the job collection to update. * @param parameters Parameters supplied to the Update Job Collection * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The Update Job Collection operation response. */ - JobCollectionUpdateResponse beginUpdating(String cloudServiceName, String jobCollectionName, JobCollectionUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + JobCollectionUpdateResponse beginUpdating(String cloudServiceName, String jobCollectionName, JobCollectionUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * Update a job collection. @@ -119,6 +141,14 @@ public interface JobCollectionOperations * @param jobCollectionName A name for the JobCollection. The name must be * unique as scoped within the CloudService. The name can be up to 100 * characters in length. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Check Name Availability operation response. */ JobCollectionCheckNameAvailabilityResponse checkNameAvailability(String cloudServiceName, String jobCollectionName) throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -143,6 +173,18 @@ public interface JobCollectionOperations * @param jobCollectionName The name of the job collection to create. * @param parameters Parameters supplied to the Create Job Collection * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -180,6 +222,18 @@ public interface JobCollectionOperations * * @param cloudServiceName The name of the cloud service. * @param jobCollectionName The name of the job collection to delete. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -214,6 +268,14 @@ public interface JobCollectionOperations * * @param cloudServiceName Name of the cloud service. * @param jobCollectionName Name of the job collection. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Get Job Collection operation response. */ JobCollectionGetResponse get(String cloudServiceName, String jobCollectionName) throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -235,6 +297,18 @@ public interface JobCollectionOperations * @param jobCollectionName The name of the job collection to update. * @param parameters Parameters supplied to the Update Job Collection * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/JobCollectionOperationsImpl.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/JobCollectionOperationsImpl.java index b136670ebde2e..f1fddb7c0a79d 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/JobCollectionOperationsImpl.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/JobCollectionOperationsImpl.java @@ -46,7 +46,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -55,7 +54,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -88,6 +86,7 @@ public class JobCollectionOperationsImpl implements ServiceOperations 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()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + JobCollectionCreateResponse result = null; + result = new JobCollectionCreateResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -315,6 +334,10 @@ public OperationResponse call() throws Exception * * @param cloudServiceName The name of the cloud service. * @param jobCollectionName The name of the job collection to delete. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -354,40 +377,50 @@ public OperationResponse beginDeleting(String cloudServiceName, String jobCollec // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -420,10 +453,20 @@ public JobCollectionUpdateResponse call() throws Exception * @param jobCollectionName The name of the job collection to update. * @param parameters Parameters supplied to the Update Job Collection * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The Update Job Collection operation response. */ @Override - public JobCollectionUpdateResponse beginUpdating(String cloudServiceName, String jobCollectionName, JobCollectionUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public JobCollectionUpdateResponse beginUpdating(String cloudServiceName, String jobCollectionName, JobCollectionUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (cloudServiceName == null) @@ -554,44 +597,54 @@ public JobCollectionUpdateResponse beginUpdating(String cloudServiceName, String // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - 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()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -624,6 +677,14 @@ public JobCollectionCheckNameAvailabilityResponse call() throws Exception * @param jobCollectionName A name for the JobCollection. The name must be * unique as scoped within the CloudService. The name can be up to 100 * characters in length. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Check Name Availability operation response. */ @Override @@ -666,60 +727,70 @@ public JobCollectionCheckNameAvailabilityResponse checkNameAvailability(String c // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - JobCollectionCheckNameAvailabilityResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new JobCollectionCheckNameAvailabilityResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ResourceNameAvailabilityResponse"); - Element resourceNameAvailabilityResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (resourceNameAvailabilityResponseElement != null) - { - NodeList elements2 = resourceNameAvailabilityResponseElement.getElementsByTagName("IsAvailable"); - Element isAvailableElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (isAvailableElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - boolean isAvailableInstance; - isAvailableInstance = Boolean.parseBoolean(isAvailableElement.getTextContent()); - result.setIsAvailable(isAvailableInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + JobCollectionCheckNameAvailabilityResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new JobCollectionCheckNameAvailabilityResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ResourceNameAvailabilityResponse"); + Element resourceNameAvailabilityResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (resourceNameAvailabilityResponseElement != null) + { + NodeList elements2 = resourceNameAvailabilityResponseElement.getElementsByTagName("IsAvailable"); + Element isAvailableElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (isAvailableElement != null) + { + boolean isAvailableInstance; + isAvailableInstance = Boolean.parseBoolean(isAvailableElement.getTextContent()); + result.setIsAvailable(isAvailableInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -760,6 +831,18 @@ public SchedulerOperationStatusResponse call() throws Exception * @param jobCollectionName The name of the job collection to create. * @param parameters Parameters supplied to the Create Job Collection * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -875,6 +958,18 @@ public SchedulerOperationStatusResponse call() throws Exception * * @param cloudServiceName The name of the cloud service. * @param jobCollectionName The name of the job collection to delete. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -980,6 +1075,14 @@ public JobCollectionGetResponse call() throws Exception * * @param cloudServiceName Name of the cloud service. * @param jobCollectionName Name of the job collection. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Get Job Collection operation response. */ @Override @@ -1018,226 +1121,236 @@ public JobCollectionGetResponse get(String cloudServiceName, String jobCollectio // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - JobCollectionGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new JobCollectionGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Resource"); - Element resourceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (resourceElement != null) - { - NodeList elements2 = resourceElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = resourceElement.getElementsByTagName("ETag"); - Element eTagElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (eTagElement != null) - { - String eTagInstance; - eTagInstance = eTagElement.getTextContent(); - result.setETag(eTagInstance); - } - - NodeList elements4 = resourceElement.getElementsByTagName("State"); - Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (stateElement != null) - { - JobCollectionState stateInstance; - stateInstance = JobCollectionState.valueOf(stateElement.getTextContent()); - result.setState(stateInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements5 = resourceElement.getElementsByTagName("SchemaVersion"); - Element schemaVersionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (schemaVersionElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String schemaVersionInstance; - schemaVersionInstance = schemaVersionElement.getTextContent(); - result.setSchemaVersion(schemaVersionInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements6 = resourceElement.getElementsByTagName("Plan"); - Element planElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (planElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String planInstance; - planInstance = planElement.getTextContent(); - result.setPlan(planInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements7 = resourceElement.getElementsByTagName("PromotionCode"); - Element promotionCodeElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (promotionCodeElement != null) - { - String promotionCodeInstance; - promotionCodeInstance = promotionCodeElement.getTextContent(); - result.setPromotionCode(promotionCodeInstance); - } + // Create Result + JobCollectionGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new JobCollectionGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements8 = resourceElement.getElementsByTagName("IntrinsicSettings"); - Element intrinsicSettingsElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (intrinsicSettingsElement != null) + NodeList elements = responseDoc.getElementsByTagName("Resource"); + Element resourceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (resourceElement != null) { - JobCollectionIntrinsicSettings intrinsicSettingsInstance = new JobCollectionIntrinsicSettings(); - result.setIntrinsicSettings(intrinsicSettingsInstance); + NodeList elements2 = resourceElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } - NodeList elements9 = intrinsicSettingsElement.getElementsByTagName("Plan"); - Element planElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (planElement2 != null) + NodeList elements3 = resourceElement.getElementsByTagName("ETag"); + Element eTagElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (eTagElement != null) { - JobCollectionPlan planInstance2; - planInstance2 = JobCollectionPlan.valueOf(planElement2.getTextContent()); - intrinsicSettingsInstance.setPlan(planInstance2); + String eTagInstance; + eTagInstance = eTagElement.getTextContent(); + result.setETag(eTagInstance); } - NodeList elements10 = intrinsicSettingsElement.getElementsByTagName("Quota"); - Element quotaElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (quotaElement != null) + NodeList elements4 = resourceElement.getElementsByTagName("State"); + Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (stateElement != null) { - JobCollectionQuota quotaInstance = new JobCollectionQuota(); - intrinsicSettingsInstance.setQuota(quotaInstance); - - NodeList elements11 = quotaElement.getElementsByTagName("MaxJobCount"); - Element maxJobCountElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (maxJobCountElement != null && (maxJobCountElement.getTextContent() != null && maxJobCountElement.getTextContent().isEmpty() != true) == false) - { - int maxJobCountInstance; - maxJobCountInstance = Integer.parseInt(maxJobCountElement.getTextContent()); - quotaInstance.setMaxJobCount(maxJobCountInstance); - } + JobCollectionState stateInstance; + stateInstance = JobCollectionState.valueOf(stateElement.getTextContent()); + result.setState(stateInstance); + } + + NodeList elements5 = resourceElement.getElementsByTagName("SchemaVersion"); + Element schemaVersionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (schemaVersionElement != null) + { + String schemaVersionInstance; + schemaVersionInstance = schemaVersionElement.getTextContent(); + result.setSchemaVersion(schemaVersionInstance); + } + + NodeList elements6 = resourceElement.getElementsByTagName("Plan"); + Element planElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (planElement != null) + { + String planInstance; + planInstance = planElement.getTextContent(); + result.setPlan(planInstance); + } + + NodeList elements7 = resourceElement.getElementsByTagName("PromotionCode"); + Element promotionCodeElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (promotionCodeElement != null) + { + String promotionCodeInstance; + promotionCodeInstance = promotionCodeElement.getTextContent(); + result.setPromotionCode(promotionCodeInstance); + } + + NodeList elements8 = resourceElement.getElementsByTagName("IntrinsicSettings"); + Element intrinsicSettingsElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (intrinsicSettingsElement != null) + { + JobCollectionIntrinsicSettings intrinsicSettingsInstance = new JobCollectionIntrinsicSettings(); + result.setIntrinsicSettings(intrinsicSettingsInstance); - NodeList elements12 = quotaElement.getElementsByTagName("MaxJobOccurrence"); - Element maxJobOccurrenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (maxJobOccurrenceElement != null && (maxJobOccurrenceElement.getTextContent() != null && maxJobOccurrenceElement.getTextContent().isEmpty() != true) == false) + NodeList elements9 = intrinsicSettingsElement.getElementsByTagName("Plan"); + Element planElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (planElement2 != null) { - int maxJobOccurrenceInstance; - maxJobOccurrenceInstance = Integer.parseInt(maxJobOccurrenceElement.getTextContent()); - quotaInstance.setMaxJobOccurrence(maxJobOccurrenceInstance); + JobCollectionPlan planInstance2; + planInstance2 = JobCollectionPlan.valueOf(planElement2.getTextContent()); + intrinsicSettingsInstance.setPlan(planInstance2); } - NodeList elements13 = quotaElement.getElementsByTagName("MaxRecurrence"); - Element maxRecurrenceElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (maxRecurrenceElement != null) + NodeList elements10 = intrinsicSettingsElement.getElementsByTagName("Quota"); + Element quotaElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (quotaElement != null) { - JobCollectionMaxRecurrence maxRecurrenceInstance = new JobCollectionMaxRecurrence(); - quotaInstance.setMaxRecurrence(maxRecurrenceInstance); + JobCollectionQuota quotaInstance = new JobCollectionQuota(); + intrinsicSettingsInstance.setQuota(quotaInstance); + + NodeList elements11 = quotaElement.getElementsByTagName("MaxJobCount"); + Element maxJobCountElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (maxJobCountElement != null && (maxJobCountElement.getTextContent() != null && maxJobCountElement.getTextContent().isEmpty() != true) == false) + { + int maxJobCountInstance; + maxJobCountInstance = Integer.parseInt(maxJobCountElement.getTextContent()); + quotaInstance.setMaxJobCount(maxJobCountInstance); + } - NodeList elements14 = maxRecurrenceElement.getElementsByTagName("Frequency"); - Element frequencyElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (frequencyElement != null) + NodeList elements12 = quotaElement.getElementsByTagName("MaxJobOccurrence"); + Element maxJobOccurrenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (maxJobOccurrenceElement != null && (maxJobOccurrenceElement.getTextContent() != null && maxJobOccurrenceElement.getTextContent().isEmpty() != true) == false) { - JobCollectionRecurrenceFrequency frequencyInstance; - frequencyInstance = JobCollectionRecurrenceFrequency.valueOf(frequencyElement.getTextContent()); - maxRecurrenceInstance.setFrequency(frequencyInstance); + int maxJobOccurrenceInstance; + maxJobOccurrenceInstance = Integer.parseInt(maxJobOccurrenceElement.getTextContent()); + quotaInstance.setMaxJobOccurrence(maxJobOccurrenceInstance); } - NodeList elements15 = maxRecurrenceElement.getElementsByTagName("Interval"); - Element intervalElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (intervalElement != null) + NodeList elements13 = quotaElement.getElementsByTagName("MaxRecurrence"); + Element maxRecurrenceElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (maxRecurrenceElement != null) { - int intervalInstance; - intervalInstance = Integer.parseInt(intervalElement.getTextContent()); - maxRecurrenceInstance.setInterval(intervalInstance); + JobCollectionMaxRecurrence maxRecurrenceInstance = new JobCollectionMaxRecurrence(); + quotaInstance.setMaxRecurrence(maxRecurrenceInstance); + + NodeList elements14 = maxRecurrenceElement.getElementsByTagName("Frequency"); + Element frequencyElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (frequencyElement != null) + { + JobCollectionRecurrenceFrequency frequencyInstance; + frequencyInstance = JobCollectionRecurrenceFrequency.valueOf(frequencyElement.getTextContent()); + maxRecurrenceInstance.setFrequency(frequencyInstance); + } + + NodeList elements15 = maxRecurrenceElement.getElementsByTagName("Interval"); + Element intervalElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (intervalElement != null) + { + int intervalInstance; + intervalInstance = Integer.parseInt(intervalElement.getTextContent()); + maxRecurrenceInstance.setInterval(intervalInstance); + } } } } - } - - NodeList elements16 = resourceElement.getElementsByTagName("Label"); - Element labelElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - result.setLabel(labelInstance); - } - - NodeList elements17 = resourceElement.getElementsByTagName("OperationStatus"); - Element operationStatusElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (operationStatusElement != null) - { - JobCollectionGetResponse.OperationStatus operationStatusInstance = new JobCollectionGetResponse.OperationStatus(); - result.setLastOperationStatus(operationStatusInstance); - NodeList elements18 = operationStatusElement.getElementsByTagName("Error"); - Element errorElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (errorElement != null) + NodeList elements16 = resourceElement.getElementsByTagName("Label"); + Element labelElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + result.setLabel(labelInstance); + } + + NodeList elements17 = resourceElement.getElementsByTagName("OperationStatus"); + Element operationStatusElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (operationStatusElement != null) { - JobCollectionGetResponse.OperationStatusResponseDetails errorInstance = new JobCollectionGetResponse.OperationStatusResponseDetails(); - operationStatusInstance.setResponseDetails(errorInstance); + JobCollectionGetResponse.OperationStatus operationStatusInstance = new JobCollectionGetResponse.OperationStatus(); + result.setLastOperationStatus(operationStatusInstance); - NodeList elements19 = errorElement.getElementsByTagName("HttpCode"); - Element httpCodeElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (httpCodeElement != null) + NodeList elements18 = operationStatusElement.getElementsByTagName("Error"); + Element errorElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (errorElement != null) { - Integer httpCodeInstance; - httpCodeInstance = Integer.valueOf(httpCodeElement.getTextContent()); - errorInstance.setStatusCode(httpCodeInstance); + JobCollectionGetResponse.OperationStatusResponseDetails errorInstance = new JobCollectionGetResponse.OperationStatusResponseDetails(); + operationStatusInstance.setResponseDetails(errorInstance); + + NodeList elements19 = errorElement.getElementsByTagName("HttpCode"); + Element httpCodeElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (httpCodeElement != null) + { + Integer httpCodeInstance; + httpCodeInstance = Integer.valueOf(httpCodeElement.getTextContent()); + errorInstance.setStatusCode(httpCodeInstance); + } + + NodeList elements20 = errorElement.getElementsByTagName("Message"); + Element messageElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } } - NodeList elements20 = errorElement.getElementsByTagName("Message"); - Element messageElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (messageElement != null) + NodeList elements21 = operationStatusElement.getElementsByTagName("Result"); + Element resultElement = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (resultElement != null) { - String messageInstance; - messageInstance = messageElement.getTextContent(); - errorInstance.setMessage(messageInstance); + SchedulerOperationStatus resultInstance; + resultInstance = SchedulerOperationStatus.valueOf(resultElement.getTextContent()); + operationStatusInstance.setStatus(resultInstance); } } - - NodeList elements21 = operationStatusElement.getElementsByTagName("Result"); - Element resultElement = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (resultElement != null) - { - SchedulerOperationStatus resultInstance; - resultInstance = SchedulerOperationStatus.valueOf(resultElement.getTextContent()); - operationStatusInstance.setStatus(resultInstance); - } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1278,6 +1391,18 @@ public SchedulerOperationStatusResponse call() throws Exception * @param jobCollectionName The name of the job collection to update. * @param parameters Parameters supplied to the Update Job Collection * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/SchedulerManagementClient.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/SchedulerManagementClient.java index eaee71024b74c..0c29132d82d02 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/SchedulerManagementClient.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/SchedulerManagementClient.java @@ -37,10 +37,19 @@ public interface SchedulerManagementClient extends FilterableService { + /** + * @return The BaseUri value. + */ URI getBaseUri(); + /** + * @return The Credentials value. + */ SubscriptionCloudCredentials getCredentials(); + /** + * @return The JobCollectionsOperations value. + */ JobCollectionOperations getJobCollectionsOperations(); /** @@ -54,6 +63,14 @@ public interface SchedulerManagementClient extends FilterableService 0 ? ((Element) elements.item(0)) : null; - if (operationElement != null) - { - NodeList elements2 = operationElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = operationElement.getElementsByTagName("Status"); - Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (statusElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - SchedulerOperationStatus statusInstance; - statusInstance = SchedulerOperationStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); - Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (httpStatusCodeElement != null) - { - Integer httpStatusCodeInstance; - httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); - result.setHttpStatusCode(httpStatusCodeInstance); - } + // Create Result + SchedulerOperationStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new SchedulerOperationStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements5 = operationElement.getElementsByTagName("Error"); - Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (errorElement != null) + NodeList elements = responseDoc.getElementsByTagName("Operation"); + Element operationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operationElement != null) { - SchedulerOperationStatusResponse.ErrorDetails errorInstance = new SchedulerOperationStatusResponse.ErrorDetails(); - result.setError(errorInstance); + NodeList elements2 = operationElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setId(idInstance); + } + + NodeList elements3 = operationElement.getElementsByTagName("Status"); + Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (statusElement != null) + { + SchedulerOperationStatus statusInstance; + statusInstance = SchedulerOperationStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); + } - NodeList elements6 = errorElement.getElementsByTagName("Code"); - Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (codeElement != null) + NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); + Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (httpStatusCodeElement != null) { - String codeInstance; - codeInstance = codeElement.getTextContent(); - errorInstance.setCode(codeInstance); + Integer httpStatusCodeInstance; + httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); + result.setHttpStatusCode(httpStatusCodeInstance); } - NodeList elements7 = errorElement.getElementsByTagName("Message"); - Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (messageElement != null) + NodeList elements5 = operationElement.getElementsByTagName("Error"); + Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (errorElement != null) { - String messageInstance; - messageInstance = messageElement.getTextContent(); - errorInstance.setMessage(messageInstance); + SchedulerOperationStatusResponse.ErrorDetails errorInstance = new SchedulerOperationStatusResponse.ErrorDetails(); + result.setError(errorInstance); + + NodeList elements6 = errorElement.getElementsByTagName("Code"); + Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (codeElement != null) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + errorInstance.setCode(codeInstance); + } + + NodeList elements7 = errorElement.getElementsByTagName("Message"); + Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -346,6 +375,14 @@ public ResourceProviderGetPropertiesResponse call() throws Exception * Gets a list of properties for the resource provider, including supported * regions and plans. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Resource Provider Get Properties operation response. */ @Override @@ -374,61 +411,71 @@ public ResourceProviderGetPropertiesResponse getResourceProviderProperties() thr // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ResourceProviderGetPropertiesResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ResourceProviderGetPropertiesResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ResourceProviderProperties"); - Element resourceProviderPropertiesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (resourceProviderPropertiesSequenceElement != null) - { - for (int i1 = 0; i1 < resourceProviderPropertiesSequenceElement.getElementsByTagName("ResourceProviderProperty").getLength(); i1 = i1 + 1) + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element resourceProviderPropertiesElement = ((org.w3c.dom.Element) resourceProviderPropertiesSequenceElement.getElementsByTagName("ResourceProviderProperty").item(i1)); - NodeList elements2 = resourceProviderPropertiesElement.getElementsByTagName("Key"); - String resourceProviderPropertiesKey = elements2.getLength() > 0 ? ((org.w3c.dom.Element) elements2.item(0)).getTextContent() : null; - NodeList elements3 = resourceProviderPropertiesElement.getElementsByTagName("Value"); - String resourceProviderPropertiesValue = elements3.getLength() > 0 ? ((org.w3c.dom.Element) elements3.item(0)).getTextContent() : null; - result.getProperties().put(resourceProviderPropertiesKey, resourceProviderPropertiesValue); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + ResourceProviderGetPropertiesResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ResourceProviderGetPropertiesResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ResourceProviderProperties"); + Element resourceProviderPropertiesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (resourceProviderPropertiesSequenceElement != null) + { + for (int i1 = 0; i1 < resourceProviderPropertiesSequenceElement.getElementsByTagName("ResourceProviderProperty").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element resourceProviderPropertiesElement = ((org.w3c.dom.Element) resourceProviderPropertiesSequenceElement.getElementsByTagName("ResourceProviderProperty").item(i1)); + NodeList elements2 = resourceProviderPropertiesElement.getElementsByTagName("Key"); + String resourceProviderPropertiesKey = elements2.getLength() > 0 ? ((org.w3c.dom.Element) elements2.item(0)).getTextContent() : null; + NodeList elements3 = resourceProviderPropertiesElement.getElementsByTagName("Value"); + String resourceProviderPropertiesValue = elements3.getLength() > 0 ? ((org.w3c.dom.Element) elements3.item(0)).getTextContent() : null; + result.getProperties().put(resourceProviderPropertiesKey, resourceProviderPropertiesValue); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -452,6 +499,10 @@ public OperationResponse call() throws Exception /** * Register the Scheduler resource provider with your subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -481,40 +532,50 @@ public OperationResponse registerResourceProvider() throws IOException, ServiceE // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -538,6 +599,10 @@ public OperationResponse call() throws Exception /** * Unregister the Scheduler resource provider with your subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -567,39 +632,49 @@ public OperationResponse unregisterResourceProvider() throws IOException, Servic // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCheckNameAvailabilityResponse.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCheckNameAvailabilityResponse.java index a745655d4ec6e..d0bcf66d209b5 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCheckNameAvailabilityResponse.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCheckNameAvailabilityResponse.java @@ -34,6 +34,7 @@ public class JobCollectionCheckNameAvailabilityResponse extends OperationRespons /** * Whether the name is available. + * @return The IsAvailable value. */ public boolean isAvailable() { @@ -42,9 +43,10 @@ public boolean isAvailable() /** * Whether the name is available. + * @param isAvailableValue The IsAvailable value. */ - public void setIsAvailable(boolean isAvailable) + public void setIsAvailable(final boolean isAvailableValue) { - this.isAvailable = isAvailable; + this.isAvailable = isAvailableValue; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCreateParameters.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCreateParameters.java index 69fdf30fbe00f..4fe55b7497109 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCreateParameters.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCreateParameters.java @@ -32,6 +32,7 @@ public class JobCollectionCreateParameters /** * Intrinsic settings for the scheduler job collections. + * @return The IntrinsicSettings value. */ public JobCollectionIntrinsicSettings getIntrinsicSettings() { @@ -40,16 +41,18 @@ public JobCollectionIntrinsicSettings getIntrinsicSettings() /** * Intrinsic settings for the scheduler job collections. + * @param intrinsicSettingsValue The IntrinsicSettings value. */ - public void setIntrinsicSettings(JobCollectionIntrinsicSettings intrinsicSettings) + public void setIntrinsicSettings(final JobCollectionIntrinsicSettings intrinsicSettingsValue) { - this.intrinsicSettings = intrinsicSettings; + this.intrinsicSettings = intrinsicSettingsValue; } private String label; /** * Label for the resource. + * @return The Label value. */ public String getLabel() { @@ -58,10 +61,11 @@ public String getLabel() /** * Label for the resource. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String schemaVersion; @@ -70,6 +74,7 @@ public void setLabel(String label) * The version of the Intrinsic Properties for your Resource. If not * specified, you must conform to the contract resource version you * registered as default. + * @return The SchemaVersion value. */ public String getSchemaVersion() { @@ -80,9 +85,10 @@ public String getSchemaVersion() * The version of the Intrinsic Properties for your Resource. If not * specified, you must conform to the contract resource version you * registered as default. + * @param schemaVersionValue The SchemaVersion value. */ - public void setSchemaVersion(String schemaVersion) + public void setSchemaVersion(final String schemaVersionValue) { - this.schemaVersion = schemaVersion; + this.schemaVersion = schemaVersionValue; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCreateResponse.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCreateResponse.java index ebc3bace55b86..93c598a7b91ee 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCreateResponse.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionCreateResponse.java @@ -34,6 +34,7 @@ public class JobCollectionCreateResponse extends OperationResponse /** * ETag of the Job Collection. + * @return The ETag value. */ public String getETag() { @@ -42,9 +43,10 @@ public String getETag() /** * ETag of the Job Collection. + * @param eTagValue The ETag value. */ - public void setETag(String eTag) + public void setETag(final String eTagValue) { - this.eTag = eTag; + this.eTag = eTagValue; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionGetResponse.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionGetResponse.java index aab233e680d67..b77142b24d3e3 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionGetResponse.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionGetResponse.java @@ -34,6 +34,7 @@ public class JobCollectionGetResponse extends OperationResponse /** * ETag of the Job Collection. + * @return The ETag value. */ public String getETag() { @@ -42,16 +43,18 @@ public String getETag() /** * ETag of the Job Collection. + * @param eTagValue The ETag value. */ - public void setETag(String eTag) + public void setETag(final String eTagValue) { - this.eTag = eTag; + this.eTag = eTagValue; } private JobCollectionIntrinsicSettings intrinsicSettings; /** * Intrinsic settings for the scheduler job collections. + * @return The IntrinsicSettings value. */ public JobCollectionIntrinsicSettings getIntrinsicSettings() { @@ -60,16 +63,18 @@ public JobCollectionIntrinsicSettings getIntrinsicSettings() /** * Intrinsic settings for the scheduler job collections. + * @param intrinsicSettingsValue The IntrinsicSettings value. */ - public void setIntrinsicSettings(JobCollectionIntrinsicSettings intrinsicSettings) + public void setIntrinsicSettings(final JobCollectionIntrinsicSettings intrinsicSettingsValue) { - this.intrinsicSettings = intrinsicSettings; + this.intrinsicSettings = intrinsicSettingsValue; } private String label; /** * Label for the resource. + * @return The Label value. */ public String getLabel() { @@ -78,16 +83,18 @@ public String getLabel() /** * Label for the resource. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private JobCollectionGetResponse.OperationStatus lastOperationStatus; /** * The promotion code for buying the resource. + * @return The LastOperationStatus value. */ public JobCollectionGetResponse.OperationStatus getLastOperationStatus() { @@ -96,16 +103,18 @@ public JobCollectionGetResponse.OperationStatus getLastOperationStatus() /** * The promotion code for buying the resource. + * @param lastOperationStatusValue The LastOperationStatus value. */ - public void setLastOperationStatus(JobCollectionGetResponse.OperationStatus lastOperationStatus) + public void setLastOperationStatus(final JobCollectionGetResponse.OperationStatus lastOperationStatusValue) { - this.lastOperationStatus = lastOperationStatus; + this.lastOperationStatus = lastOperationStatusValue; } private String name; /** * Name of the Job Collection. + * @return The Name value. */ public String getName() { @@ -114,16 +123,18 @@ public String getName() /** * Name of the Job Collection. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String plan; /** * The plan of the resource. + * @return The Plan value. */ public String getPlan() { @@ -132,16 +143,18 @@ public String getPlan() /** * The plan of the resource. + * @param planValue The Plan value. */ - public void setPlan(String plan) + public void setPlan(final String planValue) { - this.plan = plan; + this.plan = planValue; } private String promotionCode; /** * The promotion code for buying the resource. + * @return The PromotionCode value. */ public String getPromotionCode() { @@ -150,10 +163,11 @@ public String getPromotionCode() /** * The promotion code for buying the resource. + * @param promotionCodeValue The PromotionCode value. */ - public void setPromotionCode(String promotionCode) + public void setPromotionCode(final String promotionCodeValue) { - this.promotionCode = promotionCode; + this.promotionCode = promotionCodeValue; } private String schemaVersion; @@ -162,6 +176,7 @@ public void setPromotionCode(String promotionCode) * The version of the Intrinsic Properties for your Resource. If not * specified, you must conform to the contract resource version you * registered as default. + * @return The SchemaVersion value. */ public String getSchemaVersion() { @@ -172,16 +187,18 @@ public String getSchemaVersion() * The version of the Intrinsic Properties for your Resource. If not * specified, you must conform to the contract resource version you * registered as default. + * @param schemaVersionValue The SchemaVersion value. */ - public void setSchemaVersion(String schemaVersion) + public void setSchemaVersion(final String schemaVersionValue) { - this.schemaVersion = schemaVersion; + this.schemaVersion = schemaVersionValue; } private JobCollectionState state; /** * State of the Job Collection. + * @return The State value. */ public JobCollectionState getState() { @@ -190,10 +207,11 @@ public JobCollectionState getState() /** * State of the Job Collection. + * @param stateValue The State value. */ - public void setState(JobCollectionState state) + public void setState(final JobCollectionState stateValue) { - this.state = state; + this.state = stateValue; } /** @@ -205,6 +223,7 @@ public static class OperationStatus /** * Details about the last operation. + * @return The ResponseDetails value. */ public JobCollectionGetResponse.OperationStatusResponseDetails getResponseDetails() { @@ -213,16 +232,18 @@ public JobCollectionGetResponse.OperationStatusResponseDetails getResponseDetail /** * Details about the last operation. + * @param responseDetailsValue The ResponseDetails value. */ - public void setResponseDetails(JobCollectionGetResponse.OperationStatusResponseDetails responseDetails) + public void setResponseDetails(final JobCollectionGetResponse.OperationStatusResponseDetails responseDetailsValue) { - this.responseDetails = responseDetails; + this.responseDetails = responseDetailsValue; } private SchedulerOperationStatus status; /** * Status of the last operation. + * @return The Status value. */ public SchedulerOperationStatus getStatus() { @@ -231,10 +252,11 @@ public SchedulerOperationStatus getStatus() /** * Status of the last operation. + * @param statusValue The Status value. */ - public void setStatus(SchedulerOperationStatus status) + public void setStatus(final SchedulerOperationStatus statusValue) { - this.status = status; + this.status = statusValue; } } @@ -247,6 +269,7 @@ public static class OperationStatusResponseDetails /** * Message returned by the operation. + * @return The Message value. */ public String getMessage() { @@ -255,16 +278,18 @@ public String getMessage() /** * Message returned by the operation. + * @param messageValue The Message value. */ - public void setMessage(String message) + public void setMessage(final String messageValue) { - this.message = message; + this.message = messageValue; } private Integer statusCode; /** * The HTTP status code of the operation. + * @return The StatusCode value. */ public Integer getStatusCode() { @@ -273,10 +298,11 @@ public Integer getStatusCode() /** * The HTTP status code of the operation. + * @param statusCodeValue The StatusCode value. */ - public void setStatusCode(Integer statusCode) + public void setStatusCode(final Integer statusCodeValue) { - this.statusCode = statusCode; + this.statusCode = statusCodeValue; } } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionIntrinsicSettings.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionIntrinsicSettings.java index 1b7dc4ba6baec..cfbe01c8686ca 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionIntrinsicSettings.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionIntrinsicSettings.java @@ -32,6 +32,7 @@ public class JobCollectionIntrinsicSettings /** * The plan of the resource. + * @return The Plan value. */ public JobCollectionPlan getPlan() { @@ -40,16 +41,18 @@ public JobCollectionPlan getPlan() /** * The plan of the resource. + * @param planValue The Plan value. */ - public void setPlan(JobCollectionPlan plan) + public void setPlan(final JobCollectionPlan planValue) { - this.plan = plan; + this.plan = planValue; } private JobCollectionQuota quota; /** * Quota settings for the job collection. + * @return The Quota value. */ public JobCollectionQuota getQuota() { @@ -58,9 +61,10 @@ public JobCollectionQuota getQuota() /** * Quota settings for the job collection. + * @param quotaValue The Quota value. */ - public void setQuota(JobCollectionQuota quota) + public void setQuota(final JobCollectionQuota quotaValue) { - this.quota = quota; + this.quota = quotaValue; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionMaxRecurrence.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionMaxRecurrence.java index 0fe0b9c425a85..7091451fd47f0 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionMaxRecurrence.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionMaxRecurrence.java @@ -30,6 +30,7 @@ public class JobCollectionMaxRecurrence /** * Defines the maximum recurrences that can be specified in any job in this * job collection. + * @return The Frequency value. */ public JobCollectionRecurrenceFrequency getFrequency() { @@ -39,16 +40,18 @@ public JobCollectionRecurrenceFrequency getFrequency() /** * Defines the maximum recurrences that can be specified in any job in this * job collection. + * @param frequencyValue The Frequency value. */ - public void setFrequency(JobCollectionRecurrenceFrequency frequency) + public void setFrequency(final JobCollectionRecurrenceFrequency frequencyValue) { - this.frequency = frequency; + this.frequency = frequencyValue; } private int interval; /** * Defines the interval. + * @return The Interval value. */ public int getInterval() { @@ -57,9 +60,10 @@ public int getInterval() /** * Defines the interval. + * @param intervalValue The Interval value. */ - public void setInterval(int interval) + public void setInterval(final int intervalValue) { - this.interval = interval; + this.interval = intervalValue; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionQuota.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionQuota.java index e52fb7adc549e..1592ce6e4a0e1 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionQuota.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionQuota.java @@ -30,6 +30,7 @@ public class JobCollectionQuota /** * Maximum number of jobs that can be created in this job collection. * Maximum value is dependent on the plan. + * @return The MaxJobCount value. */ public Integer getMaxJobCount() { @@ -39,16 +40,18 @@ public Integer getMaxJobCount() /** * Maximum number of jobs that can be created in this job collection. * Maximum value is dependent on the plan. + * @param maxJobCountValue The MaxJobCount value. */ - public void setMaxJobCount(Integer maxJobCount) + public void setMaxJobCount(final Integer maxJobCountValue) { - this.maxJobCount = maxJobCount; + this.maxJobCount = maxJobCountValue; } private Integer maxJobOccurrence; /** * Maximum number of occurrences for all jobs in the job collection. + * @return The MaxJobOccurrence value. */ public Integer getMaxJobOccurrence() { @@ -57,10 +60,11 @@ public Integer getMaxJobOccurrence() /** * Maximum number of occurrences for all jobs in the job collection. + * @param maxJobOccurrenceValue The MaxJobOccurrence value. */ - public void setMaxJobOccurrence(Integer maxJobOccurrence) + public void setMaxJobOccurrence(final Integer maxJobOccurrenceValue) { - this.maxJobOccurrence = maxJobOccurrence; + this.maxJobOccurrence = maxJobOccurrenceValue; } private JobCollectionMaxRecurrence maxRecurrence; @@ -68,6 +72,7 @@ public void setMaxJobOccurrence(Integer maxJobOccurrence) /** * Defines the maximum recurrences that can be specified in any job in this * job collection. + * @return The MaxRecurrence value. */ public JobCollectionMaxRecurrence getMaxRecurrence() { @@ -77,9 +82,10 @@ public JobCollectionMaxRecurrence getMaxRecurrence() /** * Defines the maximum recurrences that can be specified in any job in this * job collection. + * @param maxRecurrenceValue The MaxRecurrence value. */ - public void setMaxRecurrence(JobCollectionMaxRecurrence maxRecurrence) + public void setMaxRecurrence(final JobCollectionMaxRecurrence maxRecurrenceValue) { - this.maxRecurrence = maxRecurrence; + this.maxRecurrence = maxRecurrenceValue; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionUpdateParameters.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionUpdateParameters.java index 880b6fbbc5a71..def17cf8b28d3 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionUpdateParameters.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionUpdateParameters.java @@ -33,6 +33,7 @@ public class JobCollectionUpdateParameters /** * The ETag of the job collection to update. The update will fail ifthe * ETag doesn't match. + * @return The ETag value. */ public String getETag() { @@ -42,16 +43,18 @@ public String getETag() /** * The ETag of the job collection to update. The update will fail ifthe * ETag doesn't match. + * @param eTagValue The ETag value. */ - public void setETag(String eTag) + public void setETag(final String eTagValue) { - this.eTag = eTag; + this.eTag = eTagValue; } private JobCollectionIntrinsicSettings intrinsicSettings; /** * Intrinsic settings for the scheduler job collections. + * @return The IntrinsicSettings value. */ public JobCollectionIntrinsicSettings getIntrinsicSettings() { @@ -60,16 +63,18 @@ public JobCollectionIntrinsicSettings getIntrinsicSettings() /** * Intrinsic settings for the scheduler job collections. + * @param intrinsicSettingsValue The IntrinsicSettings value. */ - public void setIntrinsicSettings(JobCollectionIntrinsicSettings intrinsicSettings) + public void setIntrinsicSettings(final JobCollectionIntrinsicSettings intrinsicSettingsValue) { - this.intrinsicSettings = intrinsicSettings; + this.intrinsicSettings = intrinsicSettingsValue; } private String label; /** * Label for the resource. + * @return The Label value. */ public String getLabel() { @@ -78,10 +83,11 @@ public String getLabel() /** * Label for the resource. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String schemaVersion; @@ -90,6 +96,7 @@ public void setLabel(String label) * The version of the Intrinsic Properties for your Resource. If not * specified, you must conform to the contract resource version you * registered as default. + * @return The SchemaVersion value. */ public String getSchemaVersion() { @@ -100,9 +107,10 @@ public String getSchemaVersion() * The version of the Intrinsic Properties for your Resource. If not * specified, you must conform to the contract resource version you * registered as default. + * @param schemaVersionValue The SchemaVersion value. */ - public void setSchemaVersion(String schemaVersion) + public void setSchemaVersion(final String schemaVersionValue) { - this.schemaVersion = schemaVersion; + this.schemaVersion = schemaVersionValue; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionUpdateResponse.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionUpdateResponse.java index 0a540a5762017..f1c7ba354de73 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionUpdateResponse.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/JobCollectionUpdateResponse.java @@ -34,6 +34,7 @@ public class JobCollectionUpdateResponse extends OperationResponse /** * New ETag of the updated Job Collection. + * @return The ETag value. */ public String getETag() { @@ -42,9 +43,10 @@ public String getETag() /** * New ETag of the updated Job Collection. + * @param eTagValue The ETag value. */ - public void setETag(String eTag) + public void setETag(final String eTagValue) { - this.eTag = eTag; + this.eTag = eTagValue; } } diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/ResourceProviderGetPropertiesResponse.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/ResourceProviderGetPropertiesResponse.java index 66f879252b5b6..89eb31cb2120b 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/ResourceProviderGetPropertiesResponse.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/ResourceProviderGetPropertiesResponse.java @@ -33,14 +33,20 @@ public class ResourceProviderGetPropertiesResponse extends OperationResponse { private HashMap properties; + /** + * @return The Properties value. + */ public HashMap getProperties() { return this.properties; } - public void setProperties(HashMap properties) + /** + * @param propertiesValue The Properties value. + */ + public void setProperties(final HashMap propertiesValue) { - this.properties = properties; + this.properties = propertiesValue; } /** diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/SchedulerOperationStatusResponse.java b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/SchedulerOperationStatusResponse.java index 40f21cc288481..f3c65675ec80e 100644 --- a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/SchedulerOperationStatusResponse.java +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/SchedulerOperationStatusResponse.java @@ -43,6 +43,7 @@ public class SchedulerOperationStatusResponse extends OperationResponse * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @return The Error value. */ public SchedulerOperationStatusResponse.ErrorDetails getError() { @@ -53,16 +54,18 @@ public SchedulerOperationStatusResponse.ErrorDetails getError() * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @param errorValue The Error value. */ - public void setError(SchedulerOperationStatusResponse.ErrorDetails error) + public void setError(final SchedulerOperationStatusResponse.ErrorDetails errorValue) { - this.error = error; + this.error = errorValue; } private String eTag; /** * Optional ETag, if returned from the original request. + * @return The ETag value. */ public String getETag() { @@ -71,16 +74,18 @@ public String getETag() /** * Optional ETag, if returned from the original request. + * @param eTagValue The ETag value. */ - public void setETag(String eTag) + public void setETag(final String eTagValue) { - this.eTag = eTag; + this.eTag = eTagValue; } private Integer httpStatusCode; /** * The HTTP status code for the asynchronous request. + * @return The HttpStatusCode value. */ public Integer getHttpStatusCode() { @@ -89,10 +94,11 @@ public Integer getHttpStatusCode() /** * The HTTP status code for the asynchronous request. + * @param httpStatusCodeValue The HttpStatusCode value. */ - public void setHttpStatusCode(Integer httpStatusCode) + public void setHttpStatusCode(final Integer httpStatusCodeValue) { - this.httpStatusCode = httpStatusCode; + this.httpStatusCode = httpStatusCodeValue; } private String id; @@ -100,6 +106,7 @@ public void setHttpStatusCode(Integer httpStatusCode) /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @return The Id value. */ public String getId() { @@ -109,16 +116,18 @@ public String getId() /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private SchedulerOperationStatus status; /** * The status of the asynchronous request. + * @return The Status value. */ public SchedulerOperationStatus getStatus() { @@ -127,10 +136,11 @@ public SchedulerOperationStatus getStatus() /** * The status of the asynchronous request. + * @param statusValue The Status value. */ - public void setStatus(SchedulerOperationStatus status) + public void setStatus(final SchedulerOperationStatus statusValue) { - this.status = status; + this.status = statusValue; } /** @@ -145,6 +155,7 @@ public static class ErrorDetails /** * The management service error code returned if the asynchronous * request failed. + * @return The Code value. */ public String getCode() { @@ -154,10 +165,11 @@ public String getCode() /** * The management service error code returned if the asynchronous * request failed. + * @param codeValue The Code value. */ - public void setCode(String code) + public void setCode(final String codeValue) { - this.code = code; + this.code = codeValue; } private String message; @@ -165,6 +177,7 @@ public void setCode(String code) /** * The management service error message returned if the asynchronous * request failed. + * @return The Message value. */ public String getMessage() { @@ -174,10 +187,11 @@ public String getMessage() /** * The management service error message returned if the asynchronous * request failed. + * @param messageValue The Message value. */ - public void setMessage(String message) + public void setMessage(final String messageValue) { - this.message = message; + this.message = messageValue; } } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DacOperations.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DacOperations.java index 4dbfa12160c52..6014a67e61d55 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DacOperations.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DacOperations.java @@ -29,12 +29,10 @@ import com.microsoft.windowsazure.management.sql.models.DacImportExportResponse; import com.microsoft.windowsazure.management.sql.models.DacImportParameters; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -49,9 +47,19 @@ public interface DacOperations * * @param serverName The name of the server being exported from. * @param parameters Export parameters. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return Response for an DAC Import/Export request. */ - DacImportExportResponse exportDatabase(String serverName, DacExportParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + DacImportExportResponse exportDatabase(String serverName, DacExportParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * Export DAC into Windows Azure blob storage. @@ -70,6 +78,18 @@ public interface DacOperations * @param username The server's username. * @param password The server's password. * @param requestId The request ID of the operation being queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response structure for the DAC GetStatus operation. */ DacGetStatusResponse getStatus(String serverName, String fullyQualifiedServerName, String username, String password, String requestId) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException; @@ -91,9 +111,19 @@ public interface DacOperations * * @param serverName The name of the server being imported to. * @param parameters Import parameters. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return Response for an DAC Import/Export request. */ - DacImportExportResponse importDatabase(String serverName, DacImportParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + DacImportExportResponse importDatabase(String serverName, DacImportParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * Import DAC from Windows Azure blob storage. diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DacOperationsImpl.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DacOperationsImpl.java index e20eda0125926..c2e8204949040 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DacOperationsImpl.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DacOperationsImpl.java @@ -33,7 +33,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; import java.text.ParseException; @@ -46,7 +45,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -56,6 +54,7 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -82,6 +81,7 @@ public class DacOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (guidElement != null) - { - result.setGuid(guidElement.getTextContent()); - } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + DacImportExportResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DacImportExportResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/", "guid"); + Element guidElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (guidElement != null) + { + result.setGuid(guidElement.getTextContent()); + } + + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -320,6 +342,18 @@ public DacGetStatusResponse call() throws Exception * @param username The server's username. * @param password The server's password. * @param requestId The request ID of the operation being queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response structure for the DAC GetStatus operation. */ @Override @@ -373,157 +407,167 @@ public DacGetStatusResponse getStatus(String serverName, String fullyQualifiedSe // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - DacGetStatusResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DacGetStatusResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "ArrayOfStatusInfo"); - Element arrayOfStatusInfoElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (arrayOfStatusInfoElement != null) - { + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + DacGetStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DacGetStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "ArrayOfStatusInfo"); + Element arrayOfStatusInfoElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; if (arrayOfStatusInfoElement != null) { - for (int i1 = 0; i1 < arrayOfStatusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "StatusInfo").getLength(); i1 = i1 + 1) + if (arrayOfStatusInfoElement != null) { - org.w3c.dom.Element statusInfoElement = ((org.w3c.dom.Element) arrayOfStatusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "StatusInfo").item(i1)); - DacGetStatusResponse.StatusInfo statusInfoInstance = new DacGetStatusResponse.StatusInfo(); - result.getStatusInfoList().add(statusInfoInstance); - - NodeList elements2 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "BlobUri"); - Element blobUriElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (blobUriElement != null) - { - URI blobUriInstance; - blobUriInstance = new URI(blobUriElement.getTextContent()); - statusInfoInstance.setBlobUri(blobUriInstance); - } - - NodeList elements3 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "DatabaseName"); - Element databaseNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (databaseNameElement != null) - { - String databaseNameInstance; - databaseNameInstance = databaseNameElement.getTextContent(); - statusInfoInstance.setDatabaseName(databaseNameInstance); - } - - NodeList elements4 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "ErrorMessage"); - Element errorMessageElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (errorMessageElement != null) + for (int i1 = 0; i1 < arrayOfStatusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "StatusInfo").getLength(); i1 = i1 + 1) { - boolean isNil = false; - String nilAttribute = errorMessageElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) + org.w3c.dom.Element statusInfoElement = ((org.w3c.dom.Element) arrayOfStatusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "StatusInfo").item(i1)); + DacGetStatusResponse.StatusInfo statusInfoInstance = new DacGetStatusResponse.StatusInfo(); + result.getStatusInfoList().add(statusInfoInstance); + + NodeList elements2 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "BlobUri"); + Element blobUriElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (blobUriElement != null) { - isNil = nilAttribute == "true"; + URI blobUriInstance; + blobUriInstance = new URI(blobUriElement.getTextContent()); + statusInfoInstance.setBlobUri(blobUriInstance); } - if (isNil == false) + + NodeList elements3 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "DatabaseName"); + Element databaseNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (databaseNameElement != null) { - String errorMessageInstance; - errorMessageInstance = errorMessageElement.getTextContent(); - statusInfoInstance.setErrorMessage(errorMessageInstance); + String databaseNameInstance; + databaseNameInstance = databaseNameElement.getTextContent(); + statusInfoInstance.setDatabaseName(databaseNameInstance); + } + + NodeList elements4 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "ErrorMessage"); + Element errorMessageElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (errorMessageElement != null) + { + boolean isNil = false; + Attr nilAttribute = errorMessageElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + String errorMessageInstance; + errorMessageInstance = errorMessageElement.getTextContent(); + statusInfoInstance.setErrorMessage(errorMessageInstance); + } + } + + NodeList elements5 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "LastModifiedTime"); + Element lastModifiedTimeElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (lastModifiedTimeElement != null) + { + Calendar lastModifiedTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(lastModifiedTimeElement.getTextContent())); + lastModifiedTimeInstance = calendar; + statusInfoInstance.setLastModifiedTime(lastModifiedTimeInstance); + } + + NodeList elements6 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "QueuedTime"); + Element queuedTimeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (queuedTimeElement != null) + { + Calendar queuedTimeInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(queuedTimeElement.getTextContent())); + queuedTimeInstance = calendar2; + statusInfoInstance.setQueuedTime(queuedTimeInstance); + } + + NodeList elements7 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "RequestId"); + Element requestIdElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (requestIdElement != null) + { + String requestIdInstance; + requestIdInstance = requestIdElement.getTextContent(); + statusInfoInstance.setRequestId(requestIdInstance); + } + + NodeList elements8 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "RequestType"); + Element requestTypeElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (requestTypeElement != null) + { + String requestTypeInstance; + requestTypeInstance = requestTypeElement.getTextContent(); + statusInfoInstance.setRequestType(requestTypeInstance); + } + + NodeList elements9 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "ServerName"); + Element serverNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (serverNameElement != null) + { + String serverNameInstance; + serverNameInstance = serverNameElement.getTextContent(); + statusInfoInstance.setServerName(serverNameInstance); + } + + NodeList elements10 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "Status"); + Element statusElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (statusElement != null) + { + String statusInstance; + statusInstance = statusElement.getTextContent(); + statusInfoInstance.setStatus(statusInstance); } - } - - NodeList elements5 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "LastModifiedTime"); - Element lastModifiedTimeElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (lastModifiedTimeElement != null) - { - Calendar lastModifiedTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(lastModifiedTimeElement.getTextContent())); - lastModifiedTimeInstance = calendar; - statusInfoInstance.setLastModifiedTime(lastModifiedTimeInstance); - } - - NodeList elements6 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "QueuedTime"); - Element queuedTimeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (queuedTimeElement != null) - { - Calendar queuedTimeInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(queuedTimeElement.getTextContent())); - queuedTimeInstance = calendar2; - statusInfoInstance.setQueuedTime(queuedTimeInstance); - } - - NodeList elements7 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "RequestId"); - Element requestIdElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (requestIdElement != null) - { - String requestIdInstance; - requestIdInstance = requestIdElement.getTextContent(); - statusInfoInstance.setRequestId(requestIdInstance); - } - - NodeList elements8 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "RequestType"); - Element requestTypeElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (requestTypeElement != null) - { - String requestTypeInstance; - requestTypeInstance = requestTypeElement.getTextContent(); - statusInfoInstance.setRequestType(requestTypeInstance); - } - - NodeList elements9 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "ServerName"); - Element serverNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (serverNameElement != null) - { - String serverNameInstance; - serverNameInstance = serverNameElement.getTextContent(); - statusInfoInstance.setServerName(serverNameInstance); - } - - NodeList elements10 = statusInfoElement.getElementsByTagNameNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "Status"); - Element statusElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (statusElement != null) - { - String statusInstance; - statusInstance = statusElement.getTextContent(); - statusInfoInstance.setStatus(statusInstance); } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -550,10 +594,20 @@ public DacImportExportResponse call() throws Exception * * @param serverName The name of the server being imported to. * @param parameters Import parameters. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return Response for an DAC Import/Export request. */ @Override - public DacImportExportResponse importDatabase(String serverName, DacImportParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public DacImportExportResponse importDatabase(String serverName, DacImportParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serverName == null) @@ -632,7 +686,9 @@ public DacImportExportResponse importDatabase(String serverName, DacImportParame Element blobCredentialsElement = requestDoc.createElementNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "BlobCredentials"); importInputElement.appendChild(blobCredentialsElement); - String typeAttribute = null; + Attr typeAttribute = requestDoc.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "type"); + typeAttribute.setValue("BlobStorageAccessKeyCredentials"); + blobCredentialsElement.setAttributeNode(typeAttribute); Element uriElement = requestDoc.createElementNS("http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes", "Uri"); uriElement.appendChild(requestDoc.createTextNode(parameters.getBlobCredentials().getUri().toString())); @@ -683,52 +739,62 @@ public DacImportExportResponse importDatabase(String serverName, DacImportParame // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - DacImportExportResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DacImportExportResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/", "guid"); - Element guidElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (guidElement != null) - { - result.setGuid(guidElement.getTextContent()); - } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + DacImportExportResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DacImportExportResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/", "guid"); + Element guidElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (guidElement != null) + { + result.setGuid(guidElement.getTextContent()); + } + + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseCopyOperations.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseCopyOperations.java index 9eae4be860729..a03e3802bbfbc 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseCopyOperations.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseCopyOperations.java @@ -30,11 +30,9 @@ import com.microsoft.windowsazure.management.sql.models.DatabaseCopyResponse; import com.microsoft.windowsazure.management.sql.models.DatabaseCopyUpdateParameters; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -52,10 +50,22 @@ public interface DatabaseCopyOperations * @param databaseName The name of the source database * @param parameters Additional parameters for the create database copy * operation + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ - DatabaseCopyResponse create(String serverName, String databaseName, DatabaseCopyCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException; + DatabaseCopyResponse create(String serverName, String databaseName, DatabaseCopyCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException; /** * The Create Database Copy operation starts a database copy. @@ -78,6 +88,10 @@ public interface DatabaseCopyOperations * @param databaseName The name of the database * @param databaseCopyName The unique identifier for the database copy to * stop + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -105,6 +119,16 @@ public interface DatabaseCopyOperations * @param databaseName The name of the database * @param databaseCopyName The unique identifier for the database copy to * retrieve + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @@ -128,6 +152,16 @@ public interface DatabaseCopyOperations * * @param serverName The name of the database server to be queried * @param databaseName The name of the database to be queried + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Response containing the list of database copies for a given * database. */ @@ -152,10 +186,22 @@ public interface DatabaseCopyOperations * update * @param parameters Additional parameters for the update database copy * operation + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ - DatabaseCopyResponse update(String serverName, String databaseName, String databaseCopyName, DatabaseCopyUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException; + DatabaseCopyResponse update(String serverName, String databaseName, String databaseCopyName, DatabaseCopyUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException; /** * The Update Database Copy operation updates a SQL Server database copy. diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseCopyOperationsImpl.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseCopyOperationsImpl.java index 06658849651c0..dc12448a81c51 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseCopyOperationsImpl.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseCopyOperationsImpl.java @@ -35,7 +35,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.HashMap; import java.util.concurrent.Callable; @@ -44,7 +43,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -81,6 +79,7 @@ public class DatabaseCopyOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement2 != null) - { - NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = serviceResourceElement2.getElementsByTagName("State"); - Element stateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); - } - - NodeList elements4 = serviceResourceElement2.getElementsByTagName("SourceServerName"); - Element sourceServerNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (sourceServerNameElement != null) - { - String sourceServerNameInstance; - sourceServerNameInstance = sourceServerNameElement.getTextContent(); - result.setSourceServerName(sourceServerNameInstance); - } - - NodeList elements5 = serviceResourceElement2.getElementsByTagName("SourceDatabaseName"); - Element sourceDatabaseNameElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (sourceDatabaseNameElement != null) - { - String sourceDatabaseNameInstance; - sourceDatabaseNameInstance = sourceDatabaseNameElement.getTextContent(); - result.setSourceDatabaseName(sourceDatabaseNameInstance); - } - - NodeList elements6 = serviceResourceElement2.getElementsByTagName("DestinationServerName"); - Element destinationServerNameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (destinationServerNameElement != null) - { - String destinationServerNameInstance; - destinationServerNameInstance = destinationServerNameElement.getTextContent(); - result.setDestinationServerName(destinationServerNameInstance); - } - - NodeList elements7 = serviceResourceElement2.getElementsByTagName("DestinationDatabaseName"); - Element destinationDatabaseNameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (destinationDatabaseNameElement != null) - { - String destinationDatabaseNameInstance; - destinationDatabaseNameInstance = destinationDatabaseNameElement.getTextContent(); - result.setDestinationDatabaseName(destinationDatabaseNameInstance); - } - - NodeList elements8 = serviceResourceElement2.getElementsByTagName("MaxLagInMinutes"); - Element maxLagInMinutesElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (maxLagInMinutesElement2 != null && (maxLagInMinutesElement2.getTextContent() != null && maxLagInMinutesElement2.getTextContent().isEmpty() != true) == false) - { - int maxLagInMinutesInstance; - maxLagInMinutesInstance = Integer.parseInt(maxLagInMinutesElement2.getTextContent()); - result.setMaxLagInMinutes(maxLagInMinutesInstance); - } - - NodeList elements9 = serviceResourceElement2.getElementsByTagName("IsContinuous"); - Element isContinuousElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (isContinuousElement2 != null) - { - boolean isContinuousInstance; - isContinuousInstance = Boolean.parseBoolean(isContinuousElement2.getTextContent()); - result.setIsContinuous(isContinuousInstance); - } - - NodeList elements10 = serviceResourceElement2.getElementsByTagName("ReplicationState"); - Element replicationStateElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (replicationStateElement != null) - { - byte replicationStateInstance; - replicationStateInstance = Byte.valueOf(replicationStateElement.getTextContent()); - result.setReplicationState(replicationStateInstance); - } - - NodeList elements11 = serviceResourceElement2.getElementsByTagName("ReplicationStateDescription"); - Element replicationStateDescriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (replicationStateDescriptionElement != null) - { - String replicationStateDescriptionInstance; - replicationStateDescriptionInstance = replicationStateDescriptionElement.getTextContent(); - result.setReplicationStateDescription(replicationStateDescriptionInstance); - } - - NodeList elements12 = serviceResourceElement2.getElementsByTagName("LocalDatabaseId"); - Element localDatabaseIdElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (localDatabaseIdElement != null) - { - int localDatabaseIdInstance; - localDatabaseIdInstance = Integer.parseInt(localDatabaseIdElement.getTextContent()); - result.setLocalDatabaseId(localDatabaseIdInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements13 = serviceResourceElement2.getElementsByTagName("IsLocalDatabaseReplicationTarget"); - Element isLocalDatabaseReplicationTargetElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (isLocalDatabaseReplicationTargetElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - boolean isLocalDatabaseReplicationTargetInstance; - isLocalDatabaseReplicationTargetInstance = Boolean.parseBoolean(isLocalDatabaseReplicationTargetElement.getTextContent()); - result.setIsLocalDatabaseReplicationTarget(isLocalDatabaseReplicationTargetInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements14 = serviceResourceElement2.getElementsByTagName("IsInterlinkConnected"); - Element isInterlinkConnectedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (isInterlinkConnectedElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_CREATED) { - boolean isInterlinkConnectedInstance; - isInterlinkConnectedInstance = Boolean.parseBoolean(isInterlinkConnectedElement.getTextContent()); - result.setIsInterlinkConnected(isInterlinkConnectedInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements15 = serviceResourceElement2.getElementsByTagName("TextStartDate"); - Element textStartDateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (textStartDateElement != null) - { - } + // Create Result + DatabaseCopyResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseCopyResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements16 = serviceResourceElement2.getElementsByTagName("TextModifyDate"); - Element textModifyDateElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (textModifyDateElement != null) + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement2 != null) { + NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = serviceResourceElement2.getElementsByTagName("State"); + Element stateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + result.setState(stateInstance); + } + + NodeList elements4 = serviceResourceElement2.getElementsByTagName("SourceServerName"); + Element sourceServerNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (sourceServerNameElement != null) + { + String sourceServerNameInstance; + sourceServerNameInstance = sourceServerNameElement.getTextContent(); + result.setSourceServerName(sourceServerNameInstance); + } + + NodeList elements5 = serviceResourceElement2.getElementsByTagName("SourceDatabaseName"); + Element sourceDatabaseNameElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (sourceDatabaseNameElement != null) + { + String sourceDatabaseNameInstance; + sourceDatabaseNameInstance = sourceDatabaseNameElement.getTextContent(); + result.setSourceDatabaseName(sourceDatabaseNameInstance); + } + + NodeList elements6 = serviceResourceElement2.getElementsByTagName("DestinationServerName"); + Element destinationServerNameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (destinationServerNameElement != null) + { + String destinationServerNameInstance; + destinationServerNameInstance = destinationServerNameElement.getTextContent(); + result.setDestinationServerName(destinationServerNameInstance); + } + + NodeList elements7 = serviceResourceElement2.getElementsByTagName("DestinationDatabaseName"); + Element destinationDatabaseNameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (destinationDatabaseNameElement != null) + { + String destinationDatabaseNameInstance; + destinationDatabaseNameInstance = destinationDatabaseNameElement.getTextContent(); + result.setDestinationDatabaseName(destinationDatabaseNameInstance); + } + + NodeList elements8 = serviceResourceElement2.getElementsByTagName("MaxLagInMinutes"); + Element maxLagInMinutesElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (maxLagInMinutesElement2 != null && (maxLagInMinutesElement2.getTextContent() != null && maxLagInMinutesElement2.getTextContent().isEmpty() != true) == false) + { + int maxLagInMinutesInstance; + maxLagInMinutesInstance = Integer.parseInt(maxLagInMinutesElement2.getTextContent()); + result.setMaxLagInMinutes(maxLagInMinutesInstance); + } + + NodeList elements9 = serviceResourceElement2.getElementsByTagName("IsContinuous"); + Element isContinuousElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (isContinuousElement2 != null) + { + boolean isContinuousInstance; + isContinuousInstance = Boolean.parseBoolean(isContinuousElement2.getTextContent()); + result.setIsContinuous(isContinuousInstance); + } + + NodeList elements10 = serviceResourceElement2.getElementsByTagName("ReplicationState"); + Element replicationStateElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (replicationStateElement != null) + { + byte replicationStateInstance; + replicationStateInstance = Byte.valueOf(replicationStateElement.getTextContent()); + result.setReplicationState(replicationStateInstance); + } + + NodeList elements11 = serviceResourceElement2.getElementsByTagName("ReplicationStateDescription"); + Element replicationStateDescriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (replicationStateDescriptionElement != null) + { + String replicationStateDescriptionInstance; + replicationStateDescriptionInstance = replicationStateDescriptionElement.getTextContent(); + result.setReplicationStateDescription(replicationStateDescriptionInstance); + } + + NodeList elements12 = serviceResourceElement2.getElementsByTagName("LocalDatabaseId"); + Element localDatabaseIdElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (localDatabaseIdElement != null) + { + int localDatabaseIdInstance; + localDatabaseIdInstance = Integer.parseInt(localDatabaseIdElement.getTextContent()); + result.setLocalDatabaseId(localDatabaseIdInstance); + } + + NodeList elements13 = serviceResourceElement2.getElementsByTagName("IsLocalDatabaseReplicationTarget"); + Element isLocalDatabaseReplicationTargetElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (isLocalDatabaseReplicationTargetElement != null) + { + boolean isLocalDatabaseReplicationTargetInstance; + isLocalDatabaseReplicationTargetInstance = Boolean.parseBoolean(isLocalDatabaseReplicationTargetElement.getTextContent()); + result.setIsLocalDatabaseReplicationTarget(isLocalDatabaseReplicationTargetInstance); + } + + NodeList elements14 = serviceResourceElement2.getElementsByTagName("IsInterlinkConnected"); + Element isInterlinkConnectedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (isInterlinkConnectedElement != null) + { + boolean isInterlinkConnectedInstance; + isInterlinkConnectedInstance = Boolean.parseBoolean(isInterlinkConnectedElement.getTextContent()); + result.setIsInterlinkConnected(isInterlinkConnectedInstance); + } + + NodeList elements15 = serviceResourceElement2.getElementsByTagName("TextStartDate"); + Element textStartDateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (textStartDateElement != null) + { + } + + NodeList elements16 = serviceResourceElement2.getElementsByTagName("TextModifyDate"); + Element textModifyDateElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (textModifyDateElement != null) + { + } + + NodeList elements17 = serviceResourceElement2.getElementsByTagName("PercentComplete"); + Element percentCompleteElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (percentCompleteElement != null && (percentCompleteElement.getTextContent() != null && percentCompleteElement.getTextContent().isEmpty() != true) == false) + { + float percentCompleteInstance; + percentCompleteInstance = Float.parseFloat(percentCompleteElement.getTextContent()); + result.setPercentComplete(percentCompleteInstance); + } + + NodeList elements18 = serviceResourceElement2.getElementsByTagName("IsForcedTerminate"); + Element isForcedTerminateElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (isForcedTerminateElement2 != null && (isForcedTerminateElement2.getTextContent() != null && isForcedTerminateElement2.getTextContent().isEmpty() != true) == false) + { + boolean isForcedTerminateInstance; + isForcedTerminateInstance = Boolean.parseBoolean(isForcedTerminateElement2.getTextContent()); + result.setIsForcedTerminate(isForcedTerminateInstance); + } } - NodeList elements17 = serviceResourceElement2.getElementsByTagName("PercentComplete"); - Element percentCompleteElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (percentCompleteElement != null && (percentCompleteElement.getTextContent() != null && percentCompleteElement.getTextContent().isEmpty() != true) == false) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - float percentCompleteInstance; - percentCompleteInstance = Float.parseFloat(percentCompleteElement.getTextContent()); - result.setPercentComplete(percentCompleteInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements18 = serviceResourceElement2.getElementsByTagName("IsForcedTerminate"); - Element isForcedTerminateElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (isForcedTerminateElement2 != null && (isForcedTerminateElement2.getTextContent() != null && isForcedTerminateElement2.getTextContent().isEmpty() != true) == false) + if (shouldTrace) { - boolean isForcedTerminateInstance; - isForcedTerminateInstance = Boolean.parseBoolean(isForcedTerminateElement2.getTextContent()); - result.setIsForcedTerminate(isForcedTerminateInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -439,6 +460,10 @@ public OperationResponse call() throws Exception * @param databaseName The name of the database * @param databaseCopyName The unique identifier for the database copy to * stop + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -480,40 +505,50 @@ public OperationResponse delete(String serverName, String databaseName, String d // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -549,6 +584,16 @@ public DatabaseCopyResponse call() throws Exception * @param databaseName The name of the database * @param databaseCopyName The unique identifier for the database copy to * retrieve + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @@ -593,461 +638,491 @@ public DatabaseCopyResponse get(String serverName, String databaseName, String d // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - DatabaseCopyResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DatabaseCopyResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); - Element serviceResourceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement != null) - { - NodeList elements2 = serviceResourceElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = serviceResourceElement.getElementsByTagName("State"); - Element stateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); - } - - NodeList elements4 = serviceResourceElement.getElementsByTagName("SourceServerName"); - Element sourceServerNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (sourceServerNameElement != null) - { - String sourceServerNameInstance; - sourceServerNameInstance = sourceServerNameElement.getTextContent(); - result.setSourceServerName(sourceServerNameInstance); - } - - NodeList elements5 = serviceResourceElement.getElementsByTagName("SourceDatabaseName"); - Element sourceDatabaseNameElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (sourceDatabaseNameElement != null) - { - String sourceDatabaseNameInstance; - sourceDatabaseNameInstance = sourceDatabaseNameElement.getTextContent(); - result.setSourceDatabaseName(sourceDatabaseNameInstance); - } - - NodeList elements6 = serviceResourceElement.getElementsByTagName("DestinationServerName"); - Element destinationServerNameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (destinationServerNameElement != null) - { - String destinationServerNameInstance; - destinationServerNameInstance = destinationServerNameElement.getTextContent(); - result.setDestinationServerName(destinationServerNameInstance); - } - - NodeList elements7 = serviceResourceElement.getElementsByTagName("DestinationDatabaseName"); - Element destinationDatabaseNameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (destinationDatabaseNameElement != null) - { - String destinationDatabaseNameInstance; - destinationDatabaseNameInstance = destinationDatabaseNameElement.getTextContent(); - result.setDestinationDatabaseName(destinationDatabaseNameInstance); - } - - NodeList elements8 = serviceResourceElement.getElementsByTagName("MaxLagInMinutes"); - Element maxLagInMinutesElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (maxLagInMinutesElement != null && (maxLagInMinutesElement.getTextContent() != null && maxLagInMinutesElement.getTextContent().isEmpty() != true) == false) - { - int maxLagInMinutesInstance; - maxLagInMinutesInstance = Integer.parseInt(maxLagInMinutesElement.getTextContent()); - result.setMaxLagInMinutes(maxLagInMinutesInstance); - } - - NodeList elements9 = serviceResourceElement.getElementsByTagName("IsContinuous"); - Element isContinuousElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (isContinuousElement != null) - { - boolean isContinuousInstance; - isContinuousInstance = Boolean.parseBoolean(isContinuousElement.getTextContent()); - result.setIsContinuous(isContinuousInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements10 = serviceResourceElement.getElementsByTagName("ReplicationState"); - Element replicationStateElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (replicationStateElement != null) - { - byte replicationStateInstance; - replicationStateInstance = Byte.valueOf(replicationStateElement.getTextContent()); - result.setReplicationState(replicationStateInstance); - } - - NodeList elements11 = serviceResourceElement.getElementsByTagName("ReplicationStateDescription"); - Element replicationStateDescriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (replicationStateDescriptionElement != null) - { - String replicationStateDescriptionInstance; - replicationStateDescriptionInstance = replicationStateDescriptionElement.getTextContent(); - result.setReplicationStateDescription(replicationStateDescriptionInstance); - } - - NodeList elements12 = serviceResourceElement.getElementsByTagName("LocalDatabaseId"); - Element localDatabaseIdElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (localDatabaseIdElement != null) - { - int localDatabaseIdInstance; - localDatabaseIdInstance = Integer.parseInt(localDatabaseIdElement.getTextContent()); - result.setLocalDatabaseId(localDatabaseIdInstance); - } - - NodeList elements13 = serviceResourceElement.getElementsByTagName("IsLocalDatabaseReplicationTarget"); - Element isLocalDatabaseReplicationTargetElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (isLocalDatabaseReplicationTargetElement != null) - { - boolean isLocalDatabaseReplicationTargetInstance; - isLocalDatabaseReplicationTargetInstance = Boolean.parseBoolean(isLocalDatabaseReplicationTargetElement.getTextContent()); - result.setIsLocalDatabaseReplicationTarget(isLocalDatabaseReplicationTargetInstance); - } - - NodeList elements14 = serviceResourceElement.getElementsByTagName("IsInterlinkConnected"); - Element isInterlinkConnectedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (isInterlinkConnectedElement != null) - { - boolean isInterlinkConnectedInstance; - isInterlinkConnectedInstance = Boolean.parseBoolean(isInterlinkConnectedElement.getTextContent()); - result.setIsInterlinkConnected(isInterlinkConnectedInstance); - } - - NodeList elements15 = serviceResourceElement.getElementsByTagName("TextStartDate"); - Element textStartDateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (textStartDateElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements16 = serviceResourceElement.getElementsByTagName("TextModifyDate"); - Element textModifyDateElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (textModifyDateElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements17 = serviceResourceElement.getElementsByTagName("PercentComplete"); - Element percentCompleteElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (percentCompleteElement != null && (percentCompleteElement.getTextContent() != null && percentCompleteElement.getTextContent().isEmpty() != true) == false) - { - float percentCompleteInstance; - percentCompleteInstance = Float.parseFloat(percentCompleteElement.getTextContent()); - result.setPercentComplete(percentCompleteInstance); - } + // Create Result + DatabaseCopyResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseCopyResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements18 = serviceResourceElement.getElementsByTagName("IsForcedTerminate"); - Element isForcedTerminateElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (isForcedTerminateElement != null && (isForcedTerminateElement.getTextContent() != null && isForcedTerminateElement.getTextContent().isEmpty() != true) == false) + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement != null) { - boolean isForcedTerminateInstance; - isForcedTerminateInstance = Boolean.parseBoolean(isForcedTerminateElement.getTextContent()); - result.setIsForcedTerminate(isForcedTerminateInstance); - } - } - - 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); - } - return result; - } - - /** - * - * @param serverName The name of the database server to be queried - * @param databaseName The name of the database to be queried - * @return Response containing the list of database copies for a given - * database. - */ - @Override - public Future listAsync(final String serverName, final String databaseName) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public DatabaseCopyListResponse call() throws Exception - { - return list(serverName, databaseName); - } - }); - } - - /** - * - * @param serverName The name of the database server to be queried - * @param databaseName The name of the database to be queried - * @return Response containing the list of database copies for a given - * database. - */ - @Override - public DatabaseCopyListResponse list(String serverName, String databaseName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException - { - // Validate - if (serverName == null) - { - throw new NullPointerException("serverName"); - } - if (databaseName == null) - { - throw new NullPointerException("databaseName"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serverName", serverName); - tracingParameters.put("databaseName", databaseName); - CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/sqlservers/servers/" + serverName + "/databases/" + databaseName + "/databasecopies"; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2012-03-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); - if (shouldTrace) - { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - DatabaseCopyListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DatabaseCopyListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); - Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourcesSequenceElement != null) - { - for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) - { - org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); - DatabaseCopyResponse serviceResourceInstance = new DatabaseCopyResponse(); - result.getDatabaseCopies().add(serviceResourceInstance); - - NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + NodeList elements2 = serviceResourceElement.getElementsByTagName("Name"); Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; if (nameElement != null) { String nameInstance; nameInstance = nameElement.getTextContent(); - serviceResourceInstance.setName(nameInstance); + result.setName(nameInstance); } - NodeList elements3 = serviceResourcesElement.getElementsByTagName("State"); + NodeList elements3 = serviceResourceElement.getElementsByTagName("State"); Element stateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; if (stateElement != null) { String stateInstance; stateInstance = stateElement.getTextContent(); - serviceResourceInstance.setState(stateInstance); + result.setState(stateInstance); } - NodeList elements4 = serviceResourcesElement.getElementsByTagName("SourceServerName"); + NodeList elements4 = serviceResourceElement.getElementsByTagName("SourceServerName"); Element sourceServerNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; if (sourceServerNameElement != null) { String sourceServerNameInstance; sourceServerNameInstance = sourceServerNameElement.getTextContent(); - serviceResourceInstance.setSourceServerName(sourceServerNameInstance); + result.setSourceServerName(sourceServerNameInstance); } - NodeList elements5 = serviceResourcesElement.getElementsByTagName("SourceDatabaseName"); + NodeList elements5 = serviceResourceElement.getElementsByTagName("SourceDatabaseName"); Element sourceDatabaseNameElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; if (sourceDatabaseNameElement != null) { String sourceDatabaseNameInstance; sourceDatabaseNameInstance = sourceDatabaseNameElement.getTextContent(); - serviceResourceInstance.setSourceDatabaseName(sourceDatabaseNameInstance); + result.setSourceDatabaseName(sourceDatabaseNameInstance); } - NodeList elements6 = serviceResourcesElement.getElementsByTagName("DestinationServerName"); + NodeList elements6 = serviceResourceElement.getElementsByTagName("DestinationServerName"); Element destinationServerNameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; if (destinationServerNameElement != null) { String destinationServerNameInstance; destinationServerNameInstance = destinationServerNameElement.getTextContent(); - serviceResourceInstance.setDestinationServerName(destinationServerNameInstance); + result.setDestinationServerName(destinationServerNameInstance); } - NodeList elements7 = serviceResourcesElement.getElementsByTagName("DestinationDatabaseName"); + NodeList elements7 = serviceResourceElement.getElementsByTagName("DestinationDatabaseName"); Element destinationDatabaseNameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; if (destinationDatabaseNameElement != null) { String destinationDatabaseNameInstance; destinationDatabaseNameInstance = destinationDatabaseNameElement.getTextContent(); - serviceResourceInstance.setDestinationDatabaseName(destinationDatabaseNameInstance); + result.setDestinationDatabaseName(destinationDatabaseNameInstance); } - NodeList elements8 = serviceResourcesElement.getElementsByTagName("MaxLagInMinutes"); + NodeList elements8 = serviceResourceElement.getElementsByTagName("MaxLagInMinutes"); Element maxLagInMinutesElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; if (maxLagInMinutesElement != null && (maxLagInMinutesElement.getTextContent() != null && maxLagInMinutesElement.getTextContent().isEmpty() != true) == false) { int maxLagInMinutesInstance; maxLagInMinutesInstance = Integer.parseInt(maxLagInMinutesElement.getTextContent()); - serviceResourceInstance.setMaxLagInMinutes(maxLagInMinutesInstance); + result.setMaxLagInMinutes(maxLagInMinutesInstance); } - NodeList elements9 = serviceResourcesElement.getElementsByTagName("IsContinuous"); + NodeList elements9 = serviceResourceElement.getElementsByTagName("IsContinuous"); Element isContinuousElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; if (isContinuousElement != null) { boolean isContinuousInstance; isContinuousInstance = Boolean.parseBoolean(isContinuousElement.getTextContent()); - serviceResourceInstance.setIsContinuous(isContinuousInstance); + result.setIsContinuous(isContinuousInstance); } - NodeList elements10 = serviceResourcesElement.getElementsByTagName("ReplicationState"); + NodeList elements10 = serviceResourceElement.getElementsByTagName("ReplicationState"); Element replicationStateElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; if (replicationStateElement != null) { byte replicationStateInstance; replicationStateInstance = Byte.valueOf(replicationStateElement.getTextContent()); - serviceResourceInstance.setReplicationState(replicationStateInstance); + result.setReplicationState(replicationStateInstance); } - NodeList elements11 = serviceResourcesElement.getElementsByTagName("ReplicationStateDescription"); + NodeList elements11 = serviceResourceElement.getElementsByTagName("ReplicationStateDescription"); Element replicationStateDescriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; if (replicationStateDescriptionElement != null) { String replicationStateDescriptionInstance; replicationStateDescriptionInstance = replicationStateDescriptionElement.getTextContent(); - serviceResourceInstance.setReplicationStateDescription(replicationStateDescriptionInstance); + result.setReplicationStateDescription(replicationStateDescriptionInstance); } - NodeList elements12 = serviceResourcesElement.getElementsByTagName("LocalDatabaseId"); + NodeList elements12 = serviceResourceElement.getElementsByTagName("LocalDatabaseId"); Element localDatabaseIdElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; if (localDatabaseIdElement != null) { int localDatabaseIdInstance; localDatabaseIdInstance = Integer.parseInt(localDatabaseIdElement.getTextContent()); - serviceResourceInstance.setLocalDatabaseId(localDatabaseIdInstance); + result.setLocalDatabaseId(localDatabaseIdInstance); } - NodeList elements13 = serviceResourcesElement.getElementsByTagName("IsLocalDatabaseReplicationTarget"); + NodeList elements13 = serviceResourceElement.getElementsByTagName("IsLocalDatabaseReplicationTarget"); Element isLocalDatabaseReplicationTargetElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; if (isLocalDatabaseReplicationTargetElement != null) { boolean isLocalDatabaseReplicationTargetInstance; isLocalDatabaseReplicationTargetInstance = Boolean.parseBoolean(isLocalDatabaseReplicationTargetElement.getTextContent()); - serviceResourceInstance.setIsLocalDatabaseReplicationTarget(isLocalDatabaseReplicationTargetInstance); + result.setIsLocalDatabaseReplicationTarget(isLocalDatabaseReplicationTargetInstance); } - NodeList elements14 = serviceResourcesElement.getElementsByTagName("IsInterlinkConnected"); + NodeList elements14 = serviceResourceElement.getElementsByTagName("IsInterlinkConnected"); Element isInterlinkConnectedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; if (isInterlinkConnectedElement != null) { boolean isInterlinkConnectedInstance; isInterlinkConnectedInstance = Boolean.parseBoolean(isInterlinkConnectedElement.getTextContent()); - serviceResourceInstance.setIsInterlinkConnected(isInterlinkConnectedInstance); + result.setIsInterlinkConnected(isInterlinkConnectedInstance); } - NodeList elements15 = serviceResourcesElement.getElementsByTagName("TextStartDate"); + NodeList elements15 = serviceResourceElement.getElementsByTagName("TextStartDate"); Element textStartDateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; if (textStartDateElement != null) { } - NodeList elements16 = serviceResourcesElement.getElementsByTagName("TextModifyDate"); + NodeList elements16 = serviceResourceElement.getElementsByTagName("TextModifyDate"); Element textModifyDateElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; if (textModifyDateElement != null) { } - NodeList elements17 = serviceResourcesElement.getElementsByTagName("PercentComplete"); + NodeList elements17 = serviceResourceElement.getElementsByTagName("PercentComplete"); Element percentCompleteElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; if (percentCompleteElement != null && (percentCompleteElement.getTextContent() != null && percentCompleteElement.getTextContent().isEmpty() != true) == false) { float percentCompleteInstance; percentCompleteInstance = Float.parseFloat(percentCompleteElement.getTextContent()); - serviceResourceInstance.setPercentComplete(percentCompleteInstance); + result.setPercentComplete(percentCompleteInstance); } - NodeList elements18 = serviceResourcesElement.getElementsByTagName("IsForcedTerminate"); + NodeList elements18 = serviceResourceElement.getElementsByTagName("IsForcedTerminate"); Element isForcedTerminateElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; if (isForcedTerminateElement != null && (isForcedTerminateElement.getTextContent() != null && isForcedTerminateElement.getTextContent().isEmpty() != true) == false) { boolean isForcedTerminateInstance; isForcedTerminateInstance = Boolean.parseBoolean(isForcedTerminateElement.getTextContent()); - serviceResourceInstance.setIsForcedTerminate(isForcedTerminateInstance); + result.setIsForcedTerminate(isForcedTerminateInstance); } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) + finally { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * + * @param serverName The name of the database server to be queried + * @param databaseName The name of the database to be queried + * @return Response containing the list of database copies for a given + * database. + */ + @Override + public Future listAsync(final String serverName, final String databaseName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public DatabaseCopyListResponse call() throws Exception + { + return list(serverName, databaseName); + } + }); + } + + /** + * + * @param serverName The name of the database server to be queried + * @param databaseName The name of the database to be queried + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return Response containing the list of database copies for a given + * database. + */ + @Override + public DatabaseCopyListResponse list(String serverName, String databaseName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + { + // Validate + if (serverName == null) + { + throw new NullPointerException("serverName"); + } + if (databaseName == null) + { + throw new NullPointerException("databaseName"); } + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; if (shouldTrace) { - CloudTracing.exit(invocationId, result); + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serverName", serverName); + tracingParameters.put("databaseName", databaseName); + CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/sqlservers/servers/" + serverName + "/databases/" + databaseName + "/databasecopies"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2012-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + DatabaseCopyListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseCopyListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); + Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourcesSequenceElement != null) + { + for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); + DatabaseCopyResponse serviceResourceInstance = new DatabaseCopyResponse(); + result.getDatabaseCopies().add(serviceResourceInstance); + + NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + serviceResourceInstance.setName(nameInstance); + } + + NodeList elements3 = serviceResourcesElement.getElementsByTagName("State"); + Element stateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + serviceResourceInstance.setState(stateInstance); + } + + NodeList elements4 = serviceResourcesElement.getElementsByTagName("SourceServerName"); + Element sourceServerNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (sourceServerNameElement != null) + { + String sourceServerNameInstance; + sourceServerNameInstance = sourceServerNameElement.getTextContent(); + serviceResourceInstance.setSourceServerName(sourceServerNameInstance); + } + + NodeList elements5 = serviceResourcesElement.getElementsByTagName("SourceDatabaseName"); + Element sourceDatabaseNameElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (sourceDatabaseNameElement != null) + { + String sourceDatabaseNameInstance; + sourceDatabaseNameInstance = sourceDatabaseNameElement.getTextContent(); + serviceResourceInstance.setSourceDatabaseName(sourceDatabaseNameInstance); + } + + NodeList elements6 = serviceResourcesElement.getElementsByTagName("DestinationServerName"); + Element destinationServerNameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (destinationServerNameElement != null) + { + String destinationServerNameInstance; + destinationServerNameInstance = destinationServerNameElement.getTextContent(); + serviceResourceInstance.setDestinationServerName(destinationServerNameInstance); + } + + NodeList elements7 = serviceResourcesElement.getElementsByTagName("DestinationDatabaseName"); + Element destinationDatabaseNameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (destinationDatabaseNameElement != null) + { + String destinationDatabaseNameInstance; + destinationDatabaseNameInstance = destinationDatabaseNameElement.getTextContent(); + serviceResourceInstance.setDestinationDatabaseName(destinationDatabaseNameInstance); + } + + NodeList elements8 = serviceResourcesElement.getElementsByTagName("MaxLagInMinutes"); + Element maxLagInMinutesElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (maxLagInMinutesElement != null && (maxLagInMinutesElement.getTextContent() != null && maxLagInMinutesElement.getTextContent().isEmpty() != true) == false) + { + int maxLagInMinutesInstance; + maxLagInMinutesInstance = Integer.parseInt(maxLagInMinutesElement.getTextContent()); + serviceResourceInstance.setMaxLagInMinutes(maxLagInMinutesInstance); + } + + NodeList elements9 = serviceResourcesElement.getElementsByTagName("IsContinuous"); + Element isContinuousElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (isContinuousElement != null) + { + boolean isContinuousInstance; + isContinuousInstance = Boolean.parseBoolean(isContinuousElement.getTextContent()); + serviceResourceInstance.setIsContinuous(isContinuousInstance); + } + + NodeList elements10 = serviceResourcesElement.getElementsByTagName("ReplicationState"); + Element replicationStateElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (replicationStateElement != null) + { + byte replicationStateInstance; + replicationStateInstance = Byte.valueOf(replicationStateElement.getTextContent()); + serviceResourceInstance.setReplicationState(replicationStateInstance); + } + + NodeList elements11 = serviceResourcesElement.getElementsByTagName("ReplicationStateDescription"); + Element replicationStateDescriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (replicationStateDescriptionElement != null) + { + String replicationStateDescriptionInstance; + replicationStateDescriptionInstance = replicationStateDescriptionElement.getTextContent(); + serviceResourceInstance.setReplicationStateDescription(replicationStateDescriptionInstance); + } + + NodeList elements12 = serviceResourcesElement.getElementsByTagName("LocalDatabaseId"); + Element localDatabaseIdElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (localDatabaseIdElement != null) + { + int localDatabaseIdInstance; + localDatabaseIdInstance = Integer.parseInt(localDatabaseIdElement.getTextContent()); + serviceResourceInstance.setLocalDatabaseId(localDatabaseIdInstance); + } + + NodeList elements13 = serviceResourcesElement.getElementsByTagName("IsLocalDatabaseReplicationTarget"); + Element isLocalDatabaseReplicationTargetElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (isLocalDatabaseReplicationTargetElement != null) + { + boolean isLocalDatabaseReplicationTargetInstance; + isLocalDatabaseReplicationTargetInstance = Boolean.parseBoolean(isLocalDatabaseReplicationTargetElement.getTextContent()); + serviceResourceInstance.setIsLocalDatabaseReplicationTarget(isLocalDatabaseReplicationTargetInstance); + } + + NodeList elements14 = serviceResourcesElement.getElementsByTagName("IsInterlinkConnected"); + Element isInterlinkConnectedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (isInterlinkConnectedElement != null) + { + boolean isInterlinkConnectedInstance; + isInterlinkConnectedInstance = Boolean.parseBoolean(isInterlinkConnectedElement.getTextContent()); + serviceResourceInstance.setIsInterlinkConnected(isInterlinkConnectedInstance); + } + + NodeList elements15 = serviceResourcesElement.getElementsByTagName("TextStartDate"); + Element textStartDateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (textStartDateElement != null) + { + } + + NodeList elements16 = serviceResourcesElement.getElementsByTagName("TextModifyDate"); + Element textModifyDateElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (textModifyDateElement != null) + { + } + + NodeList elements17 = serviceResourcesElement.getElementsByTagName("PercentComplete"); + Element percentCompleteElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (percentCompleteElement != null && (percentCompleteElement.getTextContent() != null && percentCompleteElement.getTextContent().isEmpty() != true) == false) + { + float percentCompleteInstance; + percentCompleteInstance = Float.parseFloat(percentCompleteElement.getTextContent()); + serviceResourceInstance.setPercentComplete(percentCompleteInstance); + } + + NodeList elements18 = serviceResourcesElement.getElementsByTagName("IsForcedTerminate"); + Element isForcedTerminateElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (isForcedTerminateElement != null && (isForcedTerminateElement.getTextContent() != null && isForcedTerminateElement.getTextContent().isEmpty() != true) == false) + { + boolean isForcedTerminateInstance; + isForcedTerminateInstance = Boolean.parseBoolean(isForcedTerminateElement.getTextContent()); + serviceResourceInstance.setIsForcedTerminate(isForcedTerminateInstance); + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1085,11 +1160,23 @@ public DatabaseCopyResponse call() throws Exception * update * @param parameters Additional parameters for the update database copy * operation + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public DatabaseCopyResponse update(String serverName, String databaseName, String databaseCopyName, DatabaseCopyUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException + public DatabaseCopyResponse update(String serverName, String databaseName, String databaseCopyName, DatabaseCopyUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException { // Validate if (serverName == null) @@ -1186,197 +1273,207 @@ public DatabaseCopyResponse update(String serverName, String databaseName, Strin // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - DatabaseCopyResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DatabaseCopyResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); - Element serviceResourceElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement2 != null) - { - NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = serviceResourceElement2.getElementsByTagName("State"); - Element stateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); - } - - NodeList elements4 = serviceResourceElement2.getElementsByTagName("SourceServerName"); - Element sourceServerNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (sourceServerNameElement != null) - { - String sourceServerNameInstance; - sourceServerNameInstance = sourceServerNameElement.getTextContent(); - result.setSourceServerName(sourceServerNameInstance); - } - - NodeList elements5 = serviceResourceElement2.getElementsByTagName("SourceDatabaseName"); - Element sourceDatabaseNameElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (sourceDatabaseNameElement != null) - { - String sourceDatabaseNameInstance; - sourceDatabaseNameInstance = sourceDatabaseNameElement.getTextContent(); - result.setSourceDatabaseName(sourceDatabaseNameInstance); - } - - NodeList elements6 = serviceResourceElement2.getElementsByTagName("DestinationServerName"); - Element destinationServerNameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (destinationServerNameElement != null) - { - String destinationServerNameInstance; - destinationServerNameInstance = destinationServerNameElement.getTextContent(); - result.setDestinationServerName(destinationServerNameInstance); - } - - NodeList elements7 = serviceResourceElement2.getElementsByTagName("DestinationDatabaseName"); - Element destinationDatabaseNameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (destinationDatabaseNameElement != null) - { - String destinationDatabaseNameInstance; - destinationDatabaseNameInstance = destinationDatabaseNameElement.getTextContent(); - result.setDestinationDatabaseName(destinationDatabaseNameInstance); - } - - NodeList elements8 = serviceResourceElement2.getElementsByTagName("MaxLagInMinutes"); - Element maxLagInMinutesElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (maxLagInMinutesElement2 != null && (maxLagInMinutesElement2.getTextContent() != null && maxLagInMinutesElement2.getTextContent().isEmpty() != true) == false) - { - int maxLagInMinutesInstance; - maxLagInMinutesInstance = Integer.parseInt(maxLagInMinutesElement2.getTextContent()); - result.setMaxLagInMinutes(maxLagInMinutesInstance); - } - - NodeList elements9 = serviceResourceElement2.getElementsByTagName("IsContinuous"); - Element isContinuousElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (isContinuousElement2 != null) - { - boolean isContinuousInstance; - isContinuousInstance = Boolean.parseBoolean(isContinuousElement2.getTextContent()); - result.setIsContinuous(isContinuousInstance); - } - - NodeList elements10 = serviceResourceElement2.getElementsByTagName("ReplicationState"); - Element replicationStateElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (replicationStateElement != null) - { - byte replicationStateInstance; - replicationStateInstance = Byte.valueOf(replicationStateElement.getTextContent()); - result.setReplicationState(replicationStateInstance); - } - - NodeList elements11 = serviceResourceElement2.getElementsByTagName("ReplicationStateDescription"); - Element replicationStateDescriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (replicationStateDescriptionElement != null) - { - String replicationStateDescriptionInstance; - replicationStateDescriptionInstance = replicationStateDescriptionElement.getTextContent(); - result.setReplicationStateDescription(replicationStateDescriptionInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements12 = serviceResourceElement2.getElementsByTagName("LocalDatabaseId"); - Element localDatabaseIdElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (localDatabaseIdElement != null) - { - int localDatabaseIdInstance; - localDatabaseIdInstance = Integer.parseInt(localDatabaseIdElement.getTextContent()); - result.setLocalDatabaseId(localDatabaseIdInstance); - } - - NodeList elements13 = serviceResourceElement2.getElementsByTagName("IsLocalDatabaseReplicationTarget"); - Element isLocalDatabaseReplicationTargetElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (isLocalDatabaseReplicationTargetElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - boolean isLocalDatabaseReplicationTargetInstance; - isLocalDatabaseReplicationTargetInstance = Boolean.parseBoolean(isLocalDatabaseReplicationTargetElement.getTextContent()); - result.setIsLocalDatabaseReplicationTarget(isLocalDatabaseReplicationTargetInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements14 = serviceResourceElement2.getElementsByTagName("IsInterlinkConnected"); - Element isInterlinkConnectedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (isInterlinkConnectedElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - boolean isInterlinkConnectedInstance; - isInterlinkConnectedInstance = Boolean.parseBoolean(isInterlinkConnectedElement.getTextContent()); - result.setIsInterlinkConnected(isInterlinkConnectedInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements15 = serviceResourceElement2.getElementsByTagName("TextStartDate"); - Element textStartDateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (textStartDateElement != null) - { - } + // Create Result + DatabaseCopyResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseCopyResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements16 = serviceResourceElement2.getElementsByTagName("TextModifyDate"); - Element textModifyDateElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (textModifyDateElement != null) + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement2 != null) { + NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = serviceResourceElement2.getElementsByTagName("State"); + Element stateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + result.setState(stateInstance); + } + + NodeList elements4 = serviceResourceElement2.getElementsByTagName("SourceServerName"); + Element sourceServerNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (sourceServerNameElement != null) + { + String sourceServerNameInstance; + sourceServerNameInstance = sourceServerNameElement.getTextContent(); + result.setSourceServerName(sourceServerNameInstance); + } + + NodeList elements5 = serviceResourceElement2.getElementsByTagName("SourceDatabaseName"); + Element sourceDatabaseNameElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (sourceDatabaseNameElement != null) + { + String sourceDatabaseNameInstance; + sourceDatabaseNameInstance = sourceDatabaseNameElement.getTextContent(); + result.setSourceDatabaseName(sourceDatabaseNameInstance); + } + + NodeList elements6 = serviceResourceElement2.getElementsByTagName("DestinationServerName"); + Element destinationServerNameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (destinationServerNameElement != null) + { + String destinationServerNameInstance; + destinationServerNameInstance = destinationServerNameElement.getTextContent(); + result.setDestinationServerName(destinationServerNameInstance); + } + + NodeList elements7 = serviceResourceElement2.getElementsByTagName("DestinationDatabaseName"); + Element destinationDatabaseNameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (destinationDatabaseNameElement != null) + { + String destinationDatabaseNameInstance; + destinationDatabaseNameInstance = destinationDatabaseNameElement.getTextContent(); + result.setDestinationDatabaseName(destinationDatabaseNameInstance); + } + + NodeList elements8 = serviceResourceElement2.getElementsByTagName("MaxLagInMinutes"); + Element maxLagInMinutesElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (maxLagInMinutesElement2 != null && (maxLagInMinutesElement2.getTextContent() != null && maxLagInMinutesElement2.getTextContent().isEmpty() != true) == false) + { + int maxLagInMinutesInstance; + maxLagInMinutesInstance = Integer.parseInt(maxLagInMinutesElement2.getTextContent()); + result.setMaxLagInMinutes(maxLagInMinutesInstance); + } + + NodeList elements9 = serviceResourceElement2.getElementsByTagName("IsContinuous"); + Element isContinuousElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (isContinuousElement2 != null) + { + boolean isContinuousInstance; + isContinuousInstance = Boolean.parseBoolean(isContinuousElement2.getTextContent()); + result.setIsContinuous(isContinuousInstance); + } + + NodeList elements10 = serviceResourceElement2.getElementsByTagName("ReplicationState"); + Element replicationStateElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (replicationStateElement != null) + { + byte replicationStateInstance; + replicationStateInstance = Byte.valueOf(replicationStateElement.getTextContent()); + result.setReplicationState(replicationStateInstance); + } + + NodeList elements11 = serviceResourceElement2.getElementsByTagName("ReplicationStateDescription"); + Element replicationStateDescriptionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (replicationStateDescriptionElement != null) + { + String replicationStateDescriptionInstance; + replicationStateDescriptionInstance = replicationStateDescriptionElement.getTextContent(); + result.setReplicationStateDescription(replicationStateDescriptionInstance); + } + + NodeList elements12 = serviceResourceElement2.getElementsByTagName("LocalDatabaseId"); + Element localDatabaseIdElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (localDatabaseIdElement != null) + { + int localDatabaseIdInstance; + localDatabaseIdInstance = Integer.parseInt(localDatabaseIdElement.getTextContent()); + result.setLocalDatabaseId(localDatabaseIdInstance); + } + + NodeList elements13 = serviceResourceElement2.getElementsByTagName("IsLocalDatabaseReplicationTarget"); + Element isLocalDatabaseReplicationTargetElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (isLocalDatabaseReplicationTargetElement != null) + { + boolean isLocalDatabaseReplicationTargetInstance; + isLocalDatabaseReplicationTargetInstance = Boolean.parseBoolean(isLocalDatabaseReplicationTargetElement.getTextContent()); + result.setIsLocalDatabaseReplicationTarget(isLocalDatabaseReplicationTargetInstance); + } + + NodeList elements14 = serviceResourceElement2.getElementsByTagName("IsInterlinkConnected"); + Element isInterlinkConnectedElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (isInterlinkConnectedElement != null) + { + boolean isInterlinkConnectedInstance; + isInterlinkConnectedInstance = Boolean.parseBoolean(isInterlinkConnectedElement.getTextContent()); + result.setIsInterlinkConnected(isInterlinkConnectedInstance); + } + + NodeList elements15 = serviceResourceElement2.getElementsByTagName("TextStartDate"); + Element textStartDateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (textStartDateElement != null) + { + } + + NodeList elements16 = serviceResourceElement2.getElementsByTagName("TextModifyDate"); + Element textModifyDateElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (textModifyDateElement != null) + { + } + + NodeList elements17 = serviceResourceElement2.getElementsByTagName("PercentComplete"); + Element percentCompleteElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (percentCompleteElement != null && (percentCompleteElement.getTextContent() != null && percentCompleteElement.getTextContent().isEmpty() != true) == false) + { + float percentCompleteInstance; + percentCompleteInstance = Float.parseFloat(percentCompleteElement.getTextContent()); + result.setPercentComplete(percentCompleteInstance); + } + + NodeList elements18 = serviceResourceElement2.getElementsByTagName("IsForcedTerminate"); + Element isForcedTerminateElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (isForcedTerminateElement2 != null && (isForcedTerminateElement2.getTextContent() != null && isForcedTerminateElement2.getTextContent().isEmpty() != true) == false) + { + boolean isForcedTerminateInstance; + isForcedTerminateInstance = Boolean.parseBoolean(isForcedTerminateElement2.getTextContent()); + result.setIsForcedTerminate(isForcedTerminateInstance); + } } - NodeList elements17 = serviceResourceElement2.getElementsByTagName("PercentComplete"); - Element percentCompleteElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (percentCompleteElement != null && (percentCompleteElement.getTextContent() != null && percentCompleteElement.getTextContent().isEmpty() != true) == false) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - float percentCompleteInstance; - percentCompleteInstance = Float.parseFloat(percentCompleteElement.getTextContent()); - result.setPercentComplete(percentCompleteInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements18 = serviceResourceElement2.getElementsByTagName("IsForcedTerminate"); - Element isForcedTerminateElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (isForcedTerminateElement2 != null && (isForcedTerminateElement2.getTextContent() != null && isForcedTerminateElement2.getTextContent().isEmpty() != true) == false) + if (shouldTrace) { - boolean isForcedTerminateInstance; - isForcedTerminateInstance = Boolean.parseBoolean(isForcedTerminateElement2.getTextContent()); - result.setIsForcedTerminate(isForcedTerminateInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationOperations.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationOperations.java index 6830a8bee8450..1eeb5340fcb09 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationOperations.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationOperations.java @@ -45,6 +45,16 @@ public interface DatabaseOperationOperations * executed. * @param operationGuid The Guid of the SQL Server database operation to be * obtained. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Response containing the database operation for a given operation * Guid. */ @@ -67,6 +77,16 @@ public interface DatabaseOperationOperations * * @param serverName The name of the SQL Server to be queried. * @param databaseName The name of the Database to be queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Response containing the list of database operations for a given * server or database. */ @@ -86,6 +106,16 @@ public interface DatabaseOperationOperations * Returns the list database operations for a given server. * * @param serverName The name of the SQL Server to be queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Response containing the list of database operations for a given * server or database. */ diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationOperationsImpl.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationOperationsImpl.java index f03b1fff81218..dcfe33f97b67e 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationOperationsImpl.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationOperationsImpl.java @@ -68,6 +68,7 @@ public class DatabaseOperationOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement != null) - { - NodeList elements2 = serviceResourceElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = serviceResourceElement.getElementsByTagName("Type"); - Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - result.setType(typeInstance); - } - - NodeList elements4 = serviceResourceElement.getElementsByTagName("State"); - Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); - } - - NodeList elements5 = serviceResourceElement.getElementsByTagName("SelfLink"); - Element selfLinkElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (selfLinkElement != null) - { - String selfLinkInstance; - selfLinkInstance = selfLinkElement.getTextContent(); - result.setSelfLink(selfLinkInstance); - } - - NodeList elements6 = serviceResourceElement.getElementsByTagName("ParentLink"); - Element parentLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (parentLinkElement != null) - { - String parentLinkInstance; - parentLinkInstance = parentLinkElement.getTextContent(); - result.setParentLink(parentLinkInstance); - } - - NodeList elements7 = serviceResourceElement.getElementsByTagName("Id"); - Element idElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (idElement != null) - { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); - } - - NodeList elements8 = serviceResourceElement.getElementsByTagName("StateId"); - Element stateIdElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (stateIdElement != null) - { - int stateIdInstance; - stateIdInstance = Integer.parseInt(stateIdElement.getTextContent()); - result.setStateId(stateIdInstance); - } - - NodeList elements9 = serviceResourceElement.getElementsByTagName("SessionActivityId"); - Element sessionActivityIdElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (sessionActivityIdElement != null) - { - String sessionActivityIdInstance; - sessionActivityIdInstance = sessionActivityIdElement.getTextContent(); - result.setSessionActivityId(sessionActivityIdInstance); - } - - NodeList elements10 = serviceResourceElement.getElementsByTagName("DatabaseName"); - Element databaseNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (databaseNameElement != null) - { - String databaseNameInstance; - databaseNameInstance = databaseNameElement.getTextContent(); - result.setDatabaseName(databaseNameInstance); - } - - NodeList elements11 = serviceResourceElement.getElementsByTagName("PercentComplete"); - Element percentCompleteElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (percentCompleteElement != null) - { - int percentCompleteInstance; - percentCompleteInstance = Integer.parseInt(percentCompleteElement.getTextContent()); - result.setPercentComplete(percentCompleteInstance); - } - - NodeList elements12 = serviceResourceElement.getElementsByTagName("ErrorCode"); - Element errorCodeElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (errorCodeElement != null) - { - int errorCodeInstance; - errorCodeInstance = Integer.parseInt(errorCodeElement.getTextContent()); - result.setErrorCode(errorCodeInstance); - } - - NodeList elements13 = serviceResourceElement.getElementsByTagName("Error"); - Element errorElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (errorElement != null) - { - String errorInstance; - errorInstance = errorElement.getTextContent(); - result.setError(errorInstance); - } - - NodeList elements14 = serviceResourceElement.getElementsByTagName("ErrorSeverity"); - Element errorSeverityElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (errorSeverityElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - int errorSeverityInstance; - errorSeverityInstance = Integer.parseInt(errorSeverityElement.getTextContent()); - result.setErrorSeverity(errorSeverityInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements15 = serviceResourceElement.getElementsByTagName("ErrorState"); - Element errorStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (errorStateElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - int errorStateInstance; - errorStateInstance = Integer.parseInt(errorStateElement.getTextContent()); - result.setErrorState(errorStateInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements16 = serviceResourceElement.getElementsByTagName("StartTime"); - Element startTimeElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (startTimeElement != null) - { - Calendar startTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(startTimeElement.getTextContent())); - startTimeInstance = calendar; - result.setStartTime(startTimeInstance); - } + // Create Result + DatabaseOperationGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseOperationGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements17 = serviceResourceElement.getElementsByTagName("LastModifyTime"); - Element lastModifyTimeElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (lastModifyTimeElement != null) + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement != null) { - Calendar lastModifyTimeInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(lastModifyTimeElement.getTextContent())); - lastModifyTimeInstance = calendar2; - result.setLastModifyTime(lastModifyTimeInstance); - } - } - - 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); - } - return result; - } - - /** - * Returns the list database operations for a given server and database. - * - * @param serverName The name of the SQL Server to be queried. - * @param databaseName The name of the Database to be queried. - * @return Response containing the list of database operations for a given - * server or database. - */ - @Override - public Future listByDatabaseAsync(final String serverName, final String databaseName) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public DatabaseOperationListResponse call() throws Exception - { - return listByDatabase(serverName, databaseName); - } - }); - } - - /** - * Returns the list database operations for a given server and database. - * - * @param serverName The name of the SQL Server to be queried. - * @param databaseName The name of the Database to be queried. - * @return Response containing the list of database operations for a given - * server or database. - */ - @Override - public DatabaseOperationListResponse listByDatabase(String serverName, String databaseName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException - { - // Validate - if (serverName == null) - { - throw new NullPointerException("serverName"); - } - if (databaseName == null) - { - throw new NullPointerException("databaseName"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serverName", serverName); - tracingParameters.put("databaseName", databaseName); - CloudTracing.enter(invocationId, this, "listByDatabaseAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + this.getClient().getCredentials().getSubscriptionId() + "/services/sqlservers/servers/" + serverName + "/databaseoperations?databaseName=" + databaseName; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2012-03-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); - if (shouldTrace) - { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - DatabaseOperationListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DatabaseOperationListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); - Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourcesSequenceElement != null) - { - for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) - { - org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); - DatabaseOperationListResponse.DatabaseOperation serviceResourceInstance = new DatabaseOperationListResponse.DatabaseOperation(); - result.getDatabaseOperations().add(serviceResourceInstance); - - NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + NodeList elements2 = serviceResourceElement.getElementsByTagName("Name"); Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; if (nameElement != null) { String nameInstance; nameInstance = nameElement.getTextContent(); - serviceResourceInstance.setName(nameInstance); + result.setName(nameInstance); } - NodeList elements3 = serviceResourcesElement.getElementsByTagName("Type"); + NodeList elements3 = serviceResourceElement.getElementsByTagName("Type"); Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; if (typeElement != null) { String typeInstance; typeInstance = typeElement.getTextContent(); - serviceResourceInstance.setType(typeInstance); + result.setType(typeInstance); } - NodeList elements4 = serviceResourcesElement.getElementsByTagName("State"); + NodeList elements4 = serviceResourceElement.getElementsByTagName("State"); Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; if (stateElement != null) { String stateInstance; stateInstance = stateElement.getTextContent(); - serviceResourceInstance.setState(stateInstance); + result.setState(stateInstance); } - NodeList elements5 = serviceResourcesElement.getElementsByTagName("SelfLink"); + NodeList elements5 = serviceResourceElement.getElementsByTagName("SelfLink"); Element selfLinkElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; if (selfLinkElement != null) { String selfLinkInstance; selfLinkInstance = selfLinkElement.getTextContent(); - serviceResourceInstance.setSelfLink(selfLinkInstance); + result.setSelfLink(selfLinkInstance); } - NodeList elements6 = serviceResourcesElement.getElementsByTagName("ParentLink"); + NodeList elements6 = serviceResourceElement.getElementsByTagName("ParentLink"); Element parentLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; if (parentLinkElement != null) { String parentLinkInstance; parentLinkInstance = parentLinkElement.getTextContent(); - serviceResourceInstance.setParentLink(parentLinkInstance); + result.setParentLink(parentLinkInstance); } - NodeList elements7 = serviceResourcesElement.getElementsByTagName("Id"); + NodeList elements7 = serviceResourceElement.getElementsByTagName("Id"); Element idElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; if (idElement != null) { String idInstance; idInstance = idElement.getTextContent(); - serviceResourceInstance.setId(idInstance); + result.setId(idInstance); } - NodeList elements8 = serviceResourcesElement.getElementsByTagName("StateId"); + NodeList elements8 = serviceResourceElement.getElementsByTagName("StateId"); Element stateIdElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; if (stateIdElement != null) { int stateIdInstance; stateIdInstance = Integer.parseInt(stateIdElement.getTextContent()); - serviceResourceInstance.setStateId(stateIdInstance); + result.setStateId(stateIdInstance); } - NodeList elements9 = serviceResourcesElement.getElementsByTagName("SessionActivityId"); + NodeList elements9 = serviceResourceElement.getElementsByTagName("SessionActivityId"); Element sessionActivityIdElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; if (sessionActivityIdElement != null) { String sessionActivityIdInstance; sessionActivityIdInstance = sessionActivityIdElement.getTextContent(); - serviceResourceInstance.setSessionActivityId(sessionActivityIdInstance); + result.setSessionActivityId(sessionActivityIdInstance); } - NodeList elements10 = serviceResourcesElement.getElementsByTagName("DatabaseName"); + NodeList elements10 = serviceResourceElement.getElementsByTagName("DatabaseName"); Element databaseNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; if (databaseNameElement != null) { String databaseNameInstance; databaseNameInstance = databaseNameElement.getTextContent(); - serviceResourceInstance.setDatabaseName(databaseNameInstance); + result.setDatabaseName(databaseNameInstance); } - NodeList elements11 = serviceResourcesElement.getElementsByTagName("PercentComplete"); + NodeList elements11 = serviceResourceElement.getElementsByTagName("PercentComplete"); Element percentCompleteElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; if (percentCompleteElement != null) { int percentCompleteInstance; percentCompleteInstance = Integer.parseInt(percentCompleteElement.getTextContent()); - serviceResourceInstance.setPercentComplete(percentCompleteInstance); + result.setPercentComplete(percentCompleteInstance); } - NodeList elements12 = serviceResourcesElement.getElementsByTagName("ErrorCode"); + NodeList elements12 = serviceResourceElement.getElementsByTagName("ErrorCode"); Element errorCodeElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; if (errorCodeElement != null) { int errorCodeInstance; errorCodeInstance = Integer.parseInt(errorCodeElement.getTextContent()); - serviceResourceInstance.setErrorCode(errorCodeInstance); + result.setErrorCode(errorCodeInstance); } - NodeList elements13 = serviceResourcesElement.getElementsByTagName("Error"); + NodeList elements13 = serviceResourceElement.getElementsByTagName("Error"); Element errorElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; if (errorElement != null) { String errorInstance; errorInstance = errorElement.getTextContent(); - serviceResourceInstance.setError(errorInstance); + result.setError(errorInstance); } - NodeList elements14 = serviceResourcesElement.getElementsByTagName("ErrorSeverity"); + NodeList elements14 = serviceResourceElement.getElementsByTagName("ErrorSeverity"); Element errorSeverityElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; if (errorSeverityElement != null) { int errorSeverityInstance; errorSeverityInstance = Integer.parseInt(errorSeverityElement.getTextContent()); - serviceResourceInstance.setErrorSeverity(errorSeverityInstance); + result.setErrorSeverity(errorSeverityInstance); } - NodeList elements15 = serviceResourcesElement.getElementsByTagName("ErrorState"); + NodeList elements15 = serviceResourceElement.getElementsByTagName("ErrorState"); Element errorStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; if (errorStateElement != null) { int errorStateInstance; errorStateInstance = Integer.parseInt(errorStateElement.getTextContent()); - serviceResourceInstance.setErrorState(errorStateInstance); + result.setErrorState(errorStateInstance); } - NodeList elements16 = serviceResourcesElement.getElementsByTagName("StartTime"); + NodeList elements16 = serviceResourceElement.getElementsByTagName("StartTime"); Element startTimeElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; if (startTimeElement != null) { @@ -577,10 +323,10 @@ public DatabaseOperationListResponse listByDatabase(String serverName, String da Calendar calendar = Calendar.getInstance(); calendar.setTime(simpleDateFormat.parse(startTimeElement.getTextContent())); startTimeInstance = calendar; - serviceResourceInstance.setStartTime(startTimeInstance); + result.setStartTime(startTimeInstance); } - NodeList elements17 = serviceResourcesElement.getElementsByTagName("LastModifyTime"); + NodeList elements17 = serviceResourceElement.getElementsByTagName("LastModifyTime"); Element lastModifyTimeElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; if (lastModifyTimeElement != null) { @@ -589,22 +335,317 @@ public DatabaseOperationListResponse listByDatabase(String serverName, String da Calendar calendar2 = Calendar.getInstance(); calendar2.setTime(simpleDateFormat2.parse(lastModifyTimeElement.getTextContent())); lastModifyTimeInstance = calendar2; - serviceResourceInstance.setLastModifyTime(lastModifyTimeInstance); + result.setLastModifyTime(lastModifyTimeInstance); } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * Returns the list database operations for a given server and database. + * + * @param serverName The name of the SQL Server to be queried. + * @param databaseName The name of the Database to be queried. + * @return Response containing the list of database operations for a given + * server or database. + */ + @Override + public Future listByDatabaseAsync(final String serverName, final String databaseName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public DatabaseOperationListResponse call() throws Exception + { + return listByDatabase(serverName, databaseName); + } + }); + } + + /** + * Returns the list database operations for a given server and database. + * + * @param serverName The name of the SQL Server to be queried. + * @param databaseName The name of the Database to be queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return Response containing the list of database operations for a given + * server or database. + */ + @Override + public DatabaseOperationListResponse listByDatabase(String serverName, String databaseName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + { + // Validate + if (serverName == null) + { + throw new NullPointerException("serverName"); + } + if (databaseName == null) { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + throw new NullPointerException("databaseName"); } + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; if (shouldTrace) { - CloudTracing.exit(invocationId, result); + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serverName", serverName); + tracingParameters.put("databaseName", databaseName); + CloudTracing.enter(invocationId, this, "listByDatabaseAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + this.getClient().getCredentials().getSubscriptionId() + "/services/sqlservers/servers/" + serverName + "/databaseoperations?databaseName=" + databaseName; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2012-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + DatabaseOperationListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseOperationListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); + Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourcesSequenceElement != null) + { + for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); + DatabaseOperationListResponse.DatabaseOperation serviceResourceInstance = new DatabaseOperationListResponse.DatabaseOperation(); + result.getDatabaseOperations().add(serviceResourceInstance); + + NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + serviceResourceInstance.setName(nameInstance); + } + + NodeList elements3 = serviceResourcesElement.getElementsByTagName("Type"); + Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + serviceResourceInstance.setType(typeInstance); + } + + NodeList elements4 = serviceResourcesElement.getElementsByTagName("State"); + Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + serviceResourceInstance.setState(stateInstance); + } + + NodeList elements5 = serviceResourcesElement.getElementsByTagName("SelfLink"); + Element selfLinkElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (selfLinkElement != null) + { + String selfLinkInstance; + selfLinkInstance = selfLinkElement.getTextContent(); + serviceResourceInstance.setSelfLink(selfLinkInstance); + } + + NodeList elements6 = serviceResourcesElement.getElementsByTagName("ParentLink"); + Element parentLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (parentLinkElement != null) + { + String parentLinkInstance; + parentLinkInstance = parentLinkElement.getTextContent(); + serviceResourceInstance.setParentLink(parentLinkInstance); + } + + NodeList elements7 = serviceResourcesElement.getElementsByTagName("Id"); + Element idElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + serviceResourceInstance.setId(idInstance); + } + + NodeList elements8 = serviceResourcesElement.getElementsByTagName("StateId"); + Element stateIdElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (stateIdElement != null) + { + int stateIdInstance; + stateIdInstance = Integer.parseInt(stateIdElement.getTextContent()); + serviceResourceInstance.setStateId(stateIdInstance); + } + + NodeList elements9 = serviceResourcesElement.getElementsByTagName("SessionActivityId"); + Element sessionActivityIdElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (sessionActivityIdElement != null) + { + String sessionActivityIdInstance; + sessionActivityIdInstance = sessionActivityIdElement.getTextContent(); + serviceResourceInstance.setSessionActivityId(sessionActivityIdInstance); + } + + NodeList elements10 = serviceResourcesElement.getElementsByTagName("DatabaseName"); + Element databaseNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (databaseNameElement != null) + { + String databaseNameInstance; + databaseNameInstance = databaseNameElement.getTextContent(); + serviceResourceInstance.setDatabaseName(databaseNameInstance); + } + + NodeList elements11 = serviceResourcesElement.getElementsByTagName("PercentComplete"); + Element percentCompleteElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (percentCompleteElement != null) + { + int percentCompleteInstance; + percentCompleteInstance = Integer.parseInt(percentCompleteElement.getTextContent()); + serviceResourceInstance.setPercentComplete(percentCompleteInstance); + } + + NodeList elements12 = serviceResourcesElement.getElementsByTagName("ErrorCode"); + Element errorCodeElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (errorCodeElement != null) + { + int errorCodeInstance; + errorCodeInstance = Integer.parseInt(errorCodeElement.getTextContent()); + serviceResourceInstance.setErrorCode(errorCodeInstance); + } + + NodeList elements13 = serviceResourcesElement.getElementsByTagName("Error"); + Element errorElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (errorElement != null) + { + String errorInstance; + errorInstance = errorElement.getTextContent(); + serviceResourceInstance.setError(errorInstance); + } + + NodeList elements14 = serviceResourcesElement.getElementsByTagName("ErrorSeverity"); + Element errorSeverityElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (errorSeverityElement != null) + { + int errorSeverityInstance; + errorSeverityInstance = Integer.parseInt(errorSeverityElement.getTextContent()); + serviceResourceInstance.setErrorSeverity(errorSeverityInstance); + } + + NodeList elements15 = serviceResourcesElement.getElementsByTagName("ErrorState"); + Element errorStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (errorStateElement != null) + { + int errorStateInstance; + errorStateInstance = Integer.parseInt(errorStateElement.getTextContent()); + serviceResourceInstance.setErrorState(errorStateInstance); + } + + NodeList elements16 = serviceResourcesElement.getElementsByTagName("StartTime"); + Element startTimeElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (startTimeElement != null) + { + Calendar startTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(startTimeElement.getTextContent())); + startTimeInstance = calendar; + serviceResourceInstance.setStartTime(startTimeInstance); + } + + NodeList elements17 = serviceResourcesElement.getElementsByTagName("LastModifyTime"); + Element lastModifyTimeElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (lastModifyTimeElement != null) + { + Calendar lastModifyTimeInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(lastModifyTimeElement.getTextContent())); + lastModifyTimeInstance = calendar2; + serviceResourceInstance.setLastModifyTime(lastModifyTimeInstance); + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -630,6 +671,16 @@ public DatabaseOperationListResponse call() throws Exception * Returns the list database operations for a given server. * * @param serverName The name of the SQL Server to be queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Response containing the list of database operations for a given * server or database. */ @@ -664,207 +715,217 @@ public DatabaseOperationListResponse listByServer(String serverName) throws IOEx // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - DatabaseOperationListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DatabaseOperationListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); - Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourcesSequenceElement != null) - { - for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); - DatabaseOperationListResponse.DatabaseOperation serviceResourceInstance = new DatabaseOperationListResponse.DatabaseOperation(); - result.getDatabaseOperations().add(serviceResourceInstance); - - NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - serviceResourceInstance.setName(nameInstance); - } - - NodeList elements3 = serviceResourcesElement.getElementsByTagName("Type"); - Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - serviceResourceInstance.setType(typeInstance); - } - - NodeList elements4 = serviceResourcesElement.getElementsByTagName("State"); - Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - serviceResourceInstance.setState(stateInstance); - } - - NodeList elements5 = serviceResourcesElement.getElementsByTagName("SelfLink"); - Element selfLinkElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (selfLinkElement != null) - { - String selfLinkInstance; - selfLinkInstance = selfLinkElement.getTextContent(); - serviceResourceInstance.setSelfLink(selfLinkInstance); - } - - NodeList elements6 = serviceResourcesElement.getElementsByTagName("ParentLink"); - Element parentLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (parentLinkElement != null) - { - String parentLinkInstance; - parentLinkInstance = parentLinkElement.getTextContent(); - serviceResourceInstance.setParentLink(parentLinkInstance); - } - - NodeList elements7 = serviceResourcesElement.getElementsByTagName("Id"); - Element idElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (idElement != null) - { - String idInstance; - idInstance = idElement.getTextContent(); - serviceResourceInstance.setId(idInstance); - } - - NodeList elements8 = serviceResourcesElement.getElementsByTagName("StateId"); - Element stateIdElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (stateIdElement != null) - { - int stateIdInstance; - stateIdInstance = Integer.parseInt(stateIdElement.getTextContent()); - serviceResourceInstance.setStateId(stateIdInstance); - } - - NodeList elements9 = serviceResourcesElement.getElementsByTagName("SessionActivityId"); - Element sessionActivityIdElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (sessionActivityIdElement != null) - { - String sessionActivityIdInstance; - sessionActivityIdInstance = sessionActivityIdElement.getTextContent(); - serviceResourceInstance.setSessionActivityId(sessionActivityIdInstance); - } - - NodeList elements10 = serviceResourcesElement.getElementsByTagName("DatabaseName"); - Element databaseNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (databaseNameElement != null) - { - String databaseNameInstance; - databaseNameInstance = databaseNameElement.getTextContent(); - serviceResourceInstance.setDatabaseName(databaseNameInstance); - } - - NodeList elements11 = serviceResourcesElement.getElementsByTagName("PercentComplete"); - Element percentCompleteElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (percentCompleteElement != null) - { - int percentCompleteInstance; - percentCompleteInstance = Integer.parseInt(percentCompleteElement.getTextContent()); - serviceResourceInstance.setPercentComplete(percentCompleteInstance); - } - - NodeList elements12 = serviceResourcesElement.getElementsByTagName("ErrorCode"); - Element errorCodeElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (errorCodeElement != null) - { - int errorCodeInstance; - errorCodeInstance = Integer.parseInt(errorCodeElement.getTextContent()); - serviceResourceInstance.setErrorCode(errorCodeInstance); - } - - NodeList elements13 = serviceResourcesElement.getElementsByTagName("Error"); - Element errorElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (errorElement != null) - { - String errorInstance; - errorInstance = errorElement.getTextContent(); - serviceResourceInstance.setError(errorInstance); - } - - NodeList elements14 = serviceResourcesElement.getElementsByTagName("ErrorSeverity"); - Element errorSeverityElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (errorSeverityElement != null) - { - int errorSeverityInstance; - errorSeverityInstance = Integer.parseInt(errorSeverityElement.getTextContent()); - serviceResourceInstance.setErrorSeverity(errorSeverityInstance); - } - - NodeList elements15 = serviceResourcesElement.getElementsByTagName("ErrorState"); - Element errorStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (errorStateElement != null) - { - int errorStateInstance; - errorStateInstance = Integer.parseInt(errorStateElement.getTextContent()); - serviceResourceInstance.setErrorState(errorStateInstance); - } - - NodeList elements16 = serviceResourcesElement.getElementsByTagName("StartTime"); - Element startTimeElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (startTimeElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - Calendar startTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(startTimeElement.getTextContent())); - startTimeInstance = calendar; - serviceResourceInstance.setStartTime(startTimeInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements17 = serviceResourcesElement.getElementsByTagName("LastModifyTime"); - Element lastModifyTimeElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (lastModifyTimeElement != null) - { - Calendar lastModifyTimeInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(lastModifyTimeElement.getTextContent())); - lastModifyTimeInstance = calendar2; - serviceResourceInstance.setLastModifyTime(lastModifyTimeInstance); + throw ex; + } + + // Create Result + DatabaseOperationListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseOperationListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); + Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourcesSequenceElement != null) + { + for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); + DatabaseOperationListResponse.DatabaseOperation serviceResourceInstance = new DatabaseOperationListResponse.DatabaseOperation(); + result.getDatabaseOperations().add(serviceResourceInstance); + + NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + serviceResourceInstance.setName(nameInstance); + } + + NodeList elements3 = serviceResourcesElement.getElementsByTagName("Type"); + Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + serviceResourceInstance.setType(typeInstance); + } + + NodeList elements4 = serviceResourcesElement.getElementsByTagName("State"); + Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + serviceResourceInstance.setState(stateInstance); + } + + NodeList elements5 = serviceResourcesElement.getElementsByTagName("SelfLink"); + Element selfLinkElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (selfLinkElement != null) + { + String selfLinkInstance; + selfLinkInstance = selfLinkElement.getTextContent(); + serviceResourceInstance.setSelfLink(selfLinkInstance); + } + + NodeList elements6 = serviceResourcesElement.getElementsByTagName("ParentLink"); + Element parentLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (parentLinkElement != null) + { + String parentLinkInstance; + parentLinkInstance = parentLinkElement.getTextContent(); + serviceResourceInstance.setParentLink(parentLinkInstance); + } + + NodeList elements7 = serviceResourcesElement.getElementsByTagName("Id"); + Element idElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + serviceResourceInstance.setId(idInstance); + } + + NodeList elements8 = serviceResourcesElement.getElementsByTagName("StateId"); + Element stateIdElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (stateIdElement != null) + { + int stateIdInstance; + stateIdInstance = Integer.parseInt(stateIdElement.getTextContent()); + serviceResourceInstance.setStateId(stateIdInstance); + } + + NodeList elements9 = serviceResourcesElement.getElementsByTagName("SessionActivityId"); + Element sessionActivityIdElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (sessionActivityIdElement != null) + { + String sessionActivityIdInstance; + sessionActivityIdInstance = sessionActivityIdElement.getTextContent(); + serviceResourceInstance.setSessionActivityId(sessionActivityIdInstance); + } + + NodeList elements10 = serviceResourcesElement.getElementsByTagName("DatabaseName"); + Element databaseNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (databaseNameElement != null) + { + String databaseNameInstance; + databaseNameInstance = databaseNameElement.getTextContent(); + serviceResourceInstance.setDatabaseName(databaseNameInstance); + } + + NodeList elements11 = serviceResourcesElement.getElementsByTagName("PercentComplete"); + Element percentCompleteElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (percentCompleteElement != null) + { + int percentCompleteInstance; + percentCompleteInstance = Integer.parseInt(percentCompleteElement.getTextContent()); + serviceResourceInstance.setPercentComplete(percentCompleteInstance); + } + + NodeList elements12 = serviceResourcesElement.getElementsByTagName("ErrorCode"); + Element errorCodeElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (errorCodeElement != null) + { + int errorCodeInstance; + errorCodeInstance = Integer.parseInt(errorCodeElement.getTextContent()); + serviceResourceInstance.setErrorCode(errorCodeInstance); + } + + NodeList elements13 = serviceResourcesElement.getElementsByTagName("Error"); + Element errorElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (errorElement != null) + { + String errorInstance; + errorInstance = errorElement.getTextContent(); + serviceResourceInstance.setError(errorInstance); + } + + NodeList elements14 = serviceResourcesElement.getElementsByTagName("ErrorSeverity"); + Element errorSeverityElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (errorSeverityElement != null) + { + int errorSeverityInstance; + errorSeverityInstance = Integer.parseInt(errorSeverityElement.getTextContent()); + serviceResourceInstance.setErrorSeverity(errorSeverityInstance); + } + + NodeList elements15 = serviceResourcesElement.getElementsByTagName("ErrorState"); + Element errorStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (errorStateElement != null) + { + int errorStateInstance; + errorStateInstance = Integer.parseInt(errorStateElement.getTextContent()); + serviceResourceInstance.setErrorState(errorStateInstance); + } + + NodeList elements16 = serviceResourcesElement.getElementsByTagName("StartTime"); + Element startTimeElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (startTimeElement != null) + { + Calendar startTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(startTimeElement.getTextContent())); + startTimeInstance = calendar; + serviceResourceInstance.setStartTime(startTimeInstance); + } + + NodeList elements17 = serviceResourcesElement.getElementsByTagName("LastModifyTime"); + Element lastModifyTimeElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (lastModifyTimeElement != null) + { + Calendar lastModifyTimeInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(lastModifyTimeElement.getTextContent())); + lastModifyTimeInstance = calendar2; + serviceResourceInstance.setLastModifyTime(lastModifyTimeInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperations.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperations.java index e6cfb07448afd..7174a9e6ed860 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperations.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperations.java @@ -32,11 +32,9 @@ import com.microsoft.windowsazure.management.sql.models.DatabaseUpdateParameters; import com.microsoft.windowsazure.management.sql.models.DatabaseUpdateResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -52,10 +50,22 @@ public interface DatabaseOperations * @param serverName The name of the SQL Server where the database will be * created. * @param parameters The parameters for the create database operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ - DatabaseCreateResponse create(String serverName, DatabaseCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException; + DatabaseCreateResponse create(String serverName, DatabaseCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException; /** * Creates a database in a SQL Server database server. @@ -75,6 +85,10 @@ public interface DatabaseOperations * * @param serverName The name of the server on which the database is found. * @param databaseName The name of the database to be deleted. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -98,6 +112,16 @@ public interface DatabaseOperations * @param serverName The name of the SQL Server on which the database is * housed. * @param databaseName The name of the SQL Server database to be obtained. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @@ -118,6 +142,16 @@ public interface DatabaseOperations * Returns the list SQL Server databases. * * @param serverName The name of the database server to be queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Response containing the list of databases for a given server. */ DatabaseListResponse list(String serverName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; @@ -136,10 +170,22 @@ public interface DatabaseOperations * @param serverName The name of the SQL Server where the database is housed. * @param databaseName The name of the SQL Server database to be obtained. * @param parameters The parameters for the update database operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ - DatabaseUpdateResponse update(String serverName, String databaseName, DatabaseUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException; + DatabaseUpdateResponse update(String serverName, String databaseName, DatabaseUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException; /** * Updates SQL Server database information. diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationsImpl.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationsImpl.java index 42a9d94dec104..4ae1af6f253e5 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationsImpl.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/DatabaseOperationsImpl.java @@ -37,7 +37,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -48,7 +47,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -85,6 +83,7 @@ public class DatabaseOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement2 != null) - { - NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); - Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = serviceResourceElement2.getElementsByTagName("Id"); - Element idElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (idElement != null) - { - int idInstance; - idInstance = Integer.parseInt(idElement.getTextContent()); - result.setId(idInstance); - } - - NodeList elements4 = serviceResourceElement2.getElementsByTagName("Type"); - Element typeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - result.setType(typeInstance); - } - - NodeList elements5 = serviceResourceElement2.getElementsByTagName("State"); - Element stateElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); - } - - NodeList elements6 = serviceResourceElement2.getElementsByTagName("Edition"); - Element editionElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (editionElement2 != null) - { - String editionInstance; - editionInstance = editionElement2.getTextContent(); - result.setEdition(editionInstance); - } - - NodeList elements7 = serviceResourceElement2.getElementsByTagName("MaxSizeGB"); - Element maxSizeGBElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (maxSizeGBElement2 != null) - { - long maxSizeGBInstance; - maxSizeGBInstance = Long.parseLong(maxSizeGBElement2.getTextContent()); - result.setMaximumDatabaseSizeInGB(maxSizeGBInstance); - } - - NodeList elements8 = serviceResourceElement2.getElementsByTagName("CollationName"); - Element collationNameElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (collationNameElement2 != null) - { - String collationNameInstance; - collationNameInstance = collationNameElement2.getTextContent(); - result.setCollationName(collationNameInstance); - } - - NodeList elements9 = serviceResourceElement2.getElementsByTagName("CreationDate"); - Element creationDateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (creationDateElement != null) - { - Calendar creationDateInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(creationDateElement.getTextContent())); - creationDateInstance = calendar; - result.setCreationDate(creationDateInstance); - } - - NodeList elements10 = serviceResourceElement2.getElementsByTagName("IsFederationRoot"); - Element isFederationRootElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (isFederationRootElement != null) - { - boolean isFederationRootInstance; - isFederationRootInstance = Boolean.parseBoolean(isFederationRootElement.getTextContent()); - result.setIsFederationRoot(isFederationRootInstance); - } - - NodeList elements11 = serviceResourceElement2.getElementsByTagName("IsSystemObject"); - Element isSystemObjectElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (isSystemObjectElement != null) - { - boolean isSystemObjectInstance; - isSystemObjectInstance = Boolean.parseBoolean(isSystemObjectElement.getTextContent()); - result.setIsSystemObject(isSystemObjectInstance); - } - - NodeList elements12 = serviceResourceElement2.getElementsByTagName("SizeMB"); - Element sizeMBElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (sizeMBElement != null) - { - String sizeMBInstance; - sizeMBInstance = sizeMBElement.getTextContent(); - result.setSizeMB(sizeMBInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements13 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentErrorCode"); - Element serviceObjectiveAssignmentErrorCodeElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (serviceObjectiveAssignmentErrorCodeElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String serviceObjectiveAssignmentErrorCodeInstance; - serviceObjectiveAssignmentErrorCodeInstance = serviceObjectiveAssignmentErrorCodeElement.getTextContent(); - result.setServiceObjectiveAssignmentErrorCode(serviceObjectiveAssignmentErrorCodeInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements14 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentErrorDescription"); - Element serviceObjectiveAssignmentErrorDescriptionElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (serviceObjectiveAssignmentErrorDescriptionElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_CREATED) { - String serviceObjectiveAssignmentErrorDescriptionInstance; - serviceObjectiveAssignmentErrorDescriptionInstance = serviceObjectiveAssignmentErrorDescriptionElement.getTextContent(); - result.setServiceObjectiveAssignmentErrorDescription(serviceObjectiveAssignmentErrorDescriptionInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements15 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentState"); - Element serviceObjectiveAssignmentStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (serviceObjectiveAssignmentStateElement != null) - { - String serviceObjectiveAssignmentStateInstance; - serviceObjectiveAssignmentStateInstance = serviceObjectiveAssignmentStateElement.getTextContent(); - result.setServiceObjectiveAssignmentState(serviceObjectiveAssignmentStateInstance); - } + // Create Result + DatabaseCreateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseCreateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements16 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentStateDescription"); - Element serviceObjectiveAssignmentStateDescriptionElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (serviceObjectiveAssignmentStateDescriptionElement != null) + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement2 != null) { - String serviceObjectiveAssignmentStateDescriptionInstance; - serviceObjectiveAssignmentStateDescriptionInstance = serviceObjectiveAssignmentStateDescriptionElement.getTextContent(); - result.setServiceObjectiveAssignmentStateDescription(serviceObjectiveAssignmentStateDescriptionInstance); + NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); + Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = serviceResourceElement2.getElementsByTagName("Id"); + Element idElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (idElement != null) + { + int idInstance; + idInstance = Integer.parseInt(idElement.getTextContent()); + result.setId(idInstance); + } + + NodeList elements4 = serviceResourceElement2.getElementsByTagName("Type"); + Element typeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + result.setType(typeInstance); + } + + NodeList elements5 = serviceResourceElement2.getElementsByTagName("State"); + Element stateElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + result.setState(stateInstance); + } + + NodeList elements6 = serviceResourceElement2.getElementsByTagName("Edition"); + Element editionElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (editionElement2 != null) + { + String editionInstance; + editionInstance = editionElement2.getTextContent(); + result.setEdition(editionInstance); + } + + NodeList elements7 = serviceResourceElement2.getElementsByTagName("MaxSizeGB"); + Element maxSizeGBElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (maxSizeGBElement2 != null) + { + long maxSizeGBInstance; + maxSizeGBInstance = Long.parseLong(maxSizeGBElement2.getTextContent()); + result.setMaximumDatabaseSizeInGB(maxSizeGBInstance); + } + + NodeList elements8 = serviceResourceElement2.getElementsByTagName("CollationName"); + Element collationNameElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (collationNameElement2 != null) + { + String collationNameInstance; + collationNameInstance = collationNameElement2.getTextContent(); + result.setCollationName(collationNameInstance); + } + + NodeList elements9 = serviceResourceElement2.getElementsByTagName("CreationDate"); + Element creationDateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (creationDateElement != null) + { + Calendar creationDateInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(creationDateElement.getTextContent())); + creationDateInstance = calendar; + result.setCreationDate(creationDateInstance); + } + + NodeList elements10 = serviceResourceElement2.getElementsByTagName("IsFederationRoot"); + Element isFederationRootElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (isFederationRootElement != null) + { + boolean isFederationRootInstance; + isFederationRootInstance = Boolean.parseBoolean(isFederationRootElement.getTextContent()); + result.setIsFederationRoot(isFederationRootInstance); + } + + NodeList elements11 = serviceResourceElement2.getElementsByTagName("IsSystemObject"); + Element isSystemObjectElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (isSystemObjectElement != null) + { + boolean isSystemObjectInstance; + isSystemObjectInstance = Boolean.parseBoolean(isSystemObjectElement.getTextContent()); + result.setIsSystemObject(isSystemObjectInstance); + } + + NodeList elements12 = serviceResourceElement2.getElementsByTagName("SizeMB"); + Element sizeMBElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (sizeMBElement != null) + { + String sizeMBInstance; + sizeMBInstance = sizeMBElement.getTextContent(); + result.setSizeMB(sizeMBInstance); + } + + NodeList elements13 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentErrorCode"); + Element serviceObjectiveAssignmentErrorCodeElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (serviceObjectiveAssignmentErrorCodeElement != null) + { + String serviceObjectiveAssignmentErrorCodeInstance; + serviceObjectiveAssignmentErrorCodeInstance = serviceObjectiveAssignmentErrorCodeElement.getTextContent(); + result.setServiceObjectiveAssignmentErrorCode(serviceObjectiveAssignmentErrorCodeInstance); + } + + NodeList elements14 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentErrorDescription"); + Element serviceObjectiveAssignmentErrorDescriptionElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (serviceObjectiveAssignmentErrorDescriptionElement != null) + { + String serviceObjectiveAssignmentErrorDescriptionInstance; + serviceObjectiveAssignmentErrorDescriptionInstance = serviceObjectiveAssignmentErrorDescriptionElement.getTextContent(); + result.setServiceObjectiveAssignmentErrorDescription(serviceObjectiveAssignmentErrorDescriptionInstance); + } + + NodeList elements15 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentState"); + Element serviceObjectiveAssignmentStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (serviceObjectiveAssignmentStateElement != null) + { + String serviceObjectiveAssignmentStateInstance; + serviceObjectiveAssignmentStateInstance = serviceObjectiveAssignmentStateElement.getTextContent(); + result.setServiceObjectiveAssignmentState(serviceObjectiveAssignmentStateInstance); + } + + NodeList elements16 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentStateDescription"); + Element serviceObjectiveAssignmentStateDescriptionElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (serviceObjectiveAssignmentStateDescriptionElement != null) + { + String serviceObjectiveAssignmentStateDescriptionInstance; + serviceObjectiveAssignmentStateDescriptionInstance = serviceObjectiveAssignmentStateDescriptionElement.getTextContent(); + result.setServiceObjectiveAssignmentStateDescription(serviceObjectiveAssignmentStateDescriptionInstance); + } + + NodeList elements17 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentSuccessDate"); + Element serviceObjectiveAssignmentSuccessDateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (serviceObjectiveAssignmentSuccessDateElement != null) + { + String serviceObjectiveAssignmentSuccessDateInstance; + serviceObjectiveAssignmentSuccessDateInstance = serviceObjectiveAssignmentSuccessDateElement.getTextContent(); + result.setServiceObjectiveAssignmentSuccessDate(serviceObjectiveAssignmentSuccessDateInstance); + } + + NodeList elements18 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveId"); + Element serviceObjectiveIdElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (serviceObjectiveIdElement2 != null) + { + String serviceObjectiveIdInstance; + serviceObjectiveIdInstance = serviceObjectiveIdElement2.getTextContent(); + result.setServiceObjectiveId(serviceObjectiveIdInstance); + } } - NodeList elements17 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentSuccessDate"); - Element serviceObjectiveAssignmentSuccessDateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (serviceObjectiveAssignmentSuccessDateElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - String serviceObjectiveAssignmentSuccessDateInstance; - serviceObjectiveAssignmentSuccessDateInstance = serviceObjectiveAssignmentSuccessDateElement.getTextContent(); - result.setServiceObjectiveAssignmentSuccessDate(serviceObjectiveAssignmentSuccessDateInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements18 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveId"); - Element serviceObjectiveIdElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (serviceObjectiveIdElement2 != null) + if (shouldTrace) { - String serviceObjectiveIdInstance; - serviceObjectiveIdInstance = serviceObjectiveIdElement2.getTextContent(); - result.setServiceObjectiveId(serviceObjectiveIdInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -445,6 +466,10 @@ public OperationResponse call() throws Exception * * @param serverName The name of the server on which the database is found. * @param databaseName The name of the database to be deleted. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -484,40 +509,50 @@ public OperationResponse delete(String serverName, String databaseName) throws I // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -547,6 +582,16 @@ public DatabaseGetResponse call() throws Exception * @param serverName The name of the SQL Server on which the database is * housed. * @param databaseName The name of the SQL Server database to be obtained. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @@ -586,367 +631,105 @@ public DatabaseGetResponse get(String serverName, String databaseName) throws IO // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - DatabaseGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DatabaseGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); - Element serviceResourceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement != null) - { - NodeList elements2 = serviceResourceElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = serviceResourceElement.getElementsByTagName("Id"); - Element idElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (idElement != null) - { - int idInstance; - idInstance = Integer.parseInt(idElement.getTextContent()); - result.setId(idInstance); - } - - NodeList elements4 = serviceResourceElement.getElementsByTagName("Type"); - Element typeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - result.setType(typeInstance); - } - - NodeList elements5 = serviceResourceElement.getElementsByTagName("State"); - Element stateElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); - } - - NodeList elements6 = serviceResourceElement.getElementsByTagName("Edition"); - Element editionElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (editionElement != null) - { - String editionInstance; - editionInstance = editionElement.getTextContent(); - result.setEdition(editionInstance); - } - - NodeList elements7 = serviceResourceElement.getElementsByTagName("MaxSizeGB"); - Element maxSizeGBElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (maxSizeGBElement != null) - { - long maxSizeGBInstance; - maxSizeGBInstance = Long.parseLong(maxSizeGBElement.getTextContent()); - result.setMaximumDatabaseSizeInGB(maxSizeGBInstance); - } - - NodeList elements8 = serviceResourceElement.getElementsByTagName("CollationName"); - Element collationNameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (collationNameElement != null) - { - String collationNameInstance; - collationNameInstance = collationNameElement.getTextContent(); - result.setCollationName(collationNameInstance); - } - - NodeList elements9 = serviceResourceElement.getElementsByTagName("CreationDate"); - Element creationDateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (creationDateElement != null) - { - Calendar creationDateInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(creationDateElement.getTextContent())); - creationDateInstance = calendar; - result.setCreationDate(creationDateInstance); - } - - NodeList elements10 = serviceResourceElement.getElementsByTagName("IsFederationRoot"); - Element isFederationRootElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (isFederationRootElement != null) - { - boolean isFederationRootInstance; - isFederationRootInstance = Boolean.parseBoolean(isFederationRootElement.getTextContent()); - result.setIsFederationRoot(isFederationRootInstance); - } - - NodeList elements11 = serviceResourceElement.getElementsByTagName("IsSystemObject"); - Element isSystemObjectElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (isSystemObjectElement != null) - { - boolean isSystemObjectInstance; - isSystemObjectInstance = Boolean.parseBoolean(isSystemObjectElement.getTextContent()); - result.setIsSystemObject(isSystemObjectInstance); - } - - NodeList elements12 = serviceResourceElement.getElementsByTagName("SizeMB"); - Element sizeMBElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (sizeMBElement != null) - { - String sizeMBInstance; - sizeMBInstance = sizeMBElement.getTextContent(); - result.setSizeMB(sizeMBInstance); - } - - NodeList elements13 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentErrorCode"); - Element serviceObjectiveAssignmentErrorCodeElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (serviceObjectiveAssignmentErrorCodeElement != null) - { - String serviceObjectiveAssignmentErrorCodeInstance; - serviceObjectiveAssignmentErrorCodeInstance = serviceObjectiveAssignmentErrorCodeElement.getTextContent(); - result.setServiceObjectiveAssignmentErrorCode(serviceObjectiveAssignmentErrorCodeInstance); - } - - NodeList elements14 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentErrorDescription"); - Element serviceObjectiveAssignmentErrorDescriptionElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (serviceObjectiveAssignmentErrorDescriptionElement != null) - { - String serviceObjectiveAssignmentErrorDescriptionInstance; - serviceObjectiveAssignmentErrorDescriptionInstance = serviceObjectiveAssignmentErrorDescriptionElement.getTextContent(); - result.setServiceObjectiveAssignmentErrorDescription(serviceObjectiveAssignmentErrorDescriptionInstance); - } - - NodeList elements15 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentState"); - Element serviceObjectiveAssignmentStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (serviceObjectiveAssignmentStateElement != null) - { - String serviceObjectiveAssignmentStateInstance; - serviceObjectiveAssignmentStateInstance = serviceObjectiveAssignmentStateElement.getTextContent(); - result.setServiceObjectiveAssignmentState(serviceObjectiveAssignmentStateInstance); - } - - NodeList elements16 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentStateDescription"); - Element serviceObjectiveAssignmentStateDescriptionElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (serviceObjectiveAssignmentStateDescriptionElement != null) - { - String serviceObjectiveAssignmentStateDescriptionInstance; - serviceObjectiveAssignmentStateDescriptionInstance = serviceObjectiveAssignmentStateDescriptionElement.getTextContent(); - result.setServiceObjectiveAssignmentStateDescription(serviceObjectiveAssignmentStateDescriptionInstance); - } - - NodeList elements17 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentSuccessDate"); - Element serviceObjectiveAssignmentSuccessDateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (serviceObjectiveAssignmentSuccessDateElement != null) - { - String serviceObjectiveAssignmentSuccessDateInstance; - serviceObjectiveAssignmentSuccessDateInstance = serviceObjectiveAssignmentSuccessDateElement.getTextContent(); - result.setServiceObjectiveAssignmentSuccessDate(serviceObjectiveAssignmentSuccessDateInstance); - } - - NodeList elements18 = serviceResourceElement.getElementsByTagName("ServiceObjectiveId"); - Element serviceObjectiveIdElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (serviceObjectiveIdElement != null) - { - String serviceObjectiveIdInstance; - serviceObjectiveIdInstance = serviceObjectiveIdElement.getTextContent(); - result.setServiceObjectiveId(serviceObjectiveIdInstance); - } - } - - 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); - } - return result; - } - - /** - * Returns the list SQL Server databases. - * - * @param serverName The name of the database server to be queried. - * @return Response containing the list of databases for a given server. - */ - @Override - public Future listAsync(final String serverName) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public DatabaseListResponse call() throws Exception - { - return list(serverName); + CloudTracing.sendRequest(invocationId, httpRequest); } - }); - } - - /** - * Returns the list SQL Server databases. - * - * @param serverName The name of the database server to be queried. - * @return Response containing the list of databases for a given server. - */ - @Override - public DatabaseListResponse list(String serverName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException - { - // Validate - if (serverName == null) - { - throw new NullPointerException("serverName"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serverName", serverName); - CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/sqlservers/servers/" + serverName + "/databases?contentview=generic"; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2012-03-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.receiveResponse(invocationId, httpResponse); } - throw ex; - } - - // Create Result - DatabaseListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DatabaseListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); - Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourcesSequenceElement != null) - { - for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + DatabaseGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement != null) { - org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); - DatabaseListResponse.Database serviceResourceInstance = new DatabaseListResponse.Database(); - result.getDatabases().add(serviceResourceInstance); - - NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + NodeList elements2 = serviceResourceElement.getElementsByTagName("Name"); Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; if (nameElement != null) { String nameInstance; nameInstance = nameElement.getTextContent(); - serviceResourceInstance.setName(nameInstance); + result.setName(nameInstance); } - NodeList elements3 = serviceResourcesElement.getElementsByTagName("Id"); + NodeList elements3 = serviceResourceElement.getElementsByTagName("Id"); Element idElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; if (idElement != null) { int idInstance; idInstance = Integer.parseInt(idElement.getTextContent()); - serviceResourceInstance.setId(idInstance); + result.setId(idInstance); } - NodeList elements4 = serviceResourcesElement.getElementsByTagName("Type"); + NodeList elements4 = serviceResourceElement.getElementsByTagName("Type"); Element typeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; if (typeElement != null) { String typeInstance; typeInstance = typeElement.getTextContent(); - serviceResourceInstance.setType(typeInstance); + result.setType(typeInstance); } - NodeList elements5 = serviceResourcesElement.getElementsByTagName("State"); + NodeList elements5 = serviceResourceElement.getElementsByTagName("State"); Element stateElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; if (stateElement != null) { String stateInstance; stateInstance = stateElement.getTextContent(); - serviceResourceInstance.setState(stateInstance); + result.setState(stateInstance); } - NodeList elements6 = serviceResourcesElement.getElementsByTagName("Edition"); + NodeList elements6 = serviceResourceElement.getElementsByTagName("Edition"); Element editionElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; if (editionElement != null) { String editionInstance; editionInstance = editionElement.getTextContent(); - serviceResourceInstance.setEdition(editionInstance); + result.setEdition(editionInstance); } - NodeList elements7 = serviceResourcesElement.getElementsByTagName("MaxSizeGB"); + NodeList elements7 = serviceResourceElement.getElementsByTagName("MaxSizeGB"); Element maxSizeGBElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; if (maxSizeGBElement != null) { long maxSizeGBInstance; maxSizeGBInstance = Long.parseLong(maxSizeGBElement.getTextContent()); - serviceResourceInstance.setMaximumDatabaseSizeInGB(maxSizeGBInstance); + result.setMaximumDatabaseSizeInGB(maxSizeGBInstance); } - NodeList elements8 = serviceResourcesElement.getElementsByTagName("CollationName"); + NodeList elements8 = serviceResourceElement.getElementsByTagName("CollationName"); Element collationNameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; if (collationNameElement != null) { String collationNameInstance; collationNameInstance = collationNameElement.getTextContent(); - serviceResourceInstance.setCollationName(collationNameInstance); + result.setCollationName(collationNameInstance); } - NodeList elements9 = serviceResourcesElement.getElementsByTagName("CreationDate"); + NodeList elements9 = serviceResourceElement.getElementsByTagName("CreationDate"); Element creationDateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; if (creationDateElement != null) { @@ -955,103 +738,395 @@ public DatabaseListResponse list(String serverName) throws IOException, ServiceE Calendar calendar = Calendar.getInstance(); calendar.setTime(simpleDateFormat.parse(creationDateElement.getTextContent())); creationDateInstance = calendar; - serviceResourceInstance.setCreationDate(creationDateInstance); + result.setCreationDate(creationDateInstance); } - NodeList elements10 = serviceResourcesElement.getElementsByTagName("IsFederationRoot"); + NodeList elements10 = serviceResourceElement.getElementsByTagName("IsFederationRoot"); Element isFederationRootElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; if (isFederationRootElement != null) { boolean isFederationRootInstance; isFederationRootInstance = Boolean.parseBoolean(isFederationRootElement.getTextContent()); - serviceResourceInstance.setIsFederationRoot(isFederationRootInstance); + result.setIsFederationRoot(isFederationRootInstance); } - NodeList elements11 = serviceResourcesElement.getElementsByTagName("IsSystemObject"); + NodeList elements11 = serviceResourceElement.getElementsByTagName("IsSystemObject"); Element isSystemObjectElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; if (isSystemObjectElement != null) { boolean isSystemObjectInstance; isSystemObjectInstance = Boolean.parseBoolean(isSystemObjectElement.getTextContent()); - serviceResourceInstance.setIsSystemObject(isSystemObjectInstance); + result.setIsSystemObject(isSystemObjectInstance); } - NodeList elements12 = serviceResourcesElement.getElementsByTagName("SizeMB"); + NodeList elements12 = serviceResourceElement.getElementsByTagName("SizeMB"); Element sizeMBElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; if (sizeMBElement != null) { String sizeMBInstance; sizeMBInstance = sizeMBElement.getTextContent(); - serviceResourceInstance.setSizeMB(sizeMBInstance); + result.setSizeMB(sizeMBInstance); } - NodeList elements13 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentErrorCode"); + NodeList elements13 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentErrorCode"); Element serviceObjectiveAssignmentErrorCodeElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; if (serviceObjectiveAssignmentErrorCodeElement != null) { String serviceObjectiveAssignmentErrorCodeInstance; serviceObjectiveAssignmentErrorCodeInstance = serviceObjectiveAssignmentErrorCodeElement.getTextContent(); - serviceResourceInstance.setServiceObjectiveAssignmentErrorCode(serviceObjectiveAssignmentErrorCodeInstance); + result.setServiceObjectiveAssignmentErrorCode(serviceObjectiveAssignmentErrorCodeInstance); } - NodeList elements14 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentErrorDescription"); + NodeList elements14 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentErrorDescription"); Element serviceObjectiveAssignmentErrorDescriptionElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; if (serviceObjectiveAssignmentErrorDescriptionElement != null) { String serviceObjectiveAssignmentErrorDescriptionInstance; serviceObjectiveAssignmentErrorDescriptionInstance = serviceObjectiveAssignmentErrorDescriptionElement.getTextContent(); - serviceResourceInstance.setServiceObjectiveAssignmentErrorDescription(serviceObjectiveAssignmentErrorDescriptionInstance); + result.setServiceObjectiveAssignmentErrorDescription(serviceObjectiveAssignmentErrorDescriptionInstance); } - NodeList elements15 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentState"); + NodeList elements15 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentState"); Element serviceObjectiveAssignmentStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; if (serviceObjectiveAssignmentStateElement != null) { String serviceObjectiveAssignmentStateInstance; serviceObjectiveAssignmentStateInstance = serviceObjectiveAssignmentStateElement.getTextContent(); - serviceResourceInstance.setServiceObjectiveAssignmentState(serviceObjectiveAssignmentStateInstance); + result.setServiceObjectiveAssignmentState(serviceObjectiveAssignmentStateInstance); } - NodeList elements16 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentStateDescription"); + NodeList elements16 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentStateDescription"); Element serviceObjectiveAssignmentStateDescriptionElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; if (serviceObjectiveAssignmentStateDescriptionElement != null) { String serviceObjectiveAssignmentStateDescriptionInstance; serviceObjectiveAssignmentStateDescriptionInstance = serviceObjectiveAssignmentStateDescriptionElement.getTextContent(); - serviceResourceInstance.setServiceObjectiveAssignmentStateDescription(serviceObjectiveAssignmentStateDescriptionInstance); + result.setServiceObjectiveAssignmentStateDescription(serviceObjectiveAssignmentStateDescriptionInstance); } - NodeList elements17 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentSuccessDate"); + NodeList elements17 = serviceResourceElement.getElementsByTagName("ServiceObjectiveAssignmentSuccessDate"); Element serviceObjectiveAssignmentSuccessDateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; if (serviceObjectiveAssignmentSuccessDateElement != null) { String serviceObjectiveAssignmentSuccessDateInstance; serviceObjectiveAssignmentSuccessDateInstance = serviceObjectiveAssignmentSuccessDateElement.getTextContent(); - serviceResourceInstance.setServiceObjectiveAssignmentSuccessDate(serviceObjectiveAssignmentSuccessDateInstance); + result.setServiceObjectiveAssignmentSuccessDate(serviceObjectiveAssignmentSuccessDateInstance); } - NodeList elements18 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveId"); + NodeList elements18 = serviceResourceElement.getElementsByTagName("ServiceObjectiveId"); Element serviceObjectiveIdElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; if (serviceObjectiveIdElement != null) { String serviceObjectiveIdInstance; serviceObjectiveIdInstance = serviceObjectiveIdElement.getTextContent(); - serviceResourceInstance.setServiceObjectiveId(serviceObjectiveIdInstance); + result.setServiceObjectiveId(serviceObjectiveIdInstance); } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * Returns the list SQL Server databases. + * + * @param serverName The name of the database server to be queried. + * @return Response containing the list of databases for a given server. + */ + @Override + public Future listAsync(final String serverName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public DatabaseListResponse call() throws Exception + { + return list(serverName); + } + }); + } + + /** + * Returns the list SQL Server databases. + * + * @param serverName The name of the database server to be queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return Response containing the list of databases for a given server. + */ + @Override + public DatabaseListResponse list(String serverName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + { + // Validate + if (serverName == null) { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + throw new NullPointerException("serverName"); } + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; if (shouldTrace) { - CloudTracing.exit(invocationId, result); + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serverName", serverName); + CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/sqlservers/servers/" + serverName + "/databases?contentview=generic"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2012-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + DatabaseListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); + Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourcesSequenceElement != null) + { + for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); + DatabaseListResponse.Database serviceResourceInstance = new DatabaseListResponse.Database(); + result.getDatabases().add(serviceResourceInstance); + + NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + serviceResourceInstance.setName(nameInstance); + } + + NodeList elements3 = serviceResourcesElement.getElementsByTagName("Id"); + Element idElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (idElement != null) + { + int idInstance; + idInstance = Integer.parseInt(idElement.getTextContent()); + serviceResourceInstance.setId(idInstance); + } + + NodeList elements4 = serviceResourcesElement.getElementsByTagName("Type"); + Element typeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + serviceResourceInstance.setType(typeInstance); + } + + NodeList elements5 = serviceResourcesElement.getElementsByTagName("State"); + Element stateElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + serviceResourceInstance.setState(stateInstance); + } + + NodeList elements6 = serviceResourcesElement.getElementsByTagName("Edition"); + Element editionElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (editionElement != null) + { + String editionInstance; + editionInstance = editionElement.getTextContent(); + serviceResourceInstance.setEdition(editionInstance); + } + + NodeList elements7 = serviceResourcesElement.getElementsByTagName("MaxSizeGB"); + Element maxSizeGBElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (maxSizeGBElement != null) + { + long maxSizeGBInstance; + maxSizeGBInstance = Long.parseLong(maxSizeGBElement.getTextContent()); + serviceResourceInstance.setMaximumDatabaseSizeInGB(maxSizeGBInstance); + } + + NodeList elements8 = serviceResourcesElement.getElementsByTagName("CollationName"); + Element collationNameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (collationNameElement != null) + { + String collationNameInstance; + collationNameInstance = collationNameElement.getTextContent(); + serviceResourceInstance.setCollationName(collationNameInstance); + } + + NodeList elements9 = serviceResourcesElement.getElementsByTagName("CreationDate"); + Element creationDateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (creationDateElement != null) + { + Calendar creationDateInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(creationDateElement.getTextContent())); + creationDateInstance = calendar; + serviceResourceInstance.setCreationDate(creationDateInstance); + } + + NodeList elements10 = serviceResourcesElement.getElementsByTagName("IsFederationRoot"); + Element isFederationRootElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (isFederationRootElement != null) + { + boolean isFederationRootInstance; + isFederationRootInstance = Boolean.parseBoolean(isFederationRootElement.getTextContent()); + serviceResourceInstance.setIsFederationRoot(isFederationRootInstance); + } + + NodeList elements11 = serviceResourcesElement.getElementsByTagName("IsSystemObject"); + Element isSystemObjectElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (isSystemObjectElement != null) + { + boolean isSystemObjectInstance; + isSystemObjectInstance = Boolean.parseBoolean(isSystemObjectElement.getTextContent()); + serviceResourceInstance.setIsSystemObject(isSystemObjectInstance); + } + + NodeList elements12 = serviceResourcesElement.getElementsByTagName("SizeMB"); + Element sizeMBElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (sizeMBElement != null) + { + String sizeMBInstance; + sizeMBInstance = sizeMBElement.getTextContent(); + serviceResourceInstance.setSizeMB(sizeMBInstance); + } + + NodeList elements13 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentErrorCode"); + Element serviceObjectiveAssignmentErrorCodeElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (serviceObjectiveAssignmentErrorCodeElement != null) + { + String serviceObjectiveAssignmentErrorCodeInstance; + serviceObjectiveAssignmentErrorCodeInstance = serviceObjectiveAssignmentErrorCodeElement.getTextContent(); + serviceResourceInstance.setServiceObjectiveAssignmentErrorCode(serviceObjectiveAssignmentErrorCodeInstance); + } + + NodeList elements14 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentErrorDescription"); + Element serviceObjectiveAssignmentErrorDescriptionElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (serviceObjectiveAssignmentErrorDescriptionElement != null) + { + String serviceObjectiveAssignmentErrorDescriptionInstance; + serviceObjectiveAssignmentErrorDescriptionInstance = serviceObjectiveAssignmentErrorDescriptionElement.getTextContent(); + serviceResourceInstance.setServiceObjectiveAssignmentErrorDescription(serviceObjectiveAssignmentErrorDescriptionInstance); + } + + NodeList elements15 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentState"); + Element serviceObjectiveAssignmentStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (serviceObjectiveAssignmentStateElement != null) + { + String serviceObjectiveAssignmentStateInstance; + serviceObjectiveAssignmentStateInstance = serviceObjectiveAssignmentStateElement.getTextContent(); + serviceResourceInstance.setServiceObjectiveAssignmentState(serviceObjectiveAssignmentStateInstance); + } + + NodeList elements16 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentStateDescription"); + Element serviceObjectiveAssignmentStateDescriptionElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (serviceObjectiveAssignmentStateDescriptionElement != null) + { + String serviceObjectiveAssignmentStateDescriptionInstance; + serviceObjectiveAssignmentStateDescriptionInstance = serviceObjectiveAssignmentStateDescriptionElement.getTextContent(); + serviceResourceInstance.setServiceObjectiveAssignmentStateDescription(serviceObjectiveAssignmentStateDescriptionInstance); + } + + NodeList elements17 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveAssignmentSuccessDate"); + Element serviceObjectiveAssignmentSuccessDateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (serviceObjectiveAssignmentSuccessDateElement != null) + { + String serviceObjectiveAssignmentSuccessDateInstance; + serviceObjectiveAssignmentSuccessDateInstance = serviceObjectiveAssignmentSuccessDateElement.getTextContent(); + serviceResourceInstance.setServiceObjectiveAssignmentSuccessDate(serviceObjectiveAssignmentSuccessDateInstance); + } + + NodeList elements18 = serviceResourcesElement.getElementsByTagName("ServiceObjectiveId"); + Element serviceObjectiveIdElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (serviceObjectiveIdElement != null) + { + String serviceObjectiveIdInstance; + serviceObjectiveIdInstance = serviceObjectiveIdElement.getTextContent(); + serviceResourceInstance.setServiceObjectiveId(serviceObjectiveIdInstance); + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1081,11 +1156,23 @@ public DatabaseUpdateResponse call() throws Exception * @param serverName The name of the SQL Server where the database is housed. * @param databaseName The name of the SQL Server database to be obtained. * @param parameters The parameters for the update database operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public DatabaseUpdateResponse update(String serverName, String databaseName, DatabaseUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException + public DatabaseUpdateResponse update(String serverName, String databaseName, DatabaseUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException { // Validate if (serverName == null) @@ -1184,206 +1271,216 @@ public DatabaseUpdateResponse update(String serverName, String databaseName, Dat // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - DatabaseUpdateResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new DatabaseUpdateResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); - Element serviceResourceElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement2 != null) - { - NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); - Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = serviceResourceElement2.getElementsByTagName("Id"); - Element idElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (idElement2 != null) - { - int idInstance; - idInstance = Integer.parseInt(idElement2.getTextContent()); - result.setId(idInstance); - } - - NodeList elements4 = serviceResourceElement2.getElementsByTagName("Type"); - Element typeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - result.setType(typeInstance); - } - - NodeList elements5 = serviceResourceElement2.getElementsByTagName("State"); - Element stateElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); - } - - NodeList elements6 = serviceResourceElement2.getElementsByTagName("Edition"); - Element editionElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (editionElement2 != null) - { - String editionInstance; - editionInstance = editionElement2.getTextContent(); - result.setEdition(editionInstance); - } - - NodeList elements7 = serviceResourceElement2.getElementsByTagName("MaxSizeGB"); - Element maxSizeGBElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (maxSizeGBElement2 != null) - { - long maxSizeGBInstance; - maxSizeGBInstance = Long.parseLong(maxSizeGBElement2.getTextContent()); - result.setMaximumDatabaseSizeInGB(maxSizeGBInstance); - } - - NodeList elements8 = serviceResourceElement2.getElementsByTagName("CollationName"); - Element collationNameElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (collationNameElement2 != null) - { - String collationNameInstance; - collationNameInstance = collationNameElement2.getTextContent(); - result.setCollationName(collationNameInstance); - } - - NodeList elements9 = serviceResourceElement2.getElementsByTagName("CreationDate"); - Element creationDateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (creationDateElement != null) - { - Calendar creationDateInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(creationDateElement.getTextContent())); - creationDateInstance = calendar; - result.setCreationDate(creationDateInstance); - } - - NodeList elements10 = serviceResourceElement2.getElementsByTagName("IsFederationRoot"); - Element isFederationRootElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (isFederationRootElement != null) - { - boolean isFederationRootInstance; - isFederationRootInstance = Boolean.parseBoolean(isFederationRootElement.getTextContent()); - result.setIsFederationRoot(isFederationRootInstance); - } - - NodeList elements11 = serviceResourceElement2.getElementsByTagName("IsSystemObject"); - Element isSystemObjectElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (isSystemObjectElement != null) - { - boolean isSystemObjectInstance; - isSystemObjectInstance = Boolean.parseBoolean(isSystemObjectElement.getTextContent()); - result.setIsSystemObject(isSystemObjectInstance); - } - - NodeList elements12 = serviceResourceElement2.getElementsByTagName("SizeMB"); - Element sizeMBElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (sizeMBElement != null) - { - String sizeMBInstance; - sizeMBInstance = sizeMBElement.getTextContent(); - result.setSizeMB(sizeMBInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements13 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentErrorCode"); - Element serviceObjectiveAssignmentErrorCodeElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (serviceObjectiveAssignmentErrorCodeElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String serviceObjectiveAssignmentErrorCodeInstance; - serviceObjectiveAssignmentErrorCodeInstance = serviceObjectiveAssignmentErrorCodeElement.getTextContent(); - result.setServiceObjectiveAssignmentErrorCode(serviceObjectiveAssignmentErrorCodeInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements14 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentErrorDescription"); - Element serviceObjectiveAssignmentErrorDescriptionElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (serviceObjectiveAssignmentErrorDescriptionElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String serviceObjectiveAssignmentErrorDescriptionInstance; - serviceObjectiveAssignmentErrorDescriptionInstance = serviceObjectiveAssignmentErrorDescriptionElement.getTextContent(); - result.setServiceObjectiveAssignmentErrorDescription(serviceObjectiveAssignmentErrorDescriptionInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements15 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentState"); - Element serviceObjectiveAssignmentStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (serviceObjectiveAssignmentStateElement != null) - { - String serviceObjectiveAssignmentStateInstance; - serviceObjectiveAssignmentStateInstance = serviceObjectiveAssignmentStateElement.getTextContent(); - result.setServiceObjectiveAssignmentState(serviceObjectiveAssignmentStateInstance); - } + // Create Result + DatabaseUpdateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new DatabaseUpdateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements16 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentStateDescription"); - Element serviceObjectiveAssignmentStateDescriptionElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (serviceObjectiveAssignmentStateDescriptionElement != null) + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement2 != null) { - String serviceObjectiveAssignmentStateDescriptionInstance; - serviceObjectiveAssignmentStateDescriptionInstance = serviceObjectiveAssignmentStateDescriptionElement.getTextContent(); - result.setServiceObjectiveAssignmentStateDescription(serviceObjectiveAssignmentStateDescriptionInstance); + NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); + Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = serviceResourceElement2.getElementsByTagName("Id"); + Element idElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (idElement2 != null) + { + int idInstance; + idInstance = Integer.parseInt(idElement2.getTextContent()); + result.setId(idInstance); + } + + NodeList elements4 = serviceResourceElement2.getElementsByTagName("Type"); + Element typeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + result.setType(typeInstance); + } + + NodeList elements5 = serviceResourceElement2.getElementsByTagName("State"); + Element stateElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + result.setState(stateInstance); + } + + NodeList elements6 = serviceResourceElement2.getElementsByTagName("Edition"); + Element editionElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (editionElement2 != null) + { + String editionInstance; + editionInstance = editionElement2.getTextContent(); + result.setEdition(editionInstance); + } + + NodeList elements7 = serviceResourceElement2.getElementsByTagName("MaxSizeGB"); + Element maxSizeGBElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (maxSizeGBElement2 != null) + { + long maxSizeGBInstance; + maxSizeGBInstance = Long.parseLong(maxSizeGBElement2.getTextContent()); + result.setMaximumDatabaseSizeInGB(maxSizeGBInstance); + } + + NodeList elements8 = serviceResourceElement2.getElementsByTagName("CollationName"); + Element collationNameElement2 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (collationNameElement2 != null) + { + String collationNameInstance; + collationNameInstance = collationNameElement2.getTextContent(); + result.setCollationName(collationNameInstance); + } + + NodeList elements9 = serviceResourceElement2.getElementsByTagName("CreationDate"); + Element creationDateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (creationDateElement != null) + { + Calendar creationDateInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(creationDateElement.getTextContent())); + creationDateInstance = calendar; + result.setCreationDate(creationDateInstance); + } + + NodeList elements10 = serviceResourceElement2.getElementsByTagName("IsFederationRoot"); + Element isFederationRootElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (isFederationRootElement != null) + { + boolean isFederationRootInstance; + isFederationRootInstance = Boolean.parseBoolean(isFederationRootElement.getTextContent()); + result.setIsFederationRoot(isFederationRootInstance); + } + + NodeList elements11 = serviceResourceElement2.getElementsByTagName("IsSystemObject"); + Element isSystemObjectElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (isSystemObjectElement != null) + { + boolean isSystemObjectInstance; + isSystemObjectInstance = Boolean.parseBoolean(isSystemObjectElement.getTextContent()); + result.setIsSystemObject(isSystemObjectInstance); + } + + NodeList elements12 = serviceResourceElement2.getElementsByTagName("SizeMB"); + Element sizeMBElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (sizeMBElement != null) + { + String sizeMBInstance; + sizeMBInstance = sizeMBElement.getTextContent(); + result.setSizeMB(sizeMBInstance); + } + + NodeList elements13 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentErrorCode"); + Element serviceObjectiveAssignmentErrorCodeElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (serviceObjectiveAssignmentErrorCodeElement != null) + { + String serviceObjectiveAssignmentErrorCodeInstance; + serviceObjectiveAssignmentErrorCodeInstance = serviceObjectiveAssignmentErrorCodeElement.getTextContent(); + result.setServiceObjectiveAssignmentErrorCode(serviceObjectiveAssignmentErrorCodeInstance); + } + + NodeList elements14 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentErrorDescription"); + Element serviceObjectiveAssignmentErrorDescriptionElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (serviceObjectiveAssignmentErrorDescriptionElement != null) + { + String serviceObjectiveAssignmentErrorDescriptionInstance; + serviceObjectiveAssignmentErrorDescriptionInstance = serviceObjectiveAssignmentErrorDescriptionElement.getTextContent(); + result.setServiceObjectiveAssignmentErrorDescription(serviceObjectiveAssignmentErrorDescriptionInstance); + } + + NodeList elements15 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentState"); + Element serviceObjectiveAssignmentStateElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (serviceObjectiveAssignmentStateElement != null) + { + String serviceObjectiveAssignmentStateInstance; + serviceObjectiveAssignmentStateInstance = serviceObjectiveAssignmentStateElement.getTextContent(); + result.setServiceObjectiveAssignmentState(serviceObjectiveAssignmentStateInstance); + } + + NodeList elements16 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentStateDescription"); + Element serviceObjectiveAssignmentStateDescriptionElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (serviceObjectiveAssignmentStateDescriptionElement != null) + { + String serviceObjectiveAssignmentStateDescriptionInstance; + serviceObjectiveAssignmentStateDescriptionInstance = serviceObjectiveAssignmentStateDescriptionElement.getTextContent(); + result.setServiceObjectiveAssignmentStateDescription(serviceObjectiveAssignmentStateDescriptionInstance); + } + + NodeList elements17 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentSuccessDate"); + Element serviceObjectiveAssignmentSuccessDateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (serviceObjectiveAssignmentSuccessDateElement != null) + { + String serviceObjectiveAssignmentSuccessDateInstance; + serviceObjectiveAssignmentSuccessDateInstance = serviceObjectiveAssignmentSuccessDateElement.getTextContent(); + result.setServiceObjectiveAssignmentSuccessDate(serviceObjectiveAssignmentSuccessDateInstance); + } + + NodeList elements18 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveId"); + Element serviceObjectiveIdElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (serviceObjectiveIdElement2 != null) + { + String serviceObjectiveIdInstance; + serviceObjectiveIdInstance = serviceObjectiveIdElement2.getTextContent(); + result.setServiceObjectiveId(serviceObjectiveIdInstance); + } } - NodeList elements17 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveAssignmentSuccessDate"); - Element serviceObjectiveAssignmentSuccessDateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (serviceObjectiveAssignmentSuccessDateElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - String serviceObjectiveAssignmentSuccessDateInstance; - serviceObjectiveAssignmentSuccessDateInstance = serviceObjectiveAssignmentSuccessDateElement.getTextContent(); - result.setServiceObjectiveAssignmentSuccessDate(serviceObjectiveAssignmentSuccessDateInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements18 = serviceResourceElement2.getElementsByTagName("ServiceObjectiveId"); - Element serviceObjectiveIdElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (serviceObjectiveIdElement2 != null) + if (shouldTrace) { - String serviceObjectiveIdInstance; - serviceObjectiveIdInstance = serviceObjectiveIdElement2.getTextContent(); - result.setServiceObjectiveId(serviceObjectiveIdInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/FirewallRuleOperations.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/FirewallRuleOperations.java index 99a811a9c2abf..2487fa4f74a73 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/FirewallRuleOperations.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/FirewallRuleOperations.java @@ -31,11 +31,9 @@ import com.microsoft.windowsazure.management.sql.models.FirewallRuleUpdateParameters; import com.microsoft.windowsazure.management.sql.models.FirewallRuleUpdateResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -59,10 +57,22 @@ public interface FirewallRuleOperations * @param serverName The name of the SQL database server to which this rule * will be applied. * @param parameters Parameters for the Create Firewall Rule operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ - FirewallRuleCreateResponse create(String serverName, FirewallRuleCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException; + FirewallRuleCreateResponse create(String serverName, FirewallRuleCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException; /** * Adds a new server-level firewall rule for a SQL Database server that @@ -87,6 +97,10 @@ public interface FirewallRuleOperations * @param serverName The name of the server that will be have new firewall * rule applied to it. * @param ruleName The name of the new firewall rule. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -113,6 +127,16 @@ public interface FirewallRuleOperations * more information) * * @param serverName The name of the server for which the call is being made. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @@ -140,10 +164,22 @@ public interface FirewallRuleOperations * will be applied. * @param ruleName The name of the firewall rule to be updated. * @param parameters Parameters for the Update Firewall Rule operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ - FirewallRuleUpdateResponse update(String serverName, String ruleName, FirewallRuleUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException; + FirewallRuleUpdateResponse update(String serverName, String ruleName, FirewallRuleUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException; /** * Updates an existing server-level firewall rule for a SQL Database server diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/FirewallRuleOperationsImpl.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/FirewallRuleOperationsImpl.java index 595b24d75b0a7..6046a652eddb3 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/FirewallRuleOperationsImpl.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/FirewallRuleOperationsImpl.java @@ -36,7 +36,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.text.ParseException; import java.util.HashMap; @@ -46,7 +45,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -88,6 +86,7 @@ public class FirewallRuleOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement2 != null) - { - NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); - Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement2 != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = serviceResourceElement2.getElementsByTagName("Type"); - Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (typeElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_CREATED) { - String typeInstance; - typeInstance = typeElement.getTextContent(); - result.setType(typeInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = serviceResourceElement2.getElementsByTagName("State"); - Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (stateElement != null) + // Create Result + FirewallRuleCreateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new FirewallRuleCreateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement2 != null) { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); + NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); + Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = serviceResourceElement2.getElementsByTagName("Type"); + Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + result.setType(typeInstance); + } + + NodeList elements4 = serviceResourceElement2.getElementsByTagName("State"); + Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + result.setState(stateInstance); + } + + NodeList elements5 = serviceResourceElement2.getElementsByTagName("StartIPAddress"); + Element startIPAddressElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (startIPAddressElement2 != null) + { + InetAddress startIPAddressInstance; + startIPAddressInstance = InetAddress.getByName(startIPAddressElement2.getTextContent()); + result.setStartIPAddress(startIPAddressInstance); + } + + NodeList elements6 = serviceResourceElement2.getElementsByTagName("EndIPAddress"); + Element endIPAddressElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (endIPAddressElement2 != null) + { + InetAddress endIPAddressInstance; + endIPAddressInstance = InetAddress.getByName(endIPAddressElement2.getTextContent()); + result.setEndIPAddress(endIPAddressInstance); + } } - NodeList elements5 = serviceResourceElement2.getElementsByTagName("StartIPAddress"); - Element startIPAddressElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (startIPAddressElement2 != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - InetAddress startIPAddressInstance; - startIPAddressInstance = InetAddress.getByName(startIPAddressElement2.getTextContent()); - result.setStartIPAddress(startIPAddressInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements6 = serviceResourceElement2.getElementsByTagName("EndIPAddress"); - Element endIPAddressElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (endIPAddressElement2 != null) + if (shouldTrace) { - InetAddress endIPAddressInstance; - endIPAddressInstance = InetAddress.getByName(endIPAddressElement2.getTextContent()); - result.setEndIPAddress(endIPAddressInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -336,6 +357,10 @@ public OperationResponse call() throws Exception * @param serverName The name of the server that will be have new firewall * rule applied to it. * @param ruleName The name of the new firewall rule. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -375,40 +400,50 @@ public OperationResponse delete(String serverName, String ruleName) throws IOExc // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -440,6 +475,16 @@ public FirewallRuleListResponse call() throws Exception * more information) * * @param serverName The name of the server for which the call is being made. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @@ -474,94 +519,104 @@ public FirewallRuleListResponse list(String serverName) throws IOException, Serv // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - FirewallRuleListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new FirewallRuleListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); - Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourcesSequenceElement != null) - { - for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); - FirewallRuleListResponse.FirewallRule serviceResourceInstance = new FirewallRuleListResponse.FirewallRule(); - result.getFirewallRules().add(serviceResourceInstance); - - NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - serviceResourceInstance.setName(nameInstance); - } - - NodeList elements3 = serviceResourcesElement.getElementsByTagName("Type"); - Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - serviceResourceInstance.setType(typeInstance); - } - - NodeList elements4 = serviceResourcesElement.getElementsByTagName("StartIPAddress"); - Element startIPAddressElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (startIPAddressElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - InetAddress startIPAddressInstance; - startIPAddressInstance = InetAddress.getByName(startIPAddressElement.getTextContent()); - serviceResourceInstance.setStartIPAddress(startIPAddressInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements5 = serviceResourcesElement.getElementsByTagName("EndIPAddress"); - Element endIPAddressElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (endIPAddressElement != null) + throw ex; + } + + // Create Result + FirewallRuleListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new FirewallRuleListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); + Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourcesSequenceElement != null) + { + for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) { - InetAddress endIPAddressInstance; - endIPAddressInstance = InetAddress.getByName(endIPAddressElement.getTextContent()); - serviceResourceInstance.setEndIPAddress(endIPAddressInstance); + org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); + FirewallRuleListResponse.FirewallRule serviceResourceInstance = new FirewallRuleListResponse.FirewallRule(); + result.getFirewallRules().add(serviceResourceInstance); + + NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + serviceResourceInstance.setName(nameInstance); + } + + NodeList elements3 = serviceResourcesElement.getElementsByTagName("Type"); + Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + serviceResourceInstance.setType(typeInstance); + } + + NodeList elements4 = serviceResourcesElement.getElementsByTagName("StartIPAddress"); + Element startIPAddressElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (startIPAddressElement != null) + { + InetAddress startIPAddressInstance; + startIPAddressInstance = InetAddress.getByName(startIPAddressElement.getTextContent()); + serviceResourceInstance.setStartIPAddress(startIPAddressInstance); + } + + NodeList elements5 = serviceResourcesElement.getElementsByTagName("EndIPAddress"); + Element endIPAddressElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (endIPAddressElement != null) + { + InetAddress endIPAddressInstance; + endIPAddressInstance = InetAddress.getByName(endIPAddressElement.getTextContent()); + serviceResourceInstance.setEndIPAddress(endIPAddressInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -599,11 +654,23 @@ public FirewallRuleUpdateResponse call() throws Exception * will be applied. * @param ruleName The name of the firewall rule to be updated. * @param parameters Parameters for the Update Firewall Rule operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public FirewallRuleUpdateResponse update(String serverName, String ruleName, FirewallRuleUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException + public FirewallRuleUpdateResponse update(String serverName, String ruleName, FirewallRuleUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException { // Validate if (serverName == null) @@ -688,95 +755,105 @@ public FirewallRuleUpdateResponse update(String serverName, String ruleName, Fir // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - FirewallRuleUpdateResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new FirewallRuleUpdateResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); - Element serviceResourceElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement2 != null) - { - NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); - Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement2 != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = serviceResourceElement2.getElementsByTagName("Type"); - Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (typeElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String typeInstance; - typeInstance = typeElement.getTextContent(); - result.setType(typeInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = serviceResourceElement2.getElementsByTagName("State"); - Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (stateElement != null) + // Create Result + FirewallRuleUpdateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new FirewallRuleUpdateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement2 != null) { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); + NodeList elements2 = serviceResourceElement2.getElementsByTagName("Name"); + Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = serviceResourceElement2.getElementsByTagName("Type"); + Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + result.setType(typeInstance); + } + + NodeList elements4 = serviceResourceElement2.getElementsByTagName("State"); + Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + result.setState(stateInstance); + } + + NodeList elements5 = serviceResourceElement2.getElementsByTagName("StartIPAddress"); + Element startIPAddressElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (startIPAddressElement2 != null) + { + InetAddress startIPAddressInstance; + startIPAddressInstance = InetAddress.getByName(startIPAddressElement2.getTextContent()); + result.setStartIPAddress(startIPAddressInstance); + } + + NodeList elements6 = serviceResourceElement2.getElementsByTagName("EndIPAddress"); + Element endIPAddressElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (endIPAddressElement2 != null) + { + InetAddress endIPAddressInstance; + endIPAddressInstance = InetAddress.getByName(endIPAddressElement2.getTextContent()); + result.setEndIPAddress(endIPAddressInstance); + } } - NodeList elements5 = serviceResourceElement2.getElementsByTagName("StartIPAddress"); - Element startIPAddressElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (startIPAddressElement2 != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - InetAddress startIPAddressInstance; - startIPAddressInstance = InetAddress.getByName(startIPAddressElement2.getTextContent()); - result.setStartIPAddress(startIPAddressInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements6 = serviceResourceElement2.getElementsByTagName("EndIPAddress"); - Element endIPAddressElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (endIPAddressElement2 != null) + if (shouldTrace) { - InetAddress endIPAddressInstance; - endIPAddressInstance = InetAddress.getByName(endIPAddressElement2.getTextContent()); - result.setEndIPAddress(endIPAddressInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServerOperations.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServerOperations.java index af663bf655cc2..8baffef7a0ecd 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServerOperations.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServerOperations.java @@ -30,11 +30,9 @@ import com.microsoft.windowsazure.management.sql.models.ServerCreateResponse; import com.microsoft.windowsazure.management.sql.models.ServerListResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -56,10 +54,20 @@ public interface ServerOperations * administrative user. * @param parameters Parameters for the Manage Administrator Password * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse changeAdministratorPassword(String serverName, ServerChangeAdministratorPasswordParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse changeAdministratorPassword(String serverName, ServerChangeAdministratorPasswordParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * Sets the administrative password of a SQL Database server for a @@ -82,9 +90,21 @@ public interface ServerOperations * more information) * * @param parameters Parameters supplied to the Create Server operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response returned from the Create Server operation. */ - ServerCreateResponse create(ServerCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException; + ServerCreateResponse create(ServerCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException; /** * Adds a new SQL Database server to a subscription. (see @@ -102,6 +122,10 @@ public interface ServerOperations * more information) * * @param serverName The name of the server to be deleted. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -123,6 +147,16 @@ public interface ServerOperations * (see http://msdn.microsoft.com/en-us/library/windowsazure/gg715269.aspx * for more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response structure for the Server List operation. */ ServerListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServerOperationsImpl.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServerOperationsImpl.java index 2c01759a7a979..da38adcb18905 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServerOperationsImpl.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServerOperationsImpl.java @@ -35,7 +35,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.HashMap; import java.util.concurrent.Callable; @@ -44,7 +43,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -82,6 +80,7 @@ public class ServerOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -251,10 +270,22 @@ public ServerCreateResponse call() throws Exception * more information) * * @param parameters Parameters supplied to the Create Server operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response returned from the Create Server operation. */ @Override - public ServerCreateResponse create(ServerCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException + public ServerCreateResponse create(ServerCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException { // Validate if (parameters == null) @@ -329,53 +360,63 @@ public ServerCreateResponse create(ServerCreateParameters parameters) throws Par // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_CREATED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ServerCreateResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ServerCreateResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "ServerName"); - Element serverNameElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serverNameElement != null) - { - result.setServerName(serverNameElement.getTextContent()); - } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_CREATED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + ServerCreateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServerCreateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "ServerName"); + Element serverNameElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serverNameElement != null) + { + result.setServerName(serverNameElement.getTextContent()); + } + + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -405,6 +446,10 @@ public OperationResponse call() throws Exception * more information) * * @param serverName The name of the server to be deleted. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -439,40 +484,50 @@ public OperationResponse delete(String serverName) throws IOException, ServiceEx // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -499,6 +554,16 @@ public ServerListResponse call() throws Exception * (see http://msdn.microsoft.com/en-us/library/windowsazure/gg715269.aspx * for more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response structure for the Server List operation. */ @Override @@ -527,99 +592,109 @@ public ServerListResponse list() throws IOException, ServiceException, ParserCon // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ServerListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ServerListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Servers"); - Element serversSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serversSequenceElement != null) - { - for (int i1 = 0; i1 < serversSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Server").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element serversElement = ((org.w3c.dom.Element) serversSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Server").item(i1)); - ServerListResponse.Server serverInstance = new ServerListResponse.Server(); - result.getServers().add(serverInstance); - - NodeList elements2 = serversElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - serverInstance.setName(nameInstance); - } - - NodeList elements3 = serversElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "AdministratorLogin"); - Element administratorLoginElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (administratorLoginElement != null) - { - String administratorLoginInstance; - administratorLoginInstance = administratorLoginElement.getTextContent(); - serverInstance.setAdministratorUserName(administratorLoginInstance); - } - - NodeList elements4 = serversElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Location"); - Element locationElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (locationElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String locationInstance; - locationInstance = locationElement.getTextContent(); - serverInstance.setLocation(locationInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements5 = serversElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Features"); - Element featuresSequenceElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (featuresSequenceElement != null) + throw ex; + } + + // Create Result + ServerListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServerListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Servers"); + Element serversSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serversSequenceElement != null) + { + for (int i1 = 0; i1 < serversSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Server").getLength(); i1 = i1 + 1) { - for (int i2 = 0; i2 < featuresSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Feature").getLength(); i2 = i2 + 1) + org.w3c.dom.Element serversElement = ((org.w3c.dom.Element) serversSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Server").item(i1)); + ServerListResponse.Server serverInstance = new ServerListResponse.Server(); + result.getServers().add(serverInstance); + + NodeList elements2 = serversElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + serverInstance.setName(nameInstance); + } + + NodeList elements3 = serversElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "AdministratorLogin"); + Element administratorLoginElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (administratorLoginElement != null) + { + String administratorLoginInstance; + administratorLoginInstance = administratorLoginElement.getTextContent(); + serverInstance.setAdministratorUserName(administratorLoginInstance); + } + + NodeList elements4 = serversElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Location"); + Element locationElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + serverInstance.setLocation(locationInstance); + } + + NodeList elements5 = serversElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Features"); + Element featuresSequenceElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (featuresSequenceElement != null) { - org.w3c.dom.Element featuresElement = ((org.w3c.dom.Element) featuresSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Feature").item(i2)); - NodeList elements6 = featuresElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Name"); - String featuresKey = elements6.getLength() > 0 ? ((org.w3c.dom.Element) elements6.item(0)).getTextContent() : null; - NodeList elements7 = featuresElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Value"); - String featuresValue = elements7.getLength() > 0 ? ((org.w3c.dom.Element) elements7.item(0)).getTextContent() : null; - serverInstance.getFeatures().put(featuresKey, featuresValue); + for (int i2 = 0; i2 < featuresSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Feature").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element featuresElement = ((org.w3c.dom.Element) featuresSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Feature").item(i2)); + NodeList elements6 = featuresElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Name"); + String featuresKey = elements6.getLength() > 0 ? ((org.w3c.dom.Element) elements6.item(0)).getTextContent() : null; + NodeList elements7 = featuresElement.getElementsByTagNameNS("http://schemas.microsoft.com/sqlazure/2010/12/", "Value"); + String featuresValue = elements7.getLength() > 0 ? ((org.w3c.dom.Element) elements7.item(0)).getTextContent() : null; + serverInstance.getFeatures().put(featuresKey, featuresValue); + } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServiceObjectiveOperations.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServiceObjectiveOperations.java index 1ed8fc7cae9c5..5d27e48c8a252 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServiceObjectiveOperations.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServiceObjectiveOperations.java @@ -43,6 +43,16 @@ public interface ServiceObjectiveOperations * * @param serverName The name of the SQL Server to be queried. * @param serviceObjectiveId The Id of the Service Objective to be obtained. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Response containing the service objective for a given server and * service objective Id. */ @@ -62,6 +72,16 @@ public interface ServiceObjectiveOperations * Returns information about all Service Objectives on a database server. * * @param serverName The name of the database server to be queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Response containing the list of service objective for a given * server. */ diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServiceObjectiveOperationsImpl.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServiceObjectiveOperationsImpl.java index 763fa3dde9782..027121e33f246 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServiceObjectiveOperationsImpl.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/ServiceObjectiveOperationsImpl.java @@ -66,6 +66,7 @@ public class ServiceObjectiveOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (serviceResourceElement != null) - { - NodeList elements2 = serviceResourceElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = serviceResourceElement.getElementsByTagName("Type"); - Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - result.setType(typeInstance); - } - - NodeList elements4 = serviceResourceElement.getElementsByTagName("State"); - Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); - } - - NodeList elements5 = serviceResourceElement.getElementsByTagName("SelfLink"); - Element selfLinkElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (selfLinkElement != null) - { - String selfLinkInstance; - selfLinkInstance = selfLinkElement.getTextContent(); - result.setSelfLink(selfLinkInstance); - } - - NodeList elements6 = serviceResourceElement.getElementsByTagName("ParentLink"); - Element parentLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (parentLinkElement != null) - { - String parentLinkInstance; - parentLinkInstance = parentLinkElement.getTextContent(); - result.setParentLink(parentLinkInstance); - } - - NodeList elements7 = serviceResourceElement.getElementsByTagName("Id"); - Element idElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (idElement != null) - { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); - } - - NodeList elements8 = serviceResourceElement.getElementsByTagName("IsDefault"); - Element isDefaultElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (isDefaultElement != null) - { - boolean isDefaultInstance; - isDefaultInstance = Boolean.parseBoolean(isDefaultElement.getTextContent()); - result.setIsDefault(isDefaultInstance); - } - - NodeList elements9 = serviceResourceElement.getElementsByTagName("IsSystem"); - Element isSystemElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (isSystemElement != null) - { - boolean isSystemInstance; - isSystemInstance = Boolean.parseBoolean(isSystemElement.getTextContent()); - result.setIsSystem(isSystemInstance); - } - - NodeList elements10 = serviceResourceElement.getElementsByTagName("Description"); - Element descriptionElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - result.setDescription(descriptionInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements11 = serviceResourceElement.getElementsByTagName("Enabled"); - Element enabledElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (enabledElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - boolean enabledInstance; - enabledInstance = Boolean.parseBoolean(enabledElement.getTextContent()); - result.setEnabled(enabledInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements12 = serviceResourceElement.getElementsByTagName("DimensionSettings"); - Element dimensionSettingsSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (dimensionSettingsSequenceElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - for (int i1 = 0; i1 < dimensionSettingsSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - org.w3c.dom.Element dimensionSettingsElement = ((org.w3c.dom.Element) dimensionSettingsSequenceElement.getElementsByTagName("ServiceResource").item(i1)); - ServiceObjectiveGetResponse.DimensionSettingResponse serviceResourceInstance = new ServiceObjectiveGetResponse.DimensionSettingResponse(); - result.getDimensionSettings().add(serviceResourceInstance); - - NodeList elements13 = dimensionSettingsElement.getElementsByTagName("Name"); - Element nameElement2 = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance2; - nameInstance2 = nameElement2.getTextContent(); - serviceResourceInstance.setName(nameInstance2); - } - - NodeList elements14 = dimensionSettingsElement.getElementsByTagName("Type"); - Element typeElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (typeElement2 != null) - { - String typeInstance2; - typeInstance2 = typeElement2.getTextContent(); - serviceResourceInstance.setType(typeInstance2); - } - - NodeList elements15 = dimensionSettingsElement.getElementsByTagName("State"); - Element stateElement2 = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (stateElement2 != null) - { - String stateInstance2; - stateInstance2 = stateElement2.getTextContent(); - serviceResourceInstance.setState(stateInstance2); - } - - NodeList elements16 = dimensionSettingsElement.getElementsByTagName("SelfLink"); - Element selfLinkElement2 = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (selfLinkElement2 != null) - { - String selfLinkInstance2; - selfLinkInstance2 = selfLinkElement2.getTextContent(); - serviceResourceInstance.setSelfLink(selfLinkInstance2); - } - - NodeList elements17 = dimensionSettingsElement.getElementsByTagName("ParentLink"); - Element parentLinkElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (parentLinkElement2 != null) - { - String parentLinkInstance2; - parentLinkInstance2 = parentLinkElement2.getTextContent(); - serviceResourceInstance.setParentLink(parentLinkInstance2); - } - - NodeList elements18 = dimensionSettingsElement.getElementsByTagName("Id"); - Element idElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (idElement2 != null) - { - String idInstance2; - idInstance2 = idElement2.getTextContent(); - serviceResourceInstance.setId(idInstance2); - } - - NodeList elements19 = dimensionSettingsElement.getElementsByTagName("Description"); - Element descriptionElement2 = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (descriptionElement2 != null) - { - String descriptionInstance2; - descriptionInstance2 = descriptionElement2.getTextContent(); - serviceResourceInstance.setDescription(descriptionInstance2); - } - - NodeList elements20 = dimensionSettingsElement.getElementsByTagName("Ordinal"); - Element ordinalElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (ordinalElement != null) - { - byte ordinalInstance; - ordinalInstance = Byte.valueOf(ordinalElement.getTextContent()); - serviceResourceInstance.setOrdinal(ordinalInstance); - } - - NodeList elements21 = dimensionSettingsElement.getElementsByTagName("IsDefault"); - Element isDefaultElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (isDefaultElement2 != null) - { - boolean isDefaultInstance2; - isDefaultInstance2 = Boolean.parseBoolean(isDefaultElement2.getTextContent()); - serviceResourceInstance.setIsDefault(isDefaultInstance2); - } + CloudTracing.error(invocationId, ex); } + throw ex; } - } - - 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); - } - return result; - } - - /** - * Returns information about all Service Objectives on a database server. - * - * @param serverName The name of the database server to be queried. - * @return Response containing the list of service objective for a given - * server. - */ - @Override - public Future listAsync(final String serverName) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public ServiceObjectiveListResponse call() throws Exception - { - return list(serverName); - } - }); - } - - /** - * Returns information about all Service Objectives on a database server. - * - * @param serverName The name of the database server to be queried. - * @return Response containing the list of service objective for a given - * server. - */ - @Override - public ServiceObjectiveListResponse list(String serverName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException - { - // Validate - if (serverName == null) - { - throw new NullPointerException("serverName"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serverName", serverName); - CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + this.getClient().getCredentials().getSubscriptionId() + "/services/sqlservers/servers/" + serverName + "/serviceobjectives"; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2012-03-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); - if (shouldTrace) - { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - ServiceObjectiveListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ServiceObjectiveListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); - Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serviceResourcesSequenceElement != null) - { - for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + + // Create Result + ServiceObjectiveGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServiceObjectiveGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResource"); + Element serviceResourceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourceElement != null) { - org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); - ServiceObjectiveListResponse.ServiceObjective serviceResourceInstance = new ServiceObjectiveListResponse.ServiceObjective(); - result.getServiceObjectives().add(serviceResourceInstance); - - NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + NodeList elements2 = serviceResourceElement.getElementsByTagName("Name"); Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; if (nameElement != null) { String nameInstance; nameInstance = nameElement.getTextContent(); - serviceResourceInstance.setName(nameInstance); + result.setName(nameInstance); } - NodeList elements3 = serviceResourcesElement.getElementsByTagName("Type"); + NodeList elements3 = serviceResourceElement.getElementsByTagName("Type"); Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; if (typeElement != null) { String typeInstance; typeInstance = typeElement.getTextContent(); - serviceResourceInstance.setType(typeInstance); + result.setType(typeInstance); } - NodeList elements4 = serviceResourcesElement.getElementsByTagName("State"); + NodeList elements4 = serviceResourceElement.getElementsByTagName("State"); Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; if (stateElement != null) { String stateInstance; stateInstance = stateElement.getTextContent(); - serviceResourceInstance.setState(stateInstance); + result.setState(stateInstance); } - NodeList elements5 = serviceResourcesElement.getElementsByTagName("SelfLink"); + NodeList elements5 = serviceResourceElement.getElementsByTagName("SelfLink"); Element selfLinkElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; if (selfLinkElement != null) { String selfLinkInstance; selfLinkInstance = selfLinkElement.getTextContent(); - serviceResourceInstance.setSelfLink(selfLinkInstance); + result.setSelfLink(selfLinkInstance); } - NodeList elements6 = serviceResourcesElement.getElementsByTagName("ParentLink"); + NodeList elements6 = serviceResourceElement.getElementsByTagName("ParentLink"); Element parentLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; if (parentLinkElement != null) { String parentLinkInstance; parentLinkInstance = parentLinkElement.getTextContent(); - serviceResourceInstance.setParentLink(parentLinkInstance); + result.setParentLink(parentLinkInstance); } - NodeList elements7 = serviceResourcesElement.getElementsByTagName("Id"); + NodeList elements7 = serviceResourceElement.getElementsByTagName("Id"); Element idElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; if (idElement != null) { String idInstance; idInstance = idElement.getTextContent(); - serviceResourceInstance.setId(idInstance); + result.setId(idInstance); } - NodeList elements8 = serviceResourcesElement.getElementsByTagName("IsDefault"); + NodeList elements8 = serviceResourceElement.getElementsByTagName("IsDefault"); Element isDefaultElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; if (isDefaultElement != null) { boolean isDefaultInstance; isDefaultInstance = Boolean.parseBoolean(isDefaultElement.getTextContent()); - serviceResourceInstance.setIsDefault(isDefaultInstance); + result.setIsDefault(isDefaultInstance); } - NodeList elements9 = serviceResourcesElement.getElementsByTagName("IsSystem"); + NodeList elements9 = serviceResourceElement.getElementsByTagName("IsSystem"); Element isSystemElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; if (isSystemElement != null) { boolean isSystemInstance; isSystemInstance = Boolean.parseBoolean(isSystemElement.getTextContent()); - serviceResourceInstance.setIsSystem(isSystemInstance); + result.setIsSystem(isSystemInstance); } - NodeList elements10 = serviceResourcesElement.getElementsByTagName("Description"); + NodeList elements10 = serviceResourceElement.getElementsByTagName("Description"); Element descriptionElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; if (descriptionElement != null) { String descriptionInstance; descriptionInstance = descriptionElement.getTextContent(); - serviceResourceInstance.setDescription(descriptionInstance); + result.setDescription(descriptionInstance); } - NodeList elements11 = serviceResourcesElement.getElementsByTagName("Enabled"); + NodeList elements11 = serviceResourceElement.getElementsByTagName("Enabled"); Element enabledElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; if (enabledElement != null) { boolean enabledInstance; enabledInstance = Boolean.parseBoolean(enabledElement.getTextContent()); - serviceResourceInstance.setEnabled(enabledInstance); + result.setEnabled(enabledInstance); } - NodeList elements12 = serviceResourcesElement.getElementsByTagName("DimensionSettings"); + NodeList elements12 = serviceResourceElement.getElementsByTagName("DimensionSettings"); Element dimensionSettingsSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; if (dimensionSettingsSequenceElement != null) { - for (int i2 = 0; i2 < dimensionSettingsSequenceElement.getElementsByTagName("ServiceResource").getLength(); i2 = i2 + 1) + for (int i1 = 0; i1 < dimensionSettingsSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) { - org.w3c.dom.Element dimensionSettingsElement = ((org.w3c.dom.Element) dimensionSettingsSequenceElement.getElementsByTagName("ServiceResource").item(i2)); - ServiceObjectiveListResponse.ServiceObjective.DimensionSettingResponse serviceResourceInstance2 = new ServiceObjectiveListResponse.ServiceObjective.DimensionSettingResponse(); - serviceResourceInstance.getDimensionSettings().add(serviceResourceInstance2); + org.w3c.dom.Element dimensionSettingsElement = ((org.w3c.dom.Element) dimensionSettingsSequenceElement.getElementsByTagName("ServiceResource").item(i1)); + ServiceObjectiveGetResponse.DimensionSettingResponse serviceResourceInstance = new ServiceObjectiveGetResponse.DimensionSettingResponse(); + result.getDimensionSettings().add(serviceResourceInstance); NodeList elements13 = dimensionSettingsElement.getElementsByTagName("Name"); Element nameElement2 = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; @@ -568,7 +288,7 @@ public ServiceObjectiveListResponse list(String serverName) throws IOException, { String nameInstance2; nameInstance2 = nameElement2.getTextContent(); - serviceResourceInstance2.setName(nameInstance2); + serviceResourceInstance.setName(nameInstance2); } NodeList elements14 = dimensionSettingsElement.getElementsByTagName("Type"); @@ -577,7 +297,7 @@ public ServiceObjectiveListResponse list(String serverName) throws IOException, { String typeInstance2; typeInstance2 = typeElement2.getTextContent(); - serviceResourceInstance2.setType(typeInstance2); + serviceResourceInstance.setType(typeInstance2); } NodeList elements15 = dimensionSettingsElement.getElementsByTagName("State"); @@ -586,7 +306,7 @@ public ServiceObjectiveListResponse list(String serverName) throws IOException, { String stateInstance2; stateInstance2 = stateElement2.getTextContent(); - serviceResourceInstance2.setState(stateInstance2); + serviceResourceInstance.setState(stateInstance2); } NodeList elements16 = dimensionSettingsElement.getElementsByTagName("SelfLink"); @@ -595,7 +315,7 @@ public ServiceObjectiveListResponse list(String serverName) throws IOException, { String selfLinkInstance2; selfLinkInstance2 = selfLinkElement2.getTextContent(); - serviceResourceInstance2.setSelfLink(selfLinkInstance2); + serviceResourceInstance.setSelfLink(selfLinkInstance2); } NodeList elements17 = dimensionSettingsElement.getElementsByTagName("ParentLink"); @@ -604,7 +324,7 @@ public ServiceObjectiveListResponse list(String serverName) throws IOException, { String parentLinkInstance2; parentLinkInstance2 = parentLinkElement2.getTextContent(); - serviceResourceInstance2.setParentLink(parentLinkInstance2); + serviceResourceInstance.setParentLink(parentLinkInstance2); } NodeList elements18 = dimensionSettingsElement.getElementsByTagName("Id"); @@ -613,7 +333,7 @@ public ServiceObjectiveListResponse list(String serverName) throws IOException, { String idInstance2; idInstance2 = idElement2.getTextContent(); - serviceResourceInstance2.setId(idInstance2); + serviceResourceInstance.setId(idInstance2); } NodeList elements19 = dimensionSettingsElement.getElementsByTagName("Description"); @@ -622,7 +342,7 @@ public ServiceObjectiveListResponse list(String serverName) throws IOException, { String descriptionInstance2; descriptionInstance2 = descriptionElement2.getTextContent(); - serviceResourceInstance2.setDescription(descriptionInstance2); + serviceResourceInstance.setDescription(descriptionInstance2); } NodeList elements20 = dimensionSettingsElement.getElementsByTagName("Ordinal"); @@ -631,7 +351,7 @@ public ServiceObjectiveListResponse list(String serverName) throws IOException, { byte ordinalInstance; ordinalInstance = Byte.valueOf(ordinalElement.getTextContent()); - serviceResourceInstance2.setOrdinal(ordinalInstance); + serviceResourceInstance.setOrdinal(ordinalInstance); } NodeList elements21 = dimensionSettingsElement.getElementsByTagName("IsDefault"); @@ -640,23 +360,344 @@ public ServiceObjectiveListResponse list(String serverName) throws IOException, { boolean isDefaultInstance2; isDefaultInstance2 = Boolean.parseBoolean(isDefaultElement2.getTextContent()); - serviceResourceInstance2.setIsDefault(isDefaultInstance2); + serviceResourceInstance.setIsDefault(isDefaultInstance2); } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * Returns information about all Service Objectives on a database server. + * + * @param serverName The name of the database server to be queried. + * @return Response containing the list of service objective for a given + * server. + */ + @Override + public Future listAsync(final String serverName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public ServiceObjectiveListResponse call() throws Exception + { + return list(serverName); + } + }); + } + + /** + * Returns information about all Service Objectives on a database server. + * + * @param serverName The name of the database server to be queried. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return Response containing the list of service objective for a given + * server. + */ + @Override + public ServiceObjectiveListResponse list(String serverName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + { + // Validate + if (serverName == null) { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + throw new NullPointerException("serverName"); } + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; if (shouldTrace) { - CloudTracing.exit(invocationId, result); + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serverName", serverName); + CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + this.getClient().getCredentials().getSubscriptionId() + "/services/sqlservers/servers/" + serverName + "/serviceobjectives"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2012-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + ServiceObjectiveListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServiceObjectiveListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServiceResources"); + Element serviceResourcesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serviceResourcesSequenceElement != null) + { + for (int i1 = 0; i1 < serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) serviceResourcesSequenceElement.getElementsByTagName("ServiceResource").item(i1)); + ServiceObjectiveListResponse.ServiceObjective serviceResourceInstance = new ServiceObjectiveListResponse.ServiceObjective(); + result.getServiceObjectives().add(serviceResourceInstance); + + NodeList elements2 = serviceResourcesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + serviceResourceInstance.setName(nameInstance); + } + + NodeList elements3 = serviceResourcesElement.getElementsByTagName("Type"); + Element typeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + serviceResourceInstance.setType(typeInstance); + } + + NodeList elements4 = serviceResourcesElement.getElementsByTagName("State"); + Element stateElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + serviceResourceInstance.setState(stateInstance); + } + + NodeList elements5 = serviceResourcesElement.getElementsByTagName("SelfLink"); + Element selfLinkElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (selfLinkElement != null) + { + String selfLinkInstance; + selfLinkInstance = selfLinkElement.getTextContent(); + serviceResourceInstance.setSelfLink(selfLinkInstance); + } + + NodeList elements6 = serviceResourcesElement.getElementsByTagName("ParentLink"); + Element parentLinkElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (parentLinkElement != null) + { + String parentLinkInstance; + parentLinkInstance = parentLinkElement.getTextContent(); + serviceResourceInstance.setParentLink(parentLinkInstance); + } + + NodeList elements7 = serviceResourcesElement.getElementsByTagName("Id"); + Element idElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + serviceResourceInstance.setId(idInstance); + } + + NodeList elements8 = serviceResourcesElement.getElementsByTagName("IsDefault"); + Element isDefaultElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (isDefaultElement != null) + { + boolean isDefaultInstance; + isDefaultInstance = Boolean.parseBoolean(isDefaultElement.getTextContent()); + serviceResourceInstance.setIsDefault(isDefaultInstance); + } + + NodeList elements9 = serviceResourcesElement.getElementsByTagName("IsSystem"); + Element isSystemElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (isSystemElement != null) + { + boolean isSystemInstance; + isSystemInstance = Boolean.parseBoolean(isSystemElement.getTextContent()); + serviceResourceInstance.setIsSystem(isSystemInstance); + } + + NodeList elements10 = serviceResourcesElement.getElementsByTagName("Description"); + Element descriptionElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (descriptionElement != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + serviceResourceInstance.setDescription(descriptionInstance); + } + + NodeList elements11 = serviceResourcesElement.getElementsByTagName("Enabled"); + Element enabledElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (enabledElement != null) + { + boolean enabledInstance; + enabledInstance = Boolean.parseBoolean(enabledElement.getTextContent()); + serviceResourceInstance.setEnabled(enabledInstance); + } + + NodeList elements12 = serviceResourcesElement.getElementsByTagName("DimensionSettings"); + Element dimensionSettingsSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (dimensionSettingsSequenceElement != null) + { + for (int i2 = 0; i2 < dimensionSettingsSequenceElement.getElementsByTagName("ServiceResource").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element dimensionSettingsElement = ((org.w3c.dom.Element) dimensionSettingsSequenceElement.getElementsByTagName("ServiceResource").item(i2)); + ServiceObjectiveListResponse.ServiceObjective.DimensionSettingResponse serviceResourceInstance2 = new ServiceObjectiveListResponse.ServiceObjective.DimensionSettingResponse(); + serviceResourceInstance.getDimensionSettings().add(serviceResourceInstance2); + + NodeList elements13 = dimensionSettingsElement.getElementsByTagName("Name"); + Element nameElement2 = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + serviceResourceInstance2.setName(nameInstance2); + } + + NodeList elements14 = dimensionSettingsElement.getElementsByTagName("Type"); + Element typeElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (typeElement2 != null) + { + String typeInstance2; + typeInstance2 = typeElement2.getTextContent(); + serviceResourceInstance2.setType(typeInstance2); + } + + NodeList elements15 = dimensionSettingsElement.getElementsByTagName("State"); + Element stateElement2 = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (stateElement2 != null) + { + String stateInstance2; + stateInstance2 = stateElement2.getTextContent(); + serviceResourceInstance2.setState(stateInstance2); + } + + NodeList elements16 = dimensionSettingsElement.getElementsByTagName("SelfLink"); + Element selfLinkElement2 = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (selfLinkElement2 != null) + { + String selfLinkInstance2; + selfLinkInstance2 = selfLinkElement2.getTextContent(); + serviceResourceInstance2.setSelfLink(selfLinkInstance2); + } + + NodeList elements17 = dimensionSettingsElement.getElementsByTagName("ParentLink"); + Element parentLinkElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (parentLinkElement2 != null) + { + String parentLinkInstance2; + parentLinkInstance2 = parentLinkElement2.getTextContent(); + serviceResourceInstance2.setParentLink(parentLinkInstance2); + } + + NodeList elements18 = dimensionSettingsElement.getElementsByTagName("Id"); + Element idElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (idElement2 != null) + { + String idInstance2; + idInstance2 = idElement2.getTextContent(); + serviceResourceInstance2.setId(idInstance2); + } + + NodeList elements19 = dimensionSettingsElement.getElementsByTagName("Description"); + Element descriptionElement2 = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (descriptionElement2 != null) + { + String descriptionInstance2; + descriptionInstance2 = descriptionElement2.getTextContent(); + serviceResourceInstance2.setDescription(descriptionInstance2); + } + + NodeList elements20 = dimensionSettingsElement.getElementsByTagName("Ordinal"); + Element ordinalElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (ordinalElement != null) + { + byte ordinalInstance; + ordinalInstance = Byte.valueOf(ordinalElement.getTextContent()); + serviceResourceInstance2.setOrdinal(ordinalInstance); + } + + NodeList elements21 = dimensionSettingsElement.getElementsByTagName("IsDefault"); + Element isDefaultElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (isDefaultElement2 != null) + { + boolean isDefaultInstance2; + isDefaultInstance2 = Boolean.parseBoolean(isDefaultElement2.getTextContent()); + serviceResourceInstance2.setIsDefault(isDefaultInstance2); + } + } + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/SqlManagementClient.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/SqlManagementClient.java index 302c580b3cf39..e140887b288fd 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/SqlManagementClient.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/SqlManagementClient.java @@ -37,6 +37,7 @@ public interface SqlManagementClient extends FilterableService /** * The URI used as the base for all SQL requests. + * @return The BaseUri value. */ public URI getBaseUri() { @@ -59,6 +60,7 @@ public URI getBaseUri() * Azure Service ManagementAPI use mutual authentication of management * certificates over SSL to ensure that a request made to the service is * secure. No anonymous requests are allowed. + * @return The Credentials value. */ public SubscriptionCloudCredentials getCredentials() { @@ -70,6 +72,7 @@ public SubscriptionCloudCredentials getCredentials() /** * Includes operations for importing and exporting SQL Databases into and * out of Windows Azure blob storage. + * @return The DacOperations value. */ public DacOperations getDacOperations() { @@ -81,6 +84,7 @@ public DacOperations getDacOperations() /** * The SQL Database Management API includes operations for managing SQL * Database Copies for a subscription. + * @return The DatabaseCopiesOperations value. */ public DatabaseCopyOperations getDatabaseCopiesOperations() { @@ -92,6 +96,7 @@ public DatabaseCopyOperations getDatabaseCopiesOperations() /** * The SQL Database Management API includes operations for get/stop SQL * Databases' operations for a subscription. + * @return The DatabaseOperationsOperations value. */ public DatabaseOperationOperations getDatabaseOperationsOperations() { @@ -103,6 +108,7 @@ public DatabaseOperationOperations getDatabaseOperationsOperations() /** * The SQL Database Management API includes operations for managing SQL * Databases for a subscription. + * @return The DatabasesOperations value. */ public DatabaseOperations getDatabasesOperations() { @@ -120,6 +126,7 @@ public DatabaseOperations getDatabasesOperations() * databases. (see * http://msdn.microsoft.com/en-us/library/windowsazure/gg715276.aspx for * more information) + * @return The FirewallRulesOperations value. */ public FirewallRuleOperations getFirewallRulesOperations() { @@ -133,6 +140,7 @@ public FirewallRuleOperations getFirewallRulesOperations() * Database servers for a subscription. (see * http://msdn.microsoft.com/en-us/library/windowsazure/gg715271.aspx for * more information) + * @return The ServersOperations value. */ public ServerOperations getServersOperations() { @@ -144,6 +152,7 @@ public ServerOperations getServersOperations() /** * The SQL Database Management API includes operations for getting Service * Objective for a subscription. + * @return The ServiceObjectivesOperations value. */ public ServiceObjectiveOperations getServiceObjectivesOperations() { @@ -208,6 +217,8 @@ public SqlManagementClientImpl(HttpClientBuilder httpBuilder, ExecutorService ex * The Windows Azure Service ManagementAPI use mutual authentication of * management certificates over SSL to ensure that a request made to the * service is secure. No anonymous requests are allowed. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. */ @Inject public SqlManagementClientImpl(HttpClientBuilder httpBuilder, ExecutorService executorService, @Named(ManagementConfiguration.SUBSCRIPTION_CLOUD_CREDENTIALS) SubscriptionCloudCredentials credentials) throws java.net.URISyntaxException diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacExportParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacExportParameters.java index 924de47896898..0bda24d28288d 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacExportParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacExportParameters.java @@ -34,6 +34,7 @@ public class DacExportParameters /** * Gets or sets credentials for getting the DAC. + * @return The BlobCredentials value. */ public DacExportParameters.BlobCredentialsParameter getBlobCredentials() { @@ -42,16 +43,18 @@ public DacExportParameters.BlobCredentialsParameter getBlobCredentials() /** * Gets or sets credentials for getting the DAC. + * @param blobCredentialsValue The BlobCredentials value. */ - public void setBlobCredentials(DacExportParameters.BlobCredentialsParameter blobCredentials) + public void setBlobCredentials(final DacExportParameters.BlobCredentialsParameter blobCredentialsValue) { - this.blobCredentials = blobCredentials; + this.blobCredentials = blobCredentialsValue; } private DacExportParameters.ConnectionInfoParameter connectionInfo; /** * Gets or sets connection information for the SQL Server Database. + * @return The ConnectionInfo value. */ public DacExportParameters.ConnectionInfoParameter getConnectionInfo() { @@ -60,10 +63,11 @@ public DacExportParameters.ConnectionInfoParameter getConnectionInfo() /** * Gets or sets connection information for the SQL Server Database. + * @param connectionInfoValue The ConnectionInfo value. */ - public void setConnectionInfo(DacExportParameters.ConnectionInfoParameter connectionInfo) + public void setConnectionInfo(final DacExportParameters.ConnectionInfoParameter connectionInfoValue) { - this.connectionInfo = connectionInfo; + this.connectionInfo = connectionInfoValue; } /** @@ -75,6 +79,7 @@ public static class BlobCredentialsParameter /** * Gets or sets the key for the Windows Azure Storage account. + * @return The StorageAccessKey value. */ public String getStorageAccessKey() { @@ -83,10 +88,11 @@ public String getStorageAccessKey() /** * Gets or sets the key for the Windows Azure Storage account. + * @param storageAccessKeyValue The StorageAccessKey value. */ - public void setStorageAccessKey(String storageAccessKey) + public void setStorageAccessKey(final String storageAccessKeyValue) { - this.storageAccessKey = storageAccessKey; + this.storageAccessKey = storageAccessKeyValue; } private URI uri; @@ -94,6 +100,7 @@ public void setStorageAccessKey(String storageAccessKey) /** * Gets or sets the URI of the DAC file stored in Windows Azure Blob * Storage. + * @return The Uri value. */ public URI getUri() { @@ -103,10 +110,11 @@ public URI getUri() /** * Gets or sets the URI of the DAC file stored in Windows Azure Blob * Storage. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } } @@ -119,6 +127,7 @@ public static class ConnectionInfoParameter /** * Gets or sets the name of the database. + * @return The DatabaseName value. */ public String getDatabaseName() { @@ -127,16 +136,18 @@ public String getDatabaseName() /** * Gets or sets the name of the database. + * @param databaseNameValue The DatabaseName value. */ - public void setDatabaseName(String databaseName) + public void setDatabaseName(final String databaseNameValue) { - this.databaseName = databaseName; + this.databaseName = databaseNameValue; } private String password; /** * Gets or sets the password for the database user. + * @return The Password value. */ public String getPassword() { @@ -145,16 +156,18 @@ public String getPassword() /** * Gets or sets the password for the database user. + * @param passwordValue The Password value. */ - public void setPassword(String password) + public void setPassword(final String passwordValue) { - this.password = password; + this.password = passwordValue; } private String serverName; /** * Gets or sets the SQL server name. + * @return The ServerName value. */ public String getServerName() { @@ -163,16 +176,18 @@ public String getServerName() /** * Gets or sets the SQL server name. + * @param serverNameValue The ServerName value. */ - public void setServerName(String serverName) + public void setServerName(final String serverNameValue) { - this.serverName = serverName; + this.serverName = serverNameValue; } private String userName; /** * Gets or sets the username of the database user. + * @return The UserName value. */ public String getUserName() { @@ -181,10 +196,11 @@ public String getUserName() /** * Gets or sets the username of the database user. + * @param userNameValue The UserName value. */ - public void setUserName(String userName) + public void setUserName(final String userNameValue) { - this.userName = userName; + this.userName = userNameValue; } } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacGetStatusResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacGetStatusResponse.java index b6078858f1b7e..57df7ff6b79d9 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacGetStatusResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacGetStatusResponse.java @@ -38,6 +38,7 @@ public class DacGetStatusResponse extends OperationResponse implements Iterable< /** * Gets or sets the list of statuses relevant to this import/export request. + * @return The StatusInfoList value. */ public ArrayList getStatusInfoList() { @@ -46,10 +47,11 @@ public ArrayList getStatusInfoList() /** * Gets or sets the list of statuses relevant to this import/export request. + * @param statusInfoListValue The StatusInfoList value. */ - public void setStatusInfoList(ArrayList statusInfoList) + public void setStatusInfoList(final ArrayList statusInfoListValue) { - this.statusInfoList = statusInfoList; + this.statusInfoList = statusInfoListValue; } /** @@ -81,6 +83,7 @@ public static class StatusInfo /** * Gets or sets the URI of the DAC file stored in Windows Azure Blob * Storage to be imported. + * @return The BlobUri value. */ public URI getBlobUri() { @@ -90,10 +93,11 @@ public URI getBlobUri() /** * Gets or sets the URI of the DAC file stored in Windows Azure Blob * Storage to be imported. + * @param blobUriValue The BlobUri value. */ - public void setBlobUri(URI blobUri) + public void setBlobUri(final URI blobUriValue) { - this.blobUri = blobUri; + this.blobUri = blobUriValue; } private String databaseName; @@ -101,6 +105,7 @@ public void setBlobUri(URI blobUri) /** * Gets or sets the name of the database into which this DAC will be * imported. + * @return The DatabaseName value. */ public String getDatabaseName() { @@ -110,10 +115,11 @@ public String getDatabaseName() /** * Gets or sets the name of the database into which this DAC will be * imported. + * @param databaseNameValue The DatabaseName value. */ - public void setDatabaseName(String databaseName) + public void setDatabaseName(final String databaseNameValue) { - this.databaseName = databaseName; + this.databaseName = databaseNameValue; } private String errorMessage; @@ -121,6 +127,7 @@ public void setDatabaseName(String databaseName) /** * Gets or sets the error message of the request if the request failed * in some way. + * @return The ErrorMessage value. */ public String getErrorMessage() { @@ -130,16 +137,18 @@ public String getErrorMessage() /** * Gets or sets the error message of the request if the request failed * in some way. + * @param errorMessageValue The ErrorMessage value. */ - public void setErrorMessage(String errorMessage) + public void setErrorMessage(final String errorMessageValue) { - this.errorMessage = errorMessage; + this.errorMessage = errorMessageValue; } private Calendar lastModifiedTime; /** * Gets or sets the last time the status changed. + * @return The LastModifiedTime value. */ public Calendar getLastModifiedTime() { @@ -148,10 +157,11 @@ public Calendar getLastModifiedTime() /** * Gets or sets the last time the status changed. + * @param lastModifiedTimeValue The LastModifiedTime value. */ - public void setLastModifiedTime(Calendar lastModifiedTime) + public void setLastModifiedTime(final Calendar lastModifiedTimeValue) { - this.lastModifiedTime = lastModifiedTime; + this.lastModifiedTime = lastModifiedTimeValue; } private Calendar queuedTime; @@ -159,6 +169,7 @@ public void setLastModifiedTime(Calendar lastModifiedTime) /** * Gets or sets the time at which the import/export request was queued * and the process initiated. + * @return The QueuedTime value. */ public Calendar getQueuedTime() { @@ -168,10 +179,11 @@ public Calendar getQueuedTime() /** * Gets or sets the time at which the import/export request was queued * and the process initiated. + * @param queuedTimeValue The QueuedTime value. */ - public void setQueuedTime(Calendar queuedTime) + public void setQueuedTime(final Calendar queuedTimeValue) { - this.queuedTime = queuedTime; + this.queuedTime = queuedTimeValue; } private String requestId; @@ -179,6 +191,7 @@ public void setQueuedTime(Calendar queuedTime) /** * Gets or sets the request ID of this import/export request, so that it * can be tracked with future calls to GetStatus. + * @return The RequestId value. */ public String getRequestId() { @@ -188,16 +201,18 @@ public String getRequestId() /** * Gets or sets the request ID of this import/export request, so that it * can be tracked with future calls to GetStatus. + * @param requestIdValue The RequestId value. */ - public void setRequestId(String requestId) + public void setRequestId(final String requestIdValue) { - this.requestId = requestId; + this.requestId = requestIdValue; } private String requestType; /** * Gets or sets the type (Import/Export) of this request. + * @return The RequestType value. */ public String getRequestType() { @@ -206,10 +221,11 @@ public String getRequestType() /** * Gets or sets the type (Import/Export) of this request. + * @param requestTypeValue The RequestType value. */ - public void setRequestType(String requestType) + public void setRequestType(final String requestTypeValue) { - this.requestType = requestType; + this.requestType = requestTypeValue; } private String serverName; @@ -217,6 +233,7 @@ public void setRequestType(String requestType) /** * Gets or sets the name of the SQL database server into which this DAC * will be imported or from which it will be exported. + * @return The ServerName value. */ public String getServerName() { @@ -226,16 +243,18 @@ public String getServerName() /** * Gets or sets the name of the SQL database server into which this DAC * will be imported or from which it will be exported. + * @param serverNameValue The ServerName value. */ - public void setServerName(String serverName) + public void setServerName(final String serverNameValue) { - this.serverName = serverName; + this.serverName = serverNameValue; } private String status; /** * Gets or sets the status of the import/export request. + * @return The Status value. */ public String getStatus() { @@ -244,10 +263,11 @@ public String getStatus() /** * Gets or sets the status of the import/export request. + * @param statusValue The Status value. */ - public void setStatus(String status) + public void setStatus(final String statusValue) { - this.status = status; + this.status = statusValue; } } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacImportExportResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacImportExportResponse.java index 93e629ea43144..8da6b82fc88cc 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacImportExportResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacImportExportResponse.java @@ -34,6 +34,7 @@ public class DacImportExportResponse extends OperationResponse /** * Gets or sets the operation's identifier. + * @return The Guid value. */ public String getGuid() { @@ -42,9 +43,10 @@ public String getGuid() /** * Gets or sets the operation's identifier. + * @param guidValue The Guid value. */ - public void setGuid(String guid) + public void setGuid(final String guidValue) { - this.guid = guid; + this.guid = guidValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacImportParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacImportParameters.java index d2b861fd26fdb..9f2c61c7e8ff1 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacImportParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DacImportParameters.java @@ -34,6 +34,7 @@ public class DacImportParameters /** * Gets or sets credentials for getting the DAC. + * @return The BlobCredentials value. */ public DacImportParameters.BlobCredentialsParameter getBlobCredentials() { @@ -42,16 +43,18 @@ public DacImportParameters.BlobCredentialsParameter getBlobCredentials() /** * Gets or sets credentials for getting the DAC. + * @param blobCredentialsValue The BlobCredentials value. */ - public void setBlobCredentials(DacImportParameters.BlobCredentialsParameter blobCredentials) + public void setBlobCredentials(final DacImportParameters.BlobCredentialsParameter blobCredentialsValue) { - this.blobCredentials = blobCredentials; + this.blobCredentials = blobCredentialsValue; } private DacImportParameters.ConnectionInfoParameter connectionInfo; /** * Gets or sets connection information for the SQL Server Database. + * @return The ConnectionInfo value. */ public DacImportParameters.ConnectionInfoParameter getConnectionInfo() { @@ -60,16 +63,18 @@ public DacImportParameters.ConnectionInfoParameter getConnectionInfo() /** * Gets or sets connection information for the SQL Server Database. + * @param connectionInfoValue The ConnectionInfo value. */ - public void setConnectionInfo(DacImportParameters.ConnectionInfoParameter connectionInfo) + public void setConnectionInfo(final DacImportParameters.ConnectionInfoParameter connectionInfoValue) { - this.connectionInfo = connectionInfo; + this.connectionInfo = connectionInfoValue; } private int databaseSizeInGB; /** * Gets or sets the size of this database. + * @return The DatabaseSizeInGB value. */ public int getDatabaseSizeInGB() { @@ -78,10 +83,11 @@ public int getDatabaseSizeInGB() /** * Gets or sets the size of this database. + * @param databaseSizeInGBValue The DatabaseSizeInGB value. */ - public void setDatabaseSizeInGB(int databaseSizeInGB) + public void setDatabaseSizeInGB(final int databaseSizeInGBValue) { - this.databaseSizeInGB = databaseSizeInGB; + this.databaseSizeInGB = databaseSizeInGBValue; } /** @@ -93,6 +99,7 @@ public static class BlobCredentialsParameter /** * Gets or sets the key for the Windows Azure Storage account. + * @return The StorageAccessKey value. */ public String getStorageAccessKey() { @@ -101,10 +108,11 @@ public String getStorageAccessKey() /** * Gets or sets the key for the Windows Azure Storage account. + * @param storageAccessKeyValue The StorageAccessKey value. */ - public void setStorageAccessKey(String storageAccessKey) + public void setStorageAccessKey(final String storageAccessKeyValue) { - this.storageAccessKey = storageAccessKey; + this.storageAccessKey = storageAccessKeyValue; } private URI uri; @@ -112,6 +120,7 @@ public void setStorageAccessKey(String storageAccessKey) /** * Gets or sets the URI of the DAC file stored in Windows Azure Blob * Storage. + * @return The Uri value. */ public URI getUri() { @@ -121,10 +130,11 @@ public URI getUri() /** * Gets or sets the URI of the DAC file stored in Windows Azure Blob * Storage. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } } @@ -137,6 +147,7 @@ public static class ConnectionInfoParameter /** * Gets or sets the name of the database. + * @return The DatabaseName value. */ public String getDatabaseName() { @@ -145,16 +156,18 @@ public String getDatabaseName() /** * Gets or sets the name of the database. + * @param databaseNameValue The DatabaseName value. */ - public void setDatabaseName(String databaseName) + public void setDatabaseName(final String databaseNameValue) { - this.databaseName = databaseName; + this.databaseName = databaseNameValue; } private String password; /** * Gets or sets the password for the database user. + * @return The Password value. */ public String getPassword() { @@ -163,16 +176,18 @@ public String getPassword() /** * Gets or sets the password for the database user. + * @param passwordValue The Password value. */ - public void setPassword(String password) + public void setPassword(final String passwordValue) { - this.password = password; + this.password = passwordValue; } private String serverName; /** * Gets or sets the SQL server name. + * @return The ServerName value. */ public String getServerName() { @@ -181,16 +196,18 @@ public String getServerName() /** * Gets or sets the SQL server name. + * @param serverNameValue The ServerName value. */ - public void setServerName(String serverName) + public void setServerName(final String serverNameValue) { - this.serverName = serverName; + this.serverName = serverNameValue; } private String userName; /** * Gets or sets the username of the database user. + * @return The UserName value. */ public String getUserName() { @@ -199,10 +216,11 @@ public String getUserName() /** * Gets or sets the username of the database user. + * @param userNameValue The UserName value. */ - public void setUserName(String userName) + public void setUserName(final String userNameValue) { - this.userName = userName; + this.userName = userNameValue; } } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyCreateParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyCreateParameters.java index 62bbb448f75ab..e2b0f01c27866 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyCreateParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyCreateParameters.java @@ -32,6 +32,7 @@ public class DatabaseCopyCreateParameters /** * Whether the copy should be continuous. + * @return The IsContinuous value. */ public boolean isContinuous() { @@ -40,10 +41,11 @@ public boolean isContinuous() /** * Whether the copy should be continuous. + * @param isContinuousValue The IsContinuous value. */ - public void setIsContinuous(boolean isContinuous) + public void setIsContinuous(final boolean isContinuousValue) { - this.isContinuous = isContinuous; + this.isContinuous = isContinuousValue; } private boolean isForcedTerminate; @@ -51,6 +53,7 @@ public void setIsContinuous(boolean isContinuous) /** * Whether a Delete Database Operation will cause a forced or friendly * termination. + * @return The IsForcedTerminate value. */ public boolean isForcedTerminate() { @@ -60,16 +63,18 @@ public boolean isForcedTerminate() /** * Whether a Delete Database Operation will cause a forced or friendly * termination. + * @param isForcedTerminateValue The IsForcedTerminate value. */ - public void setIsForcedTerminate(boolean isForcedTerminate) + public void setIsForcedTerminate(final boolean isForcedTerminateValue) { - this.isForcedTerminate = isForcedTerminate; + this.isForcedTerminate = isForcedTerminateValue; } private Integer maxLagInMinutes; /** * The RPO for the continous copy operation. + * @return The MaxLagInMinutes value. */ public Integer getMaxLagInMinutes() { @@ -78,16 +83,18 @@ public Integer getMaxLagInMinutes() /** * The RPO for the continous copy operation. + * @param maxLagInMinutesValue The MaxLagInMinutes value. */ - public void setMaxLagInMinutes(Integer maxLagInMinutes) + public void setMaxLagInMinutes(final Integer maxLagInMinutesValue) { - this.maxLagInMinutes = maxLagInMinutes; + this.maxLagInMinutes = maxLagInMinutesValue; } private String partnerDatabase; /** * The name of the destination database for the copy. + * @return The PartnerDatabase value. */ public String getPartnerDatabase() { @@ -96,16 +103,18 @@ public String getPartnerDatabase() /** * The name of the destination database for the copy. + * @param partnerDatabaseValue The PartnerDatabase value. */ - public void setPartnerDatabase(String partnerDatabase) + public void setPartnerDatabase(final String partnerDatabaseValue) { - this.partnerDatabase = partnerDatabase; + this.partnerDatabase = partnerDatabaseValue; } private String partnerServer; /** * The name of the destination server for the copy. + * @return The PartnerServer value. */ public String getPartnerServer() { @@ -114,9 +123,10 @@ public String getPartnerServer() /** * The name of the destination server for the copy. + * @param partnerServerValue The PartnerServer value. */ - public void setPartnerServer(String partnerServer) + public void setPartnerServer(final String partnerServerValue) { - this.partnerServer = partnerServer; + this.partnerServer = partnerServerValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyListResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyListResponse.java index 2cf345108b2d1..1ae3f872eb9e3 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyListResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyListResponse.java @@ -36,6 +36,7 @@ public class DatabaseCopyListResponse extends OperationResponse implements Itera /** * The matching SQL Server database copies. + * @return The DatabaseCopies value. */ public ArrayList getDatabaseCopies() { @@ -44,10 +45,11 @@ public ArrayList getDatabaseCopies() /** * The matching SQL Server database copies. + * @param databaseCopiesValue The DatabaseCopies value. */ - public void setDatabaseCopies(ArrayList databaseCopies) + public void setDatabaseCopies(final ArrayList databaseCopiesValue) { - this.databaseCopies = databaseCopies; + this.databaseCopies = databaseCopiesValue; } /** diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyResponse.java index 538c75b1ecbe5..e060d86a0f4a8 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyResponse.java @@ -34,6 +34,7 @@ public class DatabaseCopyResponse extends OperationResponse /** * The name of the destination database. + * @return The DestinationDatabaseName value. */ public String getDestinationDatabaseName() { @@ -42,16 +43,18 @@ public String getDestinationDatabaseName() /** * The name of the destination database. + * @param destinationDatabaseNameValue The DestinationDatabaseName value. */ - public void setDestinationDatabaseName(String destinationDatabaseName) + public void setDestinationDatabaseName(final String destinationDatabaseNameValue) { - this.destinationDatabaseName = destinationDatabaseName; + this.destinationDatabaseName = destinationDatabaseNameValue; } private String destinationServerName; /** * The name of the destination server. + * @return The DestinationServerName value. */ public String getDestinationServerName() { @@ -60,16 +63,18 @@ public String getDestinationServerName() /** * The name of the destination server. + * @param destinationServerNameValue The DestinationServerName value. */ - public void setDestinationServerName(String destinationServerName) + public void setDestinationServerName(final String destinationServerNameValue) { - this.destinationServerName = destinationServerName; + this.destinationServerName = destinationServerNameValue; } private boolean isContinuous; /** * Whether the copy is continous. + * @return The IsContinuous value. */ public boolean isContinuous() { @@ -78,16 +83,18 @@ public boolean isContinuous() /** * Whether the copy is continous. + * @param isContinuousValue The IsContinuous value. */ - public void setIsContinuous(boolean isContinuous) + public void setIsContinuous(final boolean isContinuousValue) { - this.isContinuous = isContinuous; + this.isContinuous = isContinuousValue; } private Boolean isForcedTerminate; /** * Whether database copy termination will be forced. + * @return The IsForcedTerminate value. */ public Boolean isForcedTerminate() { @@ -96,16 +103,18 @@ public Boolean isForcedTerminate() /** * Whether database copy termination will be forced. + * @param isForcedTerminateValue The IsForcedTerminate value. */ - public void setIsForcedTerminate(Boolean isForcedTerminate) + public void setIsForcedTerminate(final Boolean isForcedTerminateValue) { - this.isForcedTerminate = isForcedTerminate; + this.isForcedTerminate = isForcedTerminateValue; } private boolean isInterlinkConnected; /** * Whether the database copy is interlink connected. + * @return The IsInterlinkConnected value. */ public boolean isInterlinkConnected() { @@ -114,16 +123,18 @@ public boolean isInterlinkConnected() /** * Whether the database copy is interlink connected. + * @param isInterlinkConnectedValue The IsInterlinkConnected value. */ - public void setIsInterlinkConnected(boolean isInterlinkConnected) + public void setIsInterlinkConnected(final boolean isInterlinkConnectedValue) { - this.isInterlinkConnected = isInterlinkConnected; + this.isInterlinkConnected = isInterlinkConnectedValue; } private boolean isLocalDatabaseReplicationTarget; /** * Whether the local database is a replication target. + * @return The IsLocalDatabaseReplicationTarget value. */ public boolean isLocalDatabaseReplicationTarget() { @@ -132,16 +143,19 @@ public boolean isLocalDatabaseReplicationTarget() /** * Whether the local database is a replication target. + * @param isLocalDatabaseReplicationTargetValue The + * IsLocalDatabaseReplicationTarget value. */ - public void setIsLocalDatabaseReplicationTarget(boolean isLocalDatabaseReplicationTarget) + public void setIsLocalDatabaseReplicationTarget(final boolean isLocalDatabaseReplicationTargetValue) { - this.isLocalDatabaseReplicationTarget = isLocalDatabaseReplicationTarget; + this.isLocalDatabaseReplicationTarget = isLocalDatabaseReplicationTargetValue; } private int localDatabaseId; /** * The ID of the local database. + * @return The LocalDatabaseId value. */ public int getLocalDatabaseId() { @@ -150,16 +164,18 @@ public int getLocalDatabaseId() /** * The ID of the local database. + * @param localDatabaseIdValue The LocalDatabaseId value. */ - public void setLocalDatabaseId(int localDatabaseId) + public void setLocalDatabaseId(final int localDatabaseIdValue) { - this.localDatabaseId = localDatabaseId; + this.localDatabaseId = localDatabaseIdValue; } private Integer maxLagInMinutes; /** * The RPO for the copy. + * @return The MaxLagInMinutes value. */ public Integer getMaxLagInMinutes() { @@ -168,16 +184,18 @@ public Integer getMaxLagInMinutes() /** * The RPO for the copy. + * @param maxLagInMinutesValue The MaxLagInMinutes value. */ - public void setMaxLagInMinutes(Integer maxLagInMinutes) + public void setMaxLagInMinutes(final Integer maxLagInMinutesValue) { - this.maxLagInMinutes = maxLagInMinutes; + this.maxLagInMinutes = maxLagInMinutesValue; } private String name; /** * A unique identifier for the database copy. + * @return The Name value. */ public String getName() { @@ -186,16 +204,18 @@ public String getName() /** * A unique identifier for the database copy. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private Float percentComplete; /** * Progress towards copy completion. + * @return The PercentComplete value. */ public Float getPercentComplete() { @@ -204,16 +224,18 @@ public Float getPercentComplete() /** * Progress towards copy completion. + * @param percentCompleteValue The PercentComplete value. */ - public void setPercentComplete(Float percentComplete) + public void setPercentComplete(final Float percentCompleteValue) { - this.percentComplete = percentComplete; + this.percentComplete = percentCompleteValue; } private byte replicationState; /** * A value indicating the replication state for the database. + * @return The ReplicationState value. */ public byte getReplicationState() { @@ -222,16 +244,18 @@ public byte getReplicationState() /** * A value indicating the replication state for the database. + * @param replicationStateValue The ReplicationState value. */ - public void setReplicationState(byte replicationState) + public void setReplicationState(final byte replicationStateValue) { - this.replicationState = replicationState; + this.replicationState = replicationStateValue; } private String replicationStateDescription; /** * A description of the replication state for the database. + * @return The ReplicationStateDescription value. */ public String getReplicationStateDescription() { @@ -240,16 +264,19 @@ public String getReplicationStateDescription() /** * A description of the replication state for the database. + * @param replicationStateDescriptionValue The ReplicationStateDescription + * value. */ - public void setReplicationStateDescription(String replicationStateDescription) + public void setReplicationStateDescription(final String replicationStateDescriptionValue) { - this.replicationStateDescription = replicationStateDescription; + this.replicationStateDescription = replicationStateDescriptionValue; } private String sourceDatabaseName; /** * The name of the source database. + * @return The SourceDatabaseName value. */ public String getSourceDatabaseName() { @@ -258,16 +285,18 @@ public String getSourceDatabaseName() /** * The name of the source database. + * @param sourceDatabaseNameValue The SourceDatabaseName value. */ - public void setSourceDatabaseName(String sourceDatabaseName) + public void setSourceDatabaseName(final String sourceDatabaseNameValue) { - this.sourceDatabaseName = sourceDatabaseName; + this.sourceDatabaseName = sourceDatabaseNameValue; } private String sourceServerName; /** * The name of the source server. + * @return The SourceServerName value. */ public String getSourceServerName() { @@ -276,16 +305,18 @@ public String getSourceServerName() /** * The name of the source server. + * @param sourceServerNameValue The SourceServerName value. */ - public void setSourceServerName(String sourceServerName) + public void setSourceServerName(final String sourceServerNameValue) { - this.sourceServerName = sourceServerName; + this.sourceServerName = sourceServerNameValue; } private String state; /** * The state of the database copy. + * @return The State value. */ public String getState() { @@ -294,16 +325,18 @@ public String getState() /** * The state of the database copy. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private String textModifyDate; /** * The UTC date when the database copy became transactionally consistent. + * @return The TextModifyDate value. */ public String getTextModifyDate() { @@ -312,16 +345,18 @@ public String getTextModifyDate() /** * The UTC date when the database copy became transactionally consistent. + * @param textModifyDateValue The TextModifyDate value. */ - public void setTextModifyDate(String textModifyDate) + public void setTextModifyDate(final String textModifyDateValue) { - this.textModifyDate = textModifyDate; + this.textModifyDate = textModifyDateValue; } private String textStartDate; /** * The UTC date when the database copy was initiated. + * @return The TextStartDate value. */ public String getTextStartDate() { @@ -330,9 +365,10 @@ public String getTextStartDate() /** * The UTC date when the database copy was initiated. + * @param textStartDateValue The TextStartDate value. */ - public void setTextStartDate(String textStartDate) + public void setTextStartDate(final String textStartDateValue) { - this.textStartDate = textStartDate; + this.textStartDate = textStartDateValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyUpdateParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyUpdateParameters.java index fd596ac20f17f..04f468cf18e18 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyUpdateParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCopyUpdateParameters.java @@ -32,6 +32,7 @@ public class DatabaseCopyUpdateParameters /** * Whether the copy should be continuous. + * @return The IsContinuous value. */ public Boolean isContinuous() { @@ -40,10 +41,11 @@ public Boolean isContinuous() /** * Whether the copy should be continuous. + * @param isContinuousValue The IsContinuous value. */ - public void setIsContinuous(Boolean isContinuous) + public void setIsContinuous(final Boolean isContinuousValue) { - this.isContinuous = isContinuous; + this.isContinuous = isContinuousValue; } private Boolean isForcedTerminate; @@ -51,6 +53,7 @@ public void setIsContinuous(Boolean isContinuous) /** * Whether a Delete Database Operation will cause a forced or friendly * termination. + * @return The IsForcedTerminate value. */ public Boolean isForcedTerminate() { @@ -60,16 +63,18 @@ public Boolean isForcedTerminate() /** * Whether a Delete Database Operation will cause a forced or friendly * termination. + * @param isForcedTerminateValue The IsForcedTerminate value. */ - public void setIsForcedTerminate(Boolean isForcedTerminate) + public void setIsForcedTerminate(final Boolean isForcedTerminateValue) { - this.isForcedTerminate = isForcedTerminate; + this.isForcedTerminate = isForcedTerminateValue; } private Integer maxLagInMinutes; /** * The RPO for the continous copy operation. + * @return The MaxLagInMinutes value. */ public Integer getMaxLagInMinutes() { @@ -78,16 +83,18 @@ public Integer getMaxLagInMinutes() /** * The RPO for the continous copy operation. + * @param maxLagInMinutesValue The MaxLagInMinutes value. */ - public void setMaxLagInMinutes(Integer maxLagInMinutes) + public void setMaxLagInMinutes(final Integer maxLagInMinutesValue) { - this.maxLagInMinutes = maxLagInMinutes; + this.maxLagInMinutes = maxLagInMinutesValue; } private String partnerDatabase; /** * The name of the partner database for the copy. + * @return The PartnerDatabase value. */ public String getPartnerDatabase() { @@ -96,16 +103,18 @@ public String getPartnerDatabase() /** * The name of the partner database for the copy. + * @param partnerDatabaseValue The PartnerDatabase value. */ - public void setPartnerDatabase(String partnerDatabase) + public void setPartnerDatabase(final String partnerDatabaseValue) { - this.partnerDatabase = partnerDatabase; + this.partnerDatabase = partnerDatabaseValue; } private String partnerServer; /** * The name of the partner server for the copy. + * @return The PartnerServer value. */ public String getPartnerServer() { @@ -114,9 +123,10 @@ public String getPartnerServer() /** * The name of the partner server for the copy. + * @param partnerServerValue The PartnerServer value. */ - public void setPartnerServer(String partnerServer) + public void setPartnerServer(final String partnerServerValue) { - this.partnerServer = partnerServer; + this.partnerServer = partnerServerValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCreateParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCreateParameters.java index 0e96c33c557fc..454237ef17c50 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCreateParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCreateParameters.java @@ -32,6 +32,7 @@ public class DatabaseCreateParameters /** * Gets or sets the collation name for the new database. + * @return The CollationName value. */ public String getCollationName() { @@ -40,16 +41,18 @@ public String getCollationName() /** * Gets or sets the collation name for the new database. + * @param collationNameValue The CollationName value. */ - public void setCollationName(String collationName) + public void setCollationName(final String collationNameValue) { - this.collationName = collationName; + this.collationName = collationNameValue; } private String edition; /** * Gets or sets the edition for the new database. + * @return The Edition value. */ public String getEdition() { @@ -58,16 +61,18 @@ public String getEdition() /** * Gets or sets the edition for the new database. + * @param editionValue The Edition value. */ - public void setEdition(String edition) + public void setEdition(final String editionValue) { - this.edition = edition; + this.edition = editionValue; } private long maximumDatabaseSizeInGB; /** * Gets or sets the maximum size of this database, in Gigabytes. + * @return The MaximumDatabaseSizeInGB value. */ public long getMaximumDatabaseSizeInGB() { @@ -76,16 +81,18 @@ public long getMaximumDatabaseSizeInGB() /** * Gets or sets the maximum size of this database, in Gigabytes. + * @param maximumDatabaseSizeInGBValue The MaximumDatabaseSizeInGB value. */ - public void setMaximumDatabaseSizeInGB(long maximumDatabaseSizeInGB) + public void setMaximumDatabaseSizeInGB(final long maximumDatabaseSizeInGBValue) { - this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGB; + this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGBValue; } private String name; /** * Gets or sets the name for the new database. + * @return The Name value. */ public String getName() { @@ -94,16 +101,18 @@ public String getName() /** * Gets or sets the name for the new database. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serviceObjectiveId; /** * Gets or sets the id of this service objective. + * @return The ServiceObjectiveId value. */ public String getServiceObjectiveId() { @@ -112,9 +121,10 @@ public String getServiceObjectiveId() /** * Gets or sets the id of this service objective. + * @param serviceObjectiveIdValue The ServiceObjectiveId value. */ - public void setServiceObjectiveId(String serviceObjectiveId) + public void setServiceObjectiveId(final String serviceObjectiveIdValue) { - this.serviceObjectiveId = serviceObjectiveId; + this.serviceObjectiveId = serviceObjectiveIdValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCreateResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCreateResponse.java index 68762f0333971..b8b703c35b041 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCreateResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseCreateResponse.java @@ -35,6 +35,7 @@ public class DatabaseCreateResponse extends OperationResponse /** * Gets or sets the database resource's collation name. + * @return The CollationName value. */ public String getCollationName() { @@ -43,16 +44,18 @@ public String getCollationName() /** * Gets or sets the database resource's collation name. + * @param collationNameValue The CollationName value. */ - public void setCollationName(String collationName) + public void setCollationName(final String collationNameValue) { - this.collationName = collationName; + this.collationName = collationNameValue; } private Calendar creationDate; /** * Gets or sets the date this database was created. + * @return The CreationDate value. */ public Calendar getCreationDate() { @@ -61,16 +64,18 @@ public Calendar getCreationDate() /** * Gets or sets the date this database was created. + * @param creationDateValue The CreationDate value. */ - public void setCreationDate(Calendar creationDate) + public void setCreationDate(final Calendar creationDateValue) { - this.creationDate = creationDate; + this.creationDate = creationDateValue; } private String edition; /** * Gets or sets the database resource's edition. + * @return The Edition value. */ public String getEdition() { @@ -79,16 +84,18 @@ public String getEdition() /** * Gets or sets the database resource's edition. + * @param editionValue The Edition value. */ - public void setEdition(String edition) + public void setEdition(final String editionValue) { - this.edition = edition; + this.edition = editionValue; } private int id; /** * Gets or sets the id of the database. + * @return The Id value. */ public int getId() { @@ -97,16 +104,18 @@ public int getId() /** * Gets or sets the id of the database. + * @param idValue The Id value. */ - public void setId(int id) + public void setId(final int idValue) { - this.id = id; + this.id = idValue; } private boolean isFederationRoot; /** * Gets or sets a value indicating whether the database is a federation root. + * @return The IsFederationRoot value. */ public boolean isFederationRoot() { @@ -115,16 +124,18 @@ public boolean isFederationRoot() /** * Gets or sets a value indicating whether the database is a federation root. + * @param isFederationRootValue The IsFederationRoot value. */ - public void setIsFederationRoot(boolean isFederationRoot) + public void setIsFederationRoot(final boolean isFederationRootValue) { - this.isFederationRoot = isFederationRoot; + this.isFederationRoot = isFederationRootValue; } private boolean isSystemObject; /** * Gets or sets a value indicating whether the database is a system object. + * @return The IsSystemObject value. */ public boolean isSystemObject() { @@ -133,16 +144,18 @@ public boolean isSystemObject() /** * Gets or sets a value indicating whether the database is a system object. + * @param isSystemObjectValue The IsSystemObject value. */ - public void setIsSystemObject(boolean isSystemObject) + public void setIsSystemObject(final boolean isSystemObjectValue) { - this.isSystemObject = isSystemObject; + this.isSystemObject = isSystemObjectValue; } private long maximumDatabaseSizeInGB; /** * Gets or sets the maximum size of this database, in Gigabytes. + * @return The MaximumDatabaseSizeInGB value. */ public long getMaximumDatabaseSizeInGB() { @@ -151,16 +164,18 @@ public long getMaximumDatabaseSizeInGB() /** * Gets or sets the maximum size of this database, in Gigabytes. + * @param maximumDatabaseSizeInGBValue The MaximumDatabaseSizeInGB value. */ - public void setMaximumDatabaseSizeInGB(long maximumDatabaseSizeInGB) + public void setMaximumDatabaseSizeInGB(final long maximumDatabaseSizeInGBValue) { - this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGB; + this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGBValue; } private String name; /** * Gets or sets the name of the database. + * @return The Name value. */ public String getName() { @@ -169,16 +184,18 @@ public String getName() /** * Gets or sets the name of the database. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serviceObjectiveAssignmentErrorCode; /** * Gets or sets the error code for this service objective. + * @return The ServiceObjectiveAssignmentErrorCode value. */ public String getServiceObjectiveAssignmentErrorCode() { @@ -187,16 +204,19 @@ public String getServiceObjectiveAssignmentErrorCode() /** * Gets or sets the error code for this service objective. + * @param serviceObjectiveAssignmentErrorCodeValue The + * ServiceObjectiveAssignmentErrorCode value. */ - public void setServiceObjectiveAssignmentErrorCode(String serviceObjectiveAssignmentErrorCode) + public void setServiceObjectiveAssignmentErrorCode(final String serviceObjectiveAssignmentErrorCodeValue) { - this.serviceObjectiveAssignmentErrorCode = serviceObjectiveAssignmentErrorCode; + this.serviceObjectiveAssignmentErrorCode = serviceObjectiveAssignmentErrorCodeValue; } private String serviceObjectiveAssignmentErrorDescription; /** * Gets or sets the error description, if any. + * @return The ServiceObjectiveAssignmentErrorDescription value. */ public String getServiceObjectiveAssignmentErrorDescription() { @@ -205,16 +225,19 @@ public String getServiceObjectiveAssignmentErrorDescription() /** * Gets or sets the error description, if any. + * @param serviceObjectiveAssignmentErrorDescriptionValue The + * ServiceObjectiveAssignmentErrorDescription value. */ - public void setServiceObjectiveAssignmentErrorDescription(String serviceObjectiveAssignmentErrorDescription) + public void setServiceObjectiveAssignmentErrorDescription(final String serviceObjectiveAssignmentErrorDescriptionValue) { - this.serviceObjectiveAssignmentErrorDescription = serviceObjectiveAssignmentErrorDescription; + this.serviceObjectiveAssignmentErrorDescription = serviceObjectiveAssignmentErrorDescriptionValue; } private String serviceObjectiveAssignmentState; /** * Gets or sets the state of the current assignment. + * @return The ServiceObjectiveAssignmentState value. */ public String getServiceObjectiveAssignmentState() { @@ -223,16 +246,19 @@ public String getServiceObjectiveAssignmentState() /** * Gets or sets the state of the current assignment. + * @param serviceObjectiveAssignmentStateValue The + * ServiceObjectiveAssignmentState value. */ - public void setServiceObjectiveAssignmentState(String serviceObjectiveAssignmentState) + public void setServiceObjectiveAssignmentState(final String serviceObjectiveAssignmentStateValue) { - this.serviceObjectiveAssignmentState = serviceObjectiveAssignmentState; + this.serviceObjectiveAssignmentState = serviceObjectiveAssignmentStateValue; } private String serviceObjectiveAssignmentStateDescription; /** * Gets or sets the state description. + * @return The ServiceObjectiveAssignmentStateDescription value. */ public String getServiceObjectiveAssignmentStateDescription() { @@ -241,16 +267,19 @@ public String getServiceObjectiveAssignmentStateDescription() /** * Gets or sets the state description. + * @param serviceObjectiveAssignmentStateDescriptionValue The + * ServiceObjectiveAssignmentStateDescription value. */ - public void setServiceObjectiveAssignmentStateDescription(String serviceObjectiveAssignmentStateDescription) + public void setServiceObjectiveAssignmentStateDescription(final String serviceObjectiveAssignmentStateDescriptionValue) { - this.serviceObjectiveAssignmentStateDescription = serviceObjectiveAssignmentStateDescription; + this.serviceObjectiveAssignmentStateDescription = serviceObjectiveAssignmentStateDescriptionValue; } private String serviceObjectiveAssignmentSuccessDate; /** * Gets or sets the date the service's assignment succeeded. + * @return The ServiceObjectiveAssignmentSuccessDate value. */ public String getServiceObjectiveAssignmentSuccessDate() { @@ -259,16 +288,19 @@ public String getServiceObjectiveAssignmentSuccessDate() /** * Gets or sets the date the service's assignment succeeded. + * @param serviceObjectiveAssignmentSuccessDateValue The + * ServiceObjectiveAssignmentSuccessDate value. */ - public void setServiceObjectiveAssignmentSuccessDate(String serviceObjectiveAssignmentSuccessDate) + public void setServiceObjectiveAssignmentSuccessDate(final String serviceObjectiveAssignmentSuccessDateValue) { - this.serviceObjectiveAssignmentSuccessDate = serviceObjectiveAssignmentSuccessDate; + this.serviceObjectiveAssignmentSuccessDate = serviceObjectiveAssignmentSuccessDateValue; } private String serviceObjectiveId; /** * Gets or sets the id of this service objective. + * @return The ServiceObjectiveId value. */ public String getServiceObjectiveId() { @@ -277,16 +309,18 @@ public String getServiceObjectiveId() /** * Gets or sets the id of this service objective. + * @param serviceObjectiveIdValue The ServiceObjectiveId value. */ - public void setServiceObjectiveId(String serviceObjectiveId) + public void setServiceObjectiveId(final String serviceObjectiveIdValue) { - this.serviceObjectiveId = serviceObjectiveId; + this.serviceObjectiveId = serviceObjectiveIdValue; } private String sizeMB; /** * Gets or sets the size of this database in megabytes (MB). + * @return The SizeMB value. */ public String getSizeMB() { @@ -295,16 +329,18 @@ public String getSizeMB() /** * Gets or sets the size of this database in megabytes (MB). + * @param sizeMBValue The SizeMB value. */ - public void setSizeMB(String sizeMB) + public void setSizeMB(final String sizeMBValue) { - this.sizeMB = sizeMB; + this.sizeMB = sizeMBValue; } private String state; /** * Gets or sets the state of the database. + * @return The State value. */ public String getState() { @@ -313,16 +349,18 @@ public String getState() /** * Gets or sets the state of the database. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -331,9 +369,10 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseGetResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseGetResponse.java index 44347003e17a1..415e72c5afb45 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseGetResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseGetResponse.java @@ -35,6 +35,7 @@ public class DatabaseGetResponse extends OperationResponse /** * Gets or sets the database resource's collation name. + * @return The CollationName value. */ public String getCollationName() { @@ -43,16 +44,18 @@ public String getCollationName() /** * Gets or sets the database resource's collation name. + * @param collationNameValue The CollationName value. */ - public void setCollationName(String collationName) + public void setCollationName(final String collationNameValue) { - this.collationName = collationName; + this.collationName = collationNameValue; } private Calendar creationDate; /** * Gets or sets the date this database was created. + * @return The CreationDate value. */ public Calendar getCreationDate() { @@ -61,16 +64,18 @@ public Calendar getCreationDate() /** * Gets or sets the date this database was created. + * @param creationDateValue The CreationDate value. */ - public void setCreationDate(Calendar creationDate) + public void setCreationDate(final Calendar creationDateValue) { - this.creationDate = creationDate; + this.creationDate = creationDateValue; } private String edition; /** * Gets or sets the database resource's edition. + * @return The Edition value. */ public String getEdition() { @@ -79,16 +84,18 @@ public String getEdition() /** * Gets or sets the database resource's edition. + * @param editionValue The Edition value. */ - public void setEdition(String edition) + public void setEdition(final String editionValue) { - this.edition = edition; + this.edition = editionValue; } private int id; /** * Gets or sets the id of the database. + * @return The Id value. */ public int getId() { @@ -97,16 +104,18 @@ public int getId() /** * Gets or sets the id of the database. + * @param idValue The Id value. */ - public void setId(int id) + public void setId(final int idValue) { - this.id = id; + this.id = idValue; } private boolean isFederationRoot; /** * Gets or sets a value indicating whether the database is a federation root. + * @return The IsFederationRoot value. */ public boolean isFederationRoot() { @@ -115,16 +124,18 @@ public boolean isFederationRoot() /** * Gets or sets a value indicating whether the database is a federation root. + * @param isFederationRootValue The IsFederationRoot value. */ - public void setIsFederationRoot(boolean isFederationRoot) + public void setIsFederationRoot(final boolean isFederationRootValue) { - this.isFederationRoot = isFederationRoot; + this.isFederationRoot = isFederationRootValue; } private boolean isSystemObject; /** * Gets or sets a value indicating whether the database is a system object. + * @return The IsSystemObject value. */ public boolean isSystemObject() { @@ -133,16 +144,18 @@ public boolean isSystemObject() /** * Gets or sets a value indicating whether the database is a system object. + * @param isSystemObjectValue The IsSystemObject value. */ - public void setIsSystemObject(boolean isSystemObject) + public void setIsSystemObject(final boolean isSystemObjectValue) { - this.isSystemObject = isSystemObject; + this.isSystemObject = isSystemObjectValue; } private long maximumDatabaseSizeInGB; /** * Gets or sets the maximum size of this database, in Gigabytes. + * @return The MaximumDatabaseSizeInGB value. */ public long getMaximumDatabaseSizeInGB() { @@ -151,16 +164,18 @@ public long getMaximumDatabaseSizeInGB() /** * Gets or sets the maximum size of this database, in Gigabytes. + * @param maximumDatabaseSizeInGBValue The MaximumDatabaseSizeInGB value. */ - public void setMaximumDatabaseSizeInGB(long maximumDatabaseSizeInGB) + public void setMaximumDatabaseSizeInGB(final long maximumDatabaseSizeInGBValue) { - this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGB; + this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGBValue; } private String name; /** * Gets or sets the name of the database. + * @return The Name value. */ public String getName() { @@ -169,16 +184,18 @@ public String getName() /** * Gets or sets the name of the database. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serviceObjectiveAssignmentErrorCode; /** * Gets or sets the error code for this service objective. + * @return The ServiceObjectiveAssignmentErrorCode value. */ public String getServiceObjectiveAssignmentErrorCode() { @@ -187,16 +204,19 @@ public String getServiceObjectiveAssignmentErrorCode() /** * Gets or sets the error code for this service objective. + * @param serviceObjectiveAssignmentErrorCodeValue The + * ServiceObjectiveAssignmentErrorCode value. */ - public void setServiceObjectiveAssignmentErrorCode(String serviceObjectiveAssignmentErrorCode) + public void setServiceObjectiveAssignmentErrorCode(final String serviceObjectiveAssignmentErrorCodeValue) { - this.serviceObjectiveAssignmentErrorCode = serviceObjectiveAssignmentErrorCode; + this.serviceObjectiveAssignmentErrorCode = serviceObjectiveAssignmentErrorCodeValue; } private String serviceObjectiveAssignmentErrorDescription; /** * Gets or sets the error description, if any. + * @return The ServiceObjectiveAssignmentErrorDescription value. */ public String getServiceObjectiveAssignmentErrorDescription() { @@ -205,16 +225,19 @@ public String getServiceObjectiveAssignmentErrorDescription() /** * Gets or sets the error description, if any. + * @param serviceObjectiveAssignmentErrorDescriptionValue The + * ServiceObjectiveAssignmentErrorDescription value. */ - public void setServiceObjectiveAssignmentErrorDescription(String serviceObjectiveAssignmentErrorDescription) + public void setServiceObjectiveAssignmentErrorDescription(final String serviceObjectiveAssignmentErrorDescriptionValue) { - this.serviceObjectiveAssignmentErrorDescription = serviceObjectiveAssignmentErrorDescription; + this.serviceObjectiveAssignmentErrorDescription = serviceObjectiveAssignmentErrorDescriptionValue; } private String serviceObjectiveAssignmentState; /** * Gets or sets the state of the current assignment. + * @return The ServiceObjectiveAssignmentState value. */ public String getServiceObjectiveAssignmentState() { @@ -223,16 +246,19 @@ public String getServiceObjectiveAssignmentState() /** * Gets or sets the state of the current assignment. + * @param serviceObjectiveAssignmentStateValue The + * ServiceObjectiveAssignmentState value. */ - public void setServiceObjectiveAssignmentState(String serviceObjectiveAssignmentState) + public void setServiceObjectiveAssignmentState(final String serviceObjectiveAssignmentStateValue) { - this.serviceObjectiveAssignmentState = serviceObjectiveAssignmentState; + this.serviceObjectiveAssignmentState = serviceObjectiveAssignmentStateValue; } private String serviceObjectiveAssignmentStateDescription; /** * Gets or sets the state description. + * @return The ServiceObjectiveAssignmentStateDescription value. */ public String getServiceObjectiveAssignmentStateDescription() { @@ -241,16 +267,19 @@ public String getServiceObjectiveAssignmentStateDescription() /** * Gets or sets the state description. + * @param serviceObjectiveAssignmentStateDescriptionValue The + * ServiceObjectiveAssignmentStateDescription value. */ - public void setServiceObjectiveAssignmentStateDescription(String serviceObjectiveAssignmentStateDescription) + public void setServiceObjectiveAssignmentStateDescription(final String serviceObjectiveAssignmentStateDescriptionValue) { - this.serviceObjectiveAssignmentStateDescription = serviceObjectiveAssignmentStateDescription; + this.serviceObjectiveAssignmentStateDescription = serviceObjectiveAssignmentStateDescriptionValue; } private String serviceObjectiveAssignmentSuccessDate; /** * Gets or sets the date the service's assignment succeeded. + * @return The ServiceObjectiveAssignmentSuccessDate value. */ public String getServiceObjectiveAssignmentSuccessDate() { @@ -259,16 +288,19 @@ public String getServiceObjectiveAssignmentSuccessDate() /** * Gets or sets the date the service's assignment succeeded. + * @param serviceObjectiveAssignmentSuccessDateValue The + * ServiceObjectiveAssignmentSuccessDate value. */ - public void setServiceObjectiveAssignmentSuccessDate(String serviceObjectiveAssignmentSuccessDate) + public void setServiceObjectiveAssignmentSuccessDate(final String serviceObjectiveAssignmentSuccessDateValue) { - this.serviceObjectiveAssignmentSuccessDate = serviceObjectiveAssignmentSuccessDate; + this.serviceObjectiveAssignmentSuccessDate = serviceObjectiveAssignmentSuccessDateValue; } private String serviceObjectiveId; /** * Gets or sets the id of this service objective. + * @return The ServiceObjectiveId value. */ public String getServiceObjectiveId() { @@ -277,16 +309,18 @@ public String getServiceObjectiveId() /** * Gets or sets the id of this service objective. + * @param serviceObjectiveIdValue The ServiceObjectiveId value. */ - public void setServiceObjectiveId(String serviceObjectiveId) + public void setServiceObjectiveId(final String serviceObjectiveIdValue) { - this.serviceObjectiveId = serviceObjectiveId; + this.serviceObjectiveId = serviceObjectiveIdValue; } private String sizeMB; /** * Gets or sets the size of this database in megabytes (MB). + * @return The SizeMB value. */ public String getSizeMB() { @@ -295,16 +329,18 @@ public String getSizeMB() /** * Gets or sets the size of this database in megabytes (MB). + * @param sizeMBValue The SizeMB value. */ - public void setSizeMB(String sizeMB) + public void setSizeMB(final String sizeMBValue) { - this.sizeMB = sizeMB; + this.sizeMB = sizeMBValue; } private String state; /** * Gets or sets the state of the database. + * @return The State value. */ public String getState() { @@ -313,16 +349,18 @@ public String getState() /** * Gets or sets the state of the database. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -331,9 +369,10 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseListResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseListResponse.java index d1565147da325..9ab91ff2904b6 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseListResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseListResponse.java @@ -37,6 +37,7 @@ public class DatabaseListResponse extends OperationResponse implements Iterable< /** * Gets or sets the SQL Server databases that are housed in a server. + * @return The Databases value. */ public ArrayList getDatabases() { @@ -45,10 +46,11 @@ public ArrayList getDatabases() /** * Gets or sets the SQL Server databases that are housed in a server. + * @param databasesValue The Databases value. */ - public void setDatabases(ArrayList databases) + public void setDatabases(final ArrayList databasesValue) { - this.databases = databases; + this.databases = databasesValue; } /** @@ -79,6 +81,7 @@ public static class Database /** * Gets or sets the database resource's collation name. + * @return The CollationName value. */ public String getCollationName() { @@ -87,16 +90,18 @@ public String getCollationName() /** * Gets or sets the database resource's collation name. + * @param collationNameValue The CollationName value. */ - public void setCollationName(String collationName) + public void setCollationName(final String collationNameValue) { - this.collationName = collationName; + this.collationName = collationNameValue; } private Calendar creationDate; /** * Gets or sets the date this database was created. + * @return The CreationDate value. */ public Calendar getCreationDate() { @@ -105,16 +110,18 @@ public Calendar getCreationDate() /** * Gets or sets the date this database was created. + * @param creationDateValue The CreationDate value. */ - public void setCreationDate(Calendar creationDate) + public void setCreationDate(final Calendar creationDateValue) { - this.creationDate = creationDate; + this.creationDate = creationDateValue; } private String edition; /** * Gets or sets the database resource's edition. + * @return The Edition value. */ public String getEdition() { @@ -123,16 +130,18 @@ public String getEdition() /** * Gets or sets the database resource's edition. + * @param editionValue The Edition value. */ - public void setEdition(String edition) + public void setEdition(final String editionValue) { - this.edition = edition; + this.edition = editionValue; } private int id; /** * Gets or sets the id of the database. + * @return The Id value. */ public int getId() { @@ -141,10 +150,11 @@ public int getId() /** * Gets or sets the id of the database. + * @param idValue The Id value. */ - public void setId(int id) + public void setId(final int idValue) { - this.id = id; + this.id = idValue; } private boolean isFederationRoot; @@ -152,6 +162,7 @@ public void setId(int id) /** * Gets or sets a value indicating whether the database is a federation * root. + * @return The IsFederationRoot value. */ public boolean isFederationRoot() { @@ -161,10 +172,11 @@ public boolean isFederationRoot() /** * Gets or sets a value indicating whether the database is a federation * root. + * @param isFederationRootValue The IsFederationRoot value. */ - public void setIsFederationRoot(boolean isFederationRoot) + public void setIsFederationRoot(final boolean isFederationRootValue) { - this.isFederationRoot = isFederationRoot; + this.isFederationRoot = isFederationRootValue; } private boolean isSystemObject; @@ -172,6 +184,7 @@ public void setIsFederationRoot(boolean isFederationRoot) /** * Gets or sets a value indicating whether the database is a system * object. + * @return The IsSystemObject value. */ public boolean isSystemObject() { @@ -181,16 +194,18 @@ public boolean isSystemObject() /** * Gets or sets a value indicating whether the database is a system * object. + * @param isSystemObjectValue The IsSystemObject value. */ - public void setIsSystemObject(boolean isSystemObject) + public void setIsSystemObject(final boolean isSystemObjectValue) { - this.isSystemObject = isSystemObject; + this.isSystemObject = isSystemObjectValue; } private long maximumDatabaseSizeInGB; /** * Gets or sets the maximum size of this database, in Gigabytes. + * @return The MaximumDatabaseSizeInGB value. */ public long getMaximumDatabaseSizeInGB() { @@ -199,16 +214,18 @@ public long getMaximumDatabaseSizeInGB() /** * Gets or sets the maximum size of this database, in Gigabytes. + * @param maximumDatabaseSizeInGBValue The MaximumDatabaseSizeInGB value. */ - public void setMaximumDatabaseSizeInGB(long maximumDatabaseSizeInGB) + public void setMaximumDatabaseSizeInGB(final long maximumDatabaseSizeInGBValue) { - this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGB; + this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGBValue; } private String name; /** * Gets or sets the name of the database. + * @return The Name value. */ public String getName() { @@ -217,16 +234,18 @@ public String getName() /** * Gets or sets the name of the database. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serviceObjectiveAssignmentErrorCode; /** * Gets or sets the error code for this service objective. + * @return The ServiceObjectiveAssignmentErrorCode value. */ public String getServiceObjectiveAssignmentErrorCode() { @@ -235,16 +254,19 @@ public String getServiceObjectiveAssignmentErrorCode() /** * Gets or sets the error code for this service objective. + * @param serviceObjectiveAssignmentErrorCodeValue The + * ServiceObjectiveAssignmentErrorCode value. */ - public void setServiceObjectiveAssignmentErrorCode(String serviceObjectiveAssignmentErrorCode) + public void setServiceObjectiveAssignmentErrorCode(final String serviceObjectiveAssignmentErrorCodeValue) { - this.serviceObjectiveAssignmentErrorCode = serviceObjectiveAssignmentErrorCode; + this.serviceObjectiveAssignmentErrorCode = serviceObjectiveAssignmentErrorCodeValue; } private String serviceObjectiveAssignmentErrorDescription; /** * Gets or sets the error description, if any. + * @return The ServiceObjectiveAssignmentErrorDescription value. */ public String getServiceObjectiveAssignmentErrorDescription() { @@ -253,16 +275,19 @@ public String getServiceObjectiveAssignmentErrorDescription() /** * Gets or sets the error description, if any. + * @param serviceObjectiveAssignmentErrorDescriptionValue The + * ServiceObjectiveAssignmentErrorDescription value. */ - public void setServiceObjectiveAssignmentErrorDescription(String serviceObjectiveAssignmentErrorDescription) + public void setServiceObjectiveAssignmentErrorDescription(final String serviceObjectiveAssignmentErrorDescriptionValue) { - this.serviceObjectiveAssignmentErrorDescription = serviceObjectiveAssignmentErrorDescription; + this.serviceObjectiveAssignmentErrorDescription = serviceObjectiveAssignmentErrorDescriptionValue; } private String serviceObjectiveAssignmentState; /** * Gets or sets the state of the current assignment. + * @return The ServiceObjectiveAssignmentState value. */ public String getServiceObjectiveAssignmentState() { @@ -271,16 +296,19 @@ public String getServiceObjectiveAssignmentState() /** * Gets or sets the state of the current assignment. + * @param serviceObjectiveAssignmentStateValue The + * ServiceObjectiveAssignmentState value. */ - public void setServiceObjectiveAssignmentState(String serviceObjectiveAssignmentState) + public void setServiceObjectiveAssignmentState(final String serviceObjectiveAssignmentStateValue) { - this.serviceObjectiveAssignmentState = serviceObjectiveAssignmentState; + this.serviceObjectiveAssignmentState = serviceObjectiveAssignmentStateValue; } private String serviceObjectiveAssignmentStateDescription; /** * Gets or sets the state description. + * @return The ServiceObjectiveAssignmentStateDescription value. */ public String getServiceObjectiveAssignmentStateDescription() { @@ -289,16 +317,19 @@ public String getServiceObjectiveAssignmentStateDescription() /** * Gets or sets the state description. + * @param serviceObjectiveAssignmentStateDescriptionValue The + * ServiceObjectiveAssignmentStateDescription value. */ - public void setServiceObjectiveAssignmentStateDescription(String serviceObjectiveAssignmentStateDescription) + public void setServiceObjectiveAssignmentStateDescription(final String serviceObjectiveAssignmentStateDescriptionValue) { - this.serviceObjectiveAssignmentStateDescription = serviceObjectiveAssignmentStateDescription; + this.serviceObjectiveAssignmentStateDescription = serviceObjectiveAssignmentStateDescriptionValue; } private String serviceObjectiveAssignmentSuccessDate; /** * Gets or sets the date the service's assignment succeeded. + * @return The ServiceObjectiveAssignmentSuccessDate value. */ public String getServiceObjectiveAssignmentSuccessDate() { @@ -307,16 +338,19 @@ public String getServiceObjectiveAssignmentSuccessDate() /** * Gets or sets the date the service's assignment succeeded. + * @param serviceObjectiveAssignmentSuccessDateValue The + * ServiceObjectiveAssignmentSuccessDate value. */ - public void setServiceObjectiveAssignmentSuccessDate(String serviceObjectiveAssignmentSuccessDate) + public void setServiceObjectiveAssignmentSuccessDate(final String serviceObjectiveAssignmentSuccessDateValue) { - this.serviceObjectiveAssignmentSuccessDate = serviceObjectiveAssignmentSuccessDate; + this.serviceObjectiveAssignmentSuccessDate = serviceObjectiveAssignmentSuccessDateValue; } private String serviceObjectiveId; /** * Gets or sets the id of this service objective. + * @return The ServiceObjectiveId value. */ public String getServiceObjectiveId() { @@ -325,16 +359,18 @@ public String getServiceObjectiveId() /** * Gets or sets the id of this service objective. + * @param serviceObjectiveIdValue The ServiceObjectiveId value. */ - public void setServiceObjectiveId(String serviceObjectiveId) + public void setServiceObjectiveId(final String serviceObjectiveIdValue) { - this.serviceObjectiveId = serviceObjectiveId; + this.serviceObjectiveId = serviceObjectiveIdValue; } private String sizeMB; /** * Gets or sets the size of this database in megabytes (MB). + * @return The SizeMB value. */ public String getSizeMB() { @@ -343,16 +379,18 @@ public String getSizeMB() /** * Gets or sets the size of this database in megabytes (MB). + * @param sizeMBValue The SizeMB value. */ - public void setSizeMB(String sizeMB) + public void setSizeMB(final String sizeMBValue) { - this.sizeMB = sizeMB; + this.sizeMB = sizeMBValue; } private String state; /** * Gets or sets the state of the database. + * @return The State value. */ public String getState() { @@ -361,16 +399,18 @@ public String getState() /** * Gets or sets the state of the database. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -379,10 +419,11 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseOperationGetResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseOperationGetResponse.java index 1efe8150de66d..7cc711e3259a7 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseOperationGetResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseOperationGetResponse.java @@ -36,6 +36,7 @@ public class DatabaseOperationGetResponse extends OperationResponse /** * Gets or sets the name of the SQL Database on which the operation is * performed. + * @return The DatabaseName value. */ public String getDatabaseName() { @@ -45,10 +46,11 @@ public String getDatabaseName() /** * Gets or sets the name of the SQL Database on which the operation is * performed. + * @param databaseNameValue The DatabaseName value. */ - public void setDatabaseName(String databaseName) + public void setDatabaseName(final String databaseNameValue) { - this.databaseName = databaseName; + this.databaseName = databaseNameValue; } private String error; @@ -56,6 +58,7 @@ public void setDatabaseName(String databaseName) /** * Gets or sets the description of the error that occurred during a failed * operation. + * @return The Error value. */ public String getError() { @@ -65,10 +68,11 @@ public String getError() /** * Gets or sets the description of the error that occurred during a failed * operation. + * @param errorValue The Error value. */ - public void setError(String error) + public void setError(final String errorValue) { - this.error = error; + this.error = errorValue; } private int errorCode; @@ -76,6 +80,7 @@ public void setError(String error) /** * Gets or sets the code indicating the error that occurred during a failed * operation. + * @return The ErrorCode value. */ public int getErrorCode() { @@ -85,10 +90,11 @@ public int getErrorCode() /** * Gets or sets the code indicating the error that occurred during a failed * operation. + * @param errorCodeValue The ErrorCode value. */ - public void setErrorCode(int errorCode) + public void setErrorCode(final int errorCodeValue) { - this.errorCode = errorCode; + this.errorCode = errorCodeValue; } private int errorSeverity; @@ -96,6 +102,7 @@ public void setErrorCode(int errorCode) /** * Gets or sets the severity level of the error that occurred during a * failed operation. + * @return The ErrorSeverity value. */ public int getErrorSeverity() { @@ -105,16 +112,18 @@ public int getErrorSeverity() /** * Gets or sets the severity level of the error that occurred during a * failed operation. + * @param errorSeverityValue The ErrorSeverity value. */ - public void setErrorSeverity(int errorSeverity) + public void setErrorSeverity(final int errorSeverityValue) { - this.errorSeverity = errorSeverity; + this.errorSeverity = errorSeverityValue; } private int errorState; /** * Gets or sets the error state. + * @return The ErrorState value. */ public int getErrorState() { @@ -123,16 +132,18 @@ public int getErrorState() /** * Gets or sets the error state. + * @param errorStateValue The ErrorState value. */ - public void setErrorState(int errorState) + public void setErrorState(final int errorStateValue) { - this.errorState = errorState; + this.errorState = errorStateValue; } private String id; /** * Gets or sets unique identifier of the operation. + * @return The Id value. */ public String getId() { @@ -141,10 +152,11 @@ public String getId() /** * Gets or sets unique identifier of the operation. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private Calendar lastModifyTime; @@ -152,6 +164,7 @@ public void setId(String id) /** * Gets or sets the timestamp when the record was last modified for a long * running operation. + * @return The LastModifyTime value. */ public Calendar getLastModifyTime() { @@ -161,16 +174,18 @@ public Calendar getLastModifyTime() /** * Gets or sets the timestamp when the record was last modified for a long * running operation. + * @param lastModifyTimeValue The LastModifyTime value. */ - public void setLastModifyTime(Calendar lastModifyTime) + public void setLastModifyTime(final Calendar lastModifyTimeValue) { - this.lastModifyTime = lastModifyTime; + this.lastModifyTime = lastModifyTimeValue; } private String name; /** * Gets or sets the name of the operation. + * @return The Name value. */ public String getName() { @@ -179,16 +194,18 @@ public String getName() /** * Gets or sets the name of the operation. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String parentLink; /** * Gets or sets the ParentLink of the operation. + * @return The ParentLink value. */ public String getParentLink() { @@ -197,16 +214,18 @@ public String getParentLink() /** * Gets or sets the ParentLink of the operation. + * @param parentLinkValue The ParentLink value. */ - public void setParentLink(String parentLink) + public void setParentLink(final String parentLinkValue) { - this.parentLink = parentLink; + this.parentLink = parentLinkValue; } private int percentComplete; /** * Gets or sets the percentage of operation that has completed. + * @return The PercentComplete value. */ public int getPercentComplete() { @@ -215,16 +234,18 @@ public int getPercentComplete() /** * Gets or sets the percentage of operation that has completed. + * @param percentCompleteValue The PercentComplete value. */ - public void setPercentComplete(int percentComplete) + public void setPercentComplete(final int percentCompleteValue) { - this.percentComplete = percentComplete; + this.percentComplete = percentCompleteValue; } private String selfLink; /** * Gets or sets the SelfLink of the operation. + * @return The SelfLink value. */ public String getSelfLink() { @@ -233,16 +254,18 @@ public String getSelfLink() /** * Gets or sets the SelfLink of the operation. + * @param selfLinkValue The SelfLink value. */ - public void setSelfLink(String selfLink) + public void setSelfLink(final String selfLinkValue) { - this.selfLink = selfLink; + this.selfLink = selfLinkValue; } private String sessionActivityId; /** * Gets or sets session scoped ID of the operation. + * @return The SessionActivityId value. */ public String getSessionActivityId() { @@ -251,16 +274,18 @@ public String getSessionActivityId() /** * Gets or sets session scoped ID of the operation. + * @param sessionActivityIdValue The SessionActivityId value. */ - public void setSessionActivityId(String sessionActivityId) + public void setSessionActivityId(final String sessionActivityIdValue) { - this.sessionActivityId = sessionActivityId; + this.sessionActivityId = sessionActivityIdValue; } private Calendar startTime; /** * Gets or sets the timestamp when the operation started. + * @return The StartTime value. */ public Calendar getStartTime() { @@ -269,16 +294,18 @@ public Calendar getStartTime() /** * Gets or sets the timestamp when the operation started. + * @param startTimeValue The StartTime value. */ - public void setStartTime(Calendar startTime) + public void setStartTime(final Calendar startTimeValue) { - this.startTime = startTime; + this.startTime = startTimeValue; } private String state; /** * Gets or sets the state of the operation. + * @return The State value. */ public String getState() { @@ -287,10 +314,11 @@ public String getState() /** * Gets or sets the state of the operation. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private int stateId; @@ -298,6 +326,7 @@ public void setState(String state) /** * Gets or sets the current state of the long running operation in numeric * format. + * @return The StateId value. */ public int getStateId() { @@ -307,16 +336,18 @@ public int getStateId() /** * Gets or sets the current state of the long running operation in numeric * format. + * @param stateIdValue The StateId value. */ - public void setStateId(int stateId) + public void setStateId(final int stateIdValue) { - this.stateId = stateId; + this.stateId = stateIdValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -325,9 +356,10 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseOperationListResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseOperationListResponse.java index 9e834a34d847c..80e4067a9a832 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseOperationListResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseOperationListResponse.java @@ -38,6 +38,7 @@ public class DatabaseOperationListResponse extends OperationResponse implements /** * Gets or sets the list of database operations' response. + * @return The DatabaseOperations value. */ public ArrayList getDatabaseOperations() { @@ -46,10 +47,11 @@ public ArrayList getDatabaseOpe /** * Gets or sets the list of database operations' response. + * @param databaseOperationsValue The DatabaseOperations value. */ - public void setDatabaseOperations(ArrayList databaseOperations) + public void setDatabaseOperations(final ArrayList databaseOperationsValue) { - this.databaseOperations = databaseOperations; + this.databaseOperations = databaseOperationsValue; } /** @@ -81,6 +83,7 @@ public static class DatabaseOperation /** * Gets or sets the name of the SQL Database on which the operation is * performed. + * @return The DatabaseName value. */ public String getDatabaseName() { @@ -90,10 +93,11 @@ public String getDatabaseName() /** * Gets or sets the name of the SQL Database on which the operation is * performed. + * @param databaseNameValue The DatabaseName value. */ - public void setDatabaseName(String databaseName) + public void setDatabaseName(final String databaseNameValue) { - this.databaseName = databaseName; + this.databaseName = databaseNameValue; } private String error; @@ -101,6 +105,7 @@ public void setDatabaseName(String databaseName) /** * Gets or sets the description of the error that occurred during a * failed operation. + * @return The Error value. */ public String getError() { @@ -110,10 +115,11 @@ public String getError() /** * Gets or sets the description of the error that occurred during a * failed operation. + * @param errorValue The Error value. */ - public void setError(String error) + public void setError(final String errorValue) { - this.error = error; + this.error = errorValue; } private int errorCode; @@ -121,6 +127,7 @@ public void setError(String error) /** * Gets or sets the code indicating the error that occurred during a * failed operation. + * @return The ErrorCode value. */ public int getErrorCode() { @@ -130,10 +137,11 @@ public int getErrorCode() /** * Gets or sets the code indicating the error that occurred during a * failed operation. + * @param errorCodeValue The ErrorCode value. */ - public void setErrorCode(int errorCode) + public void setErrorCode(final int errorCodeValue) { - this.errorCode = errorCode; + this.errorCode = errorCodeValue; } private int errorSeverity; @@ -141,6 +149,7 @@ public void setErrorCode(int errorCode) /** * Gets or sets the severity level of the error that occurred during a * failed operation. + * @return The ErrorSeverity value. */ public int getErrorSeverity() { @@ -150,16 +159,18 @@ public int getErrorSeverity() /** * Gets or sets the severity level of the error that occurred during a * failed operation. + * @param errorSeverityValue The ErrorSeverity value. */ - public void setErrorSeverity(int errorSeverity) + public void setErrorSeverity(final int errorSeverityValue) { - this.errorSeverity = errorSeverity; + this.errorSeverity = errorSeverityValue; } private int errorState; /** * Gets or sets the error state. + * @return The ErrorState value. */ public int getErrorState() { @@ -168,16 +179,18 @@ public int getErrorState() /** * Gets or sets the error state. + * @param errorStateValue The ErrorState value. */ - public void setErrorState(int errorState) + public void setErrorState(final int errorStateValue) { - this.errorState = errorState; + this.errorState = errorStateValue; } private String id; /** * Gets or sets unique identifier of the operation.. + * @return The Id value. */ public String getId() { @@ -186,10 +199,11 @@ public String getId() /** * Gets or sets unique identifier of the operation.. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private Calendar lastModifyTime; @@ -197,6 +211,7 @@ public void setId(String id) /** * Gets or sets the timestamp when the record was last modified for a * long running operation. + * @return The LastModifyTime value. */ public Calendar getLastModifyTime() { @@ -206,16 +221,18 @@ public Calendar getLastModifyTime() /** * Gets or sets the timestamp when the record was last modified for a * long running operation. + * @param lastModifyTimeValue The LastModifyTime value. */ - public void setLastModifyTime(Calendar lastModifyTime) + public void setLastModifyTime(final Calendar lastModifyTimeValue) { - this.lastModifyTime = lastModifyTime; + this.lastModifyTime = lastModifyTimeValue; } private String name; /** * Gets or sets the name of the operation. + * @return The Name value. */ public String getName() { @@ -224,16 +241,18 @@ public String getName() /** * Gets or sets the name of the operation. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String parentLink; /** * Gets or sets the ParentLink of the operation. + * @return The ParentLink value. */ public String getParentLink() { @@ -242,16 +261,18 @@ public String getParentLink() /** * Gets or sets the ParentLink of the operation. + * @param parentLinkValue The ParentLink value. */ - public void setParentLink(String parentLink) + public void setParentLink(final String parentLinkValue) { - this.parentLink = parentLink; + this.parentLink = parentLinkValue; } private int percentComplete; /** * Gets or sets the percentage of operation that has completed. + * @return The PercentComplete value. */ public int getPercentComplete() { @@ -260,16 +281,18 @@ public int getPercentComplete() /** * Gets or sets the percentage of operation that has completed. + * @param percentCompleteValue The PercentComplete value. */ - public void setPercentComplete(int percentComplete) + public void setPercentComplete(final int percentCompleteValue) { - this.percentComplete = percentComplete; + this.percentComplete = percentCompleteValue; } private String selfLink; /** * Gets or sets the SelfLink of the operation. + * @return The SelfLink value. */ public String getSelfLink() { @@ -278,16 +301,18 @@ public String getSelfLink() /** * Gets or sets the SelfLink of the operation. + * @param selfLinkValue The SelfLink value. */ - public void setSelfLink(String selfLink) + public void setSelfLink(final String selfLinkValue) { - this.selfLink = selfLink; + this.selfLink = selfLinkValue; } private String sessionActivityId; /** * Gets or sets session scoped ID of the operation. + * @return The SessionActivityId value. */ public String getSessionActivityId() { @@ -296,16 +321,18 @@ public String getSessionActivityId() /** * Gets or sets session scoped ID of the operation. + * @param sessionActivityIdValue The SessionActivityId value. */ - public void setSessionActivityId(String sessionActivityId) + public void setSessionActivityId(final String sessionActivityIdValue) { - this.sessionActivityId = sessionActivityId; + this.sessionActivityId = sessionActivityIdValue; } private Calendar startTime; /** * Gets or sets the timestamp when the operation started. + * @return The StartTime value. */ public Calendar getStartTime() { @@ -314,16 +341,18 @@ public Calendar getStartTime() /** * Gets or sets the timestamp when the operation started. + * @param startTimeValue The StartTime value. */ - public void setStartTime(Calendar startTime) + public void setStartTime(final Calendar startTimeValue) { - this.startTime = startTime; + this.startTime = startTimeValue; } private String state; /** * Gets or sets the state of the operation. + * @return The State value. */ public String getState() { @@ -332,10 +361,11 @@ public String getState() /** * Gets or sets the state of the operation. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private int stateId; @@ -343,6 +373,7 @@ public void setState(String state) /** * Gets or sets current state of the long running operation in numeric * format. + * @return The StateId value. */ public int getStateId() { @@ -352,16 +383,18 @@ public int getStateId() /** * Gets or sets current state of the long running operation in numeric * format. + * @param stateIdValue The StateId value. */ - public void setStateId(int stateId) + public void setStateId(final int stateIdValue) { - this.stateId = stateId; + this.stateId = stateIdValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -370,10 +403,11 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseUpdateParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseUpdateParameters.java index 2be2585157ecf..de7a43a350c8a 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseUpdateParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseUpdateParameters.java @@ -32,6 +32,7 @@ public class DatabaseUpdateParameters /** * Gets or sets the collation name for the new database. + * @return The CollationName value. */ public String getCollationName() { @@ -40,16 +41,18 @@ public String getCollationName() /** * Gets or sets the collation name for the new database. + * @param collationNameValue The CollationName value. */ - public void setCollationName(String collationName) + public void setCollationName(final String collationNameValue) { - this.collationName = collationName; + this.collationName = collationNameValue; } private String edition; /** * Gets or sets the edition for the new database. + * @return The Edition value. */ public String getEdition() { @@ -58,16 +61,18 @@ public String getEdition() /** * Gets or sets the edition for the new database. + * @param editionValue The Edition value. */ - public void setEdition(String edition) + public void setEdition(final String editionValue) { - this.edition = edition; + this.edition = editionValue; } private int id; /** * Gets or sets the id of the database. + * @return The Id value. */ public int getId() { @@ -76,16 +81,18 @@ public int getId() /** * Gets or sets the id of the database. + * @param idValue The Id value. */ - public void setId(int id) + public void setId(final int idValue) { - this.id = id; + this.id = idValue; } private long maximumDatabaseSizeInGB; /** * Gets or sets the maximum size of this database, in Gigabytes. + * @return The MaximumDatabaseSizeInGB value. */ public long getMaximumDatabaseSizeInGB() { @@ -94,16 +101,18 @@ public long getMaximumDatabaseSizeInGB() /** * Gets or sets the maximum size of this database, in Gigabytes. + * @param maximumDatabaseSizeInGBValue The MaximumDatabaseSizeInGB value. */ - public void setMaximumDatabaseSizeInGB(long maximumDatabaseSizeInGB) + public void setMaximumDatabaseSizeInGB(final long maximumDatabaseSizeInGBValue) { - this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGB; + this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGBValue; } private String name; /** * Gets or sets the name of the database. + * @return The Name value. */ public String getName() { @@ -112,16 +121,18 @@ public String getName() /** * Gets or sets the name of the database. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serviceObjectiveId; /** * Gets or sets the id of this service objective. + * @return The ServiceObjectiveId value. */ public String getServiceObjectiveId() { @@ -130,9 +141,10 @@ public String getServiceObjectiveId() /** * Gets or sets the id of this service objective. + * @param serviceObjectiveIdValue The ServiceObjectiveId value. */ - public void setServiceObjectiveId(String serviceObjectiveId) + public void setServiceObjectiveId(final String serviceObjectiveIdValue) { - this.serviceObjectiveId = serviceObjectiveId; + this.serviceObjectiveId = serviceObjectiveIdValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseUpdateResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseUpdateResponse.java index 365973c71d6e0..049172c2f439e 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseUpdateResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/DatabaseUpdateResponse.java @@ -35,6 +35,7 @@ public class DatabaseUpdateResponse extends OperationResponse /** * Gets or sets the database resource's collation name. + * @return The CollationName value. */ public String getCollationName() { @@ -43,16 +44,18 @@ public String getCollationName() /** * Gets or sets the database resource's collation name. + * @param collationNameValue The CollationName value. */ - public void setCollationName(String collationName) + public void setCollationName(final String collationNameValue) { - this.collationName = collationName; + this.collationName = collationNameValue; } private Calendar creationDate; /** * Gets or sets the date this database was created. + * @return The CreationDate value. */ public Calendar getCreationDate() { @@ -61,16 +64,18 @@ public Calendar getCreationDate() /** * Gets or sets the date this database was created. + * @param creationDateValue The CreationDate value. */ - public void setCreationDate(Calendar creationDate) + public void setCreationDate(final Calendar creationDateValue) { - this.creationDate = creationDate; + this.creationDate = creationDateValue; } private String edition; /** * Gets or sets the database resource's edition. + * @return The Edition value. */ public String getEdition() { @@ -79,16 +84,18 @@ public String getEdition() /** * Gets or sets the database resource's edition. + * @param editionValue The Edition value. */ - public void setEdition(String edition) + public void setEdition(final String editionValue) { - this.edition = edition; + this.edition = editionValue; } private int id; /** * Gets or sets the id of the database. + * @return The Id value. */ public int getId() { @@ -97,16 +104,18 @@ public int getId() /** * Gets or sets the id of the database. + * @param idValue The Id value. */ - public void setId(int id) + public void setId(final int idValue) { - this.id = id; + this.id = idValue; } private boolean isFederationRoot; /** * Gets or sets a value indicating whether the database is a federation root. + * @return The IsFederationRoot value. */ public boolean isFederationRoot() { @@ -115,16 +124,18 @@ public boolean isFederationRoot() /** * Gets or sets a value indicating whether the database is a federation root. + * @param isFederationRootValue The IsFederationRoot value. */ - public void setIsFederationRoot(boolean isFederationRoot) + public void setIsFederationRoot(final boolean isFederationRootValue) { - this.isFederationRoot = isFederationRoot; + this.isFederationRoot = isFederationRootValue; } private boolean isSystemObject; /** * Gets or sets a value indicating whether the database is a system object. + * @return The IsSystemObject value. */ public boolean isSystemObject() { @@ -133,16 +144,18 @@ public boolean isSystemObject() /** * Gets or sets a value indicating whether the database is a system object. + * @param isSystemObjectValue The IsSystemObject value. */ - public void setIsSystemObject(boolean isSystemObject) + public void setIsSystemObject(final boolean isSystemObjectValue) { - this.isSystemObject = isSystemObject; + this.isSystemObject = isSystemObjectValue; } private long maximumDatabaseSizeInGB; /** * Gets or sets the maximum size of this database, in Gigabytes. + * @return The MaximumDatabaseSizeInGB value. */ public long getMaximumDatabaseSizeInGB() { @@ -151,16 +164,18 @@ public long getMaximumDatabaseSizeInGB() /** * Gets or sets the maximum size of this database, in Gigabytes. + * @param maximumDatabaseSizeInGBValue The MaximumDatabaseSizeInGB value. */ - public void setMaximumDatabaseSizeInGB(long maximumDatabaseSizeInGB) + public void setMaximumDatabaseSizeInGB(final long maximumDatabaseSizeInGBValue) { - this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGB; + this.maximumDatabaseSizeInGB = maximumDatabaseSizeInGBValue; } private String name; /** * Gets or sets the name of the database. + * @return The Name value. */ public String getName() { @@ -169,16 +184,18 @@ public String getName() /** * Gets or sets the name of the database. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serviceObjectiveAssignmentErrorCode; /** * Gets or sets the error code for this service objective. + * @return The ServiceObjectiveAssignmentErrorCode value. */ public String getServiceObjectiveAssignmentErrorCode() { @@ -187,16 +204,19 @@ public String getServiceObjectiveAssignmentErrorCode() /** * Gets or sets the error code for this service objective. + * @param serviceObjectiveAssignmentErrorCodeValue The + * ServiceObjectiveAssignmentErrorCode value. */ - public void setServiceObjectiveAssignmentErrorCode(String serviceObjectiveAssignmentErrorCode) + public void setServiceObjectiveAssignmentErrorCode(final String serviceObjectiveAssignmentErrorCodeValue) { - this.serviceObjectiveAssignmentErrorCode = serviceObjectiveAssignmentErrorCode; + this.serviceObjectiveAssignmentErrorCode = serviceObjectiveAssignmentErrorCodeValue; } private String serviceObjectiveAssignmentErrorDescription; /** * Gets or sets the error description, if any. + * @return The ServiceObjectiveAssignmentErrorDescription value. */ public String getServiceObjectiveAssignmentErrorDescription() { @@ -205,16 +225,19 @@ public String getServiceObjectiveAssignmentErrorDescription() /** * Gets or sets the error description, if any. + * @param serviceObjectiveAssignmentErrorDescriptionValue The + * ServiceObjectiveAssignmentErrorDescription value. */ - public void setServiceObjectiveAssignmentErrorDescription(String serviceObjectiveAssignmentErrorDescription) + public void setServiceObjectiveAssignmentErrorDescription(final String serviceObjectiveAssignmentErrorDescriptionValue) { - this.serviceObjectiveAssignmentErrorDescription = serviceObjectiveAssignmentErrorDescription; + this.serviceObjectiveAssignmentErrorDescription = serviceObjectiveAssignmentErrorDescriptionValue; } private String serviceObjectiveAssignmentState; /** * Gets or sets the state of the current assignment. + * @return The ServiceObjectiveAssignmentState value. */ public String getServiceObjectiveAssignmentState() { @@ -223,16 +246,19 @@ public String getServiceObjectiveAssignmentState() /** * Gets or sets the state of the current assignment. + * @param serviceObjectiveAssignmentStateValue The + * ServiceObjectiveAssignmentState value. */ - public void setServiceObjectiveAssignmentState(String serviceObjectiveAssignmentState) + public void setServiceObjectiveAssignmentState(final String serviceObjectiveAssignmentStateValue) { - this.serviceObjectiveAssignmentState = serviceObjectiveAssignmentState; + this.serviceObjectiveAssignmentState = serviceObjectiveAssignmentStateValue; } private String serviceObjectiveAssignmentStateDescription; /** * Gets or sets the state description. + * @return The ServiceObjectiveAssignmentStateDescription value. */ public String getServiceObjectiveAssignmentStateDescription() { @@ -241,16 +267,19 @@ public String getServiceObjectiveAssignmentStateDescription() /** * Gets or sets the state description. + * @param serviceObjectiveAssignmentStateDescriptionValue The + * ServiceObjectiveAssignmentStateDescription value. */ - public void setServiceObjectiveAssignmentStateDescription(String serviceObjectiveAssignmentStateDescription) + public void setServiceObjectiveAssignmentStateDescription(final String serviceObjectiveAssignmentStateDescriptionValue) { - this.serviceObjectiveAssignmentStateDescription = serviceObjectiveAssignmentStateDescription; + this.serviceObjectiveAssignmentStateDescription = serviceObjectiveAssignmentStateDescriptionValue; } private String serviceObjectiveAssignmentSuccessDate; /** * Gets or sets the date the service's assignment succeeded. + * @return The ServiceObjectiveAssignmentSuccessDate value. */ public String getServiceObjectiveAssignmentSuccessDate() { @@ -259,16 +288,19 @@ public String getServiceObjectiveAssignmentSuccessDate() /** * Gets or sets the date the service's assignment succeeded. + * @param serviceObjectiveAssignmentSuccessDateValue The + * ServiceObjectiveAssignmentSuccessDate value. */ - public void setServiceObjectiveAssignmentSuccessDate(String serviceObjectiveAssignmentSuccessDate) + public void setServiceObjectiveAssignmentSuccessDate(final String serviceObjectiveAssignmentSuccessDateValue) { - this.serviceObjectiveAssignmentSuccessDate = serviceObjectiveAssignmentSuccessDate; + this.serviceObjectiveAssignmentSuccessDate = serviceObjectiveAssignmentSuccessDateValue; } private String serviceObjectiveId; /** * Gets or sets the id of this service objective. + * @return The ServiceObjectiveId value. */ public String getServiceObjectiveId() { @@ -277,16 +309,18 @@ public String getServiceObjectiveId() /** * Gets or sets the id of this service objective. + * @param serviceObjectiveIdValue The ServiceObjectiveId value. */ - public void setServiceObjectiveId(String serviceObjectiveId) + public void setServiceObjectiveId(final String serviceObjectiveIdValue) { - this.serviceObjectiveId = serviceObjectiveId; + this.serviceObjectiveId = serviceObjectiveIdValue; } private String sizeMB; /** * Gets or sets the size of this database in megabytes (MB). + * @return The SizeMB value. */ public String getSizeMB() { @@ -295,16 +329,18 @@ public String getSizeMB() /** * Gets or sets the size of this database in megabytes (MB). + * @param sizeMBValue The SizeMB value. */ - public void setSizeMB(String sizeMB) + public void setSizeMB(final String sizeMBValue) { - this.sizeMB = sizeMB; + this.sizeMB = sizeMBValue; } private String state; /** * Gets or sets the state of the database. + * @return The State value. */ public String getState() { @@ -313,16 +349,18 @@ public String getState() /** * Gets or sets the state of the database. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -331,9 +369,10 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleCreateParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleCreateParameters.java index d5b083e4c0d99..eb45e5fdb4781 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleCreateParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleCreateParameters.java @@ -34,6 +34,7 @@ public class FirewallRuleCreateParameters /** * Gets or sets the ending IP address applied to this firewall rule. + * @return The EndIPAddress value. */ public InetAddress getEndIPAddress() { @@ -42,16 +43,18 @@ public InetAddress getEndIPAddress() /** * Gets or sets the ending IP address applied to this firewall rule. + * @param endIPAddressValue The EndIPAddress value. */ - public void setEndIPAddress(InetAddress endIPAddress) + public void setEndIPAddress(final InetAddress endIPAddressValue) { - this.endIPAddress = endIPAddress; + this.endIPAddress = endIPAddressValue; } private String name; /** * Gets or sets the name of this firewall rule. + * @return The Name value. */ public String getName() { @@ -60,16 +63,18 @@ public String getName() /** * Gets or sets the name of this firewall rule. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private InetAddress startIPAddress; /** * Gets or sets the beginning IP address applied to this firewall rule. + * @return The StartIPAddress value. */ public InetAddress getStartIPAddress() { @@ -78,9 +83,10 @@ public InetAddress getStartIPAddress() /** * Gets or sets the beginning IP address applied to this firewall rule. + * @param startIPAddressValue The StartIPAddress value. */ - public void setStartIPAddress(InetAddress startIPAddress) + public void setStartIPAddress(final InetAddress startIPAddressValue) { - this.startIPAddress = startIPAddress; + this.startIPAddress = startIPAddressValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleCreateResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleCreateResponse.java index 9b9384e872100..0f71d486bfca8 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleCreateResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleCreateResponse.java @@ -35,6 +35,7 @@ public class FirewallRuleCreateResponse extends OperationResponse /** * Gets or sets the ending IP address applied to this rule. + * @return The EndIPAddress value. */ public InetAddress getEndIPAddress() { @@ -43,16 +44,18 @@ public InetAddress getEndIPAddress() /** * Gets or sets the ending IP address applied to this rule. + * @param endIPAddressValue The EndIPAddress value. */ - public void setEndIPAddress(InetAddress endIPAddress) + public void setEndIPAddress(final InetAddress endIPAddressValue) { - this.endIPAddress = endIPAddress; + this.endIPAddress = endIPAddressValue; } private String name; /** * Gets or sets the name of the Firewall Rule. + * @return The Name value. */ public String getName() { @@ -61,16 +64,18 @@ public String getName() /** * Gets or sets the name of the Firewall Rule. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private InetAddress startIPAddress; /** * Gets or sets the beginning IP address applied to this rule. + * @return The StartIPAddress value. */ public InetAddress getStartIPAddress() { @@ -79,16 +84,18 @@ public InetAddress getStartIPAddress() /** * Gets or sets the beginning IP address applied to this rule. + * @param startIPAddressValue The StartIPAddress value. */ - public void setStartIPAddress(InetAddress startIPAddress) + public void setStartIPAddress(final InetAddress startIPAddressValue) { - this.startIPAddress = startIPAddress; + this.startIPAddress = startIPAddressValue; } private String state; /** * Gets or sets the state of the rule. + * @return The State value. */ public String getState() { @@ -97,16 +104,18 @@ public String getState() /** * Gets or sets the state of the rule. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -115,9 +124,10 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleListResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleListResponse.java index 819f40a54208f..d9669e403537f 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleListResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleListResponse.java @@ -37,6 +37,7 @@ public class FirewallRuleListResponse extends OperationResponse implements Itera /** * Gets or sets the firewall rules for this SQL Database Server. + * @return The FirewallRules value. */ public ArrayList getFirewallRules() { @@ -45,10 +46,11 @@ public ArrayList getFirewallRules() /** * Gets or sets the firewall rules for this SQL Database Server. + * @param firewallRulesValue The FirewallRules value. */ - public void setFirewallRules(ArrayList firewallRules) + public void setFirewallRules(final ArrayList firewallRulesValue) { - this.firewallRules = firewallRules; + this.firewallRules = firewallRulesValue; } /** @@ -79,6 +81,7 @@ public static class FirewallRule /** * Gets or sets the ending IP address applied to this rule. + * @return The EndIPAddress value. */ public InetAddress getEndIPAddress() { @@ -87,16 +90,18 @@ public InetAddress getEndIPAddress() /** * Gets or sets the ending IP address applied to this rule. + * @param endIPAddressValue The EndIPAddress value. */ - public void setEndIPAddress(InetAddress endIPAddress) + public void setEndIPAddress(final InetAddress endIPAddressValue) { - this.endIPAddress = endIPAddress; + this.endIPAddress = endIPAddressValue; } private String name; /** * Gets or sets the name of the Firewall Rule. + * @return The Name value. */ public String getName() { @@ -105,16 +110,18 @@ public String getName() /** * Gets or sets the name of the Firewall Rule. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private InetAddress startIPAddress; /** * Gets or sets the beginning IP address applied to this rule. + * @return The StartIPAddress value. */ public InetAddress getStartIPAddress() { @@ -123,16 +130,18 @@ public InetAddress getStartIPAddress() /** * Gets or sets the beginning IP address applied to this rule. + * @param startIPAddressValue The StartIPAddress value. */ - public void setStartIPAddress(InetAddress startIPAddress) + public void setStartIPAddress(final InetAddress startIPAddressValue) { - this.startIPAddress = startIPAddress; + this.startIPAddress = startIPAddressValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -141,10 +150,11 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleUpdateParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleUpdateParameters.java index ffc71a56b7684..a7efbb1a9fc64 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleUpdateParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleUpdateParameters.java @@ -34,6 +34,7 @@ public class FirewallRuleUpdateParameters /** * Gets or sets the ending IP address applied to this firewall rule. + * @return The EndIPAddress value. */ public InetAddress getEndIPAddress() { @@ -42,16 +43,18 @@ public InetAddress getEndIPAddress() /** * Gets or sets the ending IP address applied to this firewall rule. + * @param endIPAddressValue The EndIPAddress value. */ - public void setEndIPAddress(InetAddress endIPAddress) + public void setEndIPAddress(final InetAddress endIPAddressValue) { - this.endIPAddress = endIPAddress; + this.endIPAddress = endIPAddressValue; } private String name; /** * Gets or sets the name of this firewall rule. + * @return The Name value. */ public String getName() { @@ -60,16 +63,18 @@ public String getName() /** * Gets or sets the name of this firewall rule. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private InetAddress startIPAddress; /** * Gets or sets the beginning IP address applied to this firewall rule. + * @return The StartIPAddress value. */ public InetAddress getStartIPAddress() { @@ -78,9 +83,10 @@ public InetAddress getStartIPAddress() /** * Gets or sets the beginning IP address applied to this firewall rule. + * @param startIPAddressValue The StartIPAddress value. */ - public void setStartIPAddress(InetAddress startIPAddress) + public void setStartIPAddress(final InetAddress startIPAddressValue) { - this.startIPAddress = startIPAddress; + this.startIPAddress = startIPAddressValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleUpdateResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleUpdateResponse.java index 4e750595acbd5..abfa83b98dc02 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleUpdateResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/FirewallRuleUpdateResponse.java @@ -35,6 +35,7 @@ public class FirewallRuleUpdateResponse extends OperationResponse /** * Gets or sets the ending IP address applied to this rule. + * @return The EndIPAddress value. */ public InetAddress getEndIPAddress() { @@ -43,16 +44,18 @@ public InetAddress getEndIPAddress() /** * Gets or sets the ending IP address applied to this rule. + * @param endIPAddressValue The EndIPAddress value. */ - public void setEndIPAddress(InetAddress endIPAddress) + public void setEndIPAddress(final InetAddress endIPAddressValue) { - this.endIPAddress = endIPAddress; + this.endIPAddress = endIPAddressValue; } private String name; /** * Gets or sets the name of the Firewall Rule. + * @return The Name value. */ public String getName() { @@ -61,16 +64,18 @@ public String getName() /** * Gets or sets the name of the Firewall Rule. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private InetAddress startIPAddress; /** * Gets or sets the beginning IP address applied to this rule. + * @return The StartIPAddress value. */ public InetAddress getStartIPAddress() { @@ -79,16 +84,18 @@ public InetAddress getStartIPAddress() /** * Gets or sets the beginning IP address applied to this rule. + * @param startIPAddressValue The StartIPAddress value. */ - public void setStartIPAddress(InetAddress startIPAddress) + public void setStartIPAddress(final InetAddress startIPAddressValue) { - this.startIPAddress = startIPAddress; + this.startIPAddress = startIPAddressValue; } private String state; /** * Gets or sets the state of the rule. + * @return The State value. */ public String getState() { @@ -97,16 +104,18 @@ public String getState() /** * Gets or sets the state of the rule. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -115,9 +124,10 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerChangeAdministratorPasswordParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerChangeAdministratorPasswordParameters.java index d4ed0ca9150ba..aa22c5ebd9deb 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerChangeAdministratorPasswordParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerChangeAdministratorPasswordParameters.java @@ -32,6 +32,7 @@ public class ServerChangeAdministratorPasswordParameters /** * Gets or sets new password for the administrator. + * @return The NewPassword value. */ public String getNewPassword() { @@ -40,9 +41,10 @@ public String getNewPassword() /** * Gets or sets new password for the administrator. + * @param newPasswordValue The NewPassword value. */ - public void setNewPassword(String newPassword) + public void setNewPassword(final String newPasswordValue) { - this.newPassword = newPassword; + this.newPassword = newPasswordValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerCreateParameters.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerCreateParameters.java index 3f29f8329983d..a2af4c83f8ae4 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerCreateParameters.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerCreateParameters.java @@ -32,6 +32,7 @@ public class ServerCreateParameters /** * Gets or sets the administrator password. + * @return The AdministratorPassword value. */ public String getAdministratorPassword() { @@ -40,16 +41,18 @@ public String getAdministratorPassword() /** * Gets or sets the administrator password. + * @param administratorPasswordValue The AdministratorPassword value. */ - public void setAdministratorPassword(String administratorPassword) + public void setAdministratorPassword(final String administratorPasswordValue) { - this.administratorPassword = administratorPassword; + this.administratorPassword = administratorPasswordValue; } private String administratorUserName; /** * Gets or sets the administrator username. + * @return The AdministratorUserName value. */ public String getAdministratorUserName() { @@ -58,16 +61,18 @@ public String getAdministratorUserName() /** * Gets or sets the administrator username. + * @param administratorUserNameValue The AdministratorUserName value. */ - public void setAdministratorUserName(String administratorUserName) + public void setAdministratorUserName(final String administratorUserNameValue) { - this.administratorUserName = administratorUserName; + this.administratorUserName = administratorUserNameValue; } private String location; /** * Gets or sets the region in which this server will be created. + * @return The Location value. */ public String getLocation() { @@ -76,9 +81,10 @@ public String getLocation() /** * Gets or sets the region in which this server will be created. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerCreateResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerCreateResponse.java index 43f4f871d1344..c7fd579b845fb 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerCreateResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerCreateResponse.java @@ -34,6 +34,7 @@ public class ServerCreateResponse extends OperationResponse /** * Gets or sets the name of the server that was created. + * @return The ServerName value. */ public String getServerName() { @@ -42,9 +43,10 @@ public String getServerName() /** * Gets or sets the name of the server that was created. + * @param serverNameValue The ServerName value. */ - public void setServerName(String serverName) + public void setServerName(final String serverNameValue) { - this.serverName = serverName; + this.serverName = serverNameValue; } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerListResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerListResponse.java index 9905c572361fb..e0308c2fea058 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerListResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServerListResponse.java @@ -37,6 +37,7 @@ public class ServerListResponse extends OperationResponse implements Iterable getServers() { @@ -45,10 +46,11 @@ public ArrayList getServers() /** * Gets or sets the SQL Servers that are valid for your subscription. + * @param serversValue The Servers value. */ - public void setServers(ArrayList servers) + public void setServers(final ArrayList serversValue) { - this.servers = servers; + this.servers = serversValue; } /** @@ -79,6 +81,7 @@ public static class Server /** * Gets or sets the name of an administrator for this server. + * @return The AdministratorUserName value. */ public String getAdministratorUserName() { @@ -87,10 +90,11 @@ public String getAdministratorUserName() /** * Gets or sets the name of an administrator for this server. + * @param administratorUserNameValue The AdministratorUserName value. */ - public void setAdministratorUserName(String administratorUserName) + public void setAdministratorUserName(final String administratorUserNameValue) { - this.administratorUserName = administratorUserName; + this.administratorUserName = administratorUserNameValue; } private HashMap features; @@ -98,6 +102,7 @@ public void setAdministratorUserName(String administratorUserName) /** * Gets or sets the list of features and the type of database server for * an individual server. + * @return The Features value. */ public HashMap getFeatures() { @@ -107,10 +112,11 @@ public HashMap getFeatures() /** * Gets or sets the list of features and the type of database server for * an individual server. + * @param featuresValue The Features value. */ - public void setFeatures(HashMap features) + public void setFeatures(final HashMap featuresValue) { - this.features = features; + this.features = featuresValue; } private String location; @@ -118,6 +124,7 @@ public void setFeatures(HashMap features) /** * Gets or sets the name of a data center location that is valid for * your subscription. + * @return The Location value. */ public String getLocation() { @@ -127,16 +134,18 @@ public String getLocation() /** * Gets or sets the name of a data center location that is valid for * your subscription. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private String name; /** * Gets or sets the name of a SQL Server running in your subscription. + * @return The Name value. */ public String getName() { @@ -145,10 +154,11 @@ public String getName() /** * Gets or sets the name of a SQL Server running in your subscription. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } /** diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServiceObjectiveGetResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServiceObjectiveGetResponse.java index b4f99975901e7..e44bbd959597c 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServiceObjectiveGetResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServiceObjectiveGetResponse.java @@ -36,6 +36,7 @@ public class ServiceObjectiveGetResponse extends OperationResponse /** * Gets or sets the service objective description. + * @return The Description value. */ public String getDescription() { @@ -44,16 +45,18 @@ public String getDescription() /** * Gets or sets the service objective description. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private ArrayList dimensionSettings; /** * Gets or sets the service objective dimension settings. + * @return The DimensionSettings value. */ public ArrayList getDimensionSettings() { @@ -62,16 +65,18 @@ public ArrayList getDimens /** * Gets or sets the service objective dimension settings. + * @param dimensionSettingsValue The DimensionSettings value. */ - public void setDimensionSettings(ArrayList dimensionSettings) + public void setDimensionSettings(final ArrayList dimensionSettingsValue) { - this.dimensionSettings = dimensionSettings; + this.dimensionSettings = dimensionSettingsValue; } private boolean enabled; /** * Gets or sets a value indicating whether the service objective is enabled. + * @return The Enabled value. */ public boolean isEnabled() { @@ -80,16 +85,18 @@ public boolean isEnabled() /** * Gets or sets a value indicating whether the service objective is enabled. + * @param enabledValue The Enabled value. */ - public void setEnabled(boolean enabled) + public void setEnabled(final boolean enabledValue) { - this.enabled = enabled; + this.enabled = enabledValue; } private String id; /** * Gets or sets the service objective id. + * @return The Id value. */ public String getId() { @@ -98,10 +105,11 @@ public String getId() /** * Gets or sets the service objective id. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private boolean isDefault; @@ -109,6 +117,7 @@ public void setId(String id) /** * Gets or sets a value indicating whether the service objective is the * default objective. + * @return The IsDefault value. */ public boolean isDefault() { @@ -118,10 +127,11 @@ public boolean isDefault() /** * Gets or sets a value indicating whether the service objective is the * default objective. + * @param isDefaultValue The IsDefault value. */ - public void setIsDefault(boolean isDefault) + public void setIsDefault(final boolean isDefaultValue) { - this.isDefault = isDefault; + this.isDefault = isDefaultValue; } private boolean isSystem; @@ -129,6 +139,7 @@ public void setIsDefault(boolean isDefault) /** * Gets or sets a value indicating whether the service objective is a system * objective. + * @return The IsSystem value. */ public boolean isSystem() { @@ -138,16 +149,18 @@ public boolean isSystem() /** * Gets or sets a value indicating whether the service objective is a system * objective. + * @param isSystemValue The IsSystem value. */ - public void setIsSystem(boolean isSystem) + public void setIsSystem(final boolean isSystemValue) { - this.isSystem = isSystem; + this.isSystem = isSystemValue; } private String name; /** * Gets or sets the name of the service objective. + * @return The Name value. */ public String getName() { @@ -156,16 +169,18 @@ public String getName() /** * Gets or sets the name of the service objective. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String parentLink; /** * Gets or sets the ParentLink of the service objective. + * @return The ParentLink value. */ public String getParentLink() { @@ -174,16 +189,18 @@ public String getParentLink() /** * Gets or sets the ParentLink of the service objective. + * @param parentLinkValue The ParentLink value. */ - public void setParentLink(String parentLink) + public void setParentLink(final String parentLinkValue) { - this.parentLink = parentLink; + this.parentLink = parentLinkValue; } private String selfLink; /** * Gets or sets the SelfLink of the service objective. + * @return The SelfLink value. */ public String getSelfLink() { @@ -192,16 +209,18 @@ public String getSelfLink() /** * Gets or sets the SelfLink of the service objective. + * @param selfLinkValue The SelfLink value. */ - public void setSelfLink(String selfLink) + public void setSelfLink(final String selfLinkValue) { - this.selfLink = selfLink; + this.selfLink = selfLinkValue; } private String state; /** * Gets or sets the state of the service objective. + * @return The State value. */ public String getState() { @@ -210,16 +229,18 @@ public String getState() /** * Gets or sets the state of the service objective. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -228,10 +249,11 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } /** @@ -253,6 +275,7 @@ public static class DimensionSettingResponse /** * Gets or sets the dimension setting description. + * @return The Description value. */ public String getDescription() { @@ -261,16 +284,18 @@ public String getDescription() /** * Gets or sets the dimension setting description. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String id; /** * Gets or sets the dimension setting id. + * @return The Id value. */ public String getId() { @@ -279,10 +304,11 @@ public String getId() /** * Gets or sets the dimension setting id. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private boolean isDefault; @@ -290,6 +316,7 @@ public void setId(String id) /** * Gets or sets a value indicating whether the dimension setting is the * default setting. + * @return The IsDefault value. */ public boolean isDefault() { @@ -299,16 +326,18 @@ public boolean isDefault() /** * Gets or sets a value indicating whether the dimension setting is the * default setting. + * @param isDefaultValue The IsDefault value. */ - public void setIsDefault(boolean isDefault) + public void setIsDefault(final boolean isDefaultValue) { - this.isDefault = isDefault; + this.isDefault = isDefaultValue; } private String name; /** * Gets or sets the name of the dimension setting. + * @return The Name value. */ public String getName() { @@ -317,16 +346,18 @@ public String getName() /** * Gets or sets the name of the dimension setting. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private byte ordinal; /** * Gets or sets the dimension setting ordinal position. + * @return The Ordinal value. */ public byte getOrdinal() { @@ -335,16 +366,18 @@ public byte getOrdinal() /** * Gets or sets the dimension setting ordinal position. + * @param ordinalValue The Ordinal value. */ - public void setOrdinal(byte ordinal) + public void setOrdinal(final byte ordinalValue) { - this.ordinal = ordinal; + this.ordinal = ordinalValue; } private String parentLink; /** * Gets or sets the ParentLink of the dimension setting. + * @return The ParentLink value. */ public String getParentLink() { @@ -353,16 +386,18 @@ public String getParentLink() /** * Gets or sets the ParentLink of the dimension setting. + * @param parentLinkValue The ParentLink value. */ - public void setParentLink(String parentLink) + public void setParentLink(final String parentLinkValue) { - this.parentLink = parentLink; + this.parentLink = parentLinkValue; } private String selfLink; /** * Gets or sets the SelfLink of the dimension setting. + * @return The SelfLink value. */ public String getSelfLink() { @@ -371,16 +406,18 @@ public String getSelfLink() /** * Gets or sets the SelfLink of the dimension setting. + * @param selfLinkValue The SelfLink value. */ - public void setSelfLink(String selfLink) + public void setSelfLink(final String selfLinkValue) { - this.selfLink = selfLink; + this.selfLink = selfLinkValue; } private String state; /** * Gets or sets the state of the dimension setting. + * @return The State value. */ public String getState() { @@ -389,16 +426,18 @@ public String getState() /** * Gets or sets the state of the dimension setting. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private String type; /** * Gets or sets the type of resource. + * @return The Type value. */ public String getType() { @@ -407,10 +446,11 @@ public String getType() /** * Gets or sets the type of resource. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } } diff --git a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServiceObjectiveListResponse.java b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServiceObjectiveListResponse.java index 08b3c911757fb..52dfd24858313 100644 --- a/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServiceObjectiveListResponse.java +++ b/management-sql/src/main/java/com/microsoft/windowsazure/management/sql/models/ServiceObjectiveListResponse.java @@ -36,6 +36,7 @@ public class ServiceObjectiveListResponse extends OperationResponse implements I /** * Gets or sets the list of Service Objectives that are existing in a server. + * @return The ServiceObjectives value. */ public ArrayList getServiceObjectives() { @@ -44,10 +45,11 @@ public ArrayList getServiceObject /** * Gets or sets the list of Service Objectives that are existing in a server. + * @param serviceObjectivesValue The ServiceObjectives value. */ - public void setServiceObjectives(ArrayList serviceObjectives) + public void setServiceObjectives(final ArrayList serviceObjectivesValue) { - this.serviceObjectives = serviceObjectives; + this.serviceObjectives = serviceObjectivesValue; } /** @@ -78,6 +80,7 @@ public static class ServiceObjective /** * Gets or sets the service objective description. + * @return The Description value. */ public String getDescription() { @@ -86,16 +89,18 @@ public String getDescription() /** * Gets or sets the service objective description. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private ArrayList dimensionSettings; /** * Gets or sets the service objective dimension settings. + * @return The DimensionSettings value. */ public ArrayList getDimensionSettings() { @@ -104,10 +109,11 @@ public ArrayList dimensionSettings) + public void setDimensionSettings(final ArrayList dimensionSettingsValue) { - this.dimensionSettings = dimensionSettings; + this.dimensionSettings = dimensionSettingsValue; } private boolean enabled; @@ -115,6 +121,7 @@ public void setDimensionSettings(ArrayList 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -355,6 +377,14 @@ public CheckNameAvailabilityResponse call() throws Exception * * @param serviceName The desired storage account name to check for * availability. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The response to a storage account check name availability request. */ @Override @@ -388,78 +418,88 @@ public CheckNameAvailabilityResponse checkNameAvailability(String serviceName) t // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - CheckNameAvailabilityResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new CheckNameAvailabilityResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("AvailabilityResponse"); - Element availabilityResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (availabilityResponseElement != null) - { - NodeList elements2 = availabilityResponseElement.getElementsByTagName("Result"); - Element resultElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (resultElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - boolean resultInstance; - resultInstance = Boolean.parseBoolean(resultElement.getTextContent()); - result.setIsAvailable(resultInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements3 = availabilityResponseElement.getElementsByTagName("Reason"); - Element reasonElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (reasonElement != null) + // Create Result + CheckNameAvailabilityResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new CheckNameAvailabilityResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("AvailabilityResponse"); + Element availabilityResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (availabilityResponseElement != null) { - boolean isNil = false; - String nilAttribute = reasonElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) + NodeList elements2 = availabilityResponseElement.getElementsByTagName("Result"); + Element resultElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (resultElement != null) { - isNil = nilAttribute == "true"; + boolean resultInstance; + resultInstance = Boolean.parseBoolean(resultElement.getTextContent()); + result.setIsAvailable(resultInstance); } - if (isNil == false) + + NodeList elements3 = availabilityResponseElement.getElementsByTagName("Reason"); + Element reasonElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (reasonElement != null) { - String reasonInstance; - reasonInstance = reasonElement.getTextContent(); - result.setReason(reasonInstance); + boolean isNil = false; + Attr nilAttribute = reasonElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + String reasonInstance; + reasonInstance = reasonElement.getTextContent(); + result.setReason(reasonInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -500,6 +540,18 @@ public StorageOperationStatusResponse call() throws Exception * * @param parameters Parameters supplied to the Create Storage Account * operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -609,6 +661,10 @@ public OperationResponse call() throws Exception * more information) * * @param serviceName The name of the storage account. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -643,40 +699,50 @@ public OperationResponse delete(String serviceName) throws IOException, ServiceE // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -707,6 +773,18 @@ public StorageServiceGetResponse call() throws Exception * more information) * * @param serviceName Name of the storage account to get. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Storage Account Properties operation response. */ @Override @@ -740,501 +818,82 @@ public StorageServiceGetResponse get(String serviceName) throws IOException, Ser // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - StorageServiceGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new StorageServiceGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("StorageService"); - Element storageServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (storageServiceElement != null) - { - NodeList elements2 = storageServiceElement.getElementsByTagName("Url"); - Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (urlElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - URI urlInstance; - urlInstance = new URI(urlElement.getTextContent()); - result.setUri(urlInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = storageServiceElement.getElementsByTagName("ServiceName"); - Element serviceNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (serviceNameElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String serviceNameInstance; - serviceNameInstance = serviceNameElement.getTextContent(); - result.setServiceName(serviceNameInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = storageServiceElement.getElementsByTagName("StorageServiceProperties"); - Element storageServicePropertiesElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (storageServicePropertiesElement != null) + // Create Result + StorageServiceGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new StorageServiceGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("StorageService"); + Element storageServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (storageServiceElement != null) { - StorageServiceProperties storageServicePropertiesInstance = new StorageServiceProperties(); - result.setProperties(storageServicePropertiesInstance); - - NodeList elements5 = storageServicePropertiesElement.getElementsByTagName("Description"); - Element descriptionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (descriptionElement != null) - { - boolean isNil = false; - String nilAttribute = descriptionElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) - { - isNil = nilAttribute == "true"; - } - if (isNil == false) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - storageServicePropertiesInstance.setDescription(descriptionInstance); - } - } - - NodeList elements6 = storageServicePropertiesElement.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - storageServicePropertiesInstance.setAffinityGroup(affinityGroupInstance); - } - - NodeList elements7 = storageServicePropertiesElement.getElementsByTagName("Location"); - Element locationElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (locationElement != null) - { - String locationInstance; - locationInstance = locationElement.getTextContent(); - storageServicePropertiesInstance.setLocation(locationInstance); - } - - NodeList elements8 = storageServicePropertiesElement.getElementsByTagName("Label"); - Element labelElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (labelElement != null) + NodeList elements2 = storageServiceElement.getElementsByTagName("Url"); + Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (urlElement != null) { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - storageServicePropertiesInstance.setLabel(labelInstance); + URI urlInstance; + urlInstance = new URI(urlElement.getTextContent()); + result.setUri(urlInstance); } - NodeList elements9 = storageServicePropertiesElement.getElementsByTagName("Status"); - Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (statusElement != null) + NodeList elements3 = storageServiceElement.getElementsByTagName("ServiceName"); + Element serviceNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (serviceNameElement != null) { - StorageServiceStatus statusInstance; - statusInstance = StorageServiceStatus.valueOf(statusElement.getTextContent()); - storageServicePropertiesInstance.setStatus(statusInstance); + String serviceNameInstance; + serviceNameInstance = serviceNameElement.getTextContent(); + result.setServiceName(serviceNameInstance); } - NodeList elements10 = storageServicePropertiesElement.getElementsByTagName("Endpoints"); - Element endpointsSequenceElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (endpointsSequenceElement != null) + NodeList elements4 = storageServiceElement.getElementsByTagName("StorageServiceProperties"); + Element storageServicePropertiesElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (storageServicePropertiesElement != null) { - for (int i1 = 0; i1 < endpointsSequenceElement.getElementsByTagName("Endpoint").getLength(); i1 = i1 + 1) + StorageServiceProperties storageServicePropertiesInstance = new StorageServiceProperties(); + result.setProperties(storageServicePropertiesInstance); + + NodeList elements5 = storageServicePropertiesElement.getElementsByTagName("Description"); + Element descriptionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (descriptionElement != null) { - org.w3c.dom.Element endpointsElement = ((org.w3c.dom.Element) endpointsSequenceElement.getElementsByTagName("Endpoint").item(i1)); - storageServicePropertiesInstance.getEndpoints().add(new URI(endpointsElement.getTextContent())); - } - } - - NodeList elements11 = storageServicePropertiesElement.getElementsByTagName("GeoReplicationEnabled"); - Element geoReplicationEnabledElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (geoReplicationEnabledElement != null) - { - boolean geoReplicationEnabledInstance; - geoReplicationEnabledInstance = Boolean.parseBoolean(geoReplicationEnabledElement.getTextContent()); - storageServicePropertiesInstance.setGeoReplicationEnabled(geoReplicationEnabledInstance); - } - - NodeList elements12 = storageServicePropertiesElement.getElementsByTagName("GeoPrimaryRegion"); - Element geoPrimaryRegionElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (geoPrimaryRegionElement != null) - { - String geoPrimaryRegionInstance; - geoPrimaryRegionInstance = geoPrimaryRegionElement.getTextContent(); - storageServicePropertiesInstance.setGeoPrimaryRegion(geoPrimaryRegionInstance); - } - - NodeList elements13 = storageServicePropertiesElement.getElementsByTagName("StatusOfPrimary"); - Element statusOfPrimaryElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (statusOfPrimaryElement != null && (statusOfPrimaryElement.getTextContent() != null && statusOfPrimaryElement.getTextContent().isEmpty() != true) == false) - { - GeoRegionStatus statusOfPrimaryInstance; - statusOfPrimaryInstance = GeoRegionStatus.valueOf(statusOfPrimaryElement.getTextContent()); - storageServicePropertiesInstance.setStatusOfGeoPrimaryRegion(statusOfPrimaryInstance); - } - - NodeList elements14 = storageServicePropertiesElement.getElementsByTagName("LastGeoFailoverTime"); - Element lastGeoFailoverTimeElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (lastGeoFailoverTimeElement != null && (lastGeoFailoverTimeElement.getTextContent() != null && lastGeoFailoverTimeElement.getTextContent().isEmpty() != true) == false) - { - Calendar lastGeoFailoverTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(lastGeoFailoverTimeElement.getTextContent())); - lastGeoFailoverTimeInstance = calendar; - storageServicePropertiesInstance.setLastGeoFailoverTime(lastGeoFailoverTimeInstance); - } - - NodeList elements15 = storageServicePropertiesElement.getElementsByTagName("GeoSecondaryRegion"); - Element geoSecondaryRegionElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (geoSecondaryRegionElement != null) - { - String geoSecondaryRegionInstance; - geoSecondaryRegionInstance = geoSecondaryRegionElement.getTextContent(); - storageServicePropertiesInstance.setGeoSecondaryRegion(geoSecondaryRegionInstance); - } - - NodeList elements16 = storageServicePropertiesElement.getElementsByTagName("StatusOfSecondary"); - Element statusOfSecondaryElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (statusOfSecondaryElement != null && (statusOfSecondaryElement.getTextContent() != null && statusOfSecondaryElement.getTextContent().isEmpty() != true) == false) - { - GeoRegionStatus statusOfSecondaryInstance; - statusOfSecondaryInstance = GeoRegionStatus.valueOf(statusOfSecondaryElement.getTextContent()); - storageServicePropertiesInstance.setStatusOfGeoSecondaryRegion(statusOfSecondaryInstance); - } - } - - NodeList elements17 = storageServiceElement.getElementsByTagName("ExtendedProperties"); - Element extendedPropertiesSequenceElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (extendedPropertiesSequenceElement != null) - { - for (int i2 = 0; i2 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i2 = i2 + 1) - { - org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i2)); - NodeList elements18 = extendedPropertiesElement.getElementsByTagName("Name"); - String extendedPropertiesKey = elements18.getLength() > 0 ? ((org.w3c.dom.Element) elements18.item(0)).getTextContent() : null; - NodeList elements19 = extendedPropertiesElement.getElementsByTagName("Value"); - String extendedPropertiesValue = elements19.getLength() > 0 ? ((org.w3c.dom.Element) elements19.item(0)).getTextContent() : null; - result.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); - } - } - - NodeList elements20 = storageServiceElement.getElementsByTagName("Capabilities"); - Element capabilitiesSequenceElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (capabilitiesSequenceElement != null) - { - for (int i3 = 0; i3 < capabilitiesSequenceElement.getElementsByTagName("Capability").getLength(); i3 = i3 + 1) - { - org.w3c.dom.Element capabilitiesElement = ((org.w3c.dom.Element) capabilitiesSequenceElement.getElementsByTagName("Capability").item(i3)); - result.getCapabilities().add(capabilitiesElement.getTextContent()); - } - } - } - - 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); - } - return result; - } - - /** - * The Get Storage Keys operation returns the primary and secondary access - * keys for the specified storage account. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/ee460785.aspx for - * more information) - * - * @param serviceName The name of the desired storage account. - * @return The primary and secondary access keys for a storage account. - */ - @Override - public Future getKeysAsync(final String serviceName) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public StorageAccountGetKeysResponse call() throws Exception - { - return getKeys(serviceName); - } - }); - } - - /** - * The Get Storage Keys operation returns the primary and secondary access - * keys for the specified storage account. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/ee460785.aspx for - * more information) - * - * @param serviceName The name of the desired storage account. - * @return The primary and secondary access keys for a storage account. - */ - @Override - public StorageAccountGetKeysResponse getKeys(String serviceName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException - { - // Validate - if (serviceName == null) - { - throw new NullPointerException("serviceName"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("serviceName", serviceName); - CloudTracing.enter(invocationId, this, "getKeysAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/storageservices/" + serviceName + "/keys"; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2013-03-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); - if (shouldTrace) - { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - StorageAccountGetKeysResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new StorageAccountGetKeysResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("StorageService"); - Element storageServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (storageServiceElement != null) - { - NodeList elements2 = storageServiceElement.getElementsByTagName("Url"); - Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (urlElement != null) - { - URI urlInstance; - urlInstance = new URI(urlElement.getTextContent()); - result.setUri(urlInstance); - } - - NodeList elements3 = storageServiceElement.getElementsByTagName("StorageServiceKeys"); - Element storageServiceKeysElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (storageServiceKeysElement != null) - { - NodeList elements4 = storageServiceKeysElement.getElementsByTagName("Primary"); - Element primaryElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (primaryElement != null) - { - String primaryInstance; - primaryInstance = primaryElement.getTextContent(); - result.setPrimaryKey(primaryInstance); - } - - NodeList elements5 = storageServiceKeysElement.getElementsByTagName("Secondary"); - Element secondaryElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (secondaryElement != null) - { - String secondaryInstance; - secondaryInstance = secondaryElement.getTextContent(); - result.setSecondaryKey(secondaryInstance); - } - } - } - - 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); - } - return result; - } - - /** - * The List Storage Accounts operation lists the storage accounts available - * under the current subscription. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/ee460787.aspx for - * more information) - * - * @return The List Storage Accounts operation response. - */ - @Override - public Future listAsync() - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public StorageServiceListResponse call() throws Exception - { - return list(); - } - }); - } - - /** - * The List Storage Accounts operation lists the storage accounts available - * under the current subscription. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/ee460787.aspx for - * more information) - * - * @return The List Storage Accounts operation response. - */ - @Override - public StorageServiceListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException - { - // Validate - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/storageservices"; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2013-03-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); - if (shouldTrace) - { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - StorageServiceListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new StorageServiceListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("StorageServices"); - Element storageServicesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (storageServicesSequenceElement != null) - { - for (int i1 = 0; i1 < storageServicesSequenceElement.getElementsByTagName("StorageService").getLength(); i1 = i1 + 1) - { - org.w3c.dom.Element storageServicesElement = ((org.w3c.dom.Element) storageServicesSequenceElement.getElementsByTagName("StorageService").item(i1)); - StorageServiceListResponse.StorageService storageServiceInstance = new StorageServiceListResponse.StorageService(); - result.getStorageServices().add(storageServiceInstance); - - NodeList elements2 = storageServicesElement.getElementsByTagName("Url"); - Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (urlElement != null) - { - URI urlInstance; - urlInstance = new URI(urlElement.getTextContent()); - storageServiceInstance.setUri(urlInstance); - } - - NodeList elements3 = storageServicesElement.getElementsByTagName("ServiceName"); - Element serviceNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (serviceNameElement != null) - { - String serviceNameInstance; - serviceNameInstance = serviceNameElement.getTextContent(); - storageServiceInstance.setServiceName(serviceNameInstance); - } - - NodeList elements4 = storageServicesElement.getElementsByTagName("StorageServiceProperties"); - Element storageServicePropertiesElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (storageServicePropertiesElement != null) - { - StorageServiceProperties storageServicePropertiesInstance = new StorageServiceProperties(); - storageServiceInstance.setProperties(storageServicePropertiesInstance); - - NodeList elements5 = storageServicePropertiesElement.getElementsByTagName("Description"); - Element descriptionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (descriptionElement != null) - { - boolean isNil = false; - String nilAttribute = descriptionElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) - { - isNil = nilAttribute == "true"; - } - if (isNil == false) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - storageServicePropertiesInstance.setDescription(descriptionInstance); - } + boolean isNil = false; + Attr nilAttribute = descriptionElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + storageServicePropertiesInstance.setDescription(descriptionInstance); + } } NodeList elements6 = storageServicePropertiesElement.getElementsByTagName("AffinityGroup"); @@ -1277,9 +936,9 @@ public StorageServiceListResponse list() throws IOException, ServiceException, P Element endpointsSequenceElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; if (endpointsSequenceElement != null) { - for (int i2 = 0; i2 < endpointsSequenceElement.getElementsByTagName("Endpoint").getLength(); i2 = i2 + 1) + for (int i1 = 0; i1 < endpointsSequenceElement.getElementsByTagName("Endpoint").getLength(); i1 = i1 + 1) { - org.w3c.dom.Element endpointsElement = ((org.w3c.dom.Element) endpointsSequenceElement.getElementsByTagName("Endpoint").item(i2)); + org.w3c.dom.Element endpointsElement = ((org.w3c.dom.Element) endpointsSequenceElement.getElementsByTagName("Endpoint").item(i1)); storageServicePropertiesInstance.getEndpoints().add(new URI(endpointsElement.getTextContent())); } } @@ -1342,34 +1001,505 @@ public StorageServiceListResponse list() throws IOException, ServiceException, P } } - NodeList elements17 = storageServicesElement.getElementsByTagName("ExtendedProperties"); + NodeList elements17 = storageServiceElement.getElementsByTagName("ExtendedProperties"); Element extendedPropertiesSequenceElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; if (extendedPropertiesSequenceElement != null) { - for (int i3 = 0; i3 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i3 = i3 + 1) + for (int i2 = 0; i2 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i2 = i2 + 1) { - org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i3)); + org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i2)); NodeList elements18 = extendedPropertiesElement.getElementsByTagName("Name"); String extendedPropertiesKey = elements18.getLength() > 0 ? ((org.w3c.dom.Element) elements18.item(0)).getTextContent() : null; NodeList elements19 = extendedPropertiesElement.getElementsByTagName("Value"); String extendedPropertiesValue = elements19.getLength() > 0 ? ((org.w3c.dom.Element) elements19.item(0)).getTextContent() : null; - storageServiceInstance.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + result.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); } } + + NodeList elements20 = storageServiceElement.getElementsByTagName("Capabilities"); + Element capabilitiesSequenceElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (capabilitiesSequenceElement != null) + { + for (int i3 = 0; i3 < capabilitiesSequenceElement.getElementsByTagName("Capability").getLength(); i3 = i3 + 1) + { + org.w3c.dom.Element capabilitiesElement = ((org.w3c.dom.Element) capabilitiesSequenceElement.getElementsByTagName("Capability").item(i3)); + result.getCapabilities().add(capabilitiesElement.getTextContent()); + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * The Get Storage Keys operation returns the primary and secondary access + * keys for the specified storage account. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/ee460785.aspx for + * more information) + * + * @param serviceName The name of the desired storage account. + * @return The primary and secondary access keys for a storage account. + */ + @Override + public Future getKeysAsync(final String serviceName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public StorageAccountGetKeysResponse call() throws Exception + { + return getKeys(serviceName); } + }); + } + + /** + * The Get Storage Keys operation returns the primary and secondary access + * keys for the specified storage account. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/ee460785.aspx for + * more information) + * + * @param serviceName The name of the desired storage account. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @return The primary and secondary access keys for a storage account. + */ + @Override + public StorageAccountGetKeysResponse getKeys(String serviceName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException + { + // Validate + if (serviceName == null) + { + throw new NullPointerException("serviceName"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("serviceName", serviceName); + CloudTracing.enter(invocationId, this, "getKeysAsync", tracingParameters); } - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/storageservices/" + serviceName + "/keys"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + StorageAccountGetKeysResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new StorageAccountGetKeysResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("StorageService"); + Element storageServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (storageServiceElement != null) + { + NodeList elements2 = storageServiceElement.getElementsByTagName("Url"); + Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (urlElement != null) + { + URI urlInstance; + urlInstance = new URI(urlElement.getTextContent()); + result.setUri(urlInstance); + } + + NodeList elements3 = storageServiceElement.getElementsByTagName("StorageServiceKeys"); + Element storageServiceKeysElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (storageServiceKeysElement != null) + { + NodeList elements4 = storageServiceKeysElement.getElementsByTagName("Primary"); + Element primaryElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (primaryElement != null) + { + String primaryInstance; + primaryInstance = primaryElement.getTextContent(); + result.setPrimaryKey(primaryInstance); + } + + NodeList elements5 = storageServiceKeysElement.getElementsByTagName("Secondary"); + Element secondaryElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (secondaryElement != null) + { + String secondaryInstance; + secondaryInstance = secondaryElement.getTextContent(); + result.setSecondaryKey(secondaryInstance); + } + } + } + + 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); + } + return result; + } + finally { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } + } + + /** + * The List Storage Accounts operation lists the storage accounts available + * under the current subscription. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/ee460787.aspx for + * more information) + * + * @return The List Storage Accounts operation response. + */ + @Override + public Future listAsync() + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public StorageServiceListResponse call() throws Exception + { + return list(); + } + }); + } + + /** + * The List Storage Accounts operation lists the storage accounts available + * under the current subscription. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/ee460787.aspx for + * more information) + * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return The List Storage Accounts operation response. + */ + @Override + public StorageServiceListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException, ParseException + { + // Validate + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; if (shouldTrace) { - CloudTracing.exit(invocationId, result); + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + CloudTracing.enter(invocationId, this, "listAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/storageservices"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-03-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + StorageServiceListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new StorageServiceListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("StorageServices"); + Element storageServicesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (storageServicesSequenceElement != null) + { + for (int i1 = 0; i1 < storageServicesSequenceElement.getElementsByTagName("StorageService").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element storageServicesElement = ((org.w3c.dom.Element) storageServicesSequenceElement.getElementsByTagName("StorageService").item(i1)); + StorageServiceListResponse.StorageService storageServiceInstance = new StorageServiceListResponse.StorageService(); + result.getStorageServices().add(storageServiceInstance); + + NodeList elements2 = storageServicesElement.getElementsByTagName("Url"); + Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (urlElement != null) + { + URI urlInstance; + urlInstance = new URI(urlElement.getTextContent()); + storageServiceInstance.setUri(urlInstance); + } + + NodeList elements3 = storageServicesElement.getElementsByTagName("ServiceName"); + Element serviceNameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (serviceNameElement != null) + { + String serviceNameInstance; + serviceNameInstance = serviceNameElement.getTextContent(); + storageServiceInstance.setServiceName(serviceNameInstance); + } + + NodeList elements4 = storageServicesElement.getElementsByTagName("StorageServiceProperties"); + Element storageServicePropertiesElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (storageServicePropertiesElement != null) + { + StorageServiceProperties storageServicePropertiesInstance = new StorageServiceProperties(); + storageServiceInstance.setProperties(storageServicePropertiesInstance); + + NodeList elements5 = storageServicePropertiesElement.getElementsByTagName("Description"); + Element descriptionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (descriptionElement != null) + { + boolean isNil = false; + Attr nilAttribute = descriptionElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + storageServicePropertiesInstance.setDescription(descriptionInstance); + } + } + + NodeList elements6 = storageServicePropertiesElement.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + storageServicePropertiesInstance.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements7 = storageServicePropertiesElement.getElementsByTagName("Location"); + Element locationElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (locationElement != null) + { + String locationInstance; + locationInstance = locationElement.getTextContent(); + storageServicePropertiesInstance.setLocation(locationInstance); + } + + NodeList elements8 = storageServicePropertiesElement.getElementsByTagName("Label"); + Element labelElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + storageServicePropertiesInstance.setLabel(labelInstance); + } + + NodeList elements9 = storageServicePropertiesElement.getElementsByTagName("Status"); + Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (statusElement != null) + { + StorageServiceStatus statusInstance; + statusInstance = StorageServiceStatus.valueOf(statusElement.getTextContent()); + storageServicePropertiesInstance.setStatus(statusInstance); + } + + NodeList elements10 = storageServicePropertiesElement.getElementsByTagName("Endpoints"); + Element endpointsSequenceElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (endpointsSequenceElement != null) + { + for (int i2 = 0; i2 < endpointsSequenceElement.getElementsByTagName("Endpoint").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element endpointsElement = ((org.w3c.dom.Element) endpointsSequenceElement.getElementsByTagName("Endpoint").item(i2)); + storageServicePropertiesInstance.getEndpoints().add(new URI(endpointsElement.getTextContent())); + } + } + + NodeList elements11 = storageServicePropertiesElement.getElementsByTagName("GeoReplicationEnabled"); + Element geoReplicationEnabledElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (geoReplicationEnabledElement != null) + { + boolean geoReplicationEnabledInstance; + geoReplicationEnabledInstance = Boolean.parseBoolean(geoReplicationEnabledElement.getTextContent()); + storageServicePropertiesInstance.setGeoReplicationEnabled(geoReplicationEnabledInstance); + } + + NodeList elements12 = storageServicePropertiesElement.getElementsByTagName("GeoPrimaryRegion"); + Element geoPrimaryRegionElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (geoPrimaryRegionElement != null) + { + String geoPrimaryRegionInstance; + geoPrimaryRegionInstance = geoPrimaryRegionElement.getTextContent(); + storageServicePropertiesInstance.setGeoPrimaryRegion(geoPrimaryRegionInstance); + } + + NodeList elements13 = storageServicePropertiesElement.getElementsByTagName("StatusOfPrimary"); + Element statusOfPrimaryElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (statusOfPrimaryElement != null && (statusOfPrimaryElement.getTextContent() != null && statusOfPrimaryElement.getTextContent().isEmpty() != true) == false) + { + GeoRegionStatus statusOfPrimaryInstance; + statusOfPrimaryInstance = GeoRegionStatus.valueOf(statusOfPrimaryElement.getTextContent()); + storageServicePropertiesInstance.setStatusOfGeoPrimaryRegion(statusOfPrimaryInstance); + } + + NodeList elements14 = storageServicePropertiesElement.getElementsByTagName("LastGeoFailoverTime"); + Element lastGeoFailoverTimeElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (lastGeoFailoverTimeElement != null && (lastGeoFailoverTimeElement.getTextContent() != null && lastGeoFailoverTimeElement.getTextContent().isEmpty() != true) == false) + { + Calendar lastGeoFailoverTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(lastGeoFailoverTimeElement.getTextContent())); + lastGeoFailoverTimeInstance = calendar; + storageServicePropertiesInstance.setLastGeoFailoverTime(lastGeoFailoverTimeInstance); + } + + NodeList elements15 = storageServicePropertiesElement.getElementsByTagName("GeoSecondaryRegion"); + Element geoSecondaryRegionElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (geoSecondaryRegionElement != null) + { + String geoSecondaryRegionInstance; + geoSecondaryRegionInstance = geoSecondaryRegionElement.getTextContent(); + storageServicePropertiesInstance.setGeoSecondaryRegion(geoSecondaryRegionInstance); + } + + NodeList elements16 = storageServicePropertiesElement.getElementsByTagName("StatusOfSecondary"); + Element statusOfSecondaryElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (statusOfSecondaryElement != null && (statusOfSecondaryElement.getTextContent() != null && statusOfSecondaryElement.getTextContent().isEmpty() != true) == false) + { + GeoRegionStatus statusOfSecondaryInstance; + statusOfSecondaryInstance = GeoRegionStatus.valueOf(statusOfSecondaryElement.getTextContent()); + storageServicePropertiesInstance.setStatusOfGeoSecondaryRegion(statusOfSecondaryInstance); + } + } + + NodeList elements17 = storageServicesElement.getElementsByTagName("ExtendedProperties"); + Element extendedPropertiesSequenceElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (extendedPropertiesSequenceElement != null) + { + for (int i3 = 0; i3 < extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").getLength(); i3 = i3 + 1) + { + org.w3c.dom.Element extendedPropertiesElement = ((org.w3c.dom.Element) extendedPropertiesSequenceElement.getElementsByTagName("ExtendedProperty").item(i3)); + NodeList elements18 = extendedPropertiesElement.getElementsByTagName("Name"); + String extendedPropertiesKey = elements18.getLength() > 0 ? ((org.w3c.dom.Element) elements18.item(0)).getTextContent() : null; + NodeList elements19 = extendedPropertiesElement.getElementsByTagName("Value"); + String extendedPropertiesValue = elements19.getLength() > 0 ? ((org.w3c.dom.Element) elements19.item(0)).getTextContent() : null; + storageServiceInstance.getExtendedProperties().put(extendedPropertiesKey, extendedPropertiesValue); + } + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1400,10 +1530,22 @@ public StorageAccountRegenerateKeysResponse call() throws Exception * more information) * * @param parameters Parameters supplied to the Regenerate Keys operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The primary and secondary access keys for a storage account. */ @Override - public StorageAccountRegenerateKeysResponse regenerateKeys(StorageAccountRegenerateKeysParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, URISyntaxException + public StorageAccountRegenerateKeysResponse regenerateKeys(StorageAccountRegenerateKeysParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, URISyntaxException { // Validate if (parameters == null) @@ -1462,83 +1604,93 @@ public StorageAccountRegenerateKeysResponse regenerateKeys(StorageAccountRegener // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - StorageAccountRegenerateKeysResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new StorageAccountRegenerateKeysResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("StorageService"); - Element storageServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (storageServiceElement != null) - { - NodeList elements2 = storageServiceElement.getElementsByTagName("Url"); - Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (urlElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - URI urlInstance; - urlInstance = new URI(urlElement.getTextContent()); - result.setUri(urlInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements3 = storageServiceElement.getElementsByTagName("StorageServiceKeys"); - Element storageServiceKeysElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (storageServiceKeysElement != null) + // Create Result + StorageAccountRegenerateKeysResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new StorageAccountRegenerateKeysResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("StorageService"); + Element storageServiceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (storageServiceElement != null) { - NodeList elements4 = storageServiceKeysElement.getElementsByTagName("Primary"); - Element primaryElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (primaryElement != null) + NodeList elements2 = storageServiceElement.getElementsByTagName("Url"); + Element urlElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (urlElement != null) { - String primaryInstance; - primaryInstance = primaryElement.getTextContent(); - result.setPrimaryKey(primaryInstance); + URI urlInstance; + urlInstance = new URI(urlElement.getTextContent()); + result.setUri(urlInstance); } - NodeList elements5 = storageServiceKeysElement.getElementsByTagName("Secondary"); - Element secondaryElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (secondaryElement != null) + NodeList elements3 = storageServiceElement.getElementsByTagName("StorageServiceKeys"); + Element storageServiceKeysElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (storageServiceKeysElement != null) { - String secondaryInstance; - secondaryInstance = secondaryElement.getTextContent(); - result.setSecondaryKey(secondaryInstance); + NodeList elements4 = storageServiceKeysElement.getElementsByTagName("Primary"); + Element primaryElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (primaryElement != null) + { + String primaryInstance; + primaryInstance = primaryElement.getTextContent(); + result.setPrimaryKey(primaryInstance); + } + + NodeList elements5 = storageServiceKeysElement.getElementsByTagName("Secondary"); + Element secondaryElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (secondaryElement != null) + { + String secondaryInstance; + secondaryInstance = secondaryElement.getTextContent(); + result.setSecondaryKey(secondaryInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1576,11 +1728,21 @@ public OperationResponse call() throws Exception * @param serviceName Name of the storage account to update. * @param parameters Parameters supplied to the Update Storage Account * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse update(String serviceName, StorageAccountUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse update(String serviceName, StorageAccountUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (serviceName == null) @@ -1652,7 +1814,9 @@ public OperationResponse update(String serviceName, StorageAccountUpdateParamete else { Element emptyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Description"); - String nilAttribute = null; + Attr nilAttribute = requestDoc.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + nilAttribute.setValue("true"); + emptyElement.setAttributeNode(nilAttribute); updateStorageServiceInputElement.appendChild(emptyElement); } @@ -1704,39 +1868,49 @@ public OperationResponse update(String serviceName, StorageAccountUpdateParamete // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/StorageManagementClient.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/StorageManagementClient.java index 6f6a89ad45998..5a35731a88ca0 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/StorageManagementClient.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/StorageManagementClient.java @@ -45,6 +45,7 @@ public interface StorageManagementClient extends FilterableService 0 ? ((Element) elements.item(0)) : null; - if (operationElement != null) - { - NodeList elements2 = operationElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = operationElement.getElementsByTagName("Status"); - Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (statusElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - OperationStatus statusInstance; - statusInstance = OperationStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); - Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (httpStatusCodeElement != null) - { - Integer httpStatusCodeInstance; - httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); - result.setHttpStatusCode(httpStatusCodeInstance); - } + // Create Result + StorageOperationStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new StorageOperationStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements5 = operationElement.getElementsByTagName("Error"); - Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (errorElement != null) + NodeList elements = responseDoc.getElementsByTagName("Operation"); + Element operationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operationElement != null) { - StorageOperationStatusResponse.ErrorDetails errorInstance = new StorageOperationStatusResponse.ErrorDetails(); - result.setError(errorInstance); + NodeList elements2 = operationElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setId(idInstance); + } - NodeList elements6 = errorElement.getElementsByTagName("Code"); - Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (codeElement != null) + NodeList elements3 = operationElement.getElementsByTagName("Status"); + Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (statusElement != null) { - String codeInstance; - codeInstance = codeElement.getTextContent(); - errorInstance.setCode(codeInstance); + OperationStatus statusInstance; + statusInstance = OperationStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); } - NodeList elements7 = errorElement.getElementsByTagName("Message"); - Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (messageElement != null) + NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); + Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (httpStatusCodeElement != null) { - String messageInstance; - messageInstance = messageElement.getTextContent(); - errorInstance.setMessage(messageInstance); + Integer httpStatusCodeInstance; + httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); + result.setHttpStatusCode(httpStatusCodeInstance); + } + + NodeList elements5 = operationElement.getElementsByTagName("Error"); + Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (errorElement != null) + { + StorageOperationStatusResponse.ErrorDetails errorInstance = new StorageOperationStatusResponse.ErrorDetails(); + result.setError(errorInstance); + + NodeList elements6 = errorElement.getElementsByTagName("Code"); + Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (codeElement != null) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + errorInstance.setCode(codeInstance); + } + + NodeList elements7 = errorElement.getElementsByTagName("Message"); + Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/CheckNameAvailabilityResponse.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/CheckNameAvailabilityResponse.java index f4ecfe408eada..311a08be58343 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/CheckNameAvailabilityResponse.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/CheckNameAvailabilityResponse.java @@ -35,6 +35,7 @@ public class CheckNameAvailabilityResponse extends OperationResponse /** * The result of the availability request. True if the name is available, * false otherwise + * @return The IsAvailable value. */ public boolean isAvailable() { @@ -44,16 +45,18 @@ public boolean isAvailable() /** * The result of the availability request. True if the name is available, * false otherwise + * @param isAvailableValue The IsAvailable value. */ - public void setIsAvailable(boolean isAvailable) + public void setIsAvailable(final boolean isAvailableValue) { - this.isAvailable = isAvailable; + this.isAvailable = isAvailableValue; } private String reason; /** * The reason for unavailability, if the requested name is unavailable + * @return The Reason value. */ public String getReason() { @@ -62,9 +65,10 @@ public String getReason() /** * The reason for unavailability, if the requested name is unavailable + * @param reasonValue The Reason value. */ - public void setReason(String reason) + public void setReason(final String reasonValue) { - this.reason = reason; + this.reason = reasonValue; } } diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountCreateParameters.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountCreateParameters.java index 48f952bb1a9fc..5e318c7d2f529 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountCreateParameters.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountCreateParameters.java @@ -37,6 +37,7 @@ public class StorageAccountCreateParameters * group in the specified subscription. You can include either a Location * or AffinityGroup element in the request body, but not both. To list * available affinity groups, use the List Affinity Groups operation. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -48,10 +49,11 @@ public String getAffinityGroup() * group in the specified subscription. You can include either a Location * or AffinityGroup element in the request body, but not both. To list * available affinity groups, use the List Affinity Groups operation. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private String description; @@ -59,6 +61,7 @@ public void setAffinityGroup(String affinityGroup) /** * Optional. A description for the storage account. The description may be * up to 1024 characters in length. + * @return The Description value. */ public String getDescription() { @@ -68,10 +71,11 @@ public String getDescription() /** * Optional. A description for the storage account. The description may be * up to 1024 characters in length. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private HashMap extendedProperties; @@ -87,6 +91,7 @@ public void setDescription(String description) * to that of another extended property owned by the same storage account, * will result in a status code 400 (Bad Request) error. Each extended * property value has a maximum length of 255 characters. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -104,10 +109,11 @@ public HashMap getExtendedProperties() * to that of another extended property owned by the same storage account, * will result in a status code 400 (Bad Request) error. Each extended * property value has a maximum length of 255 characters. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private boolean geoReplicationEnabled; @@ -118,6 +124,7 @@ public void setExtendedProperties(HashMap extendedProperties) * body, the default value is true. If set to true, the data in the storage * account is replicated across more than one geographic location so as to * enable resilience in the face of catastrophic service loss. + * @return The GeoReplicationEnabled value. */ public boolean isGeoReplicationEnabled() { @@ -130,10 +137,11 @@ public boolean isGeoReplicationEnabled() * body, the default value is true. If set to true, the data in the storage * account is replicated across more than one geographic location so as to * enable resilience in the face of catastrophic service loss. + * @param geoReplicationEnabledValue The GeoReplicationEnabled value. */ - public void setGeoReplicationEnabled(boolean geoReplicationEnabled) + public void setGeoReplicationEnabled(final boolean geoReplicationEnabledValue) { - this.geoReplicationEnabled = geoReplicationEnabled; + this.geoReplicationEnabled = geoReplicationEnabledValue; } private String label; @@ -142,6 +150,7 @@ public void setGeoReplicationEnabled(boolean geoReplicationEnabled) * Required. A name for the storage account specified as abase64-encoded * string. The name may be up to 100 characters inlength. The name can be * used identify the storage account for yourtracking purposes. + * @return The Label value. */ public String getLabel() { @@ -159,10 +168,11 @@ public String getLabel() * Required. A name for the storage account specified as abase64-encoded * string. The name may be up to 100 characters inlength. The name can be * used identify the storage account for yourtracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String location; @@ -172,6 +182,7 @@ public void setLabel(String label) * storage account is created. You can include either a Location or * AffinityGroup element in the request body, but not both. To list * available locations, use the List Locations operation. + * @return The Location value. */ public String getLocation() { @@ -183,10 +194,11 @@ public String getLocation() * storage account is created. You can include either a Location or * AffinityGroup element in the request body, but not both. To list * available locations, use the List Locations operation. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private String serviceName; @@ -198,6 +210,7 @@ public void setLocation(String location) * DNS prefix name and can be used to access blobs, queues, and tables in * the storage account. For example: * http://ServiceName.blob.core.windows.net/mycontainer/ + * @return The ServiceName value. */ public String getServiceName() { @@ -211,10 +224,11 @@ public String getServiceName() * DNS prefix name and can be used to access blobs, queues, and tables in * the storage account. For example: * http://ServiceName.blob.core.windows.net/mycontainer/ + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } /** diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountGetKeysResponse.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountGetKeysResponse.java index b06f181ef8212..0a1347036c595 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountGetKeysResponse.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountGetKeysResponse.java @@ -35,6 +35,7 @@ public class StorageAccountGetKeysResponse extends OperationResponse /** * The primary access key for the storage account. + * @return The PrimaryKey value. */ public String getPrimaryKey() { @@ -43,16 +44,18 @@ public String getPrimaryKey() /** * The primary access key for the storage account. + * @param primaryKeyValue The PrimaryKey value. */ - public void setPrimaryKey(String primaryKey) + public void setPrimaryKey(final String primaryKeyValue) { - this.primaryKey = primaryKey; + this.primaryKey = primaryKeyValue; } private String secondaryKey; /** * The secondary access key for the storage account. + * @return The SecondaryKey value. */ public String getSecondaryKey() { @@ -61,10 +64,11 @@ public String getSecondaryKey() /** * The secondary access key for the storage account. + * @param secondaryKeyValue The SecondaryKey value. */ - public void setSecondaryKey(String secondaryKey) + public void setSecondaryKey(final String secondaryKeyValue) { - this.secondaryKey = secondaryKey; + this.secondaryKey = secondaryKeyValue; } private URI uri; @@ -72,6 +76,7 @@ public void setSecondaryKey(String secondaryKey) /** * The Service Management API request URI used to perform Get Storage * Account Properties requests against the storage account. + * @return The Uri value. */ public URI getUri() { @@ -81,9 +86,10 @@ public URI getUri() /** * The Service Management API request URI used to perform Get Storage * Account Properties requests against the storage account. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } } diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountRegenerateKeysParameters.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountRegenerateKeysParameters.java index 909bf2497417c..5ff73ea55d93f 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountRegenerateKeysParameters.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountRegenerateKeysParameters.java @@ -32,6 +32,7 @@ public class StorageAccountRegenerateKeysParameters /** * Specifies which key to regenerate. + * @return The KeyType value. */ public StorageKeyType getKeyType() { @@ -40,16 +41,18 @@ public StorageKeyType getKeyType() /** * Specifies which key to regenerate. + * @param keyTypeValue The KeyType value. */ - public void setKeyType(StorageKeyType keyType) + public void setKeyType(final StorageKeyType keyTypeValue) { - this.keyType = keyType; + this.keyType = keyTypeValue; } private String serviceName; /** * The name of the desired storage account. + * @return The ServiceName value. */ public String getServiceName() { @@ -58,9 +61,10 @@ public String getServiceName() /** * The name of the desired storage account. + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } } diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountRegenerateKeysResponse.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountRegenerateKeysResponse.java index d34d53136a2d2..7ccdea8ba6b7d 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountRegenerateKeysResponse.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountRegenerateKeysResponse.java @@ -35,6 +35,7 @@ public class StorageAccountRegenerateKeysResponse extends OperationResponse /** * The primary access key for the storage account. + * @return The PrimaryKey value. */ public String getPrimaryKey() { @@ -43,16 +44,18 @@ public String getPrimaryKey() /** * The primary access key for the storage account. + * @param primaryKeyValue The PrimaryKey value. */ - public void setPrimaryKey(String primaryKey) + public void setPrimaryKey(final String primaryKeyValue) { - this.primaryKey = primaryKey; + this.primaryKey = primaryKeyValue; } private String secondaryKey; /** * The secondary access key for the storage account. + * @return The SecondaryKey value. */ public String getSecondaryKey() { @@ -61,10 +64,11 @@ public String getSecondaryKey() /** * The secondary access key for the storage account. + * @param secondaryKeyValue The SecondaryKey value. */ - public void setSecondaryKey(String secondaryKey) + public void setSecondaryKey(final String secondaryKeyValue) { - this.secondaryKey = secondaryKey; + this.secondaryKey = secondaryKeyValue; } private URI uri; @@ -72,6 +76,7 @@ public void setSecondaryKey(String secondaryKey) /** * The Service Management API request URI used to perform Get Storage * Account Properties requests against the storage account. + * @return The Uri value. */ public URI getUri() { @@ -81,9 +86,10 @@ public URI getUri() /** * The Service Management API request URI used to perform Get Storage * Account Properties requests against the storage account. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } } diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountUpdateParameters.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountUpdateParameters.java index 6833a6d544df7..4d871207f7a2b 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountUpdateParameters.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageAccountUpdateParameters.java @@ -32,14 +32,20 @@ public class StorageAccountUpdateParameters { private String description; + /** + * @return The Description value. + */ public String getDescription() { return this.description; } - public void setDescription(String description) + /** + * @param descriptionValue The Description value. + */ + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private HashMap extendedProperties; @@ -56,6 +62,7 @@ public void setDescription(String description) * will result in a status code 400 (Bad Request) error. Each extended * property value has a maximum length of 255 characters. You can delete * an extended property by setting the value to NULL. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -74,10 +81,11 @@ public HashMap getExtendedProperties() * will result in a status code 400 (Bad Request) error. Each extended * property value has a maximum length of 255 characters. You can delete * an extended property by setting the value to NULL. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private Boolean geoReplicationEnabled; @@ -97,6 +105,7 @@ public void setExtendedProperties(HashMap extendedProperties) * the secondary data center. After the existing copy of the data is * replicated to the secondary data center, updates are geo-replicated at * no additional charge. + * @return The GeoReplicationEnabled value. */ public Boolean isGeoReplicationEnabled() { @@ -118,10 +127,11 @@ public Boolean isGeoReplicationEnabled() * the secondary data center. After the existing copy of the data is * replicated to the secondary data center, updates are geo-replicated at * no additional charge. + * @param geoReplicationEnabledValue The GeoReplicationEnabled value. */ - public void setGeoReplicationEnabled(Boolean geoReplicationEnabled) + public void setGeoReplicationEnabled(final Boolean geoReplicationEnabledValue) { - this.geoReplicationEnabled = geoReplicationEnabled; + this.geoReplicationEnabled = geoReplicationEnabledValue; } private String label; @@ -130,6 +140,7 @@ public void setGeoReplicationEnabled(Boolean geoReplicationEnabled) * Optional. A name for the storage account that is base64-encoded. The * label may be up to 100 characters in length. The name can be used * identify the storage account for your tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -140,10 +151,11 @@ public String getLabel() * Optional. A name for the storage account that is base64-encoded. The * label may be up to 100 characters in length. The name can be used * identify the storage account for your tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } /** diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageOperationStatusResponse.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageOperationStatusResponse.java index b9bebed1bdf9c..e31896266af9e 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageOperationStatusResponse.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageOperationStatusResponse.java @@ -43,6 +43,7 @@ public class StorageOperationStatusResponse extends OperationResponse * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @return The Error value. */ public StorageOperationStatusResponse.ErrorDetails getError() { @@ -53,16 +54,18 @@ public StorageOperationStatusResponse.ErrorDetails getError() * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @param errorValue The Error value. */ - public void setError(StorageOperationStatusResponse.ErrorDetails error) + public void setError(final StorageOperationStatusResponse.ErrorDetails errorValue) { - this.error = error; + this.error = errorValue; } private Integer httpStatusCode; /** * The HTTP status code for the asynchronous request. + * @return The HttpStatusCode value. */ public Integer getHttpStatusCode() { @@ -71,10 +74,11 @@ public Integer getHttpStatusCode() /** * The HTTP status code for the asynchronous request. + * @param httpStatusCodeValue The HttpStatusCode value. */ - public void setHttpStatusCode(Integer httpStatusCode) + public void setHttpStatusCode(final Integer httpStatusCodeValue) { - this.httpStatusCode = httpStatusCode; + this.httpStatusCode = httpStatusCodeValue; } private String id; @@ -82,6 +86,7 @@ public void setHttpStatusCode(Integer httpStatusCode) /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @return The Id value. */ public String getId() { @@ -91,16 +96,18 @@ public String getId() /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private OperationStatus status; /** * The status of the asynchronous request. + * @return The Status value. */ public OperationStatus getStatus() { @@ -109,10 +116,11 @@ public OperationStatus getStatus() /** * The status of the asynchronous request. + * @param statusValue The Status value. */ - public void setStatus(OperationStatus status) + public void setStatus(final OperationStatus statusValue) { - this.status = status; + this.status = statusValue; } /** @@ -127,6 +135,7 @@ public static class ErrorDetails /** * The management service error code returned if the asynchronous * request failed. + * @return The Code value. */ public String getCode() { @@ -136,10 +145,11 @@ public String getCode() /** * The management service error code returned if the asynchronous * request failed. + * @param codeValue The Code value. */ - public void setCode(String code) + public void setCode(final String codeValue) { - this.code = code; + this.code = codeValue; } private String message; @@ -147,6 +157,7 @@ public void setCode(String code) /** * The management service error message returned if the asynchronous * request failed. + * @return The Message value. */ public String getMessage() { @@ -156,10 +167,11 @@ public String getMessage() /** * The management service error message returned if the asynchronous * request failed. + * @param messageValue The Message value. */ - public void setMessage(String message) + public void setMessage(final String messageValue) { - this.message = message; + this.message = messageValue; } } } diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceGetResponse.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceGetResponse.java index 3c82b6456e85a..8e8cdfca4e1d8 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceGetResponse.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceGetResponse.java @@ -39,6 +39,7 @@ public class StorageServiceGetResponse extends OperationResponse * Indicates if the storage account is able to perform virtual machine * related operations. If so, this element returns a string containing * PersistentVMRole. Otherwise, this element will not be present. + * @return The Capabilities value. */ public ArrayList getCapabilities() { @@ -49,10 +50,11 @@ public ArrayList getCapabilities() * Indicates if the storage account is able to perform virtual machine * related operations. If so, this element returns a string containing * PersistentVMRole. Otherwise, this element will not be present. + * @param capabilitiesValue The Capabilities value. */ - public void setCapabilities(ArrayList capabilities) + public void setCapabilities(final ArrayList capabilitiesValue) { - this.capabilities = capabilities; + this.capabilities = capabilitiesValue; } private HashMap extendedProperties; @@ -68,6 +70,7 @@ public void setCapabilities(ArrayList capabilities) * to that of another extended property owned by the same storage account, * will result in a status code 400 (Bad Request) error. Each extended * property value has a maximum length of 255 characters. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -85,16 +88,18 @@ public HashMap getExtendedProperties() * to that of another extended property owned by the same storage account, * will result in a status code 400 (Bad Request) error. Each extended * property value has a maximum length of 255 characters. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private StorageServiceProperties properties; /** * Details about the storage account. + * @return The Properties value. */ public StorageServiceProperties getProperties() { @@ -103,10 +108,11 @@ public StorageServiceProperties getProperties() /** * Details about the storage account. + * @param propertiesValue The Properties value. */ - public void setProperties(StorageServiceProperties properties) + public void setProperties(final StorageServiceProperties propertiesValue) { - this.properties = properties; + this.properties = propertiesValue; } private String serviceName; @@ -117,6 +123,7 @@ public void setProperties(StorageServiceProperties properties) * example, if the service name is MyStorageAccount you could access the * blob containers by calling: * http://MyStorageAccount.blob.core.windows.net/mycontainer/ + * @return The ServiceName value. */ public String getServiceName() { @@ -129,10 +136,11 @@ public String getServiceName() * example, if the service name is MyStorageAccount you could access the * blob containers by calling: * http://MyStorageAccount.blob.core.windows.net/mycontainer/ + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } private URI uri; @@ -140,6 +148,7 @@ public void setServiceName(String serviceName) /** * The Service Management API request URI used to perform Get Storage * Account Properties requests against the storage account. + * @return The Uri value. */ public URI getUri() { @@ -149,10 +158,11 @@ public URI getUri() /** * The Service Management API request URI used to perform Get Storage * Account Properties requests against the storage account. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } /** diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceListResponse.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceListResponse.java index d2db1830ccc21..a82941333d053 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceListResponse.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceListResponse.java @@ -36,14 +36,20 @@ public class StorageServiceListResponse extends OperationResponse implements Ite { private ArrayList storageServices; + /** + * @return The StorageServices value. + */ public ArrayList getStorageServices() { return this.storageServices; } - public void setStorageServices(ArrayList storageServices) + /** + * @param storageServicesValue The StorageServices value. + */ + public void setStorageServices(final ArrayList storageServicesValue) { - this.storageServices = storageServices; + this.storageServices = storageServicesValue; } /** @@ -84,6 +90,7 @@ public static class StorageService * property owned by the same storage account, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @return The ExtendedProperties value. */ public HashMap getExtendedProperties() { @@ -102,16 +109,18 @@ public HashMap getExtendedProperties() * property owned by the same storage account, will result in a status * code 400 (Bad Request) error. Each extended property value has a * maximum length of 255 characters. + * @param extendedPropertiesValue The ExtendedProperties value. */ - public void setExtendedProperties(HashMap extendedProperties) + public void setExtendedProperties(final HashMap extendedPropertiesValue) { - this.extendedProperties = extendedProperties; + this.extendedProperties = extendedPropertiesValue; } private StorageServiceProperties properties; /** * Details about the storage account. + * @return The Properties value. */ public StorageServiceProperties getProperties() { @@ -120,10 +129,11 @@ public StorageServiceProperties getProperties() /** * Details about the storage account. + * @param propertiesValue The Properties value. */ - public void setProperties(StorageServiceProperties properties) + public void setProperties(final StorageServiceProperties propertiesValue) { - this.properties = properties; + this.properties = propertiesValue; } private String serviceName; @@ -134,6 +144,7 @@ public void setProperties(StorageServiceProperties properties) * account. For example, if the service name is MyStorageAccount you * could access the blob containers by calling: * http://MyStorageAccount.blob.core.windows.net/mycontainer/ + * @return The ServiceName value. */ public String getServiceName() { @@ -146,10 +157,11 @@ public String getServiceName() * account. For example, if the service name is MyStorageAccount you * could access the blob containers by calling: * http://MyStorageAccount.blob.core.windows.net/mycontainer/ + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } private URI uri; @@ -157,6 +169,7 @@ public void setServiceName(String serviceName) /** * The Service Management API request URI used to perform Get Storage * Account Properties requests against the storage account. + * @return The Uri value. */ public URI getUri() { @@ -166,10 +179,11 @@ public URI getUri() /** * The Service Management API request URI used to perform Get Storage * Account Properties requests against the storage account. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } /** diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceProperties.java b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceProperties.java index 0b21a4b18ad56..fec444c8e614f 100644 --- a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceProperties.java +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/StorageServiceProperties.java @@ -36,6 +36,7 @@ public class StorageServiceProperties /** * The affinity group with which this storage account is associated. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -44,16 +45,18 @@ public String getAffinityGroup() /** * The affinity group with which this storage account is associated. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private String description; /** * The user supplied description of the storage account. + * @return The Description value. */ public String getDescription() { @@ -62,10 +65,11 @@ public String getDescription() /** * The user supplied description of the storage account. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private ArrayList endpoints; @@ -73,6 +77,7 @@ public void setDescription(String description) /** * The URLs that are used to perform a retrieval of a public blob, queue, or * table object. + * @return The Endpoints value. */ public ArrayList getEndpoints() { @@ -82,10 +87,11 @@ public ArrayList getEndpoints() /** * The URLs that are used to perform a retrieval of a public blob, queue, or * table object. + * @param endpointsValue The Endpoints value. */ - public void setEndpoints(ArrayList endpoints) + public void setEndpoints(final ArrayList endpointsValue) { - this.endpoints = endpoints; + this.endpoints = endpointsValue; } private String geoPrimaryRegion; @@ -93,6 +99,7 @@ public void setEndpoints(ArrayList endpoints) /** * Indicates the primary geographical region in which the storage account * exists at this time. + * @return The GeoPrimaryRegion value. */ public String getGeoPrimaryRegion() { @@ -102,10 +109,11 @@ public String getGeoPrimaryRegion() /** * Indicates the primary geographical region in which the storage account * exists at this time. + * @param geoPrimaryRegionValue The GeoPrimaryRegion value. */ - public void setGeoPrimaryRegion(String geoPrimaryRegion) + public void setGeoPrimaryRegion(final String geoPrimaryRegionValue) { - this.geoPrimaryRegion = geoPrimaryRegion; + this.geoPrimaryRegion = geoPrimaryRegionValue; } private boolean geoReplicationEnabled; @@ -115,6 +123,7 @@ public void setGeoPrimaryRegion(String geoPrimaryRegion) * more than one geographic location so as to enable resilience in the face * of catastrophic service loss. The value is true if geo-replication is * enabled; otherwise false. + * @return The GeoReplicationEnabled value. */ public boolean isGeoReplicationEnabled() { @@ -126,10 +135,11 @@ public boolean isGeoReplicationEnabled() * more than one geographic location so as to enable resilience in the face * of catastrophic service loss. The value is true if geo-replication is * enabled; otherwise false. + * @param geoReplicationEnabledValue The GeoReplicationEnabled value. */ - public void setGeoReplicationEnabled(boolean geoReplicationEnabled) + public void setGeoReplicationEnabled(final boolean geoReplicationEnabledValue) { - this.geoReplicationEnabled = geoReplicationEnabled; + this.geoReplicationEnabled = geoReplicationEnabledValue; } private String geoSecondaryRegion; @@ -138,6 +148,7 @@ public void setGeoReplicationEnabled(boolean geoReplicationEnabled) * Indicates the geographical region in which the storage account is being * replicated. The GeoSecondaryRegion element is not returned if * geo-replication is “off” for this account. + * @return The GeoSecondaryRegion value. */ public String getGeoSecondaryRegion() { @@ -148,10 +159,11 @@ public String getGeoSecondaryRegion() * Indicates the geographical region in which the storage account is being * replicated. The GeoSecondaryRegion element is not returned if * geo-replication is “off” for this account. + * @param geoSecondaryRegionValue The GeoSecondaryRegion value. */ - public void setGeoSecondaryRegion(String geoSecondaryRegion) + public void setGeoSecondaryRegion(final String geoSecondaryRegionValue) { - this.geoSecondaryRegion = geoSecondaryRegion; + this.geoSecondaryRegion = geoSecondaryRegionValue; } private String label; @@ -160,6 +172,7 @@ public void setGeoSecondaryRegion(String geoSecondaryRegion) * The user supplied name of the storage account returned as a base-64 * encoded string. This name can be used identify the storage account for * your tracking purposes. + * @return The Label value. */ public String getLabel() { @@ -170,10 +183,11 @@ public String getLabel() * The user supplied name of the storage account returned as a base-64 * encoded string. This name can be used identify the storage account for * your tracking purposes. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private Calendar lastGeoFailoverTime; @@ -185,6 +199,7 @@ public void setLabel(String label) * [4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitMinute]:[2DigitSecond]:[7DigitsOfPrecision]Z. * LastGeoFailoverTime is not returned if there has not been an instance * of a failover. + * @return The LastGeoFailoverTime value. */ public Calendar getLastGeoFailoverTime() { @@ -198,10 +213,11 @@ public Calendar getLastGeoFailoverTime() * [4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitMinute]:[2DigitSecond]:[7DigitsOfPrecision]Z. * LastGeoFailoverTime is not returned if there has not been an instance * of a failover. + * @param lastGeoFailoverTimeValue The LastGeoFailoverTime value. */ - public void setLastGeoFailoverTime(Calendar lastGeoFailoverTime) + public void setLastGeoFailoverTime(final Calendar lastGeoFailoverTimeValue) { - this.lastGeoFailoverTime = lastGeoFailoverTime; + this.lastGeoFailoverTime = lastGeoFailoverTimeValue; } private String location; @@ -210,6 +226,7 @@ public void setLastGeoFailoverTime(Calendar lastGeoFailoverTime) * The geo-location specified when the storage account was created. This * property is only returned if the storage account is not associated with * an affinity group. + * @return The Location value. */ public String getLocation() { @@ -220,16 +237,18 @@ public String getLocation() * The geo-location specified when the storage account was created. This * property is only returned if the storage account is not associated with * an affinity group. + * @param locationValue The Location value. */ - public void setLocation(String location) + public void setLocation(final String locationValue) { - this.location = location; + this.location = locationValue; } private StorageServiceStatus status; /** * The status of the storage account at the time the operation was called. + * @return The Status value. */ public StorageServiceStatus getStatus() { @@ -238,16 +257,18 @@ public StorageServiceStatus getStatus() /** * The status of the storage account at the time the operation was called. + * @param statusValue The Status value. */ - public void setStatus(StorageServiceStatus status) + public void setStatus(final StorageServiceStatus statusValue) { - this.status = status; + this.status = statusValue; } private GeoRegionStatus statusOfGeoPrimaryRegion; /** * Indicates whether the primary storage region is available. + * @return The StatusOfGeoPrimaryRegion value. */ public GeoRegionStatus getStatusOfGeoPrimaryRegion() { @@ -256,16 +277,18 @@ public GeoRegionStatus getStatusOfGeoPrimaryRegion() /** * Indicates whether the primary storage region is available. + * @param statusOfGeoPrimaryRegionValue The StatusOfGeoPrimaryRegion value. */ - public void setStatusOfGeoPrimaryRegion(GeoRegionStatus statusOfGeoPrimaryRegion) + public void setStatusOfGeoPrimaryRegion(final GeoRegionStatus statusOfGeoPrimaryRegionValue) { - this.statusOfGeoPrimaryRegion = statusOfGeoPrimaryRegion; + this.statusOfGeoPrimaryRegion = statusOfGeoPrimaryRegionValue; } private GeoRegionStatus statusOfGeoSecondaryRegion; /** * Indicates whether the secondary storage region is available. + * @return The StatusOfGeoSecondaryRegion value. */ public GeoRegionStatus getStatusOfGeoSecondaryRegion() { @@ -274,10 +297,12 @@ public GeoRegionStatus getStatusOfGeoSecondaryRegion() /** * Indicates whether the secondary storage region is available. + * @param statusOfGeoSecondaryRegionValue The StatusOfGeoSecondaryRegion + * value. */ - public void setStatusOfGeoSecondaryRegion(GeoRegionStatus statusOfGeoSecondaryRegion) + public void setStatusOfGeoSecondaryRegion(final GeoRegionStatus statusOfGeoSecondaryRegionValue) { - this.statusOfGeoSecondaryRegion = statusOfGeoSecondaryRegion; + this.statusOfGeoSecondaryRegion = statusOfGeoSecondaryRegionValue; } /** diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/AddOnOperations.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/AddOnOperations.java index bb7bd753442d3..47efe68d40789 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/AddOnOperations.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/AddOnOperations.java @@ -28,11 +28,9 @@ import com.microsoft.windowsazure.management.store.models.AddOnOperationStatusResponse; import com.microsoft.windowsazure.management.store.models.AddOnUpdateParameters; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -52,6 +50,16 @@ public interface AddOnOperations * @param addOnName The add on name. * @param parameters Parameters used to specify how the Create procedure * will function. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -62,7 +70,7 @@ public interface AddOnOperations * the failed request, and also includes error information regarding the * failure. */ - AddOnOperationStatusResponse beginCreating(String cloudServiceName, String resourceName, String addOnName, AddOnCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + AddOnOperationStatusResponse beginCreating(String cloudServiceName, String resourceName, String addOnName, AddOnCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Create Store Item operation creates Windows Azure Store entries in a @@ -96,6 +104,10 @@ public interface AddOnOperations * resides. * @param resourceProviderType The type of store item to be deleted. * @param resourceProviderName The name of this resource provider. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -140,6 +152,18 @@ public interface AddOnOperations * @param addOnName The add on name. * @param parameters Parameters used to specify how the Create procedure * will function. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -184,6 +208,18 @@ public interface AddOnOperations * resides. * @param resourceProviderType The type of store item to be deleted. * @param resourceProviderName The name of this resource provider. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -228,6 +264,16 @@ public interface AddOnOperations * @param addOnName The addon name. * @param parameters Parameters used to specify how the Create procedure * will function. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -238,7 +284,7 @@ public interface AddOnOperations * the failed request, and also includes error information regarding the * failure. */ - AddOnOperationStatusResponse update(String cloudServiceName, String resourceName, String addOnName, AddOnUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + AddOnOperationStatusResponse update(String cloudServiceName, String resourceName, String addOnName, AddOnUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Update Store Item operation creates Windows Azure Store entries in a diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/AddOnOperationsImpl.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/AddOnOperationsImpl.java index f4976a4052603..a5cc25481e8c5 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/AddOnOperationsImpl.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/AddOnOperationsImpl.java @@ -34,7 +34,6 @@ import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -43,7 +42,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -77,6 +75,7 @@ public class AddOnOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + AddOnOperationStatusResponse result = null; + result = new AddOnOperationStatusResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -303,6 +322,10 @@ public AddOnOperationStatusResponse call() throws Exception * resides. * @param resourceProviderType The type of store item to be deleted. * @param resourceProviderName The name of this resource provider. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -359,40 +382,50 @@ public AddOnOperationStatusResponse beginDeleting(String cloudServiceName, Strin // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - AddOnOperationStatusResponse result = null; - result = new AddOnOperationStatusResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + AddOnOperationStatusResponse result = null; + result = new AddOnOperationStatusResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -437,6 +470,18 @@ public AddOnOperationStatusResponse call() throws Exception * @param addOnName The add on name. * @param parameters Parameters used to specify how the Create procedure * will function. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -562,6 +607,18 @@ public AddOnOperationStatusResponse call() throws Exception * resides. * @param resourceProviderType The type of store item to be deleted. * @param resourceProviderName The name of this resource provider. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -687,6 +744,16 @@ public AddOnOperationStatusResponse call() throws Exception * @param addOnName The addon name. * @param parameters Parameters used to specify how the Create procedure * will function. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -698,7 +765,7 @@ public AddOnOperationStatusResponse call() throws Exception * failure. */ @Override - public AddOnOperationStatusResponse update(String cloudServiceName, String resourceName, String addOnName, AddOnUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public AddOnOperationStatusResponse update(String cloudServiceName, String resourceName, String addOnName, AddOnUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (cloudServiceName == null) @@ -788,39 +855,49 @@ public AddOnOperationStatusResponse update(String cloudServiceName, String resou // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - AddOnOperationStatusResponse result = null; - result = new AddOnOperationStatusResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + AddOnOperationStatusResponse result = null; + result = new AddOnOperationStatusResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/CloudServiceOperations.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/CloudServiceOperations.java index 9f2151dba8aed..874257908f468 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/CloudServiceOperations.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/CloudServiceOperations.java @@ -28,11 +28,9 @@ import com.microsoft.windowsazure.management.store.models.CloudServiceCreateParameters; import com.microsoft.windowsazure.management.store.models.CloudServiceListResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -48,6 +46,16 @@ public interface CloudServiceOperations * * @param parameters Parameters used to specify how the Create procedure * will function. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -58,7 +66,7 @@ public interface CloudServiceOperations * the failed request, and also includes error information regarding the * failure. */ - AddOnOperationStatusResponse beginCreating(CloudServiceCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + AddOnOperationStatusResponse beginCreating(CloudServiceCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Create Cloud Service operation creates a Windows Azure cloud service @@ -84,6 +92,18 @@ public interface CloudServiceOperations * * @param parameters Parameters used to specify how the Create procedure * will function. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -118,6 +138,14 @@ public interface CloudServiceOperations * The List Cloud Services operation enumerates Windows Azure Store entries * that are provisioned for a subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The response structure for the Cloud Service List operation. */ CloudServiceListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException; diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/CloudServiceOperationsImpl.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/CloudServiceOperationsImpl.java index 03fbc20c705f0..98cc1486028ff 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/CloudServiceOperationsImpl.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/CloudServiceOperationsImpl.java @@ -34,7 +34,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -43,7 +42,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -80,6 +78,7 @@ public class CloudServiceOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + AddOnOperationStatusResponse result = null; + result = new AddOnOperationStatusResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -284,6 +303,18 @@ public AddOnOperationStatusResponse call() throws Exception * * @param parameters Parameters used to specify how the Create procedure * will function. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -386,6 +417,14 @@ public CloudServiceListResponse call() throws Exception * The List Cloud Services operation enumerates Windows Azure Store entries * that are provisioned for a subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The response structure for the Cloud Service List operation. */ @Override @@ -414,257 +453,267 @@ public CloudServiceListResponse list() throws IOException, ServiceException, Par // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - CloudServiceListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new CloudServiceListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("CloudServices"); - Element cloudServicesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (cloudServicesSequenceElement != null) - { - for (int i1 = 0; i1 < cloudServicesSequenceElement.getElementsByTagName("CloudService").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element cloudServicesElement = ((org.w3c.dom.Element) cloudServicesSequenceElement.getElementsByTagName("CloudService").item(i1)); - CloudServiceListResponse.CloudService cloudServiceInstance = new CloudServiceListResponse.CloudService(); - result.getCloudServices().add(cloudServiceInstance); - - NodeList elements2 = cloudServicesElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - cloudServiceInstance.setName(nameInstance); - } - - NodeList elements3 = cloudServicesElement.getElementsByTagName("Label"); - Element labelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; - cloudServiceInstance.setLabel(labelInstance); - } - - NodeList elements4 = cloudServicesElement.getElementsByTagName("Description"); - Element descriptionElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - cloudServiceInstance.setDescription(descriptionInstance); - } - - NodeList elements5 = cloudServicesElement.getElementsByTagName("GeoRegion"); - Element geoRegionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (geoRegionElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String geoRegionInstance; - geoRegionInstance = geoRegionElement.getTextContent(); - cloudServiceInstance.setGeoRegion(geoRegionInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements6 = cloudServicesElement.getElementsByTagName("Resources"); - Element resourcesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (resourcesSequenceElement != null) + throw ex; + } + + // Create Result + CloudServiceListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new CloudServiceListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("CloudServices"); + Element cloudServicesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (cloudServicesSequenceElement != null) + { + for (int i1 = 0; i1 < cloudServicesSequenceElement.getElementsByTagName("CloudService").getLength(); i1 = i1 + 1) { - for (int i2 = 0; i2 < resourcesSequenceElement.getElementsByTagName("Resource").getLength(); i2 = i2 + 1) + org.w3c.dom.Element cloudServicesElement = ((org.w3c.dom.Element) cloudServicesSequenceElement.getElementsByTagName("CloudService").item(i1)); + CloudServiceListResponse.CloudService cloudServiceInstance = new CloudServiceListResponse.CloudService(); + result.getCloudServices().add(cloudServiceInstance); + + NodeList elements2 = cloudServicesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) { - org.w3c.dom.Element resourcesElement = ((org.w3c.dom.Element) resourcesSequenceElement.getElementsByTagName("Resource").item(i2)); - CloudServiceListResponse.CloudService.AddOnResource resourceInstance = new CloudServiceListResponse.CloudService.AddOnResource(); - cloudServiceInstance.getResources().add(resourceInstance); - - NodeList elements7 = resourcesElement.getElementsByTagName("ResourceProviderNamespace"); - Element resourceProviderNamespaceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (resourceProviderNamespaceElement != null) - { - String resourceProviderNamespaceInstance; - resourceProviderNamespaceInstance = resourceProviderNamespaceElement.getTextContent(); - resourceInstance.setNamespace(resourceProviderNamespaceInstance); - } - - NodeList elements8 = resourcesElement.getElementsByTagName("Type"); - Element typeElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - resourceInstance.setType(typeInstance); - } - - NodeList elements9 = resourcesElement.getElementsByTagName("Name"); - Element nameElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance2; - nameInstance2 = nameElement2.getTextContent(); - resourceInstance.setName(nameInstance2); - } - - NodeList elements10 = resourcesElement.getElementsByTagName("Plan"); - Element planElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (planElement != null) - { - String planInstance; - planInstance = planElement.getTextContent(); - resourceInstance.setPlan(planInstance); - } - - NodeList elements11 = resourcesElement.getElementsByTagName("SchemaVersion"); - Element schemaVersionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (schemaVersionElement != null) - { - String schemaVersionInstance; - schemaVersionInstance = schemaVersionElement.getTextContent(); - resourceInstance.setSchemaVersion(schemaVersionInstance); - } - - NodeList elements12 = resourcesElement.getElementsByTagName("ETag"); - Element eTagElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (eTagElement != null) - { - String eTagInstance; - eTagInstance = eTagElement.getTextContent(); - resourceInstance.setETag(eTagInstance); - } - - NodeList elements13 = resourcesElement.getElementsByTagName("State"); - Element stateElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - resourceInstance.setState(stateInstance); - } - - NodeList elements14 = resourcesElement.getElementsByTagName("UsageMeters"); - Element usageMetersSequenceElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (usageMetersSequenceElement != null) + String nameInstance; + nameInstance = nameElement.getTextContent(); + cloudServiceInstance.setName(nameInstance); + } + + NodeList elements3 = cloudServicesElement.getElementsByTagName("Label"); + Element labelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent() != null ? new String(Base64.decodeBase64(labelElement.getTextContent().getBytes())) : null; + cloudServiceInstance.setLabel(labelInstance); + } + + NodeList elements4 = cloudServicesElement.getElementsByTagName("Description"); + Element descriptionElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (descriptionElement != null) + { + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + cloudServiceInstance.setDescription(descriptionInstance); + } + + NodeList elements5 = cloudServicesElement.getElementsByTagName("GeoRegion"); + Element geoRegionElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (geoRegionElement != null) + { + String geoRegionInstance; + geoRegionInstance = geoRegionElement.getTextContent(); + cloudServiceInstance.setGeoRegion(geoRegionInstance); + } + + NodeList elements6 = cloudServicesElement.getElementsByTagName("Resources"); + Element resourcesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (resourcesSequenceElement != null) + { + for (int i2 = 0; i2 < resourcesSequenceElement.getElementsByTagName("Resource").getLength(); i2 = i2 + 1) { - for (int i3 = 0; i3 < usageMetersSequenceElement.getElementsByTagName("UsageMeter").getLength(); i3 = i3 + 1) + org.w3c.dom.Element resourcesElement = ((org.w3c.dom.Element) resourcesSequenceElement.getElementsByTagName("Resource").item(i2)); + CloudServiceListResponse.CloudService.AddOnResource resourceInstance = new CloudServiceListResponse.CloudService.AddOnResource(); + cloudServiceInstance.getResources().add(resourceInstance); + + NodeList elements7 = resourcesElement.getElementsByTagName("ResourceProviderNamespace"); + Element resourceProviderNamespaceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (resourceProviderNamespaceElement != null) { - org.w3c.dom.Element usageMetersElement = ((org.w3c.dom.Element) usageMetersSequenceElement.getElementsByTagName("UsageMeter").item(i3)); - CloudServiceListResponse.CloudService.AddOnResource.UsageLimit usageMeterInstance = new CloudServiceListResponse.CloudService.AddOnResource.UsageLimit(); - resourceInstance.getUsageLimits().add(usageMeterInstance); - - NodeList elements15 = usageMetersElement.getElementsByTagName("Name"); - Element nameElement3 = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (nameElement3 != null) + String resourceProviderNamespaceInstance; + resourceProviderNamespaceInstance = resourceProviderNamespaceElement.getTextContent(); + resourceInstance.setNamespace(resourceProviderNamespaceInstance); + } + + NodeList elements8 = resourcesElement.getElementsByTagName("Type"); + Element typeElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + resourceInstance.setType(typeInstance); + } + + NodeList elements9 = resourcesElement.getElementsByTagName("Name"); + Element nameElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + resourceInstance.setName(nameInstance2); + } + + NodeList elements10 = resourcesElement.getElementsByTagName("Plan"); + Element planElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (planElement != null) + { + String planInstance; + planInstance = planElement.getTextContent(); + resourceInstance.setPlan(planInstance); + } + + NodeList elements11 = resourcesElement.getElementsByTagName("SchemaVersion"); + Element schemaVersionElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (schemaVersionElement != null) + { + String schemaVersionInstance; + schemaVersionInstance = schemaVersionElement.getTextContent(); + resourceInstance.setSchemaVersion(schemaVersionInstance); + } + + NodeList elements12 = resourcesElement.getElementsByTagName("ETag"); + Element eTagElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (eTagElement != null) + { + String eTagInstance; + eTagInstance = eTagElement.getTextContent(); + resourceInstance.setETag(eTagInstance); + } + + NodeList elements13 = resourcesElement.getElementsByTagName("State"); + Element stateElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + resourceInstance.setState(stateInstance); + } + + NodeList elements14 = resourcesElement.getElementsByTagName("UsageMeters"); + Element usageMetersSequenceElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (usageMetersSequenceElement != null) + { + for (int i3 = 0; i3 < usageMetersSequenceElement.getElementsByTagName("UsageMeter").getLength(); i3 = i3 + 1) { - String nameInstance3; - nameInstance3 = nameElement3.getTextContent(); - usageMeterInstance.setName(nameInstance3); + org.w3c.dom.Element usageMetersElement = ((org.w3c.dom.Element) usageMetersSequenceElement.getElementsByTagName("UsageMeter").item(i3)); + CloudServiceListResponse.CloudService.AddOnResource.UsageLimit usageMeterInstance = new CloudServiceListResponse.CloudService.AddOnResource.UsageLimit(); + resourceInstance.getUsageLimits().add(usageMeterInstance); + + NodeList elements15 = usageMetersElement.getElementsByTagName("Name"); + Element nameElement3 = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (nameElement3 != null) + { + String nameInstance3; + nameInstance3 = nameElement3.getTextContent(); + usageMeterInstance.setName(nameInstance3); + } + + NodeList elements16 = usageMetersElement.getElementsByTagName("Unit"); + Element unitElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (unitElement != null) + { + String unitInstance; + unitInstance = unitElement.getTextContent(); + usageMeterInstance.setUnit(unitInstance); + } + + NodeList elements17 = usageMetersElement.getElementsByTagName("Included"); + Element includedElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (includedElement != null) + { + long includedInstance; + includedInstance = Long.parseLong(includedElement.getTextContent()); + usageMeterInstance.setAmountIncluded(includedInstance); + } + + NodeList elements18 = usageMetersElement.getElementsByTagName("Used"); + Element usedElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (usedElement != null) + { + long usedInstance; + usedInstance = Long.parseLong(usedElement.getTextContent()); + usageMeterInstance.setAmountUsed(usedInstance); + } } - - NodeList elements16 = usageMetersElement.getElementsByTagName("Unit"); - Element unitElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (unitElement != null) + } + + NodeList elements19 = resourcesElement.getElementsByTagName("OutputItems"); + Element outputItemsSequenceElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (outputItemsSequenceElement != null) + { + for (int i4 = 0; i4 < outputItemsSequenceElement.getElementsByTagName("OutputItem").getLength(); i4 = i4 + 1) { - String unitInstance; - unitInstance = unitElement.getTextContent(); - usageMeterInstance.setUnit(unitInstance); + org.w3c.dom.Element outputItemsElement = ((org.w3c.dom.Element) outputItemsSequenceElement.getElementsByTagName("OutputItem").item(i4)); + NodeList elements20 = outputItemsElement.getElementsByTagName("Key"); + String outputItemsKey = elements20.getLength() > 0 ? ((org.w3c.dom.Element) elements20.item(0)).getTextContent() : null; + NodeList elements21 = outputItemsElement.getElementsByTagName("Value"); + String outputItemsValue = elements21.getLength() > 0 ? ((org.w3c.dom.Element) elements21.item(0)).getTextContent() : null; + resourceInstance.getOutputItems().put(outputItemsKey, outputItemsValue); } + } + + NodeList elements22 = resourcesElement.getElementsByTagName("OperationStatus"); + Element operationStatusElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (operationStatusElement != null) + { + CloudServiceListResponse.CloudService.AddOnResource.OperationStatus operationStatusInstance = new CloudServiceListResponse.CloudService.AddOnResource.OperationStatus(); + resourceInstance.setStatus(operationStatusInstance); - NodeList elements17 = usageMetersElement.getElementsByTagName("Included"); - Element includedElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (includedElement != null) + NodeList elements23 = operationStatusElement.getElementsByTagName("Type"); + Element typeElement2 = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (typeElement2 != null) { - long includedInstance; - includedInstance = Long.parseLong(includedElement.getTextContent()); - usageMeterInstance.setAmountIncluded(includedInstance); + String typeInstance2; + typeInstance2 = typeElement2.getTextContent(); + operationStatusInstance.setType(typeInstance2); } - NodeList elements18 = usageMetersElement.getElementsByTagName("Used"); - Element usedElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (usedElement != null) + NodeList elements24 = operationStatusElement.getElementsByTagName("Result"); + Element resultElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (resultElement != null) { - long usedInstance; - usedInstance = Long.parseLong(usedElement.getTextContent()); - usageMeterInstance.setAmountUsed(usedInstance); + String resultInstance; + resultInstance = resultElement.getTextContent(); + operationStatusInstance.setResult(resultInstance); } } } - - NodeList elements19 = resourcesElement.getElementsByTagName("OutputItems"); - Element outputItemsSequenceElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (outputItemsSequenceElement != null) - { - for (int i4 = 0; i4 < outputItemsSequenceElement.getElementsByTagName("OutputItem").getLength(); i4 = i4 + 1) - { - org.w3c.dom.Element outputItemsElement = ((org.w3c.dom.Element) outputItemsSequenceElement.getElementsByTagName("OutputItem").item(i4)); - NodeList elements20 = outputItemsElement.getElementsByTagName("Key"); - String outputItemsKey = elements20.getLength() > 0 ? ((org.w3c.dom.Element) elements20.item(0)).getTextContent() : null; - NodeList elements21 = outputItemsElement.getElementsByTagName("Value"); - String outputItemsValue = elements21.getLength() > 0 ? ((org.w3c.dom.Element) elements21.item(0)).getTextContent() : null; - resourceInstance.getOutputItems().put(outputItemsKey, outputItemsValue); - } - } - - NodeList elements22 = resourcesElement.getElementsByTagName("OperationStatus"); - Element operationStatusElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (operationStatusElement != null) - { - CloudServiceListResponse.CloudService.AddOnResource.OperationStatus operationStatusInstance = new CloudServiceListResponse.CloudService.AddOnResource.OperationStatus(); - resourceInstance.setStatus(operationStatusInstance); - - NodeList elements23 = operationStatusElement.getElementsByTagName("Type"); - Element typeElement2 = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (typeElement2 != null) - { - String typeInstance2; - typeInstance2 = typeElement2.getTextContent(); - operationStatusInstance.setType(typeInstance2); - } - - NodeList elements24 = operationStatusElement.getElementsByTagName("Result"); - Element resultElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (resultElement != null) - { - String resultInstance; - resultInstance = resultElement.getTextContent(); - operationStatusInstance.setResult(resultInstance); - } - } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/StoreManagementClient.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/StoreManagementClient.java index 34d5afe876ded..bcf3d42eea5e3 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/StoreManagementClient.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/StoreManagementClient.java @@ -41,6 +41,7 @@ public interface StoreManagementClient extends FilterableService 0 ? ((Element) elements.item(0)) : null; - if (operationElement != null) - { - NodeList elements2 = operationElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = operationElement.getElementsByTagName("Status"); - Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (statusElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - OperationStatus statusInstance; - statusInstance = OperationStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); - Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (httpStatusCodeElement != null) - { - Integer httpStatusCodeInstance; - httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); - result.setHttpStatusCode(httpStatusCodeInstance); - } + // Create Result + AddOnOperationStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new AddOnOperationStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements5 = operationElement.getElementsByTagName("Error"); - Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (errorElement != null) + NodeList elements = responseDoc.getElementsByTagName("Operation"); + Element operationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operationElement != null) { - AddOnOperationStatusResponse.ErrorDetails errorInstance = new AddOnOperationStatusResponse.ErrorDetails(); - result.setError(errorInstance); + NodeList elements2 = operationElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setId(idInstance); + } - NodeList elements6 = errorElement.getElementsByTagName("Code"); - Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (codeElement != null) + NodeList elements3 = operationElement.getElementsByTagName("Status"); + Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (statusElement != null) { - String codeInstance; - codeInstance = codeElement.getTextContent(); - errorInstance.setCode(codeInstance); + OperationStatus statusInstance; + statusInstance = OperationStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); } - NodeList elements7 = errorElement.getElementsByTagName("Message"); - Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (messageElement != null) + NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); + Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (httpStatusCodeElement != null) { - String messageInstance; - messageInstance = messageElement.getTextContent(); - errorInstance.setMessage(messageInstance); + Integer httpStatusCodeInstance; + httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); + result.setHttpStatusCode(httpStatusCodeInstance); + } + + NodeList elements5 = operationElement.getElementsByTagName("Error"); + Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (errorElement != null) + { + AddOnOperationStatusResponse.ErrorDetails errorInstance = new AddOnOperationStatusResponse.ErrorDetails(); + result.setError(errorInstance); + + NodeList elements6 = errorElement.getElementsByTagName("Code"); + Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (codeElement != null) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + errorInstance.setCode(codeInstance); + } + + NodeList elements7 = errorElement.getElementsByTagName("Message"); + Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnCreateParameters.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnCreateParameters.java index 7ad3d9bf62d8a..452c07f6e6ba2 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnCreateParameters.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnCreateParameters.java @@ -32,6 +32,7 @@ public class AddOnCreateParameters /** * The selected plan for this store addon. + * @return The Plan value. */ public String getPlan() { @@ -40,16 +41,18 @@ public String getPlan() /** * The selected plan for this store addon. + * @param planValue The Plan value. */ - public void setPlan(String plan) + public void setPlan(final String planValue) { - this.plan = plan; + this.plan = planValue; } private String promotionCode; /** * The promotion code for this store addon. + * @return The PromotionCode value. */ public String getPromotionCode() { @@ -58,16 +61,18 @@ public String getPromotionCode() /** * The promotion code for this store addon. + * @param promotionCodeValue The PromotionCode value. */ - public void setPromotionCode(String promotionCode) + public void setPromotionCode(final String promotionCodeValue) { - this.promotionCode = promotionCode; + this.promotionCode = promotionCodeValue; } private String type; /** * The type of store item to be created. + * @return The Type value. */ public String getType() { @@ -76,9 +81,10 @@ public String getType() /** * The type of store item to be created. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnOperationStatusResponse.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnOperationStatusResponse.java index 4e9ea9bdd8107..15a2e66816b3d 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnOperationStatusResponse.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnOperationStatusResponse.java @@ -43,6 +43,7 @@ public class AddOnOperationStatusResponse extends OperationResponse * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @return The Error value. */ public AddOnOperationStatusResponse.ErrorDetails getError() { @@ -53,16 +54,18 @@ public AddOnOperationStatusResponse.ErrorDetails getError() * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @param errorValue The Error value. */ - public void setError(AddOnOperationStatusResponse.ErrorDetails error) + public void setError(final AddOnOperationStatusResponse.ErrorDetails errorValue) { - this.error = error; + this.error = errorValue; } private Integer httpStatusCode; /** * The HTTP status code for the asynchronous request. + * @return The HttpStatusCode value. */ public Integer getHttpStatusCode() { @@ -71,10 +74,11 @@ public Integer getHttpStatusCode() /** * The HTTP status code for the asynchronous request. + * @param httpStatusCodeValue The HttpStatusCode value. */ - public void setHttpStatusCode(Integer httpStatusCode) + public void setHttpStatusCode(final Integer httpStatusCodeValue) { - this.httpStatusCode = httpStatusCode; + this.httpStatusCode = httpStatusCodeValue; } private String id; @@ -82,6 +86,7 @@ public void setHttpStatusCode(Integer httpStatusCode) /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @return The Id value. */ public String getId() { @@ -91,16 +96,18 @@ public String getId() /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private OperationStatus status; /** * The status of the asynchronous request. + * @return The Status value. */ public OperationStatus getStatus() { @@ -109,10 +116,11 @@ public OperationStatus getStatus() /** * The status of the asynchronous request. + * @param statusValue The Status value. */ - public void setStatus(OperationStatus status) + public void setStatus(final OperationStatus statusValue) { - this.status = status; + this.status = statusValue; } /** @@ -127,6 +135,7 @@ public static class ErrorDetails /** * The management service error code returned if the asynchronous * request failed. + * @return The Code value. */ public String getCode() { @@ -136,10 +145,11 @@ public String getCode() /** * The management service error code returned if the asynchronous * request failed. + * @param codeValue The Code value. */ - public void setCode(String code) + public void setCode(final String codeValue) { - this.code = code; + this.code = codeValue; } private String message; @@ -147,6 +157,7 @@ public void setCode(String code) /** * The management service error message returned if the asynchronous * request failed. + * @return The Message value. */ public String getMessage() { @@ -156,10 +167,11 @@ public String getMessage() /** * The management service error message returned if the asynchronous * request failed. + * @param messageValue The Message value. */ - public void setMessage(String message) + public void setMessage(final String messageValue) { - this.message = message; + this.message = messageValue; } } } diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnUpdateParameters.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnUpdateParameters.java index cb163810e86b0..a3e618acb196c 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnUpdateParameters.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/AddOnUpdateParameters.java @@ -32,6 +32,7 @@ public class AddOnUpdateParameters /** * The selected plan for this store addon. + * @return The Plan value. */ public String getPlan() { @@ -40,16 +41,18 @@ public String getPlan() /** * The selected plan for this store addon. + * @param planValue The Plan value. */ - public void setPlan(String plan) + public void setPlan(final String planValue) { - this.plan = plan; + this.plan = planValue; } private String promotionCode; /** * The promotion code for this store addon. + * @return The PromotionCode value. */ public String getPromotionCode() { @@ -58,16 +61,18 @@ public String getPromotionCode() /** * The promotion code for this store addon. + * @param promotionCodeValue The PromotionCode value. */ - public void setPromotionCode(String promotionCode) + public void setPromotionCode(final String promotionCodeValue) { - this.promotionCode = promotionCode; + this.promotionCode = promotionCodeValue; } private String type; /** * The type of store item to be created. + * @return The Type value. */ public String getType() { @@ -76,9 +81,10 @@ public String getType() /** * The type of store item to be created. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/CloudServiceCreateParameters.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/CloudServiceCreateParameters.java index 1f2bc3be900bd..508560adfc106 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/CloudServiceCreateParameters.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/CloudServiceCreateParameters.java @@ -32,6 +32,7 @@ public class CloudServiceCreateParameters /** * The description for the cloud service to be created. + * @return The Description value. */ public String getDescription() { @@ -40,16 +41,18 @@ public String getDescription() /** * The description for the cloud service to be created. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String geoRegion; /** * The geographical region to create the cloud service in. + * @return The GeoRegion value. */ public String getGeoRegion() { @@ -58,16 +61,18 @@ public String getGeoRegion() /** * The geographical region to create the cloud service in. + * @param geoRegionValue The GeoRegion value. */ - public void setGeoRegion(String geoRegion) + public void setGeoRegion(final String geoRegionValue) { - this.geoRegion = geoRegion; + this.geoRegion = geoRegionValue; } private String label; /** * The label of the cloud service to be created. + * @return The Label value. */ public String getLabel() { @@ -76,16 +81,18 @@ public String getLabel() /** * The label of the cloud service to be created. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String name; /** * The name of the cloud service to be created. + * @return The Name value. */ public String getName() { @@ -94,9 +101,10 @@ public String getName() /** * The name of the cloud service to be created. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } } diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/CloudServiceListResponse.java b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/CloudServiceListResponse.java index b8f48b8664ee3..6a1ed1b002285 100644 --- a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/CloudServiceListResponse.java +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/CloudServiceListResponse.java @@ -37,6 +37,7 @@ public class CloudServiceListResponse extends OperationResponse implements Itera /** * The list of cloud service locations for this subscription. + * @return The CloudServices value. */ public ArrayList getCloudServices() { @@ -45,10 +46,11 @@ public ArrayList getCloudServices() /** * The list of cloud service locations for this subscription. + * @param cloudServicesValue The CloudServices value. */ - public void setCloudServices(ArrayList cloudServices) + public void setCloudServices(final ArrayList cloudServicesValue) { - this.cloudServices = cloudServices; + this.cloudServices = cloudServicesValue; } /** @@ -80,6 +82,7 @@ public static class CloudService /** * The description of the cloud service region. + * @return The Description value. */ public String getDescription() { @@ -88,16 +91,18 @@ public String getDescription() /** * The description of the cloud service region. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String geoRegion; /** * The geographical region in which this cloud service can run. + * @return The GeoRegion value. */ public String getGeoRegion() { @@ -106,16 +111,18 @@ public String getGeoRegion() /** * The geographical region in which this cloud service can run. + * @param geoRegionValue The GeoRegion value. */ - public void setGeoRegion(String geoRegion) + public void setGeoRegion(final String geoRegionValue) { - this.geoRegion = geoRegion; + this.geoRegion = geoRegionValue; } private String label; /** * The label of the cloud service region. + * @return The Label value. */ public String getLabel() { @@ -124,16 +131,18 @@ public String getLabel() /** * The label of the cloud service region. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String name; /** * The name of the cloud service region. + * @return The Name value. */ public String getName() { @@ -142,10 +151,11 @@ public String getName() /** * The name of the cloud service region. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private ArrayList resources; @@ -153,6 +163,7 @@ public void setName(String name) /** * A list of existing store resources installed into a cloud service * region. + * @return The Resources value. */ public ArrayList getResources() { @@ -162,10 +173,11 @@ public ArrayList getResourc /** * A list of existing store resources installed into a cloud service * region. + * @param resourcesValue The Resources value. */ - public void setResources(ArrayList resources) + public void setResources(final ArrayList resourcesValue) { - this.resources = resources; + this.resources = resourcesValue; } /** @@ -186,6 +198,7 @@ public static class AddOnResource /** * The ETag for this store resource. + * @return The ETag value. */ public String getETag() { @@ -194,16 +207,18 @@ public String getETag() /** * The ETag for this store resource. + * @param eTagValue The ETag value. */ - public void setETag(String eTag) + public void setETag(final String eTagValue) { - this.eTag = eTag; + this.eTag = eTagValue; } private String name; /** * The user-input name of this store item. + * @return The Name value. */ public String getName() { @@ -212,16 +227,18 @@ public String getName() /** * The user-input name of this store item. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String namespace; /** * The namespace in which this store item resides. + * @return The Namespace value. */ public String getNamespace() { @@ -230,16 +247,18 @@ public String getNamespace() /** * The namespace in which this store item resides. + * @param namespaceValue The Namespace value. */ - public void setNamespace(String namespace) + public void setNamespace(final String namespaceValue) { - this.namespace = namespace; + this.namespace = namespaceValue; } private HashMap outputItems; /** * Output items associated with an individual store resource. + * @return The OutputItems value. */ public HashMap getOutputItems() { @@ -248,16 +267,18 @@ public HashMap getOutputItems() /** * Output items associated with an individual store resource. + * @param outputItemsValue The OutputItems value. */ - public void setOutputItems(HashMap outputItems) + public void setOutputItems(final HashMap outputItemsValue) { - this.outputItems = outputItems; + this.outputItems = outputItemsValue; } private String plan; /** * The plan for this store item as selected by the user. + * @return The Plan value. */ public String getPlan() { @@ -266,16 +287,18 @@ public String getPlan() /** * The plan for this store item as selected by the user. + * @param planValue The Plan value. */ - public void setPlan(String plan) + public void setPlan(final String planValue) { - this.plan = plan; + this.plan = planValue; } private String schemaVersion; /** * The schema version for this resource. + * @return The SchemaVersion value. */ public String getSchemaVersion() { @@ -284,16 +307,18 @@ public String getSchemaVersion() /** * The schema version for this resource. + * @param schemaVersionValue The SchemaVersion value. */ - public void setSchemaVersion(String schemaVersion) + public void setSchemaVersion(final String schemaVersionValue) { - this.schemaVersion = schemaVersion; + this.schemaVersion = schemaVersionValue; } private String state; /** * The state of this store resource. + * @return The State value. */ public String getState() { @@ -302,10 +327,11 @@ public String getState() /** * The state of this store resource. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private CloudServiceListResponse.CloudService.AddOnResource.OperationStatus status; @@ -313,6 +339,7 @@ public void setState(String state) /** * Operation status items associated with an individual store * resource. + * @return The Status value. */ public CloudServiceListResponse.CloudService.AddOnResource.OperationStatus getStatus() { @@ -322,16 +349,18 @@ public CloudServiceListResponse.CloudService.AddOnResource.OperationStatus getSt /** * Operation status items associated with an individual store * resource. + * @param statusValue The Status value. */ - public void setStatus(CloudServiceListResponse.CloudService.AddOnResource.OperationStatus status) + public void setStatus(final CloudServiceListResponse.CloudService.AddOnResource.OperationStatus statusValue) { - this.status = status; + this.status = statusValue; } private String type; /** * The type of store item. + * @return The Type value. */ public String getType() { @@ -340,16 +369,18 @@ public String getType() /** * The type of store item. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } private ArrayList usageLimits; /** * Usage meters associated with an individual store resource. + * @return The UsageLimits value. */ public ArrayList getUsageLimits() { @@ -358,10 +389,11 @@ public ArrayList /** * Usage meters associated with an individual store resource. + * @param usageLimitsValue The UsageLimits value. */ - public void setUsageLimits(ArrayList usageLimits) + public void setUsageLimits(final ArrayList usageLimitsValue) { - this.usageLimits = usageLimits; + this.usageLimits = usageLimitsValue; } /** @@ -383,6 +415,7 @@ public static class OperationStatus /** * The result of this operation status. + * @return The Result value. */ public String getResult() { @@ -391,16 +424,18 @@ public String getResult() /** * The result of this operation status. + * @param resultValue The Result value. */ - public void setResult(String result) + public void setResult(final String resultValue) { - this.result = result; + this.result = resultValue; } private String type; /** * The type of this operation status. + * @return The Type value. */ public String getType() { @@ -409,10 +444,11 @@ public String getType() /** * The type of this operation status. + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } @@ -427,6 +463,7 @@ public static class UsageLimit /** * Defines the limit of this usage included in this store * resource's plan. + * @return The AmountIncluded value. */ public long getAmountIncluded() { @@ -436,16 +473,18 @@ public long getAmountIncluded() /** * Defines the limit of this usage included in this store * resource's plan. + * @param amountIncludedValue The AmountIncluded value. */ - public void setAmountIncluded(long amountIncluded) + public void setAmountIncluded(final long amountIncludedValue) { - this.amountIncluded = amountIncluded; + this.amountIncluded = amountIncludedValue; } private long amountUsed; /** * The amount of this store resource that has already been used. + * @return The AmountUsed value. */ public long getAmountUsed() { @@ -454,16 +493,18 @@ public long getAmountUsed() /** * The amount of this store resource that has already been used. + * @param amountUsedValue The AmountUsed value. */ - public void setAmountUsed(long amountUsed) + public void setAmountUsed(final long amountUsedValue) { - this.amountUsed = amountUsed; + this.amountUsed = amountUsedValue; } private String name; /** * The name of this usage limit. + * @return The Name value. */ public String getName() { @@ -472,16 +513,18 @@ public String getName() /** * The name of this usage limit. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String unit; /** * The unit in which this usage limit is measured. + * @return The Unit value. */ public String getUnit() { @@ -490,10 +533,11 @@ public String getUnit() /** * The unit in which this usage limit is measured. + * @param unitValue The Unit value. */ - public void setUnit(String unit) + public void setUnit(final String unitValue) { - this.unit = unit; + this.unit = unitValue; } } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ClientRootCertificateOperations.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ClientRootCertificateOperations.java index 65d41cd3c8542..fd7307f337635 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ClientRootCertificateOperations.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ClientRootCertificateOperations.java @@ -29,7 +29,6 @@ import com.microsoft.windowsazure.management.virtualnetworks.models.ClientRootCertificateListResponse; import com.microsoft.windowsazure.management.virtualnetworks.models.GatewayOperationResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @@ -48,10 +47,28 @@ public interface ClientRootCertificateOperations * gateway. * @param parameters Parameters supplied to the Upload client certificate * Virtual Network Gateway operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return A standard storage response including an HTTP status code and * request ID. */ - GatewayOperationResponse create(String virtualNetworkName, ClientRootCertificateCreateParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException; + GatewayOperationResponse create(String virtualNetworkName, ClientRootCertificateCreateParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException; /** * The Upload Client Root Certificate operation is used to upload a new @@ -77,6 +94,24 @@ public interface ClientRootCertificateOperations * @param virtualNetworkName The name of the virtual network for this * gateway. * @param certificateThumbprint The X509 certificate thumbprint. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -106,6 +141,16 @@ public interface ClientRootCertificateOperations * @param virtualNetworkName The name of the virtual network for this * gateway. * @param certificateThumbprint The X509 certificate thumbprint. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -135,6 +180,16 @@ public interface ClientRootCertificateOperations * * @param virtualNetworkName The name of the virtual network for this * gateway. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response to the list client root certificates request. */ ClientRootCertificateListResponse list(String virtualNetworkName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ClientRootCertificateOperationsImpl.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ClientRootCertificateOperationsImpl.java index 9e7785a41f582..631c76123b572 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ClientRootCertificateOperationsImpl.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ClientRootCertificateOperationsImpl.java @@ -34,7 +34,6 @@ import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.io.InputStream; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -73,6 +72,7 @@ public class ClientRootCertificateOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (gatewayOperationAsyncResponseElement != null) - { - NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setOperationId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayOperationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayOperationResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); + Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayOperationAsyncResponseElement != null) + { + NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -254,6 +282,24 @@ public GatewayOperationResponse call() throws Exception * @param virtualNetworkName The name of the virtual network for this * gateway. * @param certificateThumbprint The X509 certificate thumbprint. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -294,60 +340,70 @@ public GatewayOperationResponse delete(String virtualNetworkName, String certifi // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayOperationResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayOperationResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); - Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (gatewayOperationAsyncResponseElement != null) - { - NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setOperationId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayOperationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayOperationResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); + Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayOperationAsyncResponseElement != null) + { + NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) + finally { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) - { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -385,6 +441,16 @@ public ClientRootCertificateGetResponse call() throws Exception * @param virtualNetworkName The name of the virtual network for this * gateway. * @param certificateThumbprint The X509 certificate thumbprint. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -424,44 +490,54 @@ public ClientRootCertificateGetResponse get(String virtualNetworkName, String ce // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ClientRootCertificateGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ClientRootCertificateGetResponse(); - result.setCertificate(StreamUtils.toString(responseContent)); - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + ClientRootCertificateGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ClientRootCertificateGetResponse(); + result.setCertificate(StreamUtils.toString(responseContent)); + + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -496,6 +572,16 @@ public ClientRootCertificateListResponse call() throws Exception * * @param virtualNetworkName The name of the virtual network for this * gateway. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response to the list client root certificates request. */ @Override @@ -530,87 +616,97 @@ public ClientRootCertificateListResponse list(String virtualNetworkName) throws // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ClientRootCertificateListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ClientRootCertificateListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ClientRootCertificates"); - Element clientRootCertificatesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (clientRootCertificatesSequenceElement != null) - { - for (int i1 = 0; i1 < clientRootCertificatesSequenceElement.getElementsByTagName("ClientRootCertificate").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element clientRootCertificatesElement = ((org.w3c.dom.Element) clientRootCertificatesSequenceElement.getElementsByTagName("ClientRootCertificate").item(i1)); - ClientRootCertificateListResponse.ClientRootCertificate clientRootCertificateInstance = new ClientRootCertificateListResponse.ClientRootCertificate(); - result.getClientRootCertificates().add(clientRootCertificateInstance); - - NodeList elements2 = clientRootCertificatesElement.getElementsByTagName("ExpirationTime"); - Element expirationTimeElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (expirationTimeElement != null) - { - Calendar expirationTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(expirationTimeElement.getTextContent())); - expirationTimeInstance = calendar; - clientRootCertificateInstance.setExpirationTime(expirationTimeInstance); - } - - NodeList elements3 = clientRootCertificatesElement.getElementsByTagName("Subject"); - Element subjectElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (subjectElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String subjectInstance; - subjectInstance = subjectElement.getTextContent(); - clientRootCertificateInstance.setSubject(subjectInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements4 = clientRootCertificatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (thumbprintElement != null) + throw ex; + } + + // Create Result + ClientRootCertificateListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ClientRootCertificateListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ClientRootCertificates"); + Element clientRootCertificatesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (clientRootCertificatesSequenceElement != null) + { + for (int i1 = 0; i1 < clientRootCertificatesSequenceElement.getElementsByTagName("ClientRootCertificate").getLength(); i1 = i1 + 1) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - clientRootCertificateInstance.setThumbprint(thumbprintInstance); + org.w3c.dom.Element clientRootCertificatesElement = ((org.w3c.dom.Element) clientRootCertificatesSequenceElement.getElementsByTagName("ClientRootCertificate").item(i1)); + ClientRootCertificateListResponse.ClientRootCertificate clientRootCertificateInstance = new ClientRootCertificateListResponse.ClientRootCertificate(); + result.getClientRootCertificates().add(clientRootCertificateInstance); + + NodeList elements2 = clientRootCertificatesElement.getElementsByTagName("ExpirationTime"); + Element expirationTimeElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (expirationTimeElement != null) + { + Calendar expirationTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(expirationTimeElement.getTextContent())); + expirationTimeInstance = calendar; + clientRootCertificateInstance.setExpirationTime(expirationTimeInstance); + } + + NodeList elements3 = clientRootCertificatesElement.getElementsByTagName("Subject"); + Element subjectElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (subjectElement != null) + { + String subjectInstance; + subjectInstance = subjectElement.getTextContent(); + clientRootCertificateInstance.setSubject(subjectInstance); + } + + NodeList elements4 = clientRootCertificatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (thumbprintElement != null) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + clientRootCertificateInstance.setThumbprint(thumbprintInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/GatewayOperations.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/GatewayOperations.java index 3814643889fef..c27156b9889f9 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/GatewayOperations.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/GatewayOperations.java @@ -37,12 +37,10 @@ import com.microsoft.windowsazure.management.virtualnetworks.models.GatewayOperationResponse; import com.microsoft.windowsazure.management.virtualnetworks.models.GatewayResetSharedKeyParameters; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -61,10 +59,20 @@ public interface GatewayOperations * @param localNetworkSiteName The name of the site to connect to. * @param parameters Parameters supplied to the Create Virtual Network * Gateway operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard storage response including an HTTP status code and * request ID. */ - GatewayOperationResponse beginConnectDisconnectOrTesting(String virtualNetworkName, String localNetworkSiteName, GatewayConnectDisconnectOrTestParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + GatewayOperationResponse beginConnectDisconnectOrTesting(String virtualNetworkName, String localNetworkSiteName, GatewayConnectDisconnectOrTestParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * To connect to, disconnect from, or test your connection to a local @@ -94,10 +102,20 @@ public interface GatewayOperations * gateway. * @param parameters Parameters supplied to the Create Virtual Network * Gateway operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard storage response including an HTTP status code and * request ID. */ - GatewayOperationResponse beginCreating(String virtualNetworkName, GatewayCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + GatewayOperationResponse beginCreating(String virtualNetworkName, GatewayCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Create Virtual network Gateway operation creates a new network @@ -121,6 +139,14 @@ public interface GatewayOperations * more information) * * @param virtualNetworkName The name of the virtual network. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -145,10 +171,18 @@ public interface GatewayOperations * more information) * * @param virtualNetworkName The name of the virtual network in Azure. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return A standard storage response including an HTTP status code and * request ID. */ - GatewayOperationResponse beginFailover(String virtualNetworkName) throws UnsupportedEncodingException, IOException, ServiceException, ParserConfigurationException, SAXException; + GatewayOperationResponse beginFailover(String virtualNetworkName) throws IOException, ServiceException, ParserConfigurationException, SAXException; /** * The Failover Virtual network Gateway operation causes a network gateway @@ -174,10 +208,20 @@ public interface GatewayOperations * @param localNetworkName The name of the local network. * @param parameters The parameters to the Virtual Network Gateway Reset * Shared Key request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard storage response including an HTTP status code and * request ID. */ - GatewayOperationResponse beginResetSharedKey(String virtualNetworkName, String localNetworkName, GatewayResetSharedKeyParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + GatewayOperationResponse beginResetSharedKey(String virtualNetworkName, String localNetworkName, GatewayResetSharedKeyParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Reset Virtual network Gateway shared key operation resets the shared @@ -209,6 +253,18 @@ public interface GatewayOperations * @param localNetworkSiteName The name of the site to connect to. * @param parameters Parameters supplied to the Create Virtual Network * Gateway operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -256,6 +312,24 @@ public interface GatewayOperations * gateway. * @param parameters Parameters supplied to the Create Virtual Network * Gateway operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -266,7 +340,7 @@ public interface GatewayOperations * the failed request, and also includes error information regarding the * failure. */ - GatewayGetOperationStatusResponse create(String virtualNetworkName, GatewayCreateParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException; + GatewayGetOperationStatusResponse create(String virtualNetworkName, GatewayCreateParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException; /** * The Create Virtual network Gateway operation creates a new network @@ -297,6 +371,24 @@ public interface GatewayOperations * more information) * * @param virtualNetworkName The name of the virtual network. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -335,6 +427,18 @@ public interface GatewayOperations * more information) * * @param virtualNetworkName The name of the virtual network in Azure. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -376,10 +480,20 @@ public interface GatewayOperations * gateway. * @param parameters Parameters supplied to the Create Virtual Network * Gateway operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard storage response including an HTTP status code and * request ID. */ - GatewayOperationResponse generateVpnClientPackage(String virtualNetworkName, GatewayGenerateVpnClientPackageParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + GatewayOperationResponse generateVpnClientPackage(String virtualNetworkName, GatewayGenerateVpnClientPackageParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * The Generate VPN Client Package creates a VPN client package for the @@ -404,6 +518,16 @@ public interface GatewayOperations * * @param virtualNetworkName The name of the virtual network for this * gateway. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -432,6 +556,10 @@ public interface GatewayOperations * gateway. * @param parameters The parameters for the GetDeviceConfigurationScript * request. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The configuration script returned from the get device * configuration script request. */ @@ -459,6 +587,14 @@ public interface GatewayOperations * more information) * * @param operationId The id of the virtualnetwork operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -500,6 +636,14 @@ public interface GatewayOperations * @param virtualNetworkName The name of the virtual network for this * gateway. * @param localNetworkName The name of the local network. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The response to the get shared key request. */ GatewayGetSharedKeyResponse getSharedKey(String virtualNetworkName, String localNetworkName) throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -526,6 +670,16 @@ public interface GatewayOperations * * @param virtualNetworkName The name of the virtual network for this * gateway. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response to a ListConnections request to a Virtual Network * Gateway. */ @@ -550,6 +704,14 @@ public interface GatewayOperations * (see http://msdn.microsoft.com/en-us/library/windowsazure/jj154102.aspx * for more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The respoonse to the get supported platform configuration request. */ GatewayListSupportedDevicesResponse listSupportedDevices() throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -576,6 +738,18 @@ public interface GatewayOperations * @param localNetworkName The name of the local network. * @param parameters The parameters to the Virtual Network Gateway Reset * Shared Key request. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/GatewayOperationsImpl.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/GatewayOperationsImpl.java index 5793193c9dc52..11ab997373688 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/GatewayOperationsImpl.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/GatewayOperationsImpl.java @@ -48,7 +48,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -61,7 +60,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -72,6 +70,7 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.StringEntity; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -94,6 +93,7 @@ public class GatewayOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (gatewayOperationAsyncResponseElement != null) - { - NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setOperationId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayOperationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayOperationResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); + Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayOperationAsyncResponseElement != null) + { + NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -308,11 +328,21 @@ public GatewayOperationResponse call() throws Exception * gateway. * @param parameters Parameters supplied to the Create Virtual Network * Gateway operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard storage response including an HTTP status code and * request ID. */ @Override - public GatewayOperationResponse beginCreating(String virtualNetworkName, GatewayCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public GatewayOperationResponse beginCreating(String virtualNetworkName, GatewayCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (virtualNetworkName == null) @@ -372,60 +402,70 @@ public GatewayOperationResponse beginCreating(String virtualNetworkName, Gateway // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_CREATED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayOperationResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayOperationResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); - Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (gatewayOperationAsyncResponseElement != null) - { - NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setOperationId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_CREATED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayOperationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayOperationResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); + Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayOperationAsyncResponseElement != null) + { + NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -457,6 +497,14 @@ public GatewayOperationResponse call() throws Exception * more information) * * @param virtualNetworkName The name of the virtual network. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -492,60 +540,70 @@ public GatewayOperationResponse beginDeleting(String virtualNetworkName) throws // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayOperationResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayOperationResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); - Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (gatewayOperationAsyncResponseElement != null) - { - NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setOperationId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayOperationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayOperationResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); + Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayOperationAsyncResponseElement != null) + { + NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -577,11 +635,19 @@ public GatewayOperationResponse call() throws Exception * more information) * * @param virtualNetworkName The name of the virtual network in Azure. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return A standard storage response including an HTTP status code and * request ID. */ @Override - public GatewayOperationResponse beginFailover(String virtualNetworkName) throws UnsupportedEncodingException, IOException, ServiceException, ParserConfigurationException, SAXException + public GatewayOperationResponse beginFailover(String virtualNetworkName) throws IOException, ServiceException, ParserConfigurationException, SAXException { // Validate if (virtualNetworkName == null) @@ -619,60 +685,70 @@ public GatewayOperationResponse beginFailover(String virtualNetworkName) throws // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayOperationResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayOperationResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); - Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (gatewayOperationAsyncResponseElement != null) - { - NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setOperationId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayOperationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayOperationResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); + Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayOperationAsyncResponseElement != null) + { + NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -714,11 +790,21 @@ public GatewayOperationResponse call() throws Exception * @param localNetworkName The name of the local network. * @param parameters The parameters to the Virtual Network Gateway Reset * Shared Key request. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard storage response including an HTTP status code and * request ID. */ @Override - public GatewayOperationResponse beginResetSharedKey(String virtualNetworkName, String localNetworkName, GatewayResetSharedKeyParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public GatewayOperationResponse beginResetSharedKey(String virtualNetworkName, String localNetworkName, GatewayResetSharedKeyParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (virtualNetworkName == null) @@ -783,60 +869,70 @@ public GatewayOperationResponse beginResetSharedKey(String virtualNetworkName, S // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayOperationResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayOperationResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); - Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (gatewayOperationAsyncResponseElement != null) - { - NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setOperationId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayOperationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayOperationResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); + Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayOperationAsyncResponseElement != null) + { + NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -887,6 +983,18 @@ public GatewayGetOperationStatusResponse call() throws Exception * @param localNetworkSiteName The name of the site to connect to. * @param parameters Parameters supplied to the Create Virtual Network * Gateway operation. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1011,6 +1119,24 @@ public GatewayGetOperationStatusResponse call() throws Exception * gateway. * @param parameters Parameters supplied to the Create Virtual Network * Gateway operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1022,7 +1148,7 @@ public GatewayGetOperationStatusResponse call() throws Exception * failure. */ @Override - public GatewayGetOperationStatusResponse create(String virtualNetworkName, GatewayCreateParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException + public GatewayGetOperationStatusResponse create(String virtualNetworkName, GatewayCreateParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException { VirtualNetworkManagementClient client2 = this.getClient(); boolean shouldTrace = CloudTracing.getIsEnabled(); @@ -1128,6 +1254,24 @@ public GatewayGetOperationStatusResponse call() throws Exception * more information) * * @param virtualNetworkName The name of the virtual network. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1244,6 +1388,18 @@ public GatewayGetOperationStatusResponse call() throws Exception * more information) * * @param virtualNetworkName The name of the virtual network in Azure. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1359,11 +1515,21 @@ public GatewayOperationResponse call() throws Exception * gateway. * @param parameters Parameters supplied to the Create Virtual Network * Gateway operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard storage response including an HTTP status code and * request ID. */ @Override - public GatewayOperationResponse generateVpnClientPackage(String virtualNetworkName, GatewayGenerateVpnClientPackageParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public GatewayOperationResponse generateVpnClientPackage(String virtualNetworkName, GatewayGenerateVpnClientPackageParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (virtualNetworkName == null) @@ -1423,60 +1589,70 @@ public GatewayOperationResponse generateVpnClientPackage(String virtualNetworkNa // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_CREATED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayOperationResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayOperationResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); - Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (gatewayOperationAsyncResponseElement != null) - { - NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_CREATED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayOperationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayOperationResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("GatewayOperationAsyncResponse"); + Element gatewayOperationAsyncResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayOperationAsyncResponseElement != null) + { + NodeList elements2 = gatewayOperationAsyncResponseElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) + { + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + } + + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setOperationId(idInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) + finally { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - - if (shouldTrace) - { - CloudTracing.exit(invocationId, result); - } - return result; } /** @@ -1510,6 +1686,16 @@ public GatewayGetResponse call() throws Exception * * @param virtualNetworkName The name of the virtual network for this * gateway. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -1544,125 +1730,135 @@ public GatewayGetResponse get(String virtualNetworkName) throws IOException, Ser // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Gateway"); - Element gatewayElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (gatewayElement != null) - { - NodeList elements2 = gatewayElement.getElementsByTagName("State"); - Element stateElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (stateElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = gatewayElement.getElementsByTagName("VIPAddress"); - Element vIPAddressElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (vIPAddressElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - InetAddress vIPAddressInstance; - vIPAddressInstance = InetAddress.getByName(vIPAddressElement.getTextContent()); - result.setVipAddress(vIPAddressInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = gatewayElement.getElementsByTagName("LastEvent"); - Element lastEventElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (lastEventElement != null) + // Create Result + GatewayGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Gateway"); + Element gatewayElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayElement != null) { - GatewayEvent lastEventInstance = new GatewayEvent(); - result.setLastEvent(lastEventInstance); - - NodeList elements5 = lastEventElement.getElementsByTagName("Timestamp"); - Element timestampElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (timestampElement != null) + NodeList elements2 = gatewayElement.getElementsByTagName("State"); + Element stateElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (stateElement != null) { - Calendar timestampInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(timestampElement.getTextContent())); - timestampInstance = calendar; - lastEventInstance.setTimestamp(timestampInstance); + String stateInstance; + stateInstance = stateElement.getTextContent(); + result.setState(stateInstance); } - NodeList elements6 = lastEventElement.getElementsByTagName("Id"); - Element idElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (idElement != null) + NodeList elements3 = gatewayElement.getElementsByTagName("VIPAddress"); + Element vIPAddressElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (vIPAddressElement != null) { - String idInstance; - idInstance = idElement.getTextContent(); - lastEventInstance.setId(idInstance); + InetAddress vIPAddressInstance; + vIPAddressInstance = InetAddress.getByName(vIPAddressElement.getTextContent()); + result.setVipAddress(vIPAddressInstance); } - NodeList elements7 = lastEventElement.getElementsByTagName("Message"); - Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (messageElement != null) + NodeList elements4 = gatewayElement.getElementsByTagName("LastEvent"); + Element lastEventElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (lastEventElement != null) { - String messageInstance; - messageInstance = messageElement.getTextContent(); - lastEventInstance.setMessage(messageInstance); + GatewayEvent lastEventInstance = new GatewayEvent(); + result.setLastEvent(lastEventInstance); + + NodeList elements5 = lastEventElement.getElementsByTagName("Timestamp"); + Element timestampElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (timestampElement != null) + { + Calendar timestampInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(timestampElement.getTextContent())); + timestampInstance = calendar; + lastEventInstance.setTimestamp(timestampInstance); + } + + NodeList elements6 = lastEventElement.getElementsByTagName("Id"); + Element idElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + lastEventInstance.setId(idInstance); + } + + NodeList elements7 = lastEventElement.getElementsByTagName("Message"); + Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + lastEventInstance.setMessage(messageInstance); + } + + NodeList elements8 = lastEventElement.getElementsByTagName("Data"); + Element dataElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (dataElement != null) + { + String dataInstance; + dataInstance = dataElement.getTextContent(); + lastEventInstance.setData(dataInstance); + } } - NodeList elements8 = lastEventElement.getElementsByTagName("Data"); - Element dataElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (dataElement != null) + NodeList elements9 = gatewayElement.getElementsByTagName("GatewayType"); + Element gatewayTypeElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (gatewayTypeElement != null) { - String dataInstance; - dataInstance = dataElement.getTextContent(); - lastEventInstance.setData(dataInstance); + GatewayType gatewayTypeInstance; + gatewayTypeInstance = GatewayType.valueOf(gatewayTypeElement.getTextContent()); + result.setGatewayType(gatewayTypeInstance); } } - NodeList elements9 = gatewayElement.getElementsByTagName("GatewayType"); - Element gatewayTypeElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (gatewayTypeElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - GatewayType gatewayTypeInstance; - gatewayTypeInstance = GatewayType.valueOf(gatewayTypeElement.getTextContent()); - result.setGatewayType(gatewayTypeInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1700,6 +1896,10 @@ public GatewayGetDeviceConfigurationScriptResponse call() throws Exception * gateway. * @param parameters The parameters for the GetDeviceConfigurationScript * request. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The configuration script returned from the get device * configuration script request. */ @@ -1739,44 +1939,54 @@ public GatewayGetDeviceConfigurationScriptResponse getDeviceConfigurationScript( // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayGetDeviceConfigurationScriptResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayGetDeviceConfigurationScriptResponse(); - result.setConfigurationScript(StreamUtils.toString(responseContent)); - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayGetDeviceConfigurationScriptResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayGetDeviceConfigurationScriptResponse(); + result.setConfigurationScript(StreamUtils.toString(responseContent)); + + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1815,6 +2025,14 @@ public GatewayGetOperationStatusResponse call() throws Exception * more information) * * @param operationId The id of the virtualnetwork operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -1856,104 +2074,114 @@ public GatewayGetOperationStatusResponse getOperationStatus(String operationId) // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayGetOperationStatusResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayGetOperationStatusResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("GatewayOperation"); - Element gatewayOperationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (gatewayOperationElement != null) - { - NodeList elements2 = gatewayOperationElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = gatewayOperationElement.getElementsByTagName("Status"); - Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (statusElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - GatewayOperationStatus statusInstance; - statusInstance = GatewayOperationStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = gatewayOperationElement.getElementsByTagName("HttpStatusCode"); - Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (httpStatusCodeElement != null) - { - Integer httpStatusCodeInstance; - httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); - result.setHttpStatusCode(httpStatusCodeInstance); - } + // Create Result + GatewayGetOperationStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayGetOperationStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements5 = gatewayOperationElement.getElementsByTagName("Error"); - Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (errorElement != null) + NodeList elements = responseDoc.getElementsByTagName("GatewayOperation"); + Element gatewayOperationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (gatewayOperationElement != null) { - GatewayGetOperationStatusResponse.ErrorDetails errorInstance = new GatewayGetOperationStatusResponse.ErrorDetails(); - result.setError(errorInstance); + NodeList elements2 = gatewayOperationElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setId(idInstance); + } - NodeList elements6 = errorElement.getElementsByTagName("Code"); - Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (codeElement != null) + NodeList elements3 = gatewayOperationElement.getElementsByTagName("Status"); + Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (statusElement != null) { - String codeInstance; - codeInstance = codeElement.getTextContent(); - errorInstance.setCode(codeInstance); + GatewayOperationStatus statusInstance; + statusInstance = GatewayOperationStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); } - NodeList elements7 = errorElement.getElementsByTagName("Message"); - Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (messageElement != null) + NodeList elements4 = gatewayOperationElement.getElementsByTagName("HttpStatusCode"); + Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (httpStatusCodeElement != null) { - String messageInstance; - messageInstance = messageElement.getTextContent(); - errorInstance.setMessage(messageInstance); + Integer httpStatusCodeInstance; + httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); + result.setHttpStatusCode(httpStatusCodeInstance); + } + + NodeList elements5 = gatewayOperationElement.getElementsByTagName("Error"); + Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (errorElement != null) + { + GatewayGetOperationStatusResponse.ErrorDetails errorInstance = new GatewayGetOperationStatusResponse.ErrorDetails(); + result.setError(errorInstance); + + NodeList elements6 = errorElement.getElementsByTagName("Code"); + Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (codeElement != null) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + errorInstance.setCode(codeInstance); + } + + NodeList elements7 = errorElement.getElementsByTagName("Message"); + Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1990,6 +2218,14 @@ public GatewayGetSharedKeyResponse call() throws Exception * @param virtualNetworkName The name of the virtual network for this * gateway. * @param localNetworkName The name of the local network. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The response to the get shared key request. */ @Override @@ -2028,60 +2264,70 @@ public GatewayGetSharedKeyResponse getSharedKey(String virtualNetworkName, Strin // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayGetSharedKeyResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayGetSharedKeyResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("SharedKey"); - Element sharedKeyElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (sharedKeyElement != null) - { - NodeList elements2 = sharedKeyElement.getElementsByTagName("Value"); - Element valueElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (valueElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String valueInstance; - valueInstance = valueElement.getTextContent(); - result.setSharedKey(valueInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayGetSharedKeyResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayGetSharedKeyResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("SharedKey"); + Element sharedKeyElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (sharedKeyElement != null) + { + NodeList elements2 = sharedKeyElement.getElementsByTagName("Value"); + Element valueElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (valueElement != null) + { + String valueInstance; + valueInstance = valueElement.getTextContent(); + result.setSharedKey(valueInstance); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -2115,6 +2361,16 @@ public GatewayListConnectionsResponse call() throws Exception * * @param virtualNetworkName The name of the virtual network for this * gateway. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response to a ListConnections request to a Virtual Network * Gateway. */ @@ -2149,164 +2405,174 @@ public GatewayListConnectionsResponse listConnections(String virtualNetworkName) // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayListConnectionsResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayListConnectionsResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Connections"); - Element connectionsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (connectionsSequenceElement != null) - { - for (int i1 = 0; i1 < connectionsSequenceElement.getElementsByTagName("Connection").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element connectionsElement = ((org.w3c.dom.Element) connectionsSequenceElement.getElementsByTagName("Connection").item(i1)); - GatewayListConnectionsResponse.GatewayConnection connectionInstance = new GatewayListConnectionsResponse.GatewayConnection(); - result.getConnections().add(connectionInstance); - - NodeList elements2 = connectionsElement.getElementsByTagName("LocalNetworkSiteName"); - Element localNetworkSiteNameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (localNetworkSiteNameElement != null) - { - String localNetworkSiteNameInstance; - localNetworkSiteNameInstance = localNetworkSiteNameElement.getTextContent(); - connectionInstance.setLocalNetworkSiteName(localNetworkSiteNameInstance); - } - - NodeList elements3 = connectionsElement.getElementsByTagName("ConnectivityState"); - Element connectivityStateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (connectivityStateElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - GatewayConnectivityState connectivityStateInstance; - connectivityStateInstance = GatewayConnectivityState.valueOf(connectivityStateElement.getTextContent()); - connectionInstance.setConnectivityState(connectivityStateInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements4 = connectionsElement.getElementsByTagName("LastEvent"); - Element lastEventElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (lastEventElement != null) + throw ex; + } + + // Create Result + GatewayListConnectionsResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayListConnectionsResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Connections"); + Element connectionsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (connectionsSequenceElement != null) + { + for (int i1 = 0; i1 < connectionsSequenceElement.getElementsByTagName("Connection").getLength(); i1 = i1 + 1) { - GatewayEvent lastEventInstance = new GatewayEvent(); - connectionInstance.setLastEvent(lastEventInstance); + org.w3c.dom.Element connectionsElement = ((org.w3c.dom.Element) connectionsSequenceElement.getElementsByTagName("Connection").item(i1)); + GatewayListConnectionsResponse.GatewayConnection connectionInstance = new GatewayListConnectionsResponse.GatewayConnection(); + result.getConnections().add(connectionInstance); - NodeList elements5 = lastEventElement.getElementsByTagName("Timestamp"); - Element timestampElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (timestampElement != null) + NodeList elements2 = connectionsElement.getElementsByTagName("LocalNetworkSiteName"); + Element localNetworkSiteNameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (localNetworkSiteNameElement != null) { - Calendar timestampInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(timestampElement.getTextContent())); - timestampInstance = calendar; - lastEventInstance.setTimestamp(timestampInstance); + String localNetworkSiteNameInstance; + localNetworkSiteNameInstance = localNetworkSiteNameElement.getTextContent(); + connectionInstance.setLocalNetworkSiteName(localNetworkSiteNameInstance); } - NodeList elements6 = lastEventElement.getElementsByTagName("Id"); - Element idElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (idElement != null) + NodeList elements3 = connectionsElement.getElementsByTagName("ConnectivityState"); + Element connectivityStateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (connectivityStateElement != null) { - String idInstance; - idInstance = idElement.getTextContent(); - lastEventInstance.setId(idInstance); + GatewayConnectivityState connectivityStateInstance; + connectivityStateInstance = GatewayConnectivityState.valueOf(connectivityStateElement.getTextContent()); + connectionInstance.setConnectivityState(connectivityStateInstance); } - NodeList elements7 = lastEventElement.getElementsByTagName("Message"); - Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (messageElement != null) + NodeList elements4 = connectionsElement.getElementsByTagName("LastEvent"); + Element lastEventElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (lastEventElement != null) { - String messageInstance; - messageInstance = messageElement.getTextContent(); - lastEventInstance.setMessage(messageInstance); + GatewayEvent lastEventInstance = new GatewayEvent(); + connectionInstance.setLastEvent(lastEventInstance); + + NodeList elements5 = lastEventElement.getElementsByTagName("Timestamp"); + Element timestampElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (timestampElement != null) + { + Calendar timestampInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(timestampElement.getTextContent())); + timestampInstance = calendar; + lastEventInstance.setTimestamp(timestampInstance); + } + + NodeList elements6 = lastEventElement.getElementsByTagName("Id"); + Element idElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + lastEventInstance.setId(idInstance); + } + + NodeList elements7 = lastEventElement.getElementsByTagName("Message"); + Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + lastEventInstance.setMessage(messageInstance); + } + + NodeList elements8 = lastEventElement.getElementsByTagName("Data"); + Element dataElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (dataElement != null) + { + String dataInstance; + dataInstance = dataElement.getTextContent(); + lastEventInstance.setData(dataInstance); + } } - NodeList elements8 = lastEventElement.getElementsByTagName("Data"); - Element dataElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (dataElement != null) + NodeList elements9 = connectionsElement.getElementsByTagName("IngressBytesTransferred"); + Element ingressBytesTransferredElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (ingressBytesTransferredElement != null) { - String dataInstance; - dataInstance = dataElement.getTextContent(); - lastEventInstance.setData(dataInstance); + long ingressBytesTransferredInstance; + ingressBytesTransferredInstance = Long.parseLong(ingressBytesTransferredElement.getTextContent()); + connectionInstance.setIngressBytesTransferred(ingressBytesTransferredInstance); } - } - - NodeList elements9 = connectionsElement.getElementsByTagName("IngressBytesTransferred"); - Element ingressBytesTransferredElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (ingressBytesTransferredElement != null) - { - long ingressBytesTransferredInstance; - ingressBytesTransferredInstance = Long.parseLong(ingressBytesTransferredElement.getTextContent()); - connectionInstance.setIngressBytesTransferred(ingressBytesTransferredInstance); - } - - NodeList elements10 = connectionsElement.getElementsByTagName("EgressBytesTransferred"); - Element egressBytesTransferredElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (egressBytesTransferredElement != null) - { - long egressBytesTransferredInstance; - egressBytesTransferredInstance = Long.parseLong(egressBytesTransferredElement.getTextContent()); - connectionInstance.setEgressBytesTransferred(egressBytesTransferredInstance); - } - - NodeList elements11 = connectionsElement.getElementsByTagName("LastConnectionEstablished"); - Element lastConnectionEstablishedElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (lastConnectionEstablishedElement != null) - { - Calendar lastConnectionEstablishedInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(lastConnectionEstablishedElement.getTextContent())); - lastConnectionEstablishedInstance = calendar2; - connectionInstance.setLastConnectionEstablished(lastConnectionEstablishedInstance); - } - - NodeList elements12 = connectionsElement.getElementsByTagName("AllocatedIPAddresses"); - Element allocatedIPAddressesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (allocatedIPAddressesSequenceElement != null) - { - for (int i2 = 0; i2 < allocatedIPAddressesSequenceElement.getElementsByTagName("string").getLength(); i2 = i2 + 1) + + NodeList elements10 = connectionsElement.getElementsByTagName("EgressBytesTransferred"); + Element egressBytesTransferredElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (egressBytesTransferredElement != null) + { + long egressBytesTransferredInstance; + egressBytesTransferredInstance = Long.parseLong(egressBytesTransferredElement.getTextContent()); + connectionInstance.setEgressBytesTransferred(egressBytesTransferredInstance); + } + + NodeList elements11 = connectionsElement.getElementsByTagName("LastConnectionEstablished"); + Element lastConnectionEstablishedElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (lastConnectionEstablishedElement != null) { - org.w3c.dom.Element allocatedIPAddressesElement = ((org.w3c.dom.Element) allocatedIPAddressesSequenceElement.getElementsByTagName("string").item(i2)); - connectionInstance.getAllocatedIPAddresses().add(allocatedIPAddressesElement.getTextContent()); + Calendar lastConnectionEstablishedInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(lastConnectionEstablishedElement.getTextContent())); + lastConnectionEstablishedInstance = calendar2; + connectionInstance.setLastConnectionEstablished(lastConnectionEstablishedInstance); + } + + NodeList elements12 = connectionsElement.getElementsByTagName("AllocatedIPAddresses"); + Element allocatedIPAddressesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (allocatedIPAddressesSequenceElement != null) + { + for (int i2 = 0; i2 < allocatedIPAddressesSequenceElement.getElementsByTagName("string").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element allocatedIPAddressesElement = ((org.w3c.dom.Element) allocatedIPAddressesSequenceElement.getElementsByTagName("string").item(i2)); + connectionInstance.getAllocatedIPAddresses().add(allocatedIPAddressesElement.getTextContent()); + } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -2335,6 +2601,14 @@ public GatewayListSupportedDevicesResponse call() throws Exception * (see http://msdn.microsoft.com/en-us/library/windowsazure/jj154102.aspx * for more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The respoonse to the get supported platform configuration request. */ @Override @@ -2363,85 +2637,88 @@ public GatewayListSupportedDevicesResponse listSupportedDevices() throws IOExcep // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - GatewayListSupportedDevicesResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new GatewayListSupportedDevicesResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("", "VpnDeviceList"); - Element vpnDeviceListElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (vpnDeviceListElement != null) - { - String versionAttribute = vpnDeviceListElement.getAttributeNS("", "version"); - if (versionAttribute != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - result.setVersion(versionAttribute); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + GatewayListSupportedDevicesResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new GatewayListSupportedDevicesResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + NodeList elements = responseDoc.getElementsByTagNameNS("", "VpnDeviceList"); + Element vpnDeviceListElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; if (vpnDeviceListElement != null) { - for (int i1 = 0; i1 < vpnDeviceListElement.getElementsByTagNameNS("", "Vendor").getLength(); i1 = i1 + 1) + Attr versionAttribute = vpnDeviceListElement.getAttributeNodeNS("", "version"); + if (versionAttribute != null) { - org.w3c.dom.Element vendorsElement = ((org.w3c.dom.Element) vpnDeviceListElement.getElementsByTagNameNS("", "Vendor").item(i1)); - GatewayListSupportedDevicesResponse.Vendor vendorInstance = new GatewayListSupportedDevicesResponse.Vendor(); - result.getVendors().add(vendorInstance); - - String nameAttribute = vendorsElement.getAttributeNS("", "name"); - if (nameAttribute != null) - { - vendorInstance.setName(nameAttribute); - } - - if (vendorsElement != null) + result.setVersion(versionAttribute.getValue()); + } + + if (vpnDeviceListElement != null) + { + for (int i1 = 0; i1 < vpnDeviceListElement.getElementsByTagNameNS("", "Vendor").getLength(); i1 = i1 + 1) { - for (int i2 = 0; i2 < vendorsElement.getElementsByTagNameNS("", "Platform").getLength(); i2 = i2 + 1) + org.w3c.dom.Element vendorsElement = ((org.w3c.dom.Element) vpnDeviceListElement.getElementsByTagNameNS("", "Vendor").item(i1)); + GatewayListSupportedDevicesResponse.Vendor vendorInstance = new GatewayListSupportedDevicesResponse.Vendor(); + result.getVendors().add(vendorInstance); + + Attr nameAttribute = vendorsElement.getAttributeNodeNS("", "name"); + if (nameAttribute != null) { - org.w3c.dom.Element platformsElement = ((org.w3c.dom.Element) vendorsElement.getElementsByTagNameNS("", "Platform").item(i2)); - GatewayListSupportedDevicesResponse.Platform platformInstance = new GatewayListSupportedDevicesResponse.Platform(); - vendorInstance.getPlatforms().add(platformInstance); - - String nameAttribute2 = platformsElement.getAttributeNS("", "name"); - if (nameAttribute2 != null) - { - platformInstance.setName(nameAttribute2); - } - - if (platformsElement != null) + vendorInstance.setName(nameAttribute.getValue()); + } + + if (vendorsElement != null) + { + for (int i2 = 0; i2 < vendorsElement.getElementsByTagNameNS("", "Platform").getLength(); i2 = i2 + 1) { - for (int i3 = 0; i3 < platformsElement.getElementsByTagNameNS("", "OSFamily").getLength(); i3 = i3 + 1) + org.w3c.dom.Element platformsElement = ((org.w3c.dom.Element) vendorsElement.getElementsByTagNameNS("", "Platform").item(i2)); + GatewayListSupportedDevicesResponse.Platform platformInstance = new GatewayListSupportedDevicesResponse.Platform(); + vendorInstance.getPlatforms().add(platformInstance); + + Attr nameAttribute2 = platformsElement.getAttributeNodeNS("", "name"); + if (nameAttribute2 != null) + { + platformInstance.setName(nameAttribute2.getValue()); + } + + if (platformsElement != null) { - org.w3c.dom.Element oSFamiliesElement = ((org.w3c.dom.Element) platformsElement.getElementsByTagNameNS("", "OSFamily").item(i3)); - GatewayListSupportedDevicesResponse.OSFamily oSFamilyInstance = new GatewayListSupportedDevicesResponse.OSFamily(); - platformInstance.getOSFamilies().add(oSFamilyInstance); - - String nameAttribute3 = oSFamiliesElement.getAttributeNS("", "name"); - if (nameAttribute3 != null) + for (int i3 = 0; i3 < platformsElement.getElementsByTagNameNS("", "OSFamily").getLength(); i3 = i3 + 1) { - oSFamilyInstance.setName(nameAttribute3); + org.w3c.dom.Element oSFamiliesElement = ((org.w3c.dom.Element) platformsElement.getElementsByTagNameNS("", "OSFamily").item(i3)); + GatewayListSupportedDevicesResponse.OSFamily oSFamilyInstance = new GatewayListSupportedDevicesResponse.OSFamily(); + platformInstance.getOSFamilies().add(oSFamilyInstance); + + Attr nameAttribute3 = oSFamiliesElement.getAttributeNodeNS("", "name"); + if (nameAttribute3 != null) + { + oSFamilyInstance.setName(nameAttribute3.getValue()); + } } } } @@ -2449,19 +2726,26 @@ public GatewayListSupportedDevicesResponse listSupportedDevices() throws IOExcep } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -2510,6 +2794,18 @@ public GatewayGetOperationStatusResponse call() throws Exception * @param localNetworkName The name of the local network. * @param parameters The parameters to the Virtual Network Gateway Reset * Shared Key request. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/NetworkOperations.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/NetworkOperations.java index b2a315f64d281..15414a7396542 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/NetworkOperations.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/NetworkOperations.java @@ -30,7 +30,6 @@ import com.microsoft.windowsazure.management.virtualnetworks.models.NetworkSetConfigurationParameters; import com.microsoft.windowsazure.management.virtualnetworks.models.VirtualNetworkOperationStatusResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @@ -46,10 +45,14 @@ public interface NetworkOperations * more information) * * @param parameters The updated network configuration. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard storage response including an HTTP status code and * request ID. */ - OperationResponse beginSettingConfiguration(NetworkSetConfigurationParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException; + OperationResponse beginSettingConfiguration(NetworkSetConfigurationParameters parameters) throws IOException, ServiceException; /** * The Set Network Configuration operation asynchronously configures the @@ -69,6 +72,10 @@ public interface NetworkOperations * http://msdn.microsoft.com/en-us/library/windowsazure/jj157196.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The Get Network Configuration operation response. */ NetworkGetConfigurationResponse getConfiguration() throws IOException, ServiceException; @@ -89,6 +96,16 @@ public interface NetworkOperations * http://msdn.microsoft.com/en-us/library/windowsazure/jj157185.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response structure for the Server List operation. */ NetworkListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; @@ -110,6 +127,18 @@ public interface NetworkOperations * more information) * * @param parameters The updated network configuration. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/NetworkOperationsImpl.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/NetworkOperationsImpl.java index a469ea4eef899..20767c93cf71e 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/NetworkOperationsImpl.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/NetworkOperationsImpl.java @@ -38,7 +38,6 @@ import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.io.InputStream; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.text.ParseException; import java.util.HashMap; @@ -75,6 +74,7 @@ public class NetworkOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -218,6 +232,10 @@ public NetworkGetConfigurationResponse call() throws Exception * http://msdn.microsoft.com/en-us/library/windowsazure/jj157196.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The Get Network Configuration operation response. */ @Override @@ -246,44 +264,54 @@ public NetworkGetConfigurationResponse getConfiguration() throws IOException, Se // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - NetworkGetConfigurationResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new NetworkGetConfigurationResponse(); - result.setConfiguration(StreamUtils.toString(responseContent)); - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + NetworkGetConfigurationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new NetworkGetConfigurationResponse(); + result.setConfiguration(StreamUtils.toString(responseContent)); + + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -312,6 +340,16 @@ public NetworkListResponse call() throws Exception * http://msdn.microsoft.com/en-us/library/windowsazure/jj157185.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The response structure for the Server List operation. */ @Override @@ -340,293 +378,303 @@ public NetworkListResponse list() throws IOException, ServiceException, ParserCo // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - NetworkListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new NetworkListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("VirtualNetworkSites"); - Element virtualNetworkSitesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (virtualNetworkSitesSequenceElement != null) - { - for (int i1 = 0; i1 < virtualNetworkSitesSequenceElement.getElementsByTagName("VirtualNetworkSite").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element virtualNetworkSitesElement = ((org.w3c.dom.Element) virtualNetworkSitesSequenceElement.getElementsByTagName("VirtualNetworkSite").item(i1)); - NetworkListResponse.VirtualNetworkSite virtualNetworkSiteInstance = new NetworkListResponse.VirtualNetworkSite(); - result.getVirtualNetworkSites().add(virtualNetworkSiteInstance); - - NodeList elements2 = virtualNetworkSitesElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - virtualNetworkSiteInstance.setName(nameInstance); - } - - NodeList elements3 = virtualNetworkSitesElement.getElementsByTagName("Label"); - Element labelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent(); - virtualNetworkSiteInstance.setLabel(labelInstance); - } - - NodeList elements4 = virtualNetworkSitesElement.getElementsByTagName("Id"); - Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (idElement != null) - { - String idInstance; - idInstance = idElement.getTextContent(); - virtualNetworkSiteInstance.setId(idInstance); - } - - NodeList elements5 = virtualNetworkSitesElement.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - virtualNetworkSiteInstance.setAffinityGroup(affinityGroupInstance); - } - - NodeList elements6 = virtualNetworkSitesElement.getElementsByTagName("State"); - Element stateElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (stateElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String stateInstance; - stateInstance = stateElement.getTextContent(); - virtualNetworkSiteInstance.setState(stateInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements7 = virtualNetworkSitesElement.getElementsByTagName("AddressSpace"); - Element addressSpaceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (addressSpaceElement != null) + throw ex; + } + + // Create Result + NetworkListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new NetworkListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("VirtualNetworkSites"); + Element virtualNetworkSitesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (virtualNetworkSitesSequenceElement != null) + { + for (int i1 = 0; i1 < virtualNetworkSitesSequenceElement.getElementsByTagName("VirtualNetworkSite").getLength(); i1 = i1 + 1) { - NetworkListResponse.AddressSpace addressSpaceInstance = new NetworkListResponse.AddressSpace(); - virtualNetworkSiteInstance.setAddressSpace(addressSpaceInstance); + org.w3c.dom.Element virtualNetworkSitesElement = ((org.w3c.dom.Element) virtualNetworkSitesSequenceElement.getElementsByTagName("VirtualNetworkSite").item(i1)); + NetworkListResponse.VirtualNetworkSite virtualNetworkSiteInstance = new NetworkListResponse.VirtualNetworkSite(); + result.getVirtualNetworkSites().add(virtualNetworkSiteInstance); - NodeList elements8 = addressSpaceElement.getElementsByTagName("AddressPrefixes"); - Element addressPrefixesSequenceElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (addressPrefixesSequenceElement != null) + NodeList elements2 = virtualNetworkSitesElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) { - for (int i2 = 0; i2 < addressPrefixesSequenceElement.getElementsByTagName("AddressPrefix").getLength(); i2 = i2 + 1) - { - org.w3c.dom.Element addressPrefixesElement = ((org.w3c.dom.Element) addressPrefixesSequenceElement.getElementsByTagName("AddressPrefix").item(i2)); - addressSpaceInstance.getAddressPrefixes().add(addressPrefixesElement.getTextContent()); - } + String nameInstance; + nameInstance = nameElement.getTextContent(); + virtualNetworkSiteInstance.setName(nameInstance); } - } - - NodeList elements9 = virtualNetworkSitesElement.getElementsByTagName("Subnets"); - Element subnetsSequenceElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (subnetsSequenceElement != null) - { - for (int i3 = 0; i3 < subnetsSequenceElement.getElementsByTagName("Subnet").getLength(); i3 = i3 + 1) + + NodeList elements3 = virtualNetworkSitesElement.getElementsByTagName("Label"); + Element labelElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (labelElement != null) { - org.w3c.dom.Element subnetsElement = ((org.w3c.dom.Element) subnetsSequenceElement.getElementsByTagName("Subnet").item(i3)); - NetworkListResponse.Subnet subnetInstance = new NetworkListResponse.Subnet(); - virtualNetworkSiteInstance.getSubnets().add(subnetInstance); - - NodeList elements10 = subnetsElement.getElementsByTagName("Name"); - Element nameElement2 = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance2; - nameInstance2 = nameElement2.getTextContent(); - subnetInstance.setName(nameInstance2); - } + String labelInstance; + labelInstance = labelElement.getTextContent(); + virtualNetworkSiteInstance.setLabel(labelInstance); + } + + NodeList elements4 = virtualNetworkSitesElement.getElementsByTagName("Id"); + Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + virtualNetworkSiteInstance.setId(idInstance); + } + + NodeList elements5 = virtualNetworkSitesElement.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + virtualNetworkSiteInstance.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements6 = virtualNetworkSitesElement.getElementsByTagName("State"); + Element stateElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + virtualNetworkSiteInstance.setState(stateInstance); + } + + NodeList elements7 = virtualNetworkSitesElement.getElementsByTagName("AddressSpace"); + Element addressSpaceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (addressSpaceElement != null) + { + NetworkListResponse.AddressSpace addressSpaceInstance = new NetworkListResponse.AddressSpace(); + virtualNetworkSiteInstance.setAddressSpace(addressSpaceInstance); - NodeList elements11 = subnetsElement.getElementsByTagName("AddressPrefix"); - Element addressPrefixElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (addressPrefixElement != null) + NodeList elements8 = addressSpaceElement.getElementsByTagName("AddressPrefixes"); + Element addressPrefixesSequenceElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (addressPrefixesSequenceElement != null) { - String addressPrefixInstance; - addressPrefixInstance = addressPrefixElement.getTextContent(); - subnetInstance.setAddressPrefix(addressPrefixInstance); + for (int i2 = 0; i2 < addressPrefixesSequenceElement.getElementsByTagName("AddressPrefix").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element addressPrefixesElement = ((org.w3c.dom.Element) addressPrefixesSequenceElement.getElementsByTagName("AddressPrefix").item(i2)); + addressSpaceInstance.getAddressPrefixes().add(addressPrefixesElement.getTextContent()); + } } } - } - - NodeList elements12 = virtualNetworkSitesElement.getElementsByTagName("Dns"); - Element dnsElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (dnsElement != null) - { - NodeList elements13 = dnsElement.getElementsByTagName("DnsServers"); - Element dnsServersSequenceElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (dnsServersSequenceElement != null) + + NodeList elements9 = virtualNetworkSitesElement.getElementsByTagName("Subnets"); + Element subnetsSequenceElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (subnetsSequenceElement != null) { - for (int i4 = 0; i4 < dnsServersSequenceElement.getElementsByTagName("DnsServer").getLength(); i4 = i4 + 1) + for (int i3 = 0; i3 < subnetsSequenceElement.getElementsByTagName("Subnet").getLength(); i3 = i3 + 1) { - org.w3c.dom.Element dnsServersElement = ((org.w3c.dom.Element) dnsServersSequenceElement.getElementsByTagName("DnsServer").item(i4)); - NetworkListResponse.DnsServer dnsServerInstance = new NetworkListResponse.DnsServer(); - virtualNetworkSiteInstance.getDnsServers().add(dnsServerInstance); + org.w3c.dom.Element subnetsElement = ((org.w3c.dom.Element) subnetsSequenceElement.getElementsByTagName("Subnet").item(i3)); + NetworkListResponse.Subnet subnetInstance = new NetworkListResponse.Subnet(); + virtualNetworkSiteInstance.getSubnets().add(subnetInstance); - NodeList elements14 = dnsServersElement.getElementsByTagName("Name"); - Element nameElement3 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (nameElement3 != null) + NodeList elements10 = subnetsElement.getElementsByTagName("Name"); + Element nameElement2 = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (nameElement2 != null) { - String nameInstance3; - nameInstance3 = nameElement3.getTextContent(); - dnsServerInstance.setName(nameInstance3); + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + subnetInstance.setName(nameInstance2); } - NodeList elements15 = dnsServersElement.getElementsByTagName("Address"); - Element addressElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (addressElement != null) + NodeList elements11 = subnetsElement.getElementsByTagName("AddressPrefix"); + Element addressPrefixElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (addressPrefixElement != null) { - InetAddress addressInstance; - addressInstance = InetAddress.getByName(addressElement.getTextContent()); - dnsServerInstance.setAddress(addressInstance); + String addressPrefixInstance; + addressPrefixInstance = addressPrefixElement.getTextContent(); + subnetInstance.setAddressPrefix(addressPrefixInstance); } } } - } - - NodeList elements16 = virtualNetworkSitesElement.getElementsByTagName("Gateway"); - Element gatewayElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (gatewayElement != null) - { - NetworkListResponse.Gateway gatewayInstance = new NetworkListResponse.Gateway(); - virtualNetworkSiteInstance.setGateway(gatewayInstance); - NodeList elements17 = gatewayElement.getElementsByTagName("Profile"); - Element profileElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (profileElement != null) + NodeList elements12 = virtualNetworkSitesElement.getElementsByTagName("Dns"); + Element dnsElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (dnsElement != null) { - GatewayProfile profileInstance; - profileInstance = GatewayProfile.valueOf(profileElement.getTextContent()); - gatewayInstance.setProfile(profileInstance); + NodeList elements13 = dnsElement.getElementsByTagName("DnsServers"); + Element dnsServersSequenceElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (dnsServersSequenceElement != null) + { + for (int i4 = 0; i4 < dnsServersSequenceElement.getElementsByTagName("DnsServer").getLength(); i4 = i4 + 1) + { + org.w3c.dom.Element dnsServersElement = ((org.w3c.dom.Element) dnsServersSequenceElement.getElementsByTagName("DnsServer").item(i4)); + NetworkListResponse.DnsServer dnsServerInstance = new NetworkListResponse.DnsServer(); + virtualNetworkSiteInstance.getDnsServers().add(dnsServerInstance); + + NodeList elements14 = dnsServersElement.getElementsByTagName("Name"); + Element nameElement3 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (nameElement3 != null) + { + String nameInstance3; + nameInstance3 = nameElement3.getTextContent(); + dnsServerInstance.setName(nameInstance3); + } + + NodeList elements15 = dnsServersElement.getElementsByTagName("Address"); + Element addressElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (addressElement != null) + { + InetAddress addressInstance; + addressInstance = InetAddress.getByName(addressElement.getTextContent()); + dnsServerInstance.setAddress(addressInstance); + } + } + } } - NodeList elements18 = gatewayElement.getElementsByTagName("Sites"); - Element sitesSequenceElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (sitesSequenceElement != null) + NodeList elements16 = virtualNetworkSitesElement.getElementsByTagName("Gateway"); + Element gatewayElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (gatewayElement != null) { - for (int i5 = 0; i5 < sitesSequenceElement.getElementsByTagName("LocalNetworkSite").getLength(); i5 = i5 + 1) + NetworkListResponse.Gateway gatewayInstance = new NetworkListResponse.Gateway(); + virtualNetworkSiteInstance.setGateway(gatewayInstance); + + NodeList elements17 = gatewayElement.getElementsByTagName("Profile"); + Element profileElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (profileElement != null) { - org.w3c.dom.Element sitesElement = ((org.w3c.dom.Element) sitesSequenceElement.getElementsByTagName("LocalNetworkSite").item(i5)); - NetworkListResponse.LocalNetworkSite localNetworkSiteInstance = new NetworkListResponse.LocalNetworkSite(); - gatewayInstance.getSites().add(localNetworkSiteInstance); - - NodeList elements19 = sitesElement.getElementsByTagName("Name"); - Element nameElement4 = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (nameElement4 != null) - { - String nameInstance4; - nameInstance4 = nameElement4.getTextContent(); - localNetworkSiteInstance.setName(nameInstance4); - } - - NodeList elements20 = sitesElement.getElementsByTagName("VpnGatewayAddress"); - Element vpnGatewayAddressElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (vpnGatewayAddressElement != null) - { - InetAddress vpnGatewayAddressInstance; - vpnGatewayAddressInstance = InetAddress.getByName(vpnGatewayAddressElement.getTextContent()); - localNetworkSiteInstance.setVpnGatewayAddress(vpnGatewayAddressInstance); - } - - NodeList elements21 = sitesElement.getElementsByTagName("AddressSpace"); - Element addressSpaceElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (addressSpaceElement2 != null) + GatewayProfile profileInstance; + profileInstance = GatewayProfile.valueOf(profileElement.getTextContent()); + gatewayInstance.setProfile(profileInstance); + } + + NodeList elements18 = gatewayElement.getElementsByTagName("Sites"); + Element sitesSequenceElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (sitesSequenceElement != null) + { + for (int i5 = 0; i5 < sitesSequenceElement.getElementsByTagName("LocalNetworkSite").getLength(); i5 = i5 + 1) { - NetworkListResponse.AddressSpace addressSpaceInstance2 = new NetworkListResponse.AddressSpace(); - localNetworkSiteInstance.setAddressSpace(addressSpaceInstance2); + org.w3c.dom.Element sitesElement = ((org.w3c.dom.Element) sitesSequenceElement.getElementsByTagName("LocalNetworkSite").item(i5)); + NetworkListResponse.LocalNetworkSite localNetworkSiteInstance = new NetworkListResponse.LocalNetworkSite(); + gatewayInstance.getSites().add(localNetworkSiteInstance); + + NodeList elements19 = sitesElement.getElementsByTagName("Name"); + Element nameElement4 = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (nameElement4 != null) + { + String nameInstance4; + nameInstance4 = nameElement4.getTextContent(); + localNetworkSiteInstance.setName(nameInstance4); + } - NodeList elements22 = addressSpaceElement2.getElementsByTagName("AddressPrefixes"); - Element addressPrefixesSequenceElement2 = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (addressPrefixesSequenceElement2 != null) + NodeList elements20 = sitesElement.getElementsByTagName("VpnGatewayAddress"); + Element vpnGatewayAddressElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (vpnGatewayAddressElement != null) { - for (int i6 = 0; i6 < addressPrefixesSequenceElement2.getElementsByTagName("AddressPrefix").getLength(); i6 = i6 + 1) + InetAddress vpnGatewayAddressInstance; + vpnGatewayAddressInstance = InetAddress.getByName(vpnGatewayAddressElement.getTextContent()); + localNetworkSiteInstance.setVpnGatewayAddress(vpnGatewayAddressInstance); + } + + NodeList elements21 = sitesElement.getElementsByTagName("AddressSpace"); + Element addressSpaceElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (addressSpaceElement2 != null) + { + NetworkListResponse.AddressSpace addressSpaceInstance2 = new NetworkListResponse.AddressSpace(); + localNetworkSiteInstance.setAddressSpace(addressSpaceInstance2); + + NodeList elements22 = addressSpaceElement2.getElementsByTagName("AddressPrefixes"); + Element addressPrefixesSequenceElement2 = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (addressPrefixesSequenceElement2 != null) { - org.w3c.dom.Element addressPrefixesElement2 = ((org.w3c.dom.Element) addressPrefixesSequenceElement2.getElementsByTagName("AddressPrefix").item(i6)); - addressSpaceInstance2.getAddressPrefixes().add(addressPrefixesElement2.getTextContent()); + for (int i6 = 0; i6 < addressPrefixesSequenceElement2.getElementsByTagName("AddressPrefix").getLength(); i6 = i6 + 1) + { + org.w3c.dom.Element addressPrefixesElement2 = ((org.w3c.dom.Element) addressPrefixesSequenceElement2.getElementsByTagName("AddressPrefix").item(i6)); + addressSpaceInstance2.getAddressPrefixes().add(addressPrefixesElement2.getTextContent()); + } } } - } - - NodeList elements23 = sitesElement.getElementsByTagName("Connections"); - Element connectionsSequenceElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (connectionsSequenceElement != null) - { - for (int i7 = 0; i7 < connectionsSequenceElement.getElementsByTagName("Connection").getLength(); i7 = i7 + 1) + + NodeList elements23 = sitesElement.getElementsByTagName("Connections"); + Element connectionsSequenceElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (connectionsSequenceElement != null) { - org.w3c.dom.Element connectionsElement = ((org.w3c.dom.Element) connectionsSequenceElement.getElementsByTagName("Connection").item(i7)); - NetworkListResponse.Connection connectionInstance = new NetworkListResponse.Connection(); - localNetworkSiteInstance.getConnections().add(connectionInstance); - - NodeList elements24 = connectionsElement.getElementsByTagName("Type"); - Element typeElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (typeElement != null) + for (int i7 = 0; i7 < connectionsSequenceElement.getElementsByTagName("Connection").getLength(); i7 = i7 + 1) { - LocalNetworkConnectionType typeInstance; - typeInstance = VirtualNetworkManagementClientImpl.parseLocalNetworkConnectionType(typeElement.getTextContent()); - connectionInstance.setType(typeInstance); + org.w3c.dom.Element connectionsElement = ((org.w3c.dom.Element) connectionsSequenceElement.getElementsByTagName("Connection").item(i7)); + NetworkListResponse.Connection connectionInstance = new NetworkListResponse.Connection(); + localNetworkSiteInstance.getConnections().add(connectionInstance); + + NodeList elements24 = connectionsElement.getElementsByTagName("Type"); + Element typeElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (typeElement != null) + { + LocalNetworkConnectionType typeInstance; + typeInstance = VirtualNetworkManagementClientImpl.parseLocalNetworkConnectionType(typeElement.getTextContent()); + connectionInstance.setType(typeInstance); + } } } } } - } - - NodeList elements25 = gatewayElement.getElementsByTagName("VPNClientAddressPool"); - Element vPNClientAddressPoolElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (vPNClientAddressPoolElement != null) - { - NetworkListResponse.VPNClientAddressPool vPNClientAddressPoolInstance = new NetworkListResponse.VPNClientAddressPool(); - gatewayInstance.setVPNClientAddressPool(vPNClientAddressPoolInstance); - NodeList elements26 = vPNClientAddressPoolElement.getElementsByTagName("AddressPrefixes"); - Element addressPrefixesSequenceElement3 = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (addressPrefixesSequenceElement3 != null) + NodeList elements25 = gatewayElement.getElementsByTagName("VPNClientAddressPool"); + Element vPNClientAddressPoolElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (vPNClientAddressPoolElement != null) { - for (int i8 = 0; i8 < addressPrefixesSequenceElement3.getElementsByTagName("AddressPrefix").getLength(); i8 = i8 + 1) + NetworkListResponse.VPNClientAddressPool vPNClientAddressPoolInstance = new NetworkListResponse.VPNClientAddressPool(); + gatewayInstance.setVPNClientAddressPool(vPNClientAddressPoolInstance); + + NodeList elements26 = vPNClientAddressPoolElement.getElementsByTagName("AddressPrefixes"); + Element addressPrefixesSequenceElement3 = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (addressPrefixesSequenceElement3 != null) { - org.w3c.dom.Element addressPrefixesElement3 = ((org.w3c.dom.Element) addressPrefixesSequenceElement3.getElementsByTagName("AddressPrefix").item(i8)); - vPNClientAddressPoolInstance.getAddressPrefixes().add(addressPrefixesElement3.getTextContent()); + for (int i8 = 0; i8 < addressPrefixesSequenceElement3.getElementsByTagName("AddressPrefix").getLength(); i8 = i8 + 1) + { + org.w3c.dom.Element addressPrefixesElement3 = ((org.w3c.dom.Element) addressPrefixesSequenceElement3.getElementsByTagName("AddressPrefix").item(i8)); + vPNClientAddressPoolInstance.getAddressPrefixes().add(addressPrefixesElement3.getTextContent()); + } } } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -665,6 +713,18 @@ public VirtualNetworkOperationStatusResponse call() throws Exception * more information) * * @param parameters The updated network configuration. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ReservedIPOperations.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ReservedIPOperations.java index bf38d96a67581..57fda70c47de8 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ReservedIPOperations.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ReservedIPOperations.java @@ -30,12 +30,10 @@ import com.microsoft.windowsazure.management.virtualnetworks.models.NetworkReservedIPListResponse; import com.microsoft.windowsazure.management.virtualnetworks.models.VirtualNetworkOperationStatusResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.text.ParseException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -47,6 +45,16 @@ public interface ReservedIPOperations * * @param parameters Parameters supplied to the Create Virtual Machine Image * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -57,7 +65,7 @@ public interface ReservedIPOperations * the failed request, and also includes error information regarding the * failure. */ - VirtualNetworkOperationStatusResponse beginCreating(NetworkReservedIPCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + VirtualNetworkOperationStatusResponse beginCreating(NetworkReservedIPCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * Preview Only. The Create Reserved IP operation creates a reserved IP from @@ -82,6 +90,14 @@ public interface ReservedIPOperations * your the subscription. * * @param ipName The name of the reserved IP. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -103,6 +119,24 @@ public interface ReservedIPOperations * * @param parameters Parameters supplied to the Create Virtual Machine Image * operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -113,7 +147,7 @@ public interface ReservedIPOperations * the failed request, and also includes error information regarding the * failure. */ - VirtualNetworkOperationStatusResponse create(NetworkReservedIPCreateParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException; + VirtualNetworkOperationStatusResponse create(NetworkReservedIPCreateParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException; /** * The Create Reserved IP operation creates a reserved IP from your the @@ -138,6 +172,24 @@ public interface ReservedIPOperations * subscription. * * @param ipName The name of the reserved IP. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -172,6 +224,16 @@ public interface ReservedIPOperations * virtual IP reserved for the subscription. * * @param ipName The name of the reserved IP to retrieve. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Preview Only. A reserved IP associated with your subscription. */ NetworkReservedIPGetResponse get(String ipName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; @@ -189,6 +251,16 @@ public interface ReservedIPOperations * Preview Only. The List Reserved IP operation retrieves the virtual IPs * reserved for the subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Preview Only. The response structure for the Server List operation */ NetworkReservedIPListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ReservedIPOperationsImpl.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ReservedIPOperationsImpl.java index 4293fbb867ac0..9ab65dcb3ca06 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ReservedIPOperationsImpl.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/ReservedIPOperationsImpl.java @@ -37,7 +37,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.text.ParseException; import java.util.HashMap; @@ -48,7 +47,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -80,6 +78,7 @@ public class ReservedIPOperationsImpl implements ServiceOperations 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + VirtualNetworkOperationStatusResponse result = null; + result = new VirtualNetworkOperationStatusResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -278,6 +297,14 @@ public OperationResponse call() throws Exception * your the subscription. * * @param ipName The name of the reserved IP. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return A standard storage response including an HTTP status code and * request ID. */ @@ -313,40 +340,50 @@ public OperationResponse beginDeleting(String ipName) throws IOException, Servic // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -383,6 +420,24 @@ public VirtualNetworkOperationStatusResponse call() throws Exception * * @param parameters Parameters supplied to the Create Virtual Machine Image * operation. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -394,7 +449,7 @@ public VirtualNetworkOperationStatusResponse call() throws Exception * failure. */ @Override - public VirtualNetworkOperationStatusResponse create(NetworkReservedIPCreateParameters parameters) throws UnsupportedEncodingException, IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException + public VirtualNetworkOperationStatusResponse create(NetworkReservedIPCreateParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, InterruptedException, ExecutionException, ServiceException { VirtualNetworkManagementClient client2 = this.getClient(); boolean shouldTrace = CloudTracing.getIsEnabled(); @@ -495,6 +550,24 @@ public VirtualNetworkOperationStatusResponse call() throws Exception * subscription. * * @param ipName The name of the reserved IP. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. * @return The response body contains the status of the specified * asynchronous operation, indicating whether it has succeeded, is * inprogress, or has failed. Note that this status is distinct from the @@ -599,6 +672,16 @@ public NetworkReservedIPGetResponse call() throws Exception * virtual IP reserved for the subscription. * * @param ipName The name of the reserved IP to retrieve. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Preview Only. A reserved IP associated with your subscription. */ @Override @@ -632,132 +715,142 @@ public NetworkReservedIPGetResponse get(String ipName) throws IOException, Servi // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - NetworkReservedIPGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new NetworkReservedIPGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ReservedIP"); - Element reservedIPElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (reservedIPElement != null) - { - NodeList elements2 = reservedIPElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements3 = reservedIPElement.getElementsByTagName("Address"); - Element addressElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (addressElement != null) - { - InetAddress addressInstance; - addressInstance = InetAddress.getByName(addressElement.getTextContent()); - result.setAddress(addressInstance); - } - - NodeList elements4 = reservedIPElement.getElementsByTagName("Id"); - Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (idElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements5 = reservedIPElement.getElementsByTagName("Label"); - Element labelElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (labelElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - String labelInstance; - labelInstance = labelElement.getTextContent(); - result.setLabel(labelInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements6 = reservedIPElement.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - result.setAffinityGroup(affinityGroupInstance); - } + // Create Result + NetworkReservedIPGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new NetworkReservedIPGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements7 = reservedIPElement.getElementsByTagName("State"); - Element stateElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (stateElement != null) + NodeList elements = responseDoc.getElementsByTagName("ReservedIP"); + Element reservedIPElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (reservedIPElement != null) { - String stateInstance; - stateInstance = stateElement.getTextContent(); - result.setState(stateInstance); - } - - NodeList elements8 = reservedIPElement.getElementsByTagName("InUse"); - Element inUseElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (inUseElement != null) - { - boolean inUseInstance; - inUseInstance = Boolean.parseBoolean(inUseElement.getTextContent()); - result.setInUse(inUseInstance); + NodeList elements2 = reservedIPElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = reservedIPElement.getElementsByTagName("Address"); + Element addressElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (addressElement != null) + { + InetAddress addressInstance; + addressInstance = InetAddress.getByName(addressElement.getTextContent()); + result.setAddress(addressInstance); + } + + NodeList elements4 = reservedIPElement.getElementsByTagName("Id"); + Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setId(idInstance); + } + + NodeList elements5 = reservedIPElement.getElementsByTagName("Label"); + Element labelElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent(); + result.setLabel(labelInstance); + } + + NodeList elements6 = reservedIPElement.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + result.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements7 = reservedIPElement.getElementsByTagName("State"); + Element stateElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + result.setState(stateInstance); + } + + NodeList elements8 = reservedIPElement.getElementsByTagName("InUse"); + Element inUseElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (inUseElement != null) + { + boolean inUseInstance; + inUseInstance = Boolean.parseBoolean(inUseElement.getTextContent()); + result.setInUse(inUseInstance); + } + + NodeList elements9 = reservedIPElement.getElementsByTagName("ServiceName"); + Element serviceNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (serviceNameElement != null) + { + String serviceNameInstance; + serviceNameInstance = serviceNameElement.getTextContent(); + result.setServiceName(serviceNameInstance); + } + + NodeList elements10 = reservedIPElement.getElementsByTagName("DeploymentName"); + Element deploymentNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (deploymentNameElement != null) + { + String deploymentNameInstance; + deploymentNameInstance = deploymentNameElement.getTextContent(); + result.setDeploymentName(deploymentNameInstance); + } } - NodeList elements9 = reservedIPElement.getElementsByTagName("ServiceName"); - Element serviceNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (serviceNameElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - String serviceNameInstance; - serviceNameInstance = serviceNameElement.getTextContent(); - result.setServiceName(serviceNameInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements10 = reservedIPElement.getElementsByTagName("DeploymentName"); - Element deploymentNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (deploymentNameElement != null) + if (shouldTrace) { - String deploymentNameInstance; - deploymentNameInstance = deploymentNameElement.getTextContent(); - result.setDeploymentName(deploymentNameInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -782,6 +875,16 @@ public NetworkReservedIPListResponse call() throws Exception * Preview Only. The List Reserved IP operation retrieves the virtual IPs * reserved for the subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return Preview Only. The response structure for the Server List operation */ @Override @@ -810,138 +913,148 @@ public NetworkReservedIPListResponse list() throws IOException, ServiceException // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - NetworkReservedIPListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new NetworkReservedIPListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ReservedIPs"); - Element reservedIPsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (reservedIPsSequenceElement != null) - { - for (int i1 = 0; i1 < reservedIPsSequenceElement.getElementsByTagName("ReservedIP").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element reservedIPsElement = ((org.w3c.dom.Element) reservedIPsSequenceElement.getElementsByTagName("ReservedIP").item(i1)); - NetworkReservedIPListResponse.ReservedIP reservedIPInstance = new NetworkReservedIPListResponse.ReservedIP(); - result.getReservedIPs().add(reservedIPInstance); - - NodeList elements2 = reservedIPsElement.getElementsByTagName("Name"); - Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - reservedIPInstance.setName(nameInstance); - } - - NodeList elements3 = reservedIPsElement.getElementsByTagName("Address"); - Element addressElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (addressElement != null) - { - InetAddress addressInstance; - addressInstance = InetAddress.getByName(addressElement.getTextContent()); - reservedIPInstance.setAddress(addressInstance); - } - - NodeList elements4 = reservedIPsElement.getElementsByTagName("Id"); - Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (idElement != null) - { - String idInstance; - idInstance = idElement.getTextContent(); - reservedIPInstance.setId(idInstance); - } - - NodeList elements5 = reservedIPsElement.getElementsByTagName("Label"); - Element labelElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (labelElement != null) - { - String labelInstance; - labelInstance = labelElement.getTextContent(); - reservedIPInstance.setLabel(labelInstance); - } - - NodeList elements6 = reservedIPsElement.getElementsByTagName("AffinityGroup"); - Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (affinityGroupElement != null) - { - String affinityGroupInstance; - affinityGroupInstance = affinityGroupElement.getTextContent(); - reservedIPInstance.setAffinityGroup(affinityGroupInstance); - } - - NodeList elements7 = reservedIPsElement.getElementsByTagName("State"); - Element stateElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (stateElement != null) - { - String stateInstance; - stateInstance = stateElement.getTextContent(); - reservedIPInstance.setState(stateInstance); - } - - NodeList elements8 = reservedIPsElement.getElementsByTagName("InUse"); - Element inUseElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (inUseElement != null) - { - boolean inUseInstance; - inUseInstance = Boolean.parseBoolean(inUseElement.getTextContent()); - reservedIPInstance.setInUse(inUseInstance); - } - - NodeList elements9 = reservedIPsElement.getElementsByTagName("ServiceName"); - Element serviceNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (serviceNameElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String serviceNameInstance; - serviceNameInstance = serviceNameElement.getTextContent(); - reservedIPInstance.setServiceName(serviceNameInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements10 = reservedIPsElement.getElementsByTagName("DeploymentName"); - Element deploymentNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (deploymentNameElement != null) + throw ex; + } + + // Create Result + NetworkReservedIPListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new NetworkReservedIPListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ReservedIPs"); + Element reservedIPsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (reservedIPsSequenceElement != null) + { + for (int i1 = 0; i1 < reservedIPsSequenceElement.getElementsByTagName("ReservedIP").getLength(); i1 = i1 + 1) { - String deploymentNameInstance; - deploymentNameInstance = deploymentNameElement.getTextContent(); - reservedIPInstance.setDeploymentName(deploymentNameInstance); + org.w3c.dom.Element reservedIPsElement = ((org.w3c.dom.Element) reservedIPsSequenceElement.getElementsByTagName("ReservedIP").item(i1)); + NetworkReservedIPListResponse.ReservedIP reservedIPInstance = new NetworkReservedIPListResponse.ReservedIP(); + result.getReservedIPs().add(reservedIPInstance); + + NodeList elements2 = reservedIPsElement.getElementsByTagName("Name"); + Element nameElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + reservedIPInstance.setName(nameInstance); + } + + NodeList elements3 = reservedIPsElement.getElementsByTagName("Address"); + Element addressElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (addressElement != null) + { + InetAddress addressInstance; + addressInstance = InetAddress.getByName(addressElement.getTextContent()); + reservedIPInstance.setAddress(addressInstance); + } + + NodeList elements4 = reservedIPsElement.getElementsByTagName("Id"); + Element idElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + reservedIPInstance.setId(idInstance); + } + + NodeList elements5 = reservedIPsElement.getElementsByTagName("Label"); + Element labelElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (labelElement != null) + { + String labelInstance; + labelInstance = labelElement.getTextContent(); + reservedIPInstance.setLabel(labelInstance); + } + + NodeList elements6 = reservedIPsElement.getElementsByTagName("AffinityGroup"); + Element affinityGroupElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (affinityGroupElement != null) + { + String affinityGroupInstance; + affinityGroupInstance = affinityGroupElement.getTextContent(); + reservedIPInstance.setAffinityGroup(affinityGroupInstance); + } + + NodeList elements7 = reservedIPsElement.getElementsByTagName("State"); + Element stateElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (stateElement != null) + { + String stateInstance; + stateInstance = stateElement.getTextContent(); + reservedIPInstance.setState(stateInstance); + } + + NodeList elements8 = reservedIPsElement.getElementsByTagName("InUse"); + Element inUseElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (inUseElement != null) + { + boolean inUseInstance; + inUseInstance = Boolean.parseBoolean(inUseElement.getTextContent()); + reservedIPInstance.setInUse(inUseInstance); + } + + NodeList elements9 = reservedIPsElement.getElementsByTagName("ServiceName"); + Element serviceNameElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (serviceNameElement != null) + { + String serviceNameInstance; + serviceNameInstance = serviceNameElement.getTextContent(); + reservedIPInstance.setServiceName(serviceNameInstance); + } + + NodeList elements10 = reservedIPsElement.getElementsByTagName("DeploymentName"); + Element deploymentNameElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (deploymentNameElement != null) + { + String deploymentNameInstance; + deploymentNameInstance = deploymentNameElement.getTextContent(); + reservedIPInstance.setDeploymentName(deploymentNameInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/StaticIPOperations.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/StaticIPOperations.java new file mode 100644 index 0000000000000..acd3cbd5f7c47 --- /dev/null +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/StaticIPOperations.java @@ -0,0 +1,65 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.virtualnetworks; + +import com.microsoft.windowsazure.exception.ServiceException; +import com.microsoft.windowsazure.management.virtualnetworks.models.NetworkStaticIPAvailabilityResponse; +import java.io.IOException; +import java.net.InetAddress; +import java.util.concurrent.Future; +import javax.xml.parsers.ParserConfigurationException; +import org.xml.sax.SAXException; + +public interface StaticIPOperations +{ + /** + * The Check Static IP operation retrieves the details for the availability + * of static IP addresses for the given virtual network. + * + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The address of the static IP. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @return A response that indicates the availability of a static IP + * address, and if not, provide a list of suggestions. + */ + NetworkStaticIPAvailabilityResponse check(String virtualNetworkName, InetAddress ipAddress) throws IOException, ServiceException, ParserConfigurationException, SAXException; + + /** + * The Check Static IP operation retrieves the details for the availability + * of static IP addresses for the given virtual network. + * + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The address of the static IP. + * @return A response that indicates the availability of a static IP + * address, and if not, provide a list of suggestions. + */ + Future checkAsync(String virtualNetworkName, InetAddress ipAddress); +} diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/StaticIPOperationsImpl.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/StaticIPOperationsImpl.java new file mode 100644 index 0000000000000..cc67ea7e9e0db --- /dev/null +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/StaticIPOperationsImpl.java @@ -0,0 +1,221 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.virtualnetworks; + +import com.microsoft.windowsazure.core.ServiceOperations; +import com.microsoft.windowsazure.exception.ServiceException; +import com.microsoft.windowsazure.management.virtualnetworks.models.NetworkStaticIPAvailabilityResponse; +import com.microsoft.windowsazure.tracing.CloudTracing; +import java.io.IOException; +import java.io.InputStream; +import java.net.InetAddress; +import java.util.HashMap; +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.client.methods.HttpGet; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class StaticIPOperationsImpl implements ServiceOperations, StaticIPOperations +{ + /** + * Initializes a new instance of the StaticIPOperationsImpl class. + * + * @param client Reference to the service client. + */ + StaticIPOperationsImpl(VirtualNetworkManagementClientImpl client) + { + this.client = client; + } + + private VirtualNetworkManagementClientImpl client; + + /** + * Gets a reference to the + * microsoft.windowsazure.management.virtualnetworks.VirtualNetworkManagementClientImpl. + * @return The Client value. + */ + public VirtualNetworkManagementClientImpl getClient() + { + return this.client; + } + + /** + * The Check Static IP operation retrieves the details for the availability + * of static IP addresses for the given virtual network. + * + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The address of the static IP. + * @return A response that indicates the availability of a static IP + * address, and if not, provide a list of suggestions. + */ + @Override + public Future checkAsync(final String virtualNetworkName, final InetAddress ipAddress) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public NetworkStaticIPAvailabilityResponse call() throws Exception + { + return check(virtualNetworkName, ipAddress); + } + }); + } + + /** + * The Check Static IP operation retrieves the details for the availability + * of static IP addresses for the given virtual network. + * + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The address of the static IP. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @return A response that indicates the availability of a static IP + * address, and if not, provide a list of suggestions. + */ + @Override + public NetworkStaticIPAvailabilityResponse check(String virtualNetworkName, InetAddress ipAddress) throws IOException, ServiceException, ParserConfigurationException, SAXException + { + // Validate + if (virtualNetworkName == null) + { + throw new NullPointerException("virtualNetworkName"); + } + if (ipAddress == null) + { + throw new NullPointerException("ipAddress"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("virtualNetworkName", virtualNetworkName); + tracingParameters.put("ipAddress", ipAddress); + CloudTracing.enter(invocationId, this, "checkAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/networking/" + virtualNetworkName + "?op=checkavailability&address=" + ipAddress; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-11-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + NetworkStaticIPAvailabilityResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new NetworkStaticIPAvailabilityResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("AddressAvailabilityResponse"); + Element addressAvailabilityResponseElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (addressAvailabilityResponseElement != null) + { + NodeList elements2 = addressAvailabilityResponseElement.getElementsByTagName("IsAvailable"); + Element isAvailableElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (isAvailableElement != null) + { + boolean isAvailableInstance; + isAvailableInstance = Boolean.parseBoolean(isAvailableElement.getTextContent()); + result.setIsAvailable(isAvailableInstance); + } + + NodeList elements3 = addressAvailabilityResponseElement.getElementsByTagName("AvailableAddresses"); + Element availableAddressesSequenceElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (availableAddressesSequenceElement != null) + { + for (int i1 = 0; i1 < availableAddressesSequenceElement.getElementsByTagName("AvailableAddress").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element availableAddressesElement = ((org.w3c.dom.Element) availableAddressesSequenceElement.getElementsByTagName("AvailableAddress").item(i1)); + result.getAvailableAddresses().add(InetAddress.getByName(availableAddressesElement.getTextContent())); + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } +} diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/VirtualNetworkManagementClient.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/VirtualNetworkManagementClient.java index d8496940a1ceb..071b32837f485 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/VirtualNetworkManagementClient.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/VirtualNetworkManagementClient.java @@ -43,6 +43,7 @@ public interface VirtualNetworkManagementClient extends FilterableService 0 ? ((Element) elements.item(0)) : null; - if (operationElement != null) - { - NodeList elements2 = operationElement.getElementsByTagName("ID"); - Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (idElement != null) + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) { - String idInstance; - idInstance = idElement.getTextContent(); - result.setId(idInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = operationElement.getElementsByTagName("Status"); - Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (statusElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - OperationStatus statusInstance; - statusInstance = OperationStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); - Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (httpStatusCodeElement != null) - { - Integer httpStatusCodeInstance; - httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); - result.setHttpStatusCode(httpStatusCodeInstance); - } + // Create Result + VirtualNetworkOperationStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new VirtualNetworkOperationStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements5 = operationElement.getElementsByTagName("Error"); - Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (errorElement != null) + NodeList elements = responseDoc.getElementsByTagName("Operation"); + Element operationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operationElement != null) { - VirtualNetworkOperationStatusResponse.ErrorDetails errorInstance = new VirtualNetworkOperationStatusResponse.ErrorDetails(); - result.setError(errorInstance); + NodeList elements2 = operationElement.getElementsByTagName("ID"); + Element idElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (idElement != null) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setId(idInstance); + } + + NodeList elements3 = operationElement.getElementsByTagName("Status"); + Element statusElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (statusElement != null) + { + OperationStatus statusInstance; + statusInstance = OperationStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); + } - NodeList elements6 = errorElement.getElementsByTagName("Code"); - Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (codeElement != null) + NodeList elements4 = operationElement.getElementsByTagName("HttpStatusCode"); + Element httpStatusCodeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (httpStatusCodeElement != null) { - String codeInstance; - codeInstance = codeElement.getTextContent(); - errorInstance.setCode(codeInstance); + Integer httpStatusCodeInstance; + httpStatusCodeInstance = Integer.valueOf(httpStatusCodeElement.getTextContent()); + result.setHttpStatusCode(httpStatusCodeInstance); } - NodeList elements7 = errorElement.getElementsByTagName("Message"); - Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (messageElement != null) + NodeList elements5 = operationElement.getElementsByTagName("Error"); + Element errorElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (errorElement != null) { - String messageInstance; - messageInstance = messageElement.getTextContent(); - errorInstance.setMessage(messageInstance); + VirtualNetworkOperationStatusResponse.ErrorDetails errorInstance = new VirtualNetworkOperationStatusResponse.ErrorDetails(); + result.setError(errorInstance); + + NodeList elements6 = errorElement.getElementsByTagName("Code"); + Element codeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (codeElement != null) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + errorInstance.setCode(codeInstance); + } + + NodeList elements7 = errorElement.getElementsByTagName("Message"); + Element messageElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateCreateParameters.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateCreateParameters.java index 0361d06a05db5..f268486e93316 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateCreateParameters.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateCreateParameters.java @@ -30,6 +30,7 @@ public class ClientRootCertificateCreateParameters /** * The new client root certificate to upload, represented as a hex encoded * string + * @return The Certificate value. */ public String getCertificate() { @@ -39,9 +40,10 @@ public String getCertificate() /** * The new client root certificate to upload, represented as a hex encoded * string + * @param certificateValue The Certificate value. */ - public void setCertificate(String certificate) + public void setCertificate(final String certificateValue) { - this.certificate = certificate; + this.certificate = certificateValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateGetResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateGetResponse.java index a5336a797032b..f3fff92a7e93a 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateGetResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateGetResponse.java @@ -34,6 +34,7 @@ public class ClientRootCertificateGetResponse extends OperationResponse /** * The current client root certificate for the network gateway. + * @return The Certificate value. */ public String getCertificate() { @@ -42,9 +43,10 @@ public String getCertificate() /** * The current client root certificate for the network gateway. + * @param certificateValue The Certificate value. */ - public void setCertificate(String certificate) + public void setCertificate(final String certificateValue) { - this.certificate = certificate; + this.certificate = certificateValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateListResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateListResponse.java index d10c0fcc21e4c..19d582876cbde 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateListResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/ClientRootCertificateListResponse.java @@ -37,6 +37,7 @@ public class ClientRootCertificateListResponse extends OperationResponse impleme /** * The list of client root certificates. + * @return The ClientRootCertificates value. */ public ArrayList getClientRootCertificates() { @@ -45,10 +46,11 @@ public ArrayList getCli /** * The list of client root certificates. + * @param clientRootCertificatesValue The ClientRootCertificates value. */ - public void setClientRootCertificates(ArrayList clientRootCertificates) + public void setClientRootCertificates(final ArrayList clientRootCertificatesValue) { - this.clientRootCertificates = clientRootCertificates; + this.clientRootCertificates = clientRootCertificatesValue; } /** @@ -76,6 +78,7 @@ public static class ClientRootCertificate /** * Specifies the time that the certificate will expire. + * @return The ExpirationTime value. */ public Calendar getExpirationTime() { @@ -84,16 +87,18 @@ public Calendar getExpirationTime() /** * Specifies the time that the certificate will expire. + * @param expirationTimeValue The ExpirationTime value. */ - public void setExpirationTime(Calendar expirationTime) + public void setExpirationTime(final Calendar expirationTimeValue) { - this.expirationTime = expirationTime; + this.expirationTime = expirationTimeValue; } private String subject; /** * Specifies the distinguished name of the certificate issuer. + * @return The Subject value. */ public String getSubject() { @@ -102,16 +107,18 @@ public String getSubject() /** * Specifies the distinguished name of the certificate issuer. + * @param subjectValue The Subject value. */ - public void setSubject(String subject) + public void setSubject(final String subjectValue) { - this.subject = subject; + this.subject = subjectValue; } private String thumbprint; /** * Specifies the thumbprint of the certificate. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -120,10 +127,11 @@ public String getThumbprint() /** * Specifies the thumbprint of the certificate. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayConnectDisconnectOrTestParameters.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayConnectDisconnectOrTestParameters.java index d3f3895eeaf60..0b5c4d507d785 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayConnectDisconnectOrTestParameters.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayConnectDisconnectOrTestParameters.java @@ -36,6 +36,7 @@ public class GatewayConnectDisconnectOrTestParameters * Required if operation is set to Test; otherwise not used. Specifies the * IP address of the target local network site with which the gateway will * test connectivity. + * @return The IPAddress value. */ public InetAddress getIPAddress() { @@ -46,10 +47,11 @@ public InetAddress getIPAddress() * Required if operation is set to Test; otherwise not used. Specifies the * IP address of the target local network site with which the gateway will * test connectivity. + * @param iPAddressValue The IPAddress value. */ - public void setIPAddress(InetAddress iPAddress) + public void setIPAddress(final InetAddress iPAddressValue) { - this.iPAddress = iPAddress; + this.iPAddress = iPAddressValue; } private GatewayConnectionUpdateOperation operation; @@ -59,6 +61,7 @@ public void setIPAddress(InetAddress iPAddress) * set to Connect, Disconnect or Test to connect to a local network, * disconnect from a local network, or test the gateway’s connection to a * local network site. + * @return The Operation value. */ public GatewayConnectionUpdateOperation getOperation() { @@ -70,9 +73,10 @@ public GatewayConnectionUpdateOperation getOperation() * set to Connect, Disconnect or Test to connect to a local network, * disconnect from a local network, or test the gateway’s connection to a * local network site. + * @param operationValue The Operation value. */ - public void setOperation(GatewayConnectionUpdateOperation operation) + public void setOperation(final GatewayConnectionUpdateOperation operationValue) { - this.operation = operation; + this.operation = operationValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayConnectivityState.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayConnectivityState.java index 7a2af02e038cc..0a990f936e0be 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayConnectivityState.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayConnectivityState.java @@ -30,4 +30,6 @@ public enum GatewayConnectivityState Connecting, NotConnected, + + Unknown, } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayCreateParameters.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayCreateParameters.java index 17d2edc879fc9..958ad49f39ddd 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayCreateParameters.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayCreateParameters.java @@ -32,6 +32,7 @@ public class GatewayCreateParameters /** * The routing type for this virtual network gateway. + * @return The GatewayType value. */ public GatewayType getGatewayType() { @@ -40,9 +41,10 @@ public GatewayType getGatewayType() /** * The routing type for this virtual network gateway. + * @param gatewayTypeValue The GatewayType value. */ - public void setGatewayType(GatewayType gatewayType) + public void setGatewayType(final GatewayType gatewayTypeValue) { - this.gatewayType = gatewayType; + this.gatewayType = gatewayTypeValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayEvent.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayEvent.java index 0a09dff0d77e2..af0f27faa15a2 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayEvent.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayEvent.java @@ -34,6 +34,7 @@ public class GatewayEvent /** * Additional data associated with this event. + * @return The Data value. */ public String getData() { @@ -42,16 +43,18 @@ public String getData() /** * Additional data associated with this event. + * @param dataValue The Data value. */ - public void setData(String data) + public void setData(final String dataValue) { - this.data = data; + this.data = dataValue; } private String id; /** * The event ID. + * @return The Id value. */ public String getId() { @@ -60,16 +63,18 @@ public String getId() /** * The event ID. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private String message; /** * The event message. + * @return The Message value. */ public String getMessage() { @@ -78,16 +83,18 @@ public String getMessage() /** * The event message. + * @param messageValue The Message value. */ - public void setMessage(String message) + public void setMessage(final String messageValue) { - this.message = message; + this.message = messageValue; } private Calendar timestamp; /** * The date and time when the event occurred. + * @return The Timestamp value. */ public Calendar getTimestamp() { @@ -96,9 +103,10 @@ public Calendar getTimestamp() /** * The date and time when the event occurred. + * @param timestampValue The Timestamp value. */ - public void setTimestamp(Calendar timestamp) + public void setTimestamp(final Calendar timestampValue) { - this.timestamp = timestamp; + this.timestamp = timestampValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGenerateVpnClientPackageParameters.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGenerateVpnClientPackageParameters.java index 253d5c7a6a610..f72f31bc15c2e 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGenerateVpnClientPackageParameters.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGenerateVpnClientPackageParameters.java @@ -32,6 +32,7 @@ public class GatewayGenerateVpnClientPackageParameters /** * The client processor architecture. + * @return The ProcessorArchitecture value. */ public GatewayProcessorArchitecture getProcessorArchitecture() { @@ -40,9 +41,10 @@ public GatewayProcessorArchitecture getProcessorArchitecture() /** * The client processor architecture. + * @param processorArchitectureValue The ProcessorArchitecture value. */ - public void setProcessorArchitecture(GatewayProcessorArchitecture processorArchitecture) + public void setProcessorArchitecture(final GatewayProcessorArchitecture processorArchitectureValue) { - this.processorArchitecture = processorArchitecture; + this.processorArchitecture = processorArchitectureValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetDeviceConfigurationScriptParameters.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetDeviceConfigurationScriptParameters.java index 5e7ab91e476a2..0c61a1ada0657 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetDeviceConfigurationScriptParameters.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetDeviceConfigurationScriptParameters.java @@ -33,6 +33,7 @@ public class GatewayGetDeviceConfigurationScriptParameters /** * The device OS Family. + * @return The OSFamily value. */ public String getOSFamily() { @@ -41,16 +42,18 @@ public String getOSFamily() /** * The device OS Family. + * @param oSFamilyValue The OSFamily value. */ - public void setOSFamily(String oSFamily) + public void setOSFamily(final String oSFamilyValue) { - this.oSFamily = oSFamily; + this.oSFamily = oSFamilyValue; } private String platform; /** * The device platform. + * @return The Platform value. */ public String getPlatform() { @@ -59,16 +62,18 @@ public String getPlatform() /** * The device platform. + * @param platformValue The Platform value. */ - public void setPlatform(String platform) + public void setPlatform(final String platformValue) { - this.platform = platform; + this.platform = platformValue; } private String vendor; /** * The name of the device vendor. + * @return The Vendor value. */ public String getVendor() { @@ -77,9 +82,10 @@ public String getVendor() /** * The name of the device vendor. + * @param vendorValue The Vendor value. */ - public void setVendor(String vendor) + public void setVendor(final String vendorValue) { - this.vendor = vendor; + this.vendor = vendorValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetDeviceConfigurationScriptResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetDeviceConfigurationScriptResponse.java index 922ad56cb0b4a..054fa1a03946e 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetDeviceConfigurationScriptResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetDeviceConfigurationScriptResponse.java @@ -35,6 +35,7 @@ public class GatewayGetDeviceConfigurationScriptResponse extends OperationRespon /** * The requested configuration script for the local network device. + * @return The ConfigurationScript value. */ public String getConfigurationScript() { @@ -43,9 +44,10 @@ public String getConfigurationScript() /** * The requested configuration script for the local network device. + * @param configurationScriptValue The ConfigurationScript value. */ - public void setConfigurationScript(String configurationScript) + public void setConfigurationScript(final String configurationScriptValue) { - this.configurationScript = configurationScript; + this.configurationScript = configurationScriptValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetOperationStatusResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetOperationStatusResponse.java index bfcd7ec59ee79..a6d5d17672ba0 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetOperationStatusResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetOperationStatusResponse.java @@ -43,6 +43,7 @@ public class GatewayGetOperationStatusResponse extends OperationResponse * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @return The Error value. */ public GatewayGetOperationStatusResponse.ErrorDetails getError() { @@ -53,16 +54,18 @@ public GatewayGetOperationStatusResponse.ErrorDetails getError() * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @param errorValue The Error value. */ - public void setError(GatewayGetOperationStatusResponse.ErrorDetails error) + public void setError(final GatewayGetOperationStatusResponse.ErrorDetails errorValue) { - this.error = error; + this.error = errorValue; } private Integer httpStatusCode; /** * The HTTP status code for the asynchronous request. + * @return The HttpStatusCode value. */ public Integer getHttpStatusCode() { @@ -71,10 +74,11 @@ public Integer getHttpStatusCode() /** * The HTTP status code for the asynchronous request. + * @param httpStatusCodeValue The HttpStatusCode value. */ - public void setHttpStatusCode(Integer httpStatusCode) + public void setHttpStatusCode(final Integer httpStatusCodeValue) { - this.httpStatusCode = httpStatusCode; + this.httpStatusCode = httpStatusCodeValue; } private String id; @@ -82,6 +86,7 @@ public void setHttpStatusCode(Integer httpStatusCode) /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @return The Id value. */ public String getId() { @@ -91,16 +96,18 @@ public String getId() /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private GatewayOperationStatus status; /** * The status of the asynchronous request. + * @return The Status value. */ public GatewayOperationStatus getStatus() { @@ -109,10 +116,11 @@ public GatewayOperationStatus getStatus() /** * The status of the asynchronous request. + * @param statusValue The Status value. */ - public void setStatus(GatewayOperationStatus status) + public void setStatus(final GatewayOperationStatus statusValue) { - this.status = status; + this.status = statusValue; } /** @@ -127,6 +135,7 @@ public static class ErrorDetails /** * The management service error code returned if the asynchronous * request failed. + * @return The Code value. */ public String getCode() { @@ -136,10 +145,11 @@ public String getCode() /** * The management service error code returned if the asynchronous * request failed. + * @param codeValue The Code value. */ - public void setCode(String code) + public void setCode(final String codeValue) { - this.code = code; + this.code = codeValue; } private String message; @@ -147,6 +157,7 @@ public void setCode(String code) /** * The management service error message returned if the asynchronous * request failed. + * @return The Message value. */ public String getMessage() { @@ -156,10 +167,11 @@ public String getMessage() /** * The management service error message returned if the asynchronous * request failed. + * @param messageValue The Message value. */ - public void setMessage(String message) + public void setMessage(final String messageValue) { - this.message = message; + this.message = messageValue; } } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetResponse.java index 90712e6c57401..6258c4a03bb68 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetResponse.java @@ -35,6 +35,7 @@ public class GatewayGetResponse extends OperationResponse /** * The type of gateway routing used for this virtual network. + * @return The GatewayType value. */ public GatewayType getGatewayType() { @@ -43,16 +44,18 @@ public GatewayType getGatewayType() /** * The type of gateway routing used for this virtual network. + * @param gatewayTypeValue The GatewayType value. */ - public void setGatewayType(GatewayType gatewayType) + public void setGatewayType(final GatewayType gatewayTypeValue) { - this.gatewayType = gatewayType; + this.gatewayType = gatewayTypeValue; } private GatewayEvent lastEvent; /** * The last recorded event for this virtual network gateway. + * @return The LastEvent value. */ public GatewayEvent getLastEvent() { @@ -61,16 +64,18 @@ public GatewayEvent getLastEvent() /** * The last recorded event for this virtual network gateway. + * @param lastEventValue The LastEvent value. */ - public void setLastEvent(GatewayEvent lastEvent) + public void setLastEvent(final GatewayEvent lastEventValue) { - this.lastEvent = lastEvent; + this.lastEvent = lastEventValue; } private String state; /** * The provisioning state of the virtual network gateway. + * @return The State value. */ public String getState() { @@ -79,16 +84,18 @@ public String getState() /** * The provisioning state of the virtual network gateway. + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private InetAddress vipAddress; /** * The virtual IP address for this virtual network gateway. + * @return The VipAddress value. */ public InetAddress getVipAddress() { @@ -97,9 +104,10 @@ public InetAddress getVipAddress() /** * The virtual IP address for this virtual network gateway. + * @param vipAddressValue The VipAddress value. */ - public void setVipAddress(InetAddress vipAddress) + public void setVipAddress(final InetAddress vipAddressValue) { - this.vipAddress = vipAddress; + this.vipAddress = vipAddressValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetSharedKeyResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetSharedKeyResponse.java index 5ca3610e3ad7d..0f921b72f2c38 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetSharedKeyResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayGetSharedKeyResponse.java @@ -35,6 +35,7 @@ public class GatewayGetSharedKeyResponse extends OperationResponse /** * Contains the shared key used by the gateway to authenticate connections * to sites on a virtual network. + * @return The SharedKey value. */ public String getSharedKey() { @@ -44,9 +45,10 @@ public String getSharedKey() /** * Contains the shared key used by the gateway to authenticate connections * to sites on a virtual network. + * @param sharedKeyValue The SharedKey value. */ - public void setSharedKey(String sharedKey) + public void setSharedKey(final String sharedKeyValue) { - this.sharedKey = sharedKey; + this.sharedKey = sharedKeyValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayListConnectionsResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayListConnectionsResponse.java index c1acaab24e906..aa0679e1f8097 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayListConnectionsResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayListConnectionsResponse.java @@ -37,6 +37,7 @@ public class GatewayListConnectionsResponse extends OperationResponse implements /** * The list of connections. + * @return The Connections value. */ public ArrayList getConnections() { @@ -45,10 +46,11 @@ public ArrayList getConnection /** * The list of connections. + * @param connectionsValue The Connections value. */ - public void setConnections(ArrayList connections) + public void setConnections(final ArrayList connectionsValue) { - this.connections = connections; + this.connections = connectionsValue; } /** @@ -78,6 +80,7 @@ public static class GatewayConnection * If LocalNetworkSiteName is defined as VPNClientConnection, this * element contains a list of IP addresses (represented as strings) * that are assigned to currently connected VPN clients. + * @return The AllocatedIPAddresses value. */ public ArrayList getAllocatedIPAddresses() { @@ -88,10 +91,11 @@ public ArrayList getAllocatedIPAddresses() * If LocalNetworkSiteName is defined as VPNClientConnection, this * element contains a list of IP addresses (represented as strings) * that are assigned to currently connected VPN clients. + * @param allocatedIPAddressesValue The AllocatedIPAddresses value. */ - public void setAllocatedIPAddresses(ArrayList allocatedIPAddresses) + public void setAllocatedIPAddresses(final ArrayList allocatedIPAddressesValue) { - this.allocatedIPAddresses = allocatedIPAddresses; + this.allocatedIPAddresses = allocatedIPAddressesValue; } private GatewayConnectivityState connectivityState; @@ -99,6 +103,7 @@ public void setAllocatedIPAddresses(ArrayList allocatedIPAddresses) /** * The connection state of the site. You can set the connection state to * Connected, Connecting or NotConnected. + * @return The ConnectivityState value. */ public GatewayConnectivityState getConnectivityState() { @@ -108,10 +113,11 @@ public GatewayConnectivityState getConnectivityState() /** * The connection state of the site. You can set the connection state to * Connected, Connecting or NotConnected. + * @param connectivityStateValue The ConnectivityState value. */ - public void setConnectivityState(GatewayConnectivityState connectivityState) + public void setConnectivityState(final GatewayConnectivityState connectivityStateValue) { - this.connectivityState = connectivityState; + this.connectivityState = connectivityStateValue; } private long egressBytesTransferred; @@ -119,6 +125,7 @@ public void setConnectivityState(GatewayConnectivityState connectivityState) /** * The number of bytes of data transferred out through this connection * since it was started. + * @return The EgressBytesTransferred value. */ public long getEgressBytesTransferred() { @@ -128,10 +135,11 @@ public long getEgressBytesTransferred() /** * The number of bytes of data transferred out through this connection * since it was started. + * @param egressBytesTransferredValue The EgressBytesTransferred value. */ - public void setEgressBytesTransferred(long egressBytesTransferred) + public void setEgressBytesTransferred(final long egressBytesTransferredValue) { - this.egressBytesTransferred = egressBytesTransferred; + this.egressBytesTransferred = egressBytesTransferredValue; } private long ingressBytesTransferred; @@ -139,6 +147,7 @@ public void setEgressBytesTransferred(long egressBytesTransferred) /** * The number of bytes of data transferred in through this connection * since it was started. + * @return The IngressBytesTransferred value. */ public long getIngressBytesTransferred() { @@ -148,28 +157,37 @@ public long getIngressBytesTransferred() /** * The number of bytes of data transferred in through this connection * since it was started. + * @param ingressBytesTransferredValue The IngressBytesTransferred value. */ - public void setIngressBytesTransferred(long ingressBytesTransferred) + public void setIngressBytesTransferred(final long ingressBytesTransferredValue) { - this.ingressBytesTransferred = ingressBytesTransferred; + this.ingressBytesTransferred = ingressBytesTransferredValue; } private Calendar lastConnectionEstablished; + /** + * @return The LastConnectionEstablished value. + */ public Calendar getLastConnectionEstablished() { return this.lastConnectionEstablished; } - public void setLastConnectionEstablished(Calendar lastConnectionEstablished) + /** + * @param lastConnectionEstablishedValue The LastConnectionEstablished + * value. + */ + public void setLastConnectionEstablished(final Calendar lastConnectionEstablishedValue) { - this.lastConnectionEstablished = lastConnectionEstablished; + this.lastConnectionEstablished = lastConnectionEstablishedValue; } private GatewayEvent lastEvent; /** * A record of the last provisioning event for this connection. + * @return The LastEvent value. */ public GatewayEvent getLastEvent() { @@ -178,16 +196,18 @@ public GatewayEvent getLastEvent() /** * A record of the last provisioning event for this connection. + * @param lastEventValue The LastEvent value. */ - public void setLastEvent(GatewayEvent lastEvent) + public void setLastEvent(final GatewayEvent lastEventValue) { - this.lastEvent = lastEvent; + this.lastEvent = lastEventValue; } private String localNetworkSiteName; /** * The name of the local network site represented by the connection. + * @return The LocalNetworkSiteName value. */ public String getLocalNetworkSiteName() { @@ -196,10 +216,11 @@ public String getLocalNetworkSiteName() /** * The name of the local network site represented by the connection. + * @param localNetworkSiteNameValue The LocalNetworkSiteName value. */ - public void setLocalNetworkSiteName(String localNetworkSiteName) + public void setLocalNetworkSiteName(final String localNetworkSiteNameValue) { - this.localNetworkSiteName = localNetworkSiteName; + this.localNetworkSiteName = localNetworkSiteNameValue; } /** diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayListSupportedDevicesResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayListSupportedDevicesResponse.java index da893f56490ab..e61d7c899a626 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayListSupportedDevicesResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayListSupportedDevicesResponse.java @@ -35,6 +35,7 @@ public class GatewayListSupportedDevicesResponse extends OperationResponse /** * The set of supported vendors. + * @return The Vendors value. */ public ArrayList getVendors() { @@ -43,16 +44,18 @@ public ArrayList getVendors() /** * The set of supported vendors. + * @param vendorsValue The Vendors value. */ - public void setVendors(ArrayList vendors) + public void setVendors(final ArrayList vendorsValue) { - this.vendors = vendors; + this.vendors = vendorsValue; } private String version; /** * The version for this device configuration list. + * @return The Version value. */ public String getVersion() { @@ -61,10 +64,11 @@ public String getVersion() /** * The version for this device configuration list. + * @param versionValue The Version value. */ - public void setVersion(String version) + public void setVersion(final String versionValue) { - this.version = version; + this.version = versionValue; } /** @@ -84,6 +88,7 @@ public static class OSFamily /** * The name of the os family. + * @return The Name value. */ public String getName() { @@ -92,10 +97,11 @@ public String getName() /** * The name of the os family. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } } @@ -108,6 +114,7 @@ public static class Platform /** * The platform name. + * @return The Name value. */ public String getName() { @@ -116,16 +123,18 @@ public String getName() /** * The platform name. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private ArrayList oSFamilies; /** * The supported OS Families for this platform. + * @return The OSFamilies value. */ public ArrayList getOSFamilies() { @@ -134,10 +143,11 @@ public ArrayList getOSFamilies() /** * The supported OS Families for this platform. + * @param oSFamiliesValue The OSFamilies value. */ - public void setOSFamilies(ArrayList oSFamilies) + public void setOSFamilies(final ArrayList oSFamiliesValue) { - this.oSFamilies = oSFamilies; + this.oSFamilies = oSFamiliesValue; } /** @@ -159,6 +169,7 @@ public static class Vendor /** * The vendor name. + * @return The Name value. */ public String getName() { @@ -167,16 +178,18 @@ public String getName() /** * The vendor name. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private ArrayList platforms; /** * The supported platforms for the vendor. + * @return The Platforms value. */ public ArrayList getPlatforms() { @@ -185,10 +198,11 @@ public ArrayList getPlatforms() /** * The supported platforms for the vendor. + * @param platformsValue The Platforms value. */ - public void setPlatforms(ArrayList platforms) + public void setPlatforms(final ArrayList platformsValue) { - this.platforms = platforms; + this.platforms = platformsValue; } /** diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayOperationResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayOperationResponse.java index 81428666e3ab5..58fa760734892 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayOperationResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayOperationResponse.java @@ -32,13 +32,19 @@ public class GatewayOperationResponse extends OperationResponse { private String operationId; + /** + * @return The OperationId value. + */ public String getOperationId() { return this.operationId; } - public void setOperationId(String operationId) + /** + * @param operationIdValue The OperationId value. + */ + public void setOperationId(final String operationIdValue) { - this.operationId = operationId; + this.operationId = operationIdValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayResetSharedKeyParameters.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayResetSharedKeyParameters.java index 8d3bf70d17662..89b4b18035ba2 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayResetSharedKeyParameters.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/GatewayResetSharedKeyParameters.java @@ -32,6 +32,7 @@ public class GatewayResetSharedKeyParameters /** * The number of bytes in the shared key. Minimum is 1 and maximum is 128 + * @return The KeyLength value. */ public int getKeyLength() { @@ -40,9 +41,10 @@ public int getKeyLength() /** * The number of bytes in the shared key. Minimum is 1 and maximum is 128 + * @param keyLengthValue The KeyLength value. */ - public void setKeyLength(int keyLength) + public void setKeyLength(final int keyLengthValue) { - this.keyLength = keyLength; + this.keyLength = keyLengthValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkGetConfigurationResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkGetConfigurationResponse.java index 206d9ef8be661..993be76217381 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkGetConfigurationResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkGetConfigurationResponse.java @@ -34,6 +34,7 @@ public class NetworkGetConfigurationResponse extends OperationResponse /** * The network configuration for this subscription. + * @return The Configuration value. */ public String getConfiguration() { @@ -42,9 +43,10 @@ public String getConfiguration() /** * The network configuration for this subscription. + * @param configurationValue The Configuration value. */ - public void setConfiguration(String configuration) + public void setConfiguration(final String configurationValue) { - this.configuration = configuration; + this.configuration = configurationValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkListResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkListResponse.java index 1e595ceebd67e..bddd7936ee07b 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkListResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkListResponse.java @@ -35,14 +35,20 @@ public class NetworkListResponse extends OperationResponse implements Iterable virtualNetworkSites; + /** + * @return The VirtualNetworkSites value. + */ public ArrayList getVirtualNetworkSites() { return this.virtualNetworkSites; } - public void setVirtualNetworkSites(ArrayList virtualNetworkSites) + /** + * @param virtualNetworkSitesValue The VirtualNetworkSites value. + */ + public void setVirtualNetworkSites(final ArrayList virtualNetworkSitesValue) { - this.virtualNetworkSites = virtualNetworkSites; + this.virtualNetworkSites = virtualNetworkSitesValue; } /** @@ -70,6 +76,7 @@ public static class AddressSpace /** * Address spaces, in CIDR format in the virtual network + * @return The AddressPrefixes value. */ public ArrayList getAddressPrefixes() { @@ -78,10 +85,11 @@ public ArrayList getAddressPrefixes() /** * Address spaces, in CIDR format in the virtual network + * @param addressPrefixesValue The AddressPrefixes value. */ - public void setAddressPrefixes(ArrayList addressPrefixes) + public void setAddressPrefixes(final ArrayList addressPrefixesValue) { - this.addressPrefixes = addressPrefixes; + this.addressPrefixes = addressPrefixesValue; } /** @@ -103,14 +111,20 @@ public static class Connection { private LocalNetworkConnectionType type; + /** + * @return The Type value. + */ public LocalNetworkConnectionType getType() { return this.type; } - public void setType(LocalNetworkConnectionType type) + /** + * @param typeValue The Type value. + */ + public void setType(final LocalNetworkConnectionType typeValue) { - this.type = type; + this.type = typeValue; } } @@ -120,6 +134,7 @@ public static class DnsServer /** * The IPv4 address of the DNS server. + * @return The Address value. */ public InetAddress getAddress() { @@ -128,16 +143,18 @@ public InetAddress getAddress() /** * The IPv4 address of the DNS server. + * @param addressValue The Address value. */ - public void setAddress(InetAddress address) + public void setAddress(final InetAddress addressValue) { - this.address = address; + this.address = addressValue; } private String name; /** * The name of the DNS server. + * @return The Name value. */ public String getName() { @@ -146,10 +163,11 @@ public String getName() /** * The name of the DNS server. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } } @@ -163,6 +181,7 @@ public static class Gateway /** * The gateway connection size. + * @return The Profile value. */ public GatewayProfile getProfile() { @@ -171,10 +190,11 @@ public GatewayProfile getProfile() /** * The gateway connection size. + * @param profileValue The Profile value. */ - public void setProfile(GatewayProfile profile) + public void setProfile(final GatewayProfile profileValue) { - this.profile = profile; + this.profile = profileValue; } private ArrayList sites; @@ -182,6 +202,7 @@ public void setProfile(GatewayProfile profile) /** * The list of local network sites that the virtual network can connect * to. + * @return The Sites value. */ public ArrayList getSites() { @@ -191,10 +212,11 @@ public ArrayList getSites() /** * The list of local network sites that the virtual network can connect * to. + * @param sitesValue The Sites value. */ - public void setSites(ArrayList sites) + public void setSites(final ArrayList sitesValue) { - this.sites = sites; + this.sites = sitesValue; } private NetworkListResponse.VPNClientAddressPool vPNClientAddressPool; @@ -202,6 +224,7 @@ public void setSites(ArrayList sites) /** * The VPNClientAddressPool reserves a pool of IP addresses for VPN * clients. This object is used for point-to-site connectivity. + * @return The VPNClientAddressPool value. */ public NetworkListResponse.VPNClientAddressPool getVPNClientAddressPool() { @@ -211,10 +234,11 @@ public NetworkListResponse.VPNClientAddressPool getVPNClientAddressPool() /** * The VPNClientAddressPool reserves a pool of IP addresses for VPN * clients. This object is used for point-to-site connectivity. + * @param vPNClientAddressPoolValue The VPNClientAddressPool value. */ - public void setVPNClientAddressPool(NetworkListResponse.VPNClientAddressPool vPNClientAddressPool) + public void setVPNClientAddressPool(final NetworkListResponse.VPNClientAddressPool vPNClientAddressPoolValue) { - this.vPNClientAddressPool = vPNClientAddressPool; + this.vPNClientAddressPool = vPNClientAddressPoolValue; } /** @@ -236,6 +260,7 @@ public static class LocalNetworkSite /** * The address space of the local network site. + * @return The AddressSpace value. */ public NetworkListResponse.AddressSpace getAddressSpace() { @@ -244,16 +269,18 @@ public NetworkListResponse.AddressSpace getAddressSpace() /** * The address space of the local network site. + * @param addressSpaceValue The AddressSpace value. */ - public void setAddressSpace(NetworkListResponse.AddressSpace addressSpace) + public void setAddressSpace(final NetworkListResponse.AddressSpace addressSpaceValue) { - this.addressSpace = addressSpace; + this.addressSpace = addressSpaceValue; } private ArrayList connections; /** * Specifies the types of connections to the local network site. + * @return The Connections value. */ public ArrayList getConnections() { @@ -262,16 +289,18 @@ public ArrayList getConnections() /** * Specifies the types of connections to the local network site. + * @param connectionsValue The Connections value. */ - public void setConnections(ArrayList connections) + public void setConnections(final ArrayList connectionsValue) { - this.connections = connections; + this.connections = connectionsValue; } private String name; /** * The name of the local network site. + * @return The Name value. */ public String getName() { @@ -280,16 +309,18 @@ public String getName() /** * The name of the local network site. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private InetAddress vpnGatewayAddress; /** * The IPv4 address of the local network site. + * @return The VpnGatewayAddress value. */ public InetAddress getVpnGatewayAddress() { @@ -298,10 +329,11 @@ public InetAddress getVpnGatewayAddress() /** * The IPv4 address of the local network site. + * @param vpnGatewayAddressValue The VpnGatewayAddress value. */ - public void setVpnGatewayAddress(InetAddress vpnGatewayAddress) + public void setVpnGatewayAddress(final InetAddress vpnGatewayAddressValue) { - this.vpnGatewayAddress = vpnGatewayAddress; + this.vpnGatewayAddress = vpnGatewayAddressValue; } /** @@ -320,6 +352,7 @@ public static class Subnet /** * Represents an address space, in CIDR format that defines the subnet + * @return The AddressPrefix value. */ public String getAddressPrefix() { @@ -328,16 +361,18 @@ public String getAddressPrefix() /** * Represents an address space, in CIDR format that defines the subnet + * @param addressPrefixValue The AddressPrefix value. */ - public void setAddressPrefix(String addressPrefix) + public void setAddressPrefix(final String addressPrefixValue) { - this.addressPrefix = addressPrefix; + this.addressPrefix = addressPrefixValue; } private String name; /** * Name for the subnet. + * @return The Name value. */ public String getName() { @@ -346,10 +381,11 @@ public String getName() /** * Name for the subnet. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } } @@ -366,6 +402,7 @@ public static class VirtualNetworkSite * The list of network address spaces for a virtual network site. This * represents the overall network space contained within the virtual * network site. + * @return The AddressSpace value. */ public NetworkListResponse.AddressSpace getAddressSpace() { @@ -376,10 +413,11 @@ public NetworkListResponse.AddressSpace getAddressSpace() * The list of network address spaces for a virtual network site. This * represents the overall network space contained within the virtual * network site. + * @param addressSpaceValue The AddressSpace value. */ - public void setAddressSpace(NetworkListResponse.AddressSpace addressSpace) + public void setAddressSpace(final NetworkListResponse.AddressSpace addressSpaceValue) { - this.addressSpace = addressSpace; + this.addressSpace = addressSpaceValue; } private String affinityGroup; @@ -387,6 +425,7 @@ public void setAddressSpace(NetworkListResponse.AddressSpace addressSpace) /** * An affinity group, which indirectly refers to the location where the * virtual network exists. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -396,16 +435,18 @@ public String getAffinityGroup() /** * An affinity group, which indirectly refers to the location where the * virtual network exists. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private ArrayList dnsServers; /** * The list of on DNS Servers associated with the virtual network site. + * @return The DnsServers value. */ public ArrayList getDnsServers() { @@ -414,10 +455,11 @@ public ArrayList getDnsServers() /** * The list of on DNS Servers associated with the virtual network site. + * @param dnsServersValue The DnsServers value. */ - public void setDnsServers(ArrayList dnsServers) + public void setDnsServers(final ArrayList dnsServersValue) { - this.dnsServers = dnsServers; + this.dnsServers = dnsServersValue; } private NetworkListResponse.Gateway gateway; @@ -426,6 +468,7 @@ public void setDnsServers(ArrayList dnsServers) * Gateway that contains a list of Local Network Sites which enables the * Virtual network site to communicate with a customer’s on premise * networks. + * @return The Gateway value. */ public NetworkListResponse.Gateway getGateway() { @@ -436,16 +479,18 @@ public NetworkListResponse.Gateway getGateway() * Gateway that contains a list of Local Network Sites which enables the * Virtual network site to communicate with a customer’s on premise * networks. + * @param gatewayValue The Gateway value. */ - public void setGateway(NetworkListResponse.Gateway gateway) + public void setGateway(final NetworkListResponse.Gateway gatewayValue) { - this.gateway = gateway; + this.gateway = gatewayValue; } private String id; /** * A unique string identifier that represents the virtual network site. + * @return The Id value. */ public String getId() { @@ -454,16 +499,18 @@ public String getId() /** * A unique string identifier that represents the virtual network site. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private String label; /** * The friendly identifier of the site. + * @return The Label value. */ public String getLabel() { @@ -472,16 +519,18 @@ public String getLabel() /** * The friendly identifier of the site. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String name; /** * Name of the virtual network site. + * @return The Name value. */ public String getName() { @@ -490,10 +539,11 @@ public String getName() /** * Name of the virtual network site. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String state; @@ -501,6 +551,7 @@ public void setName(String name) /** * Current status of the virtual network. (Created, Creating, Updating, * Deleting, Unavailable) + * @return The State value. */ public String getState() { @@ -510,10 +561,11 @@ public String getState() /** * Current status of the virtual network. (Created, Creating, Updating, * Deleting, Unavailable) + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } private ArrayList subnets; @@ -522,6 +574,7 @@ public void setState(String state) * The list of network subnets for a virtual network site. All network * subnets must be contained within the overall virtual network address * spaces. + * @return The Subnets value. */ public ArrayList getSubnets() { @@ -532,10 +585,11 @@ public ArrayList getSubnets() * The list of network subnets for a virtual network site. All network * subnets must be contained within the overall virtual network address * spaces. + * @param subnetsValue The Subnets value. */ - public void setSubnets(ArrayList subnets) + public void setSubnets(final ArrayList subnetsValue) { - this.subnets = subnets; + this.subnets = subnetsValue; } /** @@ -559,6 +613,7 @@ public static class VPNClientAddressPool /** * The CIDR identifiers that identify addresses in the pool. + * @return The AddressPrefixes value. */ public ArrayList getAddressPrefixes() { @@ -567,10 +622,11 @@ public ArrayList getAddressPrefixes() /** * The CIDR identifiers that identify addresses in the pool. + * @param addressPrefixesValue The AddressPrefixes value. */ - public void setAddressPrefixes(ArrayList addressPrefixes) + public void setAddressPrefixes(final ArrayList addressPrefixesValue) { - this.addressPrefixes = addressPrefixes; + this.addressPrefixes = addressPrefixesValue; } /** diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPCreateParameters.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPCreateParameters.java index 1c929b3dba3da..472318d71fc4d 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPCreateParameters.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPCreateParameters.java @@ -33,6 +33,7 @@ public class NetworkReservedIPCreateParameters /** * An affinity group, which indirectly refers to the location where the * virtual network exists. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -42,16 +43,18 @@ public String getAffinityGroup() /** * An affinity group, which indirectly refers to the location where the * virtual network exists. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private String deploymentName; /** * The name of the deployment the IP belongs to, if being used. + * @return The DeploymentName value. */ public String getDeploymentName() { @@ -60,16 +63,18 @@ public String getDeploymentName() /** * The name of the deployment the IP belongs to, if being used. + * @param deploymentNameValue The DeploymentName value. */ - public void setDeploymentName(String deploymentName) + public void setDeploymentName(final String deploymentNameValue) { - this.deploymentName = deploymentName; + this.deploymentName = deploymentNameValue; } private String label; /** * The friendly identifier of the site. + * @return The Label value. */ public String getLabel() { @@ -78,16 +83,18 @@ public String getLabel() /** * The friendly identifier of the site. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String name; /** * Name of the reserved IP. + * @return The Name value. */ public String getName() { @@ -96,16 +103,18 @@ public String getName() /** * Name of the reserved IP. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serviceName; /** * The name of the service the IP belongs to, if being used. + * @return The ServiceName value. */ public String getServiceName() { @@ -114,9 +123,10 @@ public String getServiceName() /** * The name of the service the IP belongs to, if being used. + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPGetResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPGetResponse.java index 46e05fa548a2e..963a6f9a45c0a 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPGetResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPGetResponse.java @@ -35,6 +35,7 @@ public class NetworkReservedIPGetResponse extends OperationResponse /** * The IP address of the reserved IP. + * @return The Address value. */ public InetAddress getAddress() { @@ -43,10 +44,11 @@ public InetAddress getAddress() /** * The IP address of the reserved IP. + * @param addressValue The Address value. */ - public void setAddress(InetAddress address) + public void setAddress(final InetAddress addressValue) { - this.address = address; + this.address = addressValue; } private String affinityGroup; @@ -54,6 +56,7 @@ public void setAddress(InetAddress address) /** * An affinity group, which indirectly refers to the location where the * virtual network exists. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -63,16 +66,18 @@ public String getAffinityGroup() /** * An affinity group, which indirectly refers to the location where the * virtual network exists. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private String deploymentName; /** * The name of the deployment the IP belongs to, if being used. + * @return The DeploymentName value. */ public String getDeploymentName() { @@ -81,16 +86,18 @@ public String getDeploymentName() /** * The name of the deployment the IP belongs to, if being used. + * @param deploymentNameValue The DeploymentName value. */ - public void setDeploymentName(String deploymentName) + public void setDeploymentName(final String deploymentNameValue) { - this.deploymentName = deploymentName; + this.deploymentName = deploymentNameValue; } private String id; /** * A unique string identifier that represents the reserved IP. + * @return The Id value. */ public String getId() { @@ -99,34 +106,38 @@ public String getId() /** * A unique string identifier that represents the reserved IP. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private boolean inUse; /** * The indicator of whether the reserved IP is being used. + * @return The InUse value. */ - public boolean getInUse() + public boolean isInUse() { return this.inUse; } /** * The indicator of whether the reserved IP is being used. + * @param inUseValue The InUse value. */ - public void setInUse(boolean inUse) + public void setInUse(final boolean inUseValue) { - this.inUse = inUse; + this.inUse = inUseValue; } private String label; /** * The friendly identifier of the site. + * @return The Label value. */ public String getLabel() { @@ -135,16 +146,18 @@ public String getLabel() /** * The friendly identifier of the site. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String name; /** * Name of the reserved IP. + * @return The Name value. */ public String getName() { @@ -153,16 +166,18 @@ public String getName() /** * Name of the reserved IP. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serviceName; /** * The name of the service the IP belongs to, if being used. + * @return The ServiceName value. */ public String getServiceName() { @@ -171,10 +186,11 @@ public String getServiceName() /** * The name of the service the IP belongs to, if being used. + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } private String state; @@ -182,6 +198,7 @@ public void setServiceName(String serviceName) /** * Current status of the reserved IP. (Created, Creating, Updating, * Deleting, Unavailable) + * @return The State value. */ public String getState() { @@ -191,9 +208,10 @@ public String getState() /** * Current status of the reserved IP. (Created, Creating, Updating, * Deleting, Unavailable) + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPListResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPListResponse.java index 5e2c73931b5e0..eb6eb706a8939 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPListResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkReservedIPListResponse.java @@ -35,14 +35,20 @@ public class NetworkReservedIPListResponse extends OperationResponse implements { private ArrayList reservedIPs; + /** + * @return The ReservedIPs value. + */ public ArrayList getReservedIPs() { return this.reservedIPs; } - public void setReservedIPs(ArrayList reservedIPs) + /** + * @param reservedIPsValue The ReservedIPs value. + */ + public void setReservedIPs(final ArrayList reservedIPsValue) { - this.reservedIPs = reservedIPs; + this.reservedIPs = reservedIPsValue; } /** @@ -73,6 +79,7 @@ public static class ReservedIP /** * The IP address of the reserved IP. + * @return The Address value. */ public InetAddress getAddress() { @@ -81,10 +88,11 @@ public InetAddress getAddress() /** * The IP address of the reserved IP. + * @param addressValue The Address value. */ - public void setAddress(InetAddress address) + public void setAddress(final InetAddress addressValue) { - this.address = address; + this.address = addressValue; } private String affinityGroup; @@ -92,6 +100,7 @@ public void setAddress(InetAddress address) /** * An affinity group, which indirectly refers to the location where the * virtual network exists. + * @return The AffinityGroup value. */ public String getAffinityGroup() { @@ -101,16 +110,18 @@ public String getAffinityGroup() /** * An affinity group, which indirectly refers to the location where the * virtual network exists. + * @param affinityGroupValue The AffinityGroup value. */ - public void setAffinityGroup(String affinityGroup) + public void setAffinityGroup(final String affinityGroupValue) { - this.affinityGroup = affinityGroup; + this.affinityGroup = affinityGroupValue; } private String deploymentName; /** * The name of the deployment the IP belongs to, if being used. + * @return The DeploymentName value. */ public String getDeploymentName() { @@ -119,16 +130,18 @@ public String getDeploymentName() /** * The name of the deployment the IP belongs to, if being used. + * @param deploymentNameValue The DeploymentName value. */ - public void setDeploymentName(String deploymentName) + public void setDeploymentName(final String deploymentNameValue) { - this.deploymentName = deploymentName; + this.deploymentName = deploymentNameValue; } private String id; /** * A unique string identifier that represents the reserved IP. + * @return The Id value. */ public String getId() { @@ -137,34 +150,38 @@ public String getId() /** * A unique string identifier that represents the reserved IP. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private boolean inUse; /** * The indicator of whether the reserved IP is being used. + * @return The InUse value. */ - public boolean getInUse() + public boolean isInUse() { return this.inUse; } /** * The indicator of whether the reserved IP is being used. + * @param inUseValue The InUse value. */ - public void setInUse(boolean inUse) + public void setInUse(final boolean inUseValue) { - this.inUse = inUse; + this.inUse = inUseValue; } private String label; /** * The friendly identifier of the site. + * @return The Label value. */ public String getLabel() { @@ -173,16 +190,18 @@ public String getLabel() /** * The friendly identifier of the site. + * @param labelValue The Label value. */ - public void setLabel(String label) + public void setLabel(final String labelValue) { - this.label = label; + this.label = labelValue; } private String name; /** * Name of the reserved IP. + * @return The Name value. */ public String getName() { @@ -191,16 +210,18 @@ public String getName() /** * Name of the reserved IP. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serviceName; /** * The name of the service the IP belongs to, if being used. + * @return The ServiceName value. */ public String getServiceName() { @@ -209,10 +230,11 @@ public String getServiceName() /** * The name of the service the IP belongs to, if being used. + * @param serviceNameValue The ServiceName value. */ - public void setServiceName(String serviceName) + public void setServiceName(final String serviceNameValue) { - this.serviceName = serviceName; + this.serviceName = serviceNameValue; } private String state; @@ -220,6 +242,7 @@ public void setServiceName(String serviceName) /** * Current status of the reserved IP. (Created, Creating, Updating, * Deleting, Unavailable) + * @return The State value. */ public String getState() { @@ -229,10 +252,11 @@ public String getState() /** * Current status of the reserved IP. (Created, Creating, Updating, * Deleting, Unavailable) + * @param stateValue The State value. */ - public void setState(String state) + public void setState(final String stateValue) { - this.state = state; + this.state = stateValue; } } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkSetConfigurationParameters.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkSetConfigurationParameters.java index d72498d476c29..ede61a683b3cd 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkSetConfigurationParameters.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkSetConfigurationParameters.java @@ -32,6 +32,7 @@ public class NetworkSetConfigurationParameters /** * The network configuration for this subscription. + * @return The Configuration value. */ public String getConfiguration() { @@ -40,9 +41,10 @@ public String getConfiguration() /** * The network configuration for this subscription. + * @param configurationValue The Configuration value. */ - public void setConfiguration(String configuration) + public void setConfiguration(final String configurationValue) { - this.configuration = configuration; + this.configuration = configurationValue; } } diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkStaticIPAvailabilityResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkStaticIPAvailabilityResponse.java new file mode 100644 index 0000000000000..f51437169b128 --- /dev/null +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/NetworkStaticIPAvailabilityResponse.java @@ -0,0 +1,86 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.virtualnetworks.models; + +import com.microsoft.windowsazure.core.OperationResponse; +import java.net.InetAddress; +import java.util.ArrayList; + +/** +* A response that indicates the availability of a static IP address, and if +* not, provide a list of suggestions. +*/ +public class NetworkStaticIPAvailabilityResponse extends OperationResponse +{ + private ArrayList availableAddresses; + + /** + * The list of the available IP addresses. + * @return The AvailableAddresses value. + */ + public ArrayList getAvailableAddresses() + { + return this.availableAddresses; + } + + /** + * The list of the available IP addresses. + * @param availableAddressesValue The AvailableAddresses value. + */ + public void setAvailableAddresses(final ArrayList availableAddressesValue) + { + this.availableAddresses = availableAddressesValue; + } + + private boolean isAvailable; + + /** + * Whether the IP address is available. + * @return The IsAvailable value. + */ + public boolean isAvailable() + { + return this.isAvailable; + } + + /** + * Whether the IP address is available. + * @param isAvailableValue The IsAvailable value. + */ + public void setIsAvailable(final boolean isAvailableValue) + { + this.isAvailable = isAvailableValue; + } + + /** + * Initializes a new instance of the NetworkStaticIPAvailabilityResponse + * class. + * + */ + public NetworkStaticIPAvailabilityResponse() + { + super(); + this.availableAddresses = new ArrayList(); + } +} diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/VirtualNetworkOperationStatusResponse.java b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/VirtualNetworkOperationStatusResponse.java index 0e56a294ddab5..129ab92c44257 100644 --- a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/VirtualNetworkOperationStatusResponse.java +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/VirtualNetworkOperationStatusResponse.java @@ -43,6 +43,7 @@ public class VirtualNetworkOperationStatusResponse extends OperationResponse * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @return The Error value. */ public VirtualNetworkOperationStatusResponse.ErrorDetails getError() { @@ -53,16 +54,18 @@ public VirtualNetworkOperationStatusResponse.ErrorDetails getError() * If the asynchronous operation failed, the response body includes the HTTP * status code for the failed request, and also includes error information * regarding the failure. + * @param errorValue The Error value. */ - public void setError(VirtualNetworkOperationStatusResponse.ErrorDetails error) + public void setError(final VirtualNetworkOperationStatusResponse.ErrorDetails errorValue) { - this.error = error; + this.error = errorValue; } private Integer httpStatusCode; /** * The HTTP status code for the asynchronous request. + * @return The HttpStatusCode value. */ public Integer getHttpStatusCode() { @@ -71,10 +74,11 @@ public Integer getHttpStatusCode() /** * The HTTP status code for the asynchronous request. + * @param httpStatusCodeValue The HttpStatusCode value. */ - public void setHttpStatusCode(Integer httpStatusCode) + public void setHttpStatusCode(final Integer httpStatusCodeValue) { - this.httpStatusCode = httpStatusCode; + this.httpStatusCode = httpStatusCodeValue; } private String id; @@ -82,6 +86,7 @@ public void setHttpStatusCode(Integer httpStatusCode) /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @return The Id value. */ public String getId() { @@ -91,16 +96,18 @@ public String getId() /** * The request ID of the asynchronous request. This value is returned in the * x-ms-request-id response header of the asynchronous request. + * @param idValue The Id value. */ - public void setId(String id) + public void setId(final String idValue) { - this.id = id; + this.id = idValue; } private OperationStatus status; /** * The status of the asynchronous request. + * @return The Status value. */ public OperationStatus getStatus() { @@ -109,10 +116,11 @@ public OperationStatus getStatus() /** * The status of the asynchronous request. + * @param statusValue The Status value. */ - public void setStatus(OperationStatus status) + public void setStatus(final OperationStatus statusValue) { - this.status = status; + this.status = statusValue; } /** @@ -127,6 +135,7 @@ public static class ErrorDetails /** * The management service error code returned if the asynchronous * request failed. + * @return The Code value. */ public String getCode() { @@ -136,10 +145,11 @@ public String getCode() /** * The management service error code returned if the asynchronous * request failed. + * @param codeValue The Code value. */ - public void setCode(String code) + public void setCode(final String codeValue) { - this.code = code; + this.code = codeValue; } private String message; @@ -147,6 +157,7 @@ public void setCode(String code) /** * The management service error message returned if the asynchronous * request failed. + * @return The Message value. */ public String getMessage() { @@ -156,10 +167,11 @@ public String getMessage() /** * The management service error message returned if the asynchronous * request failed. + * @param messageValue The Message value. */ - public void setMessage(String message) + public void setMessage(final String messageValue) { - this.message = message; + this.message = messageValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/ServerFarmOperations.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/ServerFarmOperations.java index 83ae85497ba61..c6f892297f79f 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/ServerFarmOperations.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/ServerFarmOperations.java @@ -32,12 +32,10 @@ import com.microsoft.windowsazure.management.websites.models.ServerFarmUpdateParameters; import com.microsoft.windowsazure.management.websites.models.ServerFarmUpdateResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -63,9 +61,23 @@ public interface ServerFarmOperations * * @param webSpaceName The name of the web space. * @param parameters Parameters supplied to the Create Server Farm operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Create Server Farm operation response. */ - ServerFarmCreateResponse create(String webSpaceName, ServerFarmCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException, URISyntaxException; + ServerFarmCreateResponse create(String webSpaceName, ServerFarmCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException, URISyntaxException; /** * You can create a server farm by issuing an HTTP POST request. Only one @@ -100,6 +112,10 @@ public interface ServerFarmOperations * more information) * * @param webSpaceName The name of the web space. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -139,6 +155,18 @@ public interface ServerFarmOperations * * @param webSpaceName The name of the web space. * @param serverFarmName The name of the server farm. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Server Farm operation response. */ ServerFarmGetResponse get(String webSpaceName, String serverFarmName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException, URISyntaxException; @@ -176,6 +204,14 @@ public interface ServerFarmOperations * more information) * * @param webSpaceName The name of the web space. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Server Farm operation response. */ ServerFarmListResponse list(String webSpaceName) throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -213,9 +249,23 @@ public interface ServerFarmOperations * * @param webSpaceName The name of the web space. * @param parameters Parameters supplied to the Update Server Farm operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Update Server Farm operation response. */ - ServerFarmUpdateResponse update(String webSpaceName, ServerFarmUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException, URISyntaxException; + ServerFarmUpdateResponse update(String webSpaceName, ServerFarmUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException, URISyntaxException; /** * You can create a server farm by issuing an HTTP POST request. Only one diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/ServerFarmOperationsImpl.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/ServerFarmOperationsImpl.java index f494bdc854080..354a26874a0d1 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/ServerFarmOperationsImpl.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/ServerFarmOperationsImpl.java @@ -39,7 +39,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.HashMap; @@ -49,7 +48,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -87,6 +85,7 @@ public class ServerFarmOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (serverFarmElement2 != null) - { - NodeList elements2 = serverFarmElement2.getElementsByTagName("CurrentNumberOfWorkers"); - Element currentNumberOfWorkersElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (currentNumberOfWorkersElement2 != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - int currentNumberOfWorkersInstance; - currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement2.getTextContent()); - result.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = serverFarmElement2.getElementsByTagName("CurrentWorkerSize"); - Element currentWorkerSizeElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (currentWorkerSizeElement2 != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - ServerFarmWorkerSize currentWorkerSizeInstance; - currentWorkerSizeInstance = ServerFarmWorkerSize.valueOf(currentWorkerSizeElement2.getTextContent()); - result.setCurrentWorkerSize(currentWorkerSizeInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = serverFarmElement2.getElementsByTagName("Name"); - Element nameElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); - } + // Create Result + ServerFarmCreateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServerFarmCreateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements5 = serverFarmElement2.getElementsByTagName("NumberOfWorkers"); - Element numberOfWorkersElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (numberOfWorkersElement2 != null) + NodeList elements = responseDoc.getElementsByTagName("ServerFarm"); + Element serverFarmElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serverFarmElement2 != null) { - int numberOfWorkersInstance; - numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement2.getTextContent()); - result.setNumberOfWorkers(numberOfWorkersInstance); + NodeList elements2 = serverFarmElement2.getElementsByTagName("CurrentNumberOfWorkers"); + Element currentNumberOfWorkersElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (currentNumberOfWorkersElement2 != null) + { + int currentNumberOfWorkersInstance; + currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement2.getTextContent()); + result.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + } + + NodeList elements3 = serverFarmElement2.getElementsByTagName("CurrentWorkerSize"); + Element currentWorkerSizeElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (currentWorkerSizeElement2 != null) + { + ServerFarmWorkerSize currentWorkerSizeInstance; + currentWorkerSizeInstance = ServerFarmWorkerSize.valueOf(currentWorkerSizeElement2.getTextContent()); + result.setCurrentWorkerSize(currentWorkerSizeInstance); + } + + NodeList elements4 = serverFarmElement2.getElementsByTagName("Name"); + Element nameElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements5 = serverFarmElement2.getElementsByTagName("NumberOfWorkers"); + Element numberOfWorkersElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (numberOfWorkersElement2 != null) + { + int numberOfWorkersInstance; + numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement2.getTextContent()); + result.setNumberOfWorkers(numberOfWorkersInstance); + } + + NodeList elements6 = serverFarmElement2.getElementsByTagName("WorkerSize"); + Element workerSizeElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (workerSizeElement2 != null) + { + ServerFarmWorkerSize workerSizeInstance; + workerSizeInstance = ServerFarmWorkerSize.valueOf(workerSizeElement2.getTextContent()); + result.setWorkerSize(workerSizeInstance); + } + + NodeList elements7 = serverFarmElement2.getElementsByTagName("Status"); + Element statusElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (statusElement2 != null) + { + ServerFarmStatus statusInstance; + statusInstance = ServerFarmStatus.valueOf(statusElement2.getTextContent()); + result.setStatus(statusInstance); + } } - NodeList elements6 = serverFarmElement2.getElementsByTagName("WorkerSize"); - Element workerSizeElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (workerSizeElement2 != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - ServerFarmWorkerSize workerSizeInstance; - workerSizeInstance = ServerFarmWorkerSize.valueOf(workerSizeElement2.getTextContent()); - result.setWorkerSize(workerSizeInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements7 = serverFarmElement2.getElementsByTagName("Status"); - Element statusElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (statusElement2 != null) + if (shouldTrace) { - ServerFarmStatus statusInstance; - statusInstance = ServerFarmStatus.valueOf(statusElement2.getTextContent()); - result.setStatus(statusInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -373,6 +396,10 @@ public OperationResponse call() throws Exception * more information) * * @param webSpaceName The name of the web space. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -407,40 +434,50 @@ public OperationResponse delete(String webSpaceName) throws IOException, Service // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -487,6 +524,18 @@ public ServerFarmGetResponse call() throws Exception * * @param webSpaceName The name of the web space. * @param serverFarmName The name of the server farm. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Server Farm operation response. */ @Override @@ -525,105 +574,115 @@ public ServerFarmGetResponse get(String webSpaceName, String serverFarmName) thr // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ServerFarmGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ServerFarmGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServerFarm"); - Element serverFarmElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serverFarmElement != null) - { - NodeList elements2 = serverFarmElement.getElementsByTagName("CurrentNumberOfWorkers"); - Element currentNumberOfWorkersElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (currentNumberOfWorkersElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - int currentNumberOfWorkersInstance; - currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement.getTextContent()); - result.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = serverFarmElement.getElementsByTagName("CurrentWorkerSize"); - Element currentWorkerSizeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (currentWorkerSizeElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - ServerFarmWorkerSize currentWorkerSizeInstance; - currentWorkerSizeInstance = ServerFarmWorkerSize.valueOf(currentWorkerSizeElement.getTextContent()); - result.setCurrentWorkerSize(currentWorkerSizeInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = serverFarmElement.getElementsByTagName("Name"); - Element nameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } + // Create Result + ServerFarmGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServerFarmGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements5 = serverFarmElement.getElementsByTagName("NumberOfWorkers"); - Element numberOfWorkersElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (numberOfWorkersElement != null) + NodeList elements = responseDoc.getElementsByTagName("ServerFarm"); + Element serverFarmElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serverFarmElement != null) { - int numberOfWorkersInstance; - numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement.getTextContent()); - result.setNumberOfWorkers(numberOfWorkersInstance); + NodeList elements2 = serverFarmElement.getElementsByTagName("CurrentNumberOfWorkers"); + Element currentNumberOfWorkersElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (currentNumberOfWorkersElement != null) + { + int currentNumberOfWorkersInstance; + currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement.getTextContent()); + result.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + } + + NodeList elements3 = serverFarmElement.getElementsByTagName("CurrentWorkerSize"); + Element currentWorkerSizeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (currentWorkerSizeElement != null) + { + ServerFarmWorkerSize currentWorkerSizeInstance; + currentWorkerSizeInstance = ServerFarmWorkerSize.valueOf(currentWorkerSizeElement.getTextContent()); + result.setCurrentWorkerSize(currentWorkerSizeInstance); + } + + NodeList elements4 = serverFarmElement.getElementsByTagName("Name"); + Element nameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements5 = serverFarmElement.getElementsByTagName("NumberOfWorkers"); + Element numberOfWorkersElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (numberOfWorkersElement != null) + { + int numberOfWorkersInstance; + numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement.getTextContent()); + result.setNumberOfWorkers(numberOfWorkersInstance); + } + + NodeList elements6 = serverFarmElement.getElementsByTagName("WorkerSize"); + Element workerSizeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (workerSizeElement != null) + { + ServerFarmWorkerSize workerSizeInstance; + workerSizeInstance = ServerFarmWorkerSize.valueOf(workerSizeElement.getTextContent()); + result.setWorkerSize(workerSizeInstance); + } + + NodeList elements7 = serverFarmElement.getElementsByTagName("Status"); + Element statusElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (statusElement != null) + { + ServerFarmStatus statusInstance; + statusInstance = ServerFarmStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); + } } - NodeList elements6 = serverFarmElement.getElementsByTagName("WorkerSize"); - Element workerSizeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (workerSizeElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - ServerFarmWorkerSize workerSizeInstance; - workerSizeInstance = ServerFarmWorkerSize.valueOf(workerSizeElement.getTextContent()); - result.setWorkerSize(workerSizeInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements7 = serverFarmElement.getElementsByTagName("Status"); - Element statusElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (statusElement != null) + if (shouldTrace) { - ServerFarmStatus statusInstance; - statusInstance = ServerFarmStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -668,6 +727,14 @@ public ServerFarmListResponse call() throws Exception * more information) * * @param webSpaceName The name of the web space. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Server Farm operation response. */ @Override @@ -701,112 +768,122 @@ public ServerFarmListResponse list(String webSpaceName) throws IOException, Serv // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ServerFarmListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ServerFarmListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServerFarms"); - Element serverFarmsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serverFarmsSequenceElement != null) - { - for (int i1 = 0; i1 < serverFarmsSequenceElement.getElementsByTagName("ServerFarm").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element serverFarmsElement = ((org.w3c.dom.Element) serverFarmsSequenceElement.getElementsByTagName("ServerFarm").item(i1)); - ServerFarmListResponse.ServerFarm serverFarmInstance = new ServerFarmListResponse.ServerFarm(); - result.getServerFarms().add(serverFarmInstance); - - NodeList elements2 = serverFarmsElement.getElementsByTagName("CurrentNumberOfWorkers"); - Element currentNumberOfWorkersElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (currentNumberOfWorkersElement != null) - { - int currentNumberOfWorkersInstance; - currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement.getTextContent()); - serverFarmInstance.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); - } - - NodeList elements3 = serverFarmsElement.getElementsByTagName("CurrentWorkerSize"); - Element currentWorkerSizeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (currentWorkerSizeElement != null) - { - ServerFarmWorkerSize currentWorkerSizeInstance; - currentWorkerSizeInstance = ServerFarmWorkerSize.valueOf(currentWorkerSizeElement.getTextContent()); - serverFarmInstance.setCurrentWorkerSize(currentWorkerSizeInstance); - } - - NodeList elements4 = serverFarmsElement.getElementsByTagName("Name"); - Element nameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - serverFarmInstance.setName(nameInstance); - } - - NodeList elements5 = serverFarmsElement.getElementsByTagName("NumberOfWorkers"); - Element numberOfWorkersElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (numberOfWorkersElement != null) - { - int numberOfWorkersInstance; - numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement.getTextContent()); - serverFarmInstance.setNumberOfWorkers(numberOfWorkersInstance); - } - - NodeList elements6 = serverFarmsElement.getElementsByTagName("WorkerSize"); - Element workerSizeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (workerSizeElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - ServerFarmWorkerSize workerSizeInstance; - workerSizeInstance = ServerFarmWorkerSize.valueOf(workerSizeElement.getTextContent()); - serverFarmInstance.setWorkerSize(workerSizeInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements7 = serverFarmsElement.getElementsByTagName("Status"); - Element statusElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (statusElement != null) + throw ex; + } + + // Create Result + ServerFarmListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServerFarmListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("ServerFarms"); + Element serverFarmsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serverFarmsSequenceElement != null) + { + for (int i1 = 0; i1 < serverFarmsSequenceElement.getElementsByTagName("ServerFarm").getLength(); i1 = i1 + 1) { - ServerFarmStatus statusInstance; - statusInstance = ServerFarmStatus.valueOf(statusElement.getTextContent()); - serverFarmInstance.setStatus(statusInstance); + org.w3c.dom.Element serverFarmsElement = ((org.w3c.dom.Element) serverFarmsSequenceElement.getElementsByTagName("ServerFarm").item(i1)); + ServerFarmListResponse.ServerFarm serverFarmInstance = new ServerFarmListResponse.ServerFarm(); + result.getServerFarms().add(serverFarmInstance); + + NodeList elements2 = serverFarmsElement.getElementsByTagName("CurrentNumberOfWorkers"); + Element currentNumberOfWorkersElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (currentNumberOfWorkersElement != null) + { + int currentNumberOfWorkersInstance; + currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement.getTextContent()); + serverFarmInstance.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + } + + NodeList elements3 = serverFarmsElement.getElementsByTagName("CurrentWorkerSize"); + Element currentWorkerSizeElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (currentWorkerSizeElement != null) + { + ServerFarmWorkerSize currentWorkerSizeInstance; + currentWorkerSizeInstance = ServerFarmWorkerSize.valueOf(currentWorkerSizeElement.getTextContent()); + serverFarmInstance.setCurrentWorkerSize(currentWorkerSizeInstance); + } + + NodeList elements4 = serverFarmsElement.getElementsByTagName("Name"); + Element nameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + serverFarmInstance.setName(nameInstance); + } + + NodeList elements5 = serverFarmsElement.getElementsByTagName("NumberOfWorkers"); + Element numberOfWorkersElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (numberOfWorkersElement != null) + { + int numberOfWorkersInstance; + numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement.getTextContent()); + serverFarmInstance.setNumberOfWorkers(numberOfWorkersInstance); + } + + NodeList elements6 = serverFarmsElement.getElementsByTagName("WorkerSize"); + Element workerSizeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (workerSizeElement != null) + { + ServerFarmWorkerSize workerSizeInstance; + workerSizeInstance = ServerFarmWorkerSize.valueOf(workerSizeElement.getTextContent()); + serverFarmInstance.setWorkerSize(workerSizeInstance); + } + + NodeList elements7 = serverFarmsElement.getElementsByTagName("Status"); + Element statusElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (statusElement != null) + { + ServerFarmStatus statusInstance; + statusInstance = ServerFarmStatus.valueOf(statusElement.getTextContent()); + serverFarmInstance.setStatus(statusInstance); + } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -853,10 +930,24 @@ public ServerFarmUpdateResponse call() throws Exception * * @param webSpaceName The name of the web space. * @param parameters Parameters supplied to the Update Server Farm operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Update Server Farm operation response. */ @Override - public ServerFarmUpdateResponse update(String webSpaceName, ServerFarmUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException, URISyntaxException + public ServerFarmUpdateResponse update(String webSpaceName, ServerFarmUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException, URISyntaxException { // Validate if (webSpaceName == null) @@ -945,104 +1036,114 @@ public ServerFarmUpdateResponse update(String webSpaceName, ServerFarmUpdatePara // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - ServerFarmUpdateResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new ServerFarmUpdateResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("ServerFarm"); - Element serverFarmElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (serverFarmElement2 != null) - { - NodeList elements2 = serverFarmElement2.getElementsByTagName("CurrentNumberOfWorkers"); - Element currentNumberOfWorkersElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (currentNumberOfWorkersElement2 != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - int currentNumberOfWorkersInstance; - currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement2.getTextContent()); - result.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = serverFarmElement2.getElementsByTagName("CurrentWorkerSize"); - Element currentWorkerSizeElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (currentWorkerSizeElement2 != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - ServerFarmWorkerSize currentWorkerSizeInstance; - currentWorkerSizeInstance = ServerFarmWorkerSize.valueOf(currentWorkerSizeElement2.getTextContent()); - result.setCurrentWorkerSize(currentWorkerSizeInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements4 = serverFarmElement2.getElementsByTagName("Name"); - Element nameElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); - } + // Create Result + ServerFarmUpdateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new ServerFarmUpdateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements5 = serverFarmElement2.getElementsByTagName("NumberOfWorkers"); - Element numberOfWorkersElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (numberOfWorkersElement2 != null) + NodeList elements = responseDoc.getElementsByTagName("ServerFarm"); + Element serverFarmElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (serverFarmElement2 != null) { - int numberOfWorkersInstance; - numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement2.getTextContent()); - result.setNumberOfWorkers(numberOfWorkersInstance); + NodeList elements2 = serverFarmElement2.getElementsByTagName("CurrentNumberOfWorkers"); + Element currentNumberOfWorkersElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (currentNumberOfWorkersElement2 != null) + { + int currentNumberOfWorkersInstance; + currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement2.getTextContent()); + result.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + } + + NodeList elements3 = serverFarmElement2.getElementsByTagName("CurrentWorkerSize"); + Element currentWorkerSizeElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (currentWorkerSizeElement2 != null) + { + ServerFarmWorkerSize currentWorkerSizeInstance; + currentWorkerSizeInstance = ServerFarmWorkerSize.valueOf(currentWorkerSizeElement2.getTextContent()); + result.setCurrentWorkerSize(currentWorkerSizeInstance); + } + + NodeList elements4 = serverFarmElement2.getElementsByTagName("Name"); + Element nameElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements5 = serverFarmElement2.getElementsByTagName("NumberOfWorkers"); + Element numberOfWorkersElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (numberOfWorkersElement2 != null) + { + int numberOfWorkersInstance; + numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement2.getTextContent()); + result.setNumberOfWorkers(numberOfWorkersInstance); + } + + NodeList elements6 = serverFarmElement2.getElementsByTagName("WorkerSize"); + Element workerSizeElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (workerSizeElement2 != null) + { + ServerFarmWorkerSize workerSizeInstance; + workerSizeInstance = ServerFarmWorkerSize.valueOf(workerSizeElement2.getTextContent()); + result.setWorkerSize(workerSizeInstance); + } + + NodeList elements7 = serverFarmElement2.getElementsByTagName("Status"); + Element statusElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (statusElement2 != null) + { + ServerFarmStatus statusInstance; + statusInstance = ServerFarmStatus.valueOf(statusElement2.getTextContent()); + result.setStatus(statusInstance); + } } - NodeList elements6 = serverFarmElement2.getElementsByTagName("WorkerSize"); - Element workerSizeElement2 = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (workerSizeElement2 != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - ServerFarmWorkerSize workerSizeInstance; - workerSizeInstance = ServerFarmWorkerSize.valueOf(workerSizeElement2.getTextContent()); - result.setWorkerSize(workerSizeInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements7 = serverFarmElement2.getElementsByTagName("Status"); - Element statusElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (statusElement2 != null) + if (shouldTrace) { - ServerFarmStatus statusInstance; - statusInstance = ServerFarmStatus.valueOf(statusElement2.getTextContent()); - result.setStatus(statusInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteManagementClient.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteManagementClient.java index 4e354193ac232..00a04eae43863 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteManagementClient.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteManagementClient.java @@ -27,9 +27,13 @@ import com.microsoft.windowsazure.core.OperationResponse; import com.microsoft.windowsazure.credentials.SubscriptionCloudCredentials; import com.microsoft.windowsazure.exception.ServiceException; +import com.microsoft.windowsazure.management.websites.models.WebSiteOperationStatusResponse; import java.io.IOException; import java.net.URI; +import java.text.ParseException; import java.util.concurrent.Future; +import javax.xml.parsers.ParserConfigurationException; +import org.xml.sax.SAXException; /** * The Windows Azure Web Sites management API provides a RESTful set of web @@ -43,6 +47,7 @@ public interface WebSiteManagementClient extends FilterableService getOperationStatusAsync(String webSpaceName, String siteName, String operationId); + /** * Register your subscription to use Windows Azure Web Sites. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -92,6 +161,10 @@ public interface WebSiteManagementClient extends FilterableService getOperationStatusAsync(final String webSpaceName, final String siteName, final String operationId) + { + return this.getExecutorService().submit(new Callable() { + @Override + public WebSiteOperationStatusResponse call() throws Exception + { + return getOperationStatus(webSpaceName, siteName, operationId); + } + }); + } + + /** + * The Get Operation Status operation returns the status of thespecified + * operation. After calling a long-running operation, you can call Get + * Operation Status to determine whether the operation has succeeded, + * failed, timed out, or is still in progress. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/ee460783.aspx for + * more information) + * + * @param webSpaceName The name of the webspace for the website where the + * operation was targeted. + * @param siteName The name of the site where the operation was targeted. + * @param operationId The operation ID for the operation you wish to track. + * The operation ID is returned in the Id field in the body of the response + * for long-running operations. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return The response body contains the status of the specified + * long-running operation, indicating whether it has succeeded, is + * inprogress, has time dout, or has failed. Note that this status is + * distinct from the HTTP status code returned for the Get Operation Status + * operation itself. If the long-running operation failed, the response + * body includes error information regarding the failure. + */ + @Override + public WebSiteOperationStatusResponse getOperationStatus(String webSpaceName, String siteName, String operationId) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + { + // Validate + if (webSpaceName == null) + { + throw new NullPointerException("webSpaceName"); + } + if (siteName == null) + { + throw new NullPointerException("siteName"); + } + if (operationId == null) + { + throw new NullPointerException("operationId"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("webSpaceName", webSpaceName); + tracingParameters.put("siteName", siteName); + tracingParameters.put("operationId", operationId); + CloudTracing.enter(invocationId, this, "getOperationStatusAsync", tracingParameters); + } + + // Construct URL + String url = this.getBaseUri() + "/" + this.getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + siteName + "/operations/" + operationId; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-08-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + WebSiteOperationStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteOperationStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Operation"); + Element operationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operationElement != null) + { + NodeList elements2 = operationElement.getElementsByTagName("CreatedTime"); + Element createdTimeElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (createdTimeElement != null) + { + Calendar createdTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(createdTimeElement.getTextContent())); + createdTimeInstance = calendar; + result.setCreatedTime(createdTimeInstance); + } + + NodeList elements3 = operationElement.getElementsByTagName("Errors"); + Element errorsSequenceElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (errorsSequenceElement != null) + { + boolean isNil = false; + Attr nilAttribute = errorsSequenceElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + for (int i1 = 0; i1 < errorsSequenceElement.getElementsByTagName("Error").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element errorsElement = ((org.w3c.dom.Element) errorsSequenceElement.getElementsByTagName("Error").item(i1)); + WebSiteOperationStatusResponse.Error errorInstance = new WebSiteOperationStatusResponse.Error(); + result.getErrors().add(errorInstance); + + NodeList elements4 = errorsElement.getElementsByTagName("Code"); + Element codeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (codeElement != null) + { + boolean isNil2 = false; + Attr nilAttribute2 = codeElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil2 = nilAttribute2.getValue() == "true"; + } + if (isNil2 == false) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + errorInstance.setCode(codeInstance); + } + } + + NodeList elements5 = errorsElement.getElementsByTagName("Message"); + Element messageElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (messageElement != null) + { + boolean isNil3 = false; + Attr nilAttribute3 = messageElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute3 != null) + { + isNil3 = nilAttribute3.getValue() == "true"; + } + if (isNil3 == false) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } + } + + NodeList elements6 = errorsElement.getElementsByTagName("ExtendedCode"); + Element extendedCodeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (extendedCodeElement != null) + { + boolean isNil4 = false; + Attr nilAttribute4 = extendedCodeElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute4 != null) + { + isNil4 = nilAttribute4.getValue() == "true"; + } + if (isNil4 == false) + { + String extendedCodeInstance; + extendedCodeInstance = extendedCodeElement.getTextContent(); + errorInstance.setExtendedCode(extendedCodeInstance); + } + } + + NodeList elements7 = errorsElement.getElementsByTagName("MessageTemplate"); + Element messageTemplateElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageTemplateElement != null) + { + boolean isNil5 = false; + Attr nilAttribute5 = messageTemplateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute5 != null) + { + isNil5 = nilAttribute5.getValue() == "true"; + } + if (isNil5 == false) + { + String messageTemplateInstance; + messageTemplateInstance = messageTemplateElement.getTextContent(); + errorInstance.setMessageTemplate(messageTemplateInstance); + } + } + + NodeList elements8 = errorsElement.getElementsByTagName("Parameters"); + Element parametersSequenceElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (parametersSequenceElement != null) + { + boolean isNil6 = false; + Attr nilAttribute6 = parametersSequenceElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute6 != null) + { + isNil6 = nilAttribute6.getValue() == "true"; + } + if (isNil6 == false) + { + for (int i2 = 0; i2 < parametersSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element parametersElement = ((org.w3c.dom.Element) parametersSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i2)); + errorInstance.getParameters().add(parametersElement.getTextContent()); + } + } + } + + NodeList elements9 = errorsElement.getElementsByTagName("InnerErrors"); + Element innerErrorsElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (innerErrorsElement != null) + { + boolean isNil7 = false; + Attr nilAttribute7 = innerErrorsElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute7 != null) + { + isNil7 = nilAttribute7.getValue() == "true"; + } + if (isNil7 == false) + { + String innerErrorsInstance; + innerErrorsInstance = innerErrorsElement.getTextContent(); + errorInstance.setInnerErrors(innerErrorsInstance); + } + } + } + } + } + + NodeList elements10 = operationElement.getElementsByTagName("ExpirationTime"); + Element expirationTimeElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (expirationTimeElement != null) + { + Calendar expirationTimeInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(expirationTimeElement.getTextContent())); + expirationTimeInstance = calendar2; + result.setExpirationTime(expirationTimeInstance); + } + + NodeList elements11 = operationElement.getElementsByTagName("GeoMasterOperationId"); + Element geoMasterOperationIdElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (geoMasterOperationIdElement != null) + { + boolean isNil8 = false; + Attr nilAttribute8 = geoMasterOperationIdElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute8 != null) + { + isNil8 = nilAttribute8.getValue() == "true"; + } + if (isNil8 == false) + { + String geoMasterOperationIdInstance; + geoMasterOperationIdInstance = geoMasterOperationIdElement.getTextContent(); + result.setGeoMasterOperationId(geoMasterOperationIdInstance); + } + } + + NodeList elements12 = operationElement.getElementsByTagName("Id"); + Element idElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (idElement != null) + { + boolean isNil9 = false; + Attr nilAttribute9 = idElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute9 != null) + { + isNil9 = nilAttribute9.getValue() == "true"; + } + if (isNil9 == false) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + NodeList elements13 = operationElement.getElementsByTagName("ModifiedTime"); + Element modifiedTimeElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (modifiedTimeElement != null) + { + Calendar modifiedTimeInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(modifiedTimeElement.getTextContent())); + modifiedTimeInstance = calendar3; + result.setModifiedTime(modifiedTimeInstance); + } + + NodeList elements14 = operationElement.getElementsByTagName("Name"); + Element nameElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (nameElement != null) + { + boolean isNil10 = false; + Attr nilAttribute10 = nameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute10 != null) + { + isNil10 = nilAttribute10.getValue() == "true"; + } + if (isNil10 == false) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + } + + NodeList elements15 = operationElement.getElementsByTagName("Status"); + Element statusElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (statusElement != null) + { + WebSiteOperationStatus statusInstance; + statusInstance = WebSiteOperationStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + /** * Register your subscription to use Windows Azure Web Sites. * @@ -208,6 +622,10 @@ public OperationResponse call() throws Exception /** * Register your subscription to use Windows Azure Web Sites. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -238,40 +656,50 @@ public OperationResponse registerSubscription() throws IOException, ServiceExcep // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -295,6 +723,10 @@ public OperationResponse call() throws Exception /** * Unregister your subscription to use Windows Azure Web Sites. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -325,39 +757,49 @@ public OperationResponse unregisterSubscription() throws IOException, ServiceExc // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_ACCEPTED) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_ACCEPTED) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteOperations.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteOperations.java index 5d20fa6b03308..595656ff32f55 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteOperations.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteOperations.java @@ -27,6 +27,7 @@ import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.management.websites.models.WebSiteCreateParameters; import com.microsoft.windowsazure.management.websites.models.WebSiteCreateResponse; +import com.microsoft.windowsazure.management.websites.models.WebSiteDeleteParameters; import com.microsoft.windowsazure.management.websites.models.WebSiteDeleteRepositoryResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteGetConfigurationResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteGetHistoricalUsageMetricsParameters; @@ -36,16 +37,16 @@ import com.microsoft.windowsazure.management.websites.models.WebSiteGetRepositoryResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteGetResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteGetUsageMetricsResponse; +import com.microsoft.windowsazure.management.websites.models.WebSiteOperationStatusResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteUpdateConfigurationParameters; import com.microsoft.windowsazure.management.websites.models.WebSiteUpdateParameters; import com.microsoft.windowsazure.management.websites.models.WebSiteUpdateResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; +import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -54,6 +55,48 @@ */ public interface WebSiteOperations { + /** + * You can swap a web site from one slot to the production slot. + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @param slotName The name of the web site slot to swap with the production + * slot. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return The response body contains the status of the specified + * long-running operation, indicating whether it has succeeded, is + * inprogress, has time dout, or has failed. Note that this status is + * distinct from the HTTP status code returned for the Get Operation Status + * operation itself. If the long-running operation failed, the response + * body includes error information regarding the failure. + */ + WebSiteOperationStatusResponse beginSwapingSlots(String webSpaceName, String webSiteName, String slotName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; + + /** + * You can swap a web site from one slot to the production slot. + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @param slotName The name of the web site slot to swap with the production + * slot. + * @return The response body contains the status of the specified + * long-running operation, indicating whether it has succeeded, is + * inprogress, has time dout, or has failed. Note that this status is + * distinct from the HTTP status code returned for the Get Operation Status + * operation itself. If the long-running operation failed, the response + * body includes error information regarding the failure. + */ + Future beginSwapingSlotsAsync(String webSpaceName, String webSiteName, String slotName); + /** * You can create a web site by using a POST request that includes the name * of the web site and other information in the request body. (see @@ -62,9 +105,23 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param parameters Parameters supplied to the Create Web Site operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Create Web Space operation response. */ - WebSiteCreateResponse create(String webSpaceName, WebSiteCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException, URISyntaxException; + WebSiteCreateResponse create(String webSpaceName, WebSiteCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException, URISyntaxException; /** * You can create a web site by using a POST request that includes the name @@ -89,6 +146,10 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -120,13 +181,15 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @param deleteEmptyServerFarm If the site being deleted is the last web - * site in a server farm, you can delete the server farm. - * @param deleteMetrics Delete the metrics for the site that you are deleting + * @param parameters The parameters to delete a web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse delete(String webSpaceName, String webSiteName, boolean deleteEmptyServerFarm, boolean deleteMetrics) throws IOException, ServiceException; + OperationResponse delete(String webSpaceName, String webSiteName, WebSiteDeleteParameters parameters) throws IOException, ServiceException; /** * You can delete a web site by issuing an HTTP DELETE request. If the web @@ -138,13 +201,11 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @param deleteEmptyServerFarm If the site being deleted is the last web - * site in a server farm, you can delete the server farm. - * @param deleteMetrics Delete the metrics for the site that you are deleting + * @param parameters The parameters to delete a web site. * @return A standard service response including an HTTP status code and * request ID. */ - Future deleteAsync(String webSpaceName, String webSiteName, boolean deleteEmptyServerFarm, boolean deleteMetrics); + Future deleteAsync(String webSpaceName, String webSiteName, WebSiteDeleteParameters parameters); /** * A web site repository is essentially a GIT repository that you can use to @@ -157,6 +218,16 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Delete Web Site Repository operation response. */ WebSiteDeleteRepositoryResponse deleteRepository(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException; @@ -189,6 +260,10 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -220,6 +295,18 @@ public interface WebSiteOperations * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. * @param parameters Additional parameters. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Web Site Details operation response. */ WebSiteGetResponse get(String webSpaceName, String webSiteName, WebSiteGetParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException, URISyntaxException; @@ -245,6 +332,16 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Web Site Configuration operation response. */ WebSiteGetConfigurationResponse getConfiguration(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; @@ -271,6 +368,16 @@ public interface WebSiteOperations * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. * @param parameters The Get Web Site Historical Usage Metrics parameters. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Web Site Historical Usage Metrics operation response. */ WebSiteGetHistoricalUsageMetricsResponse getHistoricalUsageMetrics(String webSpaceName, String webSiteName, WebSiteGetHistoricalUsageMetricsParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; @@ -296,6 +403,16 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Web Site Publish Profile operation response. */ WebSiteGetPublishProfileResponse getPublishProfile(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException; @@ -323,6 +440,16 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Web Site Repository operation response. */ WebSiteGetRepositoryResponse getRepository(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException; @@ -353,6 +480,16 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. * @return The Get Web Site Usage Metrics operation response. */ WebSiteGetUsageMetricsResponse getUsageMetrics(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException; @@ -379,6 +516,10 @@ public interface WebSiteOperations * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -396,6 +537,84 @@ public interface WebSiteOperations */ Future restartAsync(String webSpaceName, String webSiteName); + /** + * You can swap a web site from one slot to the production slot. + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @param slotName The name of the web site slot to swap with the production + * slot. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @return The response body contains the status of the specified + * long-running operation, indicating whether it has succeeded, is + * inprogress, has time dout, or has failed. Note that this status is + * distinct from the HTTP status code returned for the Get Operation Status + * operation itself. If the long-running operation failed, the response + * body includes error information regarding the failure. + */ + WebSiteOperationStatusResponse swapSlots(String webSpaceName, String webSiteName, String slotName) throws InterruptedException, ExecutionException, ServiceException, IOException; + + /** + * You can swap a web site from one slot to the production slot. + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @param slotName The name of the web site slot to swap with the production + * slot. + * @return The response body contains the status of the specified + * long-running operation, indicating whether it has succeeded, is + * inprogress, has time dout, or has failed. Note that this status is + * distinct from the HTTP status code returned for the Get Operation Status + * operation itself. If the long-running operation failed, the response + * body includes error information regarding the failure. + */ + Future swapSlotsAsync(String webSpaceName, String webSiteName, String slotName); + + /** + * A web site repository is essentially a GIT repository that you can use to + * manage your web site content. By using GIT source control tools, you can + * push or pull version controlled changes to your site. This API executes + * a repository sync operation. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx for + * more information) + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. + */ + OperationResponse syncRepository(String webSpaceName, String webSiteName) throws IOException, ServiceException; + + /** + * A web site repository is essentially a GIT repository that you can use to + * manage your web site content. By using GIT source control tools, you can + * push or pull version controlled changes to your site. This API executes + * a repository sync operation. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx for + * more information) + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @return A standard service response including an HTTP status code and + * request ID. + */ + Future syncRepositoryAsync(String webSpaceName, String webSiteName); + /** * You can update the settings for a web site by using the HTTP PUT method * and by specifying the settings in the request body. (see @@ -405,9 +624,23 @@ public interface WebSiteOperations * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. * @param parameters Parameters supplied to the Update Web Site operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Update Web Site operation response. */ - WebSiteUpdateResponse update(String webSpaceName, String webSiteName, WebSiteUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException, URISyntaxException; + WebSiteUpdateResponse update(String webSpaceName, String webSiteName, WebSiteUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException, URISyntaxException; /** * You can update the settings for a web site by using the HTTP PUT method @@ -432,10 +665,20 @@ public interface WebSiteOperations * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. * @param parameters The Update Web Site Configuration parameters. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ - OperationResponse updateConfiguration(String webSpaceName, String webSiteName, WebSiteUpdateConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + OperationResponse updateConfiguration(String webSpaceName, String webSiteName, WebSiteUpdateConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * You can retrieve the config settings for a web site by issuing an HTTP diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteOperationsImpl.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteOperationsImpl.java index 132f9d3ae591b..d23366d9fae4a 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteOperationsImpl.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSiteOperationsImpl.java @@ -34,6 +34,7 @@ import com.microsoft.windowsazure.management.websites.models.WebSiteComputeMode; import com.microsoft.windowsazure.management.websites.models.WebSiteCreateParameters; import com.microsoft.windowsazure.management.websites.models.WebSiteCreateResponse; +import com.microsoft.windowsazure.management.websites.models.WebSiteDeleteParameters; import com.microsoft.windowsazure.management.websites.models.WebSiteDeleteRepositoryResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteGetConfigurationResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteGetHistoricalUsageMetricsParameters; @@ -44,6 +45,8 @@ import com.microsoft.windowsazure.management.websites.models.WebSiteGetResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteGetUsageMetricsResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteMode; +import com.microsoft.windowsazure.management.websites.models.WebSiteOperationStatus; +import com.microsoft.windowsazure.management.websites.models.WebSiteOperationStatusResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteRuntimeAvailabilityState; import com.microsoft.windowsazure.management.websites.models.WebSiteSslState; import com.microsoft.windowsazure.management.websites.models.WebSiteState; @@ -52,15 +55,14 @@ import com.microsoft.windowsazure.management.websites.models.WebSiteUpdateResponse; import com.microsoft.windowsazure.management.websites.models.WebSiteUsageState; import com.microsoft.windowsazure.management.websites.models.WebSpaceAvailabilityState; +import com.microsoft.windowsazure.tracing.ClientRequestTrackingHandler; import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; -import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -68,12 +70,12 @@ import java.util.Map; import java.util.TimeZone; import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -85,6 +87,7 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.StringEntity; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -110,12 +113,392 @@ public class WebSiteOperationsImpl implements ServiceOperations beginSwapingSlotsAsync(final String webSpaceName, final String webSiteName, final String slotName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public WebSiteOperationStatusResponse call() throws Exception + { + return beginSwapingSlots(webSpaceName, webSiteName, slotName); + } + }); + } + + /** + * You can swap a web site from one slot to the production slot. + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @param slotName The name of the web site slot to swap with the production + * slot. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return The response body contains the status of the specified + * long-running operation, indicating whether it has succeeded, is + * inprogress, has time dout, or has failed. Note that this status is + * distinct from the HTTP status code returned for the Get Operation Status + * operation itself. If the long-running operation failed, the response + * body includes error information regarding the failure. + */ + @Override + public WebSiteOperationStatusResponse beginSwapingSlots(String webSpaceName, String webSiteName, String slotName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + { + // Validate + if (webSpaceName == null) + { + throw new NullPointerException("webSpaceName"); + } + if (webSiteName == null) + { + throw new NullPointerException("webSiteName"); + } + if (slotName == null) + { + throw new NullPointerException("slotName"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("webSpaceName", webSpaceName); + tracingParameters.put("webSiteName", webSiteName); + tracingParameters.put("slotName", slotName); + CloudTracing.enter(invocationId, this, "beginSwapingSlotsAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/slots?Command=swap&targetSlot=" + slotName; + + // Create HTTP transport objects + HttpPost httpRequest = new HttpPost(url); + + // Set Headers + httpRequest.setHeader("Content-Length", "0"); + httpRequest.setHeader("x-ms-version", "2013-08-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + WebSiteOperationStatusResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteOperationStatusResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Operation"); + Element operationElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (operationElement != null) + { + NodeList elements2 = operationElement.getElementsByTagName("CreatedTime"); + Element createdTimeElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (createdTimeElement != null) + { + Calendar createdTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(createdTimeElement.getTextContent())); + createdTimeInstance = calendar; + result.setCreatedTime(createdTimeInstance); + } + + NodeList elements3 = operationElement.getElementsByTagName("Errors"); + Element errorsSequenceElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (errorsSequenceElement != null) + { + boolean isNil = false; + Attr nilAttribute = errorsSequenceElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + for (int i1 = 0; i1 < errorsSequenceElement.getElementsByTagName("Error").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element errorsElement = ((org.w3c.dom.Element) errorsSequenceElement.getElementsByTagName("Error").item(i1)); + WebSiteOperationStatusResponse.Error errorInstance = new WebSiteOperationStatusResponse.Error(); + result.getErrors().add(errorInstance); + + NodeList elements4 = errorsElement.getElementsByTagName("Code"); + Element codeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (codeElement != null) + { + boolean isNil2 = false; + Attr nilAttribute2 = codeElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil2 = nilAttribute2.getValue() == "true"; + } + if (isNil2 == false) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + errorInstance.setCode(codeInstance); + } + } + + NodeList elements5 = errorsElement.getElementsByTagName("Message"); + Element messageElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (messageElement != null) + { + boolean isNil3 = false; + Attr nilAttribute3 = messageElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute3 != null) + { + isNil3 = nilAttribute3.getValue() == "true"; + } + if (isNil3 == false) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + errorInstance.setMessage(messageInstance); + } + } + + NodeList elements6 = errorsElement.getElementsByTagName("ExtendedCode"); + Element extendedCodeElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (extendedCodeElement != null) + { + boolean isNil4 = false; + Attr nilAttribute4 = extendedCodeElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute4 != null) + { + isNil4 = nilAttribute4.getValue() == "true"; + } + if (isNil4 == false) + { + String extendedCodeInstance; + extendedCodeInstance = extendedCodeElement.getTextContent(); + errorInstance.setExtendedCode(extendedCodeInstance); + } + } + + NodeList elements7 = errorsElement.getElementsByTagName("MessageTemplate"); + Element messageTemplateElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (messageTemplateElement != null) + { + boolean isNil5 = false; + Attr nilAttribute5 = messageTemplateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute5 != null) + { + isNil5 = nilAttribute5.getValue() == "true"; + } + if (isNil5 == false) + { + String messageTemplateInstance; + messageTemplateInstance = messageTemplateElement.getTextContent(); + errorInstance.setMessageTemplate(messageTemplateInstance); + } + } + + NodeList elements8 = errorsElement.getElementsByTagName("Parameters"); + Element parametersSequenceElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (parametersSequenceElement != null) + { + boolean isNil6 = false; + Attr nilAttribute6 = parametersSequenceElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute6 != null) + { + isNil6 = nilAttribute6.getValue() == "true"; + } + if (isNil6 == false) + { + for (int i2 = 0; i2 < parametersSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element parametersElement = ((org.w3c.dom.Element) parametersSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i2)); + errorInstance.getParameters().add(parametersElement.getTextContent()); + } + } + } + + NodeList elements9 = errorsElement.getElementsByTagName("InnerErrors"); + Element innerErrorsElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (innerErrorsElement != null) + { + boolean isNil7 = false; + Attr nilAttribute7 = innerErrorsElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute7 != null) + { + isNil7 = nilAttribute7.getValue() == "true"; + } + if (isNil7 == false) + { + String innerErrorsInstance; + innerErrorsInstance = innerErrorsElement.getTextContent(); + errorInstance.setInnerErrors(innerErrorsInstance); + } + } + } + } + } + + NodeList elements10 = operationElement.getElementsByTagName("ExpirationTime"); + Element expirationTimeElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (expirationTimeElement != null) + { + Calendar expirationTimeInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(expirationTimeElement.getTextContent())); + expirationTimeInstance = calendar2; + result.setExpirationTime(expirationTimeInstance); + } + + NodeList elements11 = operationElement.getElementsByTagName("GeoMasterOperationId"); + Element geoMasterOperationIdElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (geoMasterOperationIdElement != null) + { + boolean isNil8 = false; + Attr nilAttribute8 = geoMasterOperationIdElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute8 != null) + { + isNil8 = nilAttribute8.getValue() == "true"; + } + if (isNil8 == false) + { + String geoMasterOperationIdInstance; + geoMasterOperationIdInstance = geoMasterOperationIdElement.getTextContent(); + result.setGeoMasterOperationId(geoMasterOperationIdInstance); + } + } + + NodeList elements12 = operationElement.getElementsByTagName("Id"); + Element idElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (idElement != null) + { + boolean isNil9 = false; + Attr nilAttribute9 = idElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute9 != null) + { + isNil9 = nilAttribute9.getValue() == "true"; + } + if (isNil9 == false) + { + String idInstance; + idInstance = idElement.getTextContent(); + result.setOperationId(idInstance); + } + } + + NodeList elements13 = operationElement.getElementsByTagName("ModifiedTime"); + Element modifiedTimeElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (modifiedTimeElement != null) + { + Calendar modifiedTimeInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(modifiedTimeElement.getTextContent())); + modifiedTimeInstance = calendar3; + result.setModifiedTime(modifiedTimeInstance); + } + + NodeList elements14 = operationElement.getElementsByTagName("Name"); + Element nameElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (nameElement != null) + { + boolean isNil10 = false; + Attr nilAttribute10 = nameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute10 != null) + { + isNil10 = nilAttribute10.getValue() == "true"; + } + if (isNil10 == false) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + } + + NodeList elements15 = operationElement.getElementsByTagName("Status"); + Element statusElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (statusElement != null) + { + WebSiteOperationStatus statusInstance; + statusInstance = WebSiteOperationStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + /** * You can create a web site by using a POST request that includes the name * of the web site and other information in the request body. (see @@ -146,10 +529,24 @@ public WebSiteCreateResponse call() throws Exception * * @param webSpaceName The name of the web space. * @param parameters Parameters supplied to the Create Web Site operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Create Web Space operation response. */ @Override - public WebSiteCreateResponse create(String webSpaceName, WebSiteCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException, URISyntaxException + public WebSiteCreateResponse create(String webSpaceName, WebSiteCreateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException, URISyntaxException { // Validate if (webSpaceName == null) @@ -160,10 +557,6 @@ public WebSiteCreateResponse create(String webSpaceName, WebSiteCreateParameters { throw new NullPointerException("parameters"); } - if (parameters.getHostNames() == null) - { - throw new NullPointerException("parameters.HostNames"); - } if (parameters.getName() == null) { throw new NullPointerException("parameters.Name"); @@ -219,14 +612,17 @@ public WebSiteCreateResponse create(String webSpaceName, WebSiteCreateParameters Element siteElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Site"); requestDoc.appendChild(siteElement); - Element hostNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostNames"); - for (String hostNamesItem : parameters.getHostNames()) + if (parameters.getHostNames() != null) { - Element hostNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string"); - hostNamesItemElement.appendChild(requestDoc.createTextNode(hostNamesItem)); - hostNamesSequenceElement.appendChild(hostNamesItemElement); + Element hostNamesSequenceElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "HostNames"); + for (String hostNamesItem : parameters.getHostNames()) + { + Element hostNamesItemElement = requestDoc.createElementNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string"); + hostNamesItemElement.appendChild(requestDoc.createTextNode(hostNamesItem)); + hostNamesSequenceElement.appendChild(hostNamesItemElement); + } + siteElement.appendChild(hostNamesSequenceElement); } - siteElement.appendChild(hostNamesSequenceElement); Element nameElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Name"); nameElement.appendChild(requestDoc.createTextNode(parameters.getName())); @@ -288,479 +684,615 @@ public WebSiteCreateResponse create(String webSpaceName, WebSiteCreateParameters // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_CREATED) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - WebSiteCreateResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSiteCreateResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Site"); - Element siteElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (siteElement2 != null) - { - WebSite webSiteInstance = new WebSite(); - result.setWebSite(webSiteInstance); - - NodeList elements2 = siteElement2.getElementsByTagName("AdminEnabled"); - Element adminEnabledElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (adminEnabledElement != null) - { - boolean adminEnabledInstance; - adminEnabledInstance = Boolean.parseBoolean(adminEnabledElement.getTextContent()); - webSiteInstance.setAdminEnabled(adminEnabledInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements3 = siteElement2.getElementsByTagName("AvailabilityState"); - Element availabilityStateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (availabilityStateElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - WebSpaceAvailabilityState availabilityStateInstance; - availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); - webSiteInstance.setAvailabilityState(availabilityStateInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements4 = siteElement2.getElementsByTagName("ComputeMode"); - Element computeModeElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (computeModeElement2 != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_CREATED) { - WebSiteComputeMode computeModeInstance; - computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement2.getTextContent()); - webSiteInstance.setComputeMode(computeModeInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements5 = siteElement2.getElementsByTagName("Enabled"); - Element enabledElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (enabledElement != null) - { - boolean enabledInstance; - enabledInstance = Boolean.parseBoolean(enabledElement.getTextContent()); - webSiteInstance.setEnabled(enabledInstance); - } + // Create Result + WebSiteCreateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteCreateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements6 = siteElement2.getElementsByTagName("EnabledHostNames"); - Element enabledHostNamesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (enabledHostNamesSequenceElement != null) + NodeList elements = responseDoc.getElementsByTagName("Site"); + Element siteElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (siteElement2 != null) { - for (int i1 = 0; i1 < enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i1 = i1 + 1) + WebSite webSiteInstance = new WebSite(); + result.setWebSite(webSiteInstance); + + NodeList elements2 = siteElement2.getElementsByTagName("AdminEnabled"); + Element adminEnabledElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (adminEnabledElement != null) { - org.w3c.dom.Element enabledHostNamesElement = ((org.w3c.dom.Element) enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i1)); - webSiteInstance.getEnabledHostNames().add(enabledHostNamesElement.getTextContent()); + boolean adminEnabledInstance; + adminEnabledInstance = Boolean.parseBoolean(adminEnabledElement.getTextContent()); + webSiteInstance.setAdminEnabled(adminEnabledInstance); } - } - - NodeList elements7 = siteElement2.getElementsByTagName("HostNameSslStates"); - Element hostNameSslStatesSequenceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (hostNameSslStatesSequenceElement != null) - { - for (int i2 = 0; i2 < hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").getLength(); i2 = i2 + 1) + + NodeList elements3 = siteElement2.getElementsByTagName("AvailabilityState"); + Element availabilityStateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (availabilityStateElement != null) { - org.w3c.dom.Element hostNameSslStatesElement = ((org.w3c.dom.Element) hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").item(i2)); - WebSite.WebSiteHostNameSslState webSiteHostNameSslStateInstance = new WebSite.WebSiteHostNameSslState(); - webSiteInstance.getHostNameSslStates().add(webSiteHostNameSslStateInstance); - - NodeList elements8 = hostNameSslStatesElement.getElementsByTagName("Name"); - Element nameElement3 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (nameElement3 != null) - { - String nameInstance; - nameInstance = nameElement3.getTextContent(); - webSiteHostNameSslStateInstance.setName(nameInstance); - } - - NodeList elements9 = hostNameSslStatesElement.getElementsByTagName("SslState"); - Element sslStateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (sslStateElement != null) + WebSpaceAvailabilityState availabilityStateInstance; + availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); + webSiteInstance.setAvailabilityState(availabilityStateInstance); + } + + NodeList elements4 = siteElement2.getElementsByTagName("ComputeMode"); + Element computeModeElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (computeModeElement2 != null) + { + WebSiteComputeMode computeModeInstance; + computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement2.getTextContent()); + webSiteInstance.setComputeMode(computeModeInstance); + } + + NodeList elements5 = siteElement2.getElementsByTagName("Enabled"); + Element enabledElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (enabledElement != null) + { + boolean enabledInstance; + enabledInstance = Boolean.parseBoolean(enabledElement.getTextContent()); + webSiteInstance.setEnabled(enabledInstance); + } + + NodeList elements6 = siteElement2.getElementsByTagName("EnabledHostNames"); + Element enabledHostNamesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (enabledHostNamesSequenceElement != null) + { + for (int i1 = 0; i1 < enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i1 = i1 + 1) { - WebSiteSslState sslStateInstance; - sslStateInstance = WebSiteSslState.valueOf(sslStateElement.getTextContent()); - webSiteHostNameSslStateInstance.setSslState(sslStateInstance); + org.w3c.dom.Element enabledHostNamesElement = ((org.w3c.dom.Element) enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i1)); + webSiteInstance.getEnabledHostNames().add(enabledHostNamesElement.getTextContent()); } - - NodeList elements10 = hostNameSslStatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (thumbprintElement != null) + } + + NodeList elements7 = siteElement2.getElementsByTagName("HostNameSslStates"); + Element hostNameSslStatesSequenceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (hostNameSslStatesSequenceElement != null) + { + for (int i2 = 0; i2 < hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").getLength(); i2 = i2 + 1) { - boolean isNil = false; - String nilAttribute = thumbprintElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) + org.w3c.dom.Element hostNameSslStatesElement = ((org.w3c.dom.Element) hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").item(i2)); + WebSite.WebSiteHostNameSslState webSiteHostNameSslStateInstance = new WebSite.WebSiteHostNameSslState(); + webSiteInstance.getHostNameSslStates().add(webSiteHostNameSslStateInstance); + + NodeList elements8 = hostNameSslStatesElement.getElementsByTagName("Name"); + Element nameElement3 = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (nameElement3 != null) { - isNil = nilAttribute == "true"; + String nameInstance; + nameInstance = nameElement3.getTextContent(); + webSiteHostNameSslStateInstance.setName(nameInstance); } - if (isNil == false) + + NodeList elements9 = hostNameSslStatesElement.getElementsByTagName("SslState"); + Element sslStateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (sslStateElement != null) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - webSiteHostNameSslStateInstance.setThumbprint(thumbprintInstance); + WebSiteSslState sslStateInstance; + sslStateInstance = WebSiteSslState.valueOf(sslStateElement.getTextContent()); + webSiteHostNameSslStateInstance.setSslState(sslStateInstance); } - } - - NodeList elements11 = hostNameSslStatesElement.getElementsByTagName("VirtualIP"); - Element virtualIPElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (virtualIPElement != null) - { - boolean isNil2 = false; - String nilAttribute2 = virtualIPElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute2 != null) + + NodeList elements10 = hostNameSslStatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (thumbprintElement != null) { - isNil2 = nilAttribute2 == "true"; + boolean isNil = false; + Attr nilAttribute = thumbprintElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + webSiteHostNameSslStateInstance.setThumbprint(thumbprintInstance); + } } - if (isNil2 == false) + + NodeList elements11 = hostNameSslStatesElement.getElementsByTagName("VirtualIP"); + Element virtualIPElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (virtualIPElement != null) { - InetAddress virtualIPInstance; - virtualIPInstance = InetAddress.getByName(virtualIPElement.getTextContent()); - webSiteHostNameSslStateInstance.setVirtualIP(virtualIPInstance); + boolean isNil2 = false; + Attr nilAttribute2 = virtualIPElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil2 = nilAttribute2.getValue() == "true"; + } + if (isNil2 == false) + { + InetAddress virtualIPInstance; + virtualIPInstance = InetAddress.getByName(virtualIPElement.getTextContent()); + webSiteHostNameSslStateInstance.setVirtualIP(virtualIPInstance); + } } } } - } - - NodeList elements12 = siteElement2.getElementsByTagName("HostNames"); - Element hostNamesSequenceElement2 = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (hostNamesSequenceElement2 != null) - { - for (int i3 = 0; i3 < hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i3 = i3 + 1) + + NodeList elements12 = siteElement2.getElementsByTagName("HostNames"); + Element hostNamesSequenceElement2 = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (hostNamesSequenceElement2 != null) { - org.w3c.dom.Element hostNamesElement = ((org.w3c.dom.Element) hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i3)); - webSiteInstance.getHostNames().add(hostNamesElement.getTextContent()); + for (int i3 = 0; i3 < hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i3 = i3 + 1) + { + org.w3c.dom.Element hostNamesElement = ((org.w3c.dom.Element) hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i3)); + webSiteInstance.getHostNames().add(hostNamesElement.getTextContent()); + } } - } - - NodeList elements13 = siteElement2.getElementsByTagName("LastModifiedTimeUtc"); - Element lastModifiedTimeUtcElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (lastModifiedTimeUtcElement != null) - { - Calendar lastModifiedTimeUtcInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(lastModifiedTimeUtcElement.getTextContent())); - lastModifiedTimeUtcInstance = calendar; - webSiteInstance.setLastModifiedTimeUtc(lastModifiedTimeUtcInstance); - } - - NodeList elements14 = siteElement2.getElementsByTagName("Name"); - Element nameElement4 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (nameElement4 != null) - { - String nameInstance2; - nameInstance2 = nameElement4.getTextContent(); - webSiteInstance.setName(nameInstance2); - } - - NodeList elements15 = siteElement2.getElementsByTagName("Owner"); - Element ownerElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (ownerElement != null) - { - boolean isNil3 = false; - String nilAttribute3 = ownerElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute3 != null) + + NodeList elements13 = siteElement2.getElementsByTagName("LastModifiedTimeUtc"); + Element lastModifiedTimeUtcElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (lastModifiedTimeUtcElement != null) { - isNil3 = nilAttribute3 == "true"; + Calendar lastModifiedTimeUtcInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(lastModifiedTimeUtcElement.getTextContent())); + lastModifiedTimeUtcInstance = calendar; + webSiteInstance.setLastModifiedTimeUtc(lastModifiedTimeUtcInstance); } - if (isNil3 == false) + + NodeList elements14 = siteElement2.getElementsByTagName("Name"); + Element nameElement4 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (nameElement4 != null) { - String ownerInstance; - ownerInstance = ownerElement.getTextContent(); - webSiteInstance.setOwner(ownerInstance); + String nameInstance2; + nameInstance2 = nameElement4.getTextContent(); + webSiteInstance.setName(nameInstance2); } - } - - NodeList elements16 = siteElement2.getElementsByTagName("RepositorySiteName"); - Element repositorySiteNameElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (repositorySiteNameElement != null) - { - String repositorySiteNameInstance; - repositorySiteNameInstance = repositorySiteNameElement.getTextContent(); - webSiteInstance.setRepositorySiteName(repositorySiteNameInstance); - } - - NodeList elements17 = siteElement2.getElementsByTagName("RuntimeAvailabilityState"); - Element runtimeAvailabilityStateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (runtimeAvailabilityStateElement != null) - { - WebSiteRuntimeAvailabilityState runtimeAvailabilityStateInstance; - runtimeAvailabilityStateInstance = WebSiteRuntimeAvailabilityState.valueOf(runtimeAvailabilityStateElement.getTextContent()); - webSiteInstance.setRuntimeAvailabilityState(runtimeAvailabilityStateInstance); - } - - NodeList elements18 = siteElement2.getElementsByTagName("SSLCertificates"); - Element sSLCertificatesSequenceElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (sSLCertificatesSequenceElement != null) - { - for (int i4 = 0; i4 < sSLCertificatesSequenceElement.getElementsByTagName("Certificate").getLength(); i4 = i4 + 1) + + NodeList elements15 = siteElement2.getElementsByTagName("Owner"); + Element ownerElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (ownerElement != null) { - org.w3c.dom.Element sSLCertificatesElement = ((org.w3c.dom.Element) sSLCertificatesSequenceElement.getElementsByTagName("Certificate").item(i4)); - WebSite.WebSiteSslCertificate certificateInstance = new WebSite.WebSiteSslCertificate(); - webSiteInstance.getSslCertificates().add(certificateInstance); - - NodeList elements19 = sSLCertificatesElement.getElementsByTagName("ExpirationDate"); - Element expirationDateElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (expirationDateElement != null) - { - Calendar expirationDateInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(expirationDateElement.getTextContent())); - expirationDateInstance = calendar2; - certificateInstance.setExpirationDate(expirationDateInstance); - } - - NodeList elements20 = sSLCertificatesElement.getElementsByTagName("FriendlyName"); - Element friendlyNameElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (friendlyNameElement != null) - { - String friendlyNameInstance; - friendlyNameInstance = friendlyNameElement.getTextContent(); - certificateInstance.setFriendlyName(friendlyNameInstance); - } - - NodeList elements21 = sSLCertificatesElement.getElementsByTagName("HostNames"); - Element hostNamesSequenceElement3 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (hostNamesSequenceElement3 != null) - { - for (int i5 = 0; i5 < hostNamesSequenceElement3.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i5 = i5 + 1) - { - org.w3c.dom.Element hostNamesElement2 = ((org.w3c.dom.Element) hostNamesSequenceElement3.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i5)); - certificateInstance.getHostNames().add(hostNamesElement2.getTextContent()); - } - } - - NodeList elements22 = sSLCertificatesElement.getElementsByTagName("IssueDate"); - Element issueDateElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (issueDateElement != null) - { - Calendar issueDateInstance; - SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar3 = Calendar.getInstance(); - calendar3.setTime(simpleDateFormat3.parse(issueDateElement.getTextContent())); - issueDateInstance = calendar3; - certificateInstance.setIssueDate(issueDateInstance); - } - - NodeList elements23 = sSLCertificatesElement.getElementsByTagName("Issuer"); - Element issuerElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (issuerElement != null) - { - String issuerInstance; - issuerInstance = issuerElement.getTextContent(); - certificateInstance.setIssuer(issuerInstance); - } - - NodeList elements24 = sSLCertificatesElement.getElementsByTagName("Password"); - Element passwordElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (passwordElement != null) + boolean isNil3 = false; + Attr nilAttribute3 = ownerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute3 != null) { - String passwordInstance; - passwordInstance = passwordElement.getTextContent(); - certificateInstance.setPassword(passwordInstance); + isNil3 = nilAttribute3.getValue() == "true"; } - - NodeList elements25 = sSLCertificatesElement.getElementsByTagName("PfxBlob"); - Element pfxBlobElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (pfxBlobElement != null) - { - byte[] pfxBlobInstance; - pfxBlobInstance = pfxBlobElement.getTextContent() != null ? Base64.decodeBase64(pfxBlobElement.getTextContent().getBytes()) : null; - certificateInstance.setPfxBlob(pfxBlobInstance); - } - - NodeList elements26 = sSLCertificatesElement.getElementsByTagName("SelfLink"); - Element selfLinkElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (selfLinkElement != null) + if (isNil3 == false) { - URI selfLinkInstance; - selfLinkInstance = new URI(selfLinkElement.getTextContent()); - certificateInstance.setSelfLinkUri(selfLinkInstance); + String ownerInstance; + ownerInstance = ownerElement.getTextContent(); + webSiteInstance.setOwner(ownerInstance); } - - NodeList elements27 = sSLCertificatesElement.getElementsByTagName("SiteName"); - Element siteNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; - if (siteNameElement != null) + } + + NodeList elements16 = siteElement2.getElementsByTagName("RepositorySiteName"); + Element repositorySiteNameElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (repositorySiteNameElement != null) + { + String repositorySiteNameInstance; + repositorySiteNameInstance = repositorySiteNameElement.getTextContent(); + webSiteInstance.setRepositorySiteName(repositorySiteNameInstance); + } + + NodeList elements17 = siteElement2.getElementsByTagName("RuntimeAvailabilityState"); + Element runtimeAvailabilityStateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (runtimeAvailabilityStateElement != null) + { + WebSiteRuntimeAvailabilityState runtimeAvailabilityStateInstance; + runtimeAvailabilityStateInstance = WebSiteRuntimeAvailabilityState.valueOf(runtimeAvailabilityStateElement.getTextContent()); + webSiteInstance.setRuntimeAvailabilityState(runtimeAvailabilityStateInstance); + } + + NodeList elements18 = siteElement2.getElementsByTagName("SSLCertificates"); + Element sSLCertificatesSequenceElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (sSLCertificatesSequenceElement != null) + { + boolean isNil4 = false; + Attr nilAttribute4 = sSLCertificatesSequenceElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute4 != null) { - String siteNameInstance; - siteNameInstance = siteNameElement.getTextContent(); - certificateInstance.setSiteName(siteNameInstance); + isNil4 = nilAttribute4.getValue() == "true"; } - - NodeList elements28 = sSLCertificatesElement.getElementsByTagName("SubjectName"); - Element subjectNameElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; - if (subjectNameElement != null) + if (isNil4 == false) { - String subjectNameInstance; - subjectNameInstance = subjectNameElement.getTextContent(); - certificateInstance.setSubjectName(subjectNameInstance); + for (int i4 = 0; i4 < sSLCertificatesSequenceElement.getElementsByTagName("Certificate").getLength(); i4 = i4 + 1) + { + org.w3c.dom.Element sSLCertificatesElement = ((org.w3c.dom.Element) sSLCertificatesSequenceElement.getElementsByTagName("Certificate").item(i4)); + WebSite.WebSiteSslCertificate certificateInstance = new WebSite.WebSiteSslCertificate(); + webSiteInstance.getSslCertificates().add(certificateInstance); + + NodeList elements19 = sSLCertificatesElement.getElementsByTagName("ExpirationDate"); + Element expirationDateElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (expirationDateElement != null && (expirationDateElement.getTextContent() != null && expirationDateElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil5 = false; + Attr nilAttribute5 = expirationDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute5 != null) + { + isNil5 = nilAttribute5.getValue() == "true"; + } + if (isNil5 == false) + { + Calendar expirationDateInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(expirationDateElement.getTextContent())); + expirationDateInstance = calendar2; + certificateInstance.setExpirationDate(expirationDateInstance); + } + } + + NodeList elements20 = sSLCertificatesElement.getElementsByTagName("FriendlyName"); + Element friendlyNameElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (friendlyNameElement != null) + { + boolean isNil6 = false; + Attr nilAttribute6 = friendlyNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute6 != null) + { + isNil6 = nilAttribute6.getValue() == "true"; + } + if (isNil6 == false) + { + String friendlyNameInstance; + friendlyNameInstance = friendlyNameElement.getTextContent(); + certificateInstance.setFriendlyName(friendlyNameInstance); + } + } + + NodeList elements21 = sSLCertificatesElement.getElementsByTagName("HostNames"); + Element hostNamesSequenceElement3 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (hostNamesSequenceElement3 != null) + { + boolean isNil7 = false; + Attr nilAttribute7 = hostNamesSequenceElement3.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute7 != null) + { + isNil7 = nilAttribute7.getValue() == "true"; + } + if (isNil7 == false) + { + for (int i5 = 0; i5 < hostNamesSequenceElement3.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i5 = i5 + 1) + { + org.w3c.dom.Element hostNamesElement2 = ((org.w3c.dom.Element) hostNamesSequenceElement3.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i5)); + certificateInstance.getHostNames().add(hostNamesElement2.getTextContent()); + } + } + } + + NodeList elements22 = sSLCertificatesElement.getElementsByTagName("IssueDate"); + Element issueDateElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (issueDateElement != null && (issueDateElement.getTextContent() != null && issueDateElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil8 = false; + Attr nilAttribute8 = issueDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute8 != null) + { + isNil8 = nilAttribute8.getValue() == "true"; + } + if (isNil8 == false) + { + Calendar issueDateInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(issueDateElement.getTextContent())); + issueDateInstance = calendar3; + certificateInstance.setIssueDate(issueDateInstance); + } + } + + NodeList elements23 = sSLCertificatesElement.getElementsByTagName("Issuer"); + Element issuerElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (issuerElement != null) + { + boolean isNil9 = false; + Attr nilAttribute9 = issuerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute9 != null) + { + isNil9 = nilAttribute9.getValue() == "true"; + } + if (isNil9 == false) + { + String issuerInstance; + issuerInstance = issuerElement.getTextContent(); + certificateInstance.setIssuer(issuerInstance); + } + } + + NodeList elements24 = sSLCertificatesElement.getElementsByTagName("Password"); + Element passwordElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (passwordElement != null) + { + boolean isNil10 = false; + Attr nilAttribute10 = passwordElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute10 != null) + { + isNil10 = nilAttribute10.getValue() == "true"; + } + if (isNil10 == false) + { + String passwordInstance; + passwordInstance = passwordElement.getTextContent(); + certificateInstance.setPassword(passwordInstance); + } + } + + NodeList elements25 = sSLCertificatesElement.getElementsByTagName("PfxBlob"); + Element pfxBlobElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (pfxBlobElement != null) + { + boolean isNil11 = false; + Attr nilAttribute11 = pfxBlobElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute11 != null) + { + isNil11 = nilAttribute11.getValue() == "true"; + } + if (isNil11 == false) + { + byte[] pfxBlobInstance; + pfxBlobInstance = pfxBlobElement.getTextContent() != null ? Base64.decodeBase64(pfxBlobElement.getTextContent().getBytes()) : null; + certificateInstance.setPfxBlob(pfxBlobInstance); + } + } + + NodeList elements26 = sSLCertificatesElement.getElementsByTagName("SelfLink"); + Element selfLinkElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (selfLinkElement != null) + { + boolean isNil12 = false; + Attr nilAttribute12 = selfLinkElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute12 != null) + { + isNil12 = nilAttribute12.getValue() == "true"; + } + if (isNil12 == false) + { + URI selfLinkInstance; + selfLinkInstance = new URI(selfLinkElement.getTextContent()); + certificateInstance.setSelfLinkUri(selfLinkInstance); + } + } + + NodeList elements27 = sSLCertificatesElement.getElementsByTagName("SiteName"); + Element siteNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; + if (siteNameElement != null) + { + boolean isNil13 = false; + Attr nilAttribute13 = siteNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute13 != null) + { + isNil13 = nilAttribute13.getValue() == "true"; + } + if (isNil13 == false) + { + String siteNameInstance; + siteNameInstance = siteNameElement.getTextContent(); + certificateInstance.setSiteName(siteNameInstance); + } + } + + NodeList elements28 = sSLCertificatesElement.getElementsByTagName("SubjectName"); + Element subjectNameElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; + if (subjectNameElement != null) + { + boolean isNil14 = false; + Attr nilAttribute14 = subjectNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute14 != null) + { + isNil14 = nilAttribute14.getValue() == "true"; + } + if (isNil14 == false) + { + String subjectNameInstance; + subjectNameInstance = subjectNameElement.getTextContent(); + certificateInstance.setSubjectName(subjectNameInstance); + } + } + + NodeList elements29 = sSLCertificatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement2 = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; + if (thumbprintElement2 != null) + { + boolean isNil15 = false; + Attr nilAttribute15 = thumbprintElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute15 != null) + { + isNil15 = nilAttribute15.getValue() == "true"; + } + if (isNil15 == false) + { + String thumbprintInstance2; + thumbprintInstance2 = thumbprintElement2.getTextContent(); + certificateInstance.setThumbprint(thumbprintInstance2); + } + } + + NodeList elements30 = sSLCertificatesElement.getElementsByTagName("ToDelete"); + Element toDeleteElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; + if (toDeleteElement != null && (toDeleteElement.getTextContent() != null && toDeleteElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil16 = false; + Attr nilAttribute16 = toDeleteElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute16 != null) + { + isNil16 = nilAttribute16.getValue() == "true"; + } + if (isNil16 == false) + { + boolean toDeleteInstance; + toDeleteInstance = Boolean.parseBoolean(toDeleteElement.getTextContent()); + certificateInstance.setIsToBeDeleted(toDeleteInstance); + } + } + + NodeList elements31 = sSLCertificatesElement.getElementsByTagName("Valid"); + Element validElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; + if (validElement != null && (validElement.getTextContent() != null && validElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil17 = false; + Attr nilAttribute17 = validElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute17 != null) + { + isNil17 = nilAttribute17.getValue() == "true"; + } + if (isNil17 == false) + { + boolean validInstance; + validInstance = Boolean.parseBoolean(validElement.getTextContent()); + certificateInstance.setIsValid(validInstance); + } + } + } } + } + + NodeList elements32 = siteElement2.getElementsByTagName("SelfLink"); + Element selfLinkElement2 = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; + if (selfLinkElement2 != null) + { + URI selfLinkInstance2; + selfLinkInstance2 = new URI(selfLinkElement2.getTextContent()); + webSiteInstance.setUri(selfLinkInstance2); + } + + NodeList elements33 = siteElement2.getElementsByTagName("ServerFarm"); + Element serverFarmElement2 = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; + if (serverFarmElement2 != null) + { + String serverFarmInstance; + serverFarmInstance = serverFarmElement2.getTextContent(); + webSiteInstance.setServerFarm(serverFarmInstance); + } + + NodeList elements34 = siteElement2.getElementsByTagName("SiteMode"); + Element siteModeElement2 = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; + if (siteModeElement2 != null) + { + WebSiteMode siteModeInstance; + siteModeInstance = WebSiteMode.valueOf(siteModeElement2.getTextContent()); + webSiteInstance.setSiteMode(siteModeInstance); + } + + NodeList elements35 = siteElement2.getElementsByTagName("SiteProperties"); + Element sitePropertiesElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; + if (sitePropertiesElement != null) + { + WebSite.WebSiteProperties sitePropertiesInstance = new WebSite.WebSiteProperties(); + webSiteInstance.setSiteProperties(sitePropertiesInstance); - NodeList elements29 = sSLCertificatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement2 = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; - if (thumbprintElement2 != null) + NodeList elements36 = sitePropertiesElement.getElementsByTagName("AppSettings"); + Element appSettingsSequenceElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; + if (appSettingsSequenceElement != null) { - String thumbprintInstance2; - thumbprintInstance2 = thumbprintElement2.getTextContent(); - certificateInstance.setThumbprint(thumbprintInstance2); + for (int i6 = 0; i6 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i6 = i6 + 1) + { + org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i6)); + NodeList elements37 = appSettingsElement.getElementsByTagName("Name"); + String appSettingsKey = elements37.getLength() > 0 ? ((org.w3c.dom.Element) elements37.item(0)).getTextContent() : null; + NodeList elements38 = appSettingsElement.getElementsByTagName("Value"); + String appSettingsValue = elements38.getLength() > 0 ? ((org.w3c.dom.Element) elements38.item(0)).getTextContent() : null; + sitePropertiesInstance.getAppSettings().put(appSettingsKey, appSettingsValue); + } } - NodeList elements30 = sSLCertificatesElement.getElementsByTagName("ToDelete"); - Element toDeleteElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; - if (toDeleteElement != null) + NodeList elements39 = sitePropertiesElement.getElementsByTagName("Metadata"); + Element metadataSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; + if (metadataSequenceElement != null) { - boolean toDeleteInstance; - toDeleteInstance = Boolean.parseBoolean(toDeleteElement.getTextContent()); - certificateInstance.setIsToBeDeleted(toDeleteInstance); + for (int i7 = 0; i7 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i7 = i7 + 1) + { + org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i7)); + NodeList elements40 = metadataElement.getElementsByTagName("Name"); + String metadataKey = elements40.getLength() > 0 ? ((org.w3c.dom.Element) elements40.item(0)).getTextContent() : null; + NodeList elements41 = metadataElement.getElementsByTagName("Value"); + String metadataValue = elements41.getLength() > 0 ? ((org.w3c.dom.Element) elements41.item(0)).getTextContent() : null; + sitePropertiesInstance.getMetadata().put(metadataKey, metadataValue); + } } - NodeList elements31 = sSLCertificatesElement.getElementsByTagName("Valid"); - Element validElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; - if (validElement != null) + NodeList elements42 = sitePropertiesElement.getElementsByTagName("Properties"); + Element propertiesSequenceElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; + if (propertiesSequenceElement != null) { - boolean validInstance; - validInstance = Boolean.parseBoolean(validElement.getTextContent()); - certificateInstance.setIsValid(validInstance); + for (int i8 = 0; i8 < propertiesSequenceElement.getElementsByTagName("NameValuePair").getLength(); i8 = i8 + 1) + { + org.w3c.dom.Element propertiesElement = ((org.w3c.dom.Element) propertiesSequenceElement.getElementsByTagName("NameValuePair").item(i8)); + NodeList elements43 = propertiesElement.getElementsByTagName("Name"); + String propertiesKey = elements43.getLength() > 0 ? ((org.w3c.dom.Element) elements43.item(0)).getTextContent() : null; + NodeList elements44 = propertiesElement.getElementsByTagName("Value"); + String propertiesValue = elements44.getLength() > 0 ? ((org.w3c.dom.Element) elements44.item(0)).getTextContent() : null; + sitePropertiesInstance.getProperties().put(propertiesKey, propertiesValue); + } } } - } - - NodeList elements32 = siteElement2.getElementsByTagName("SelfLink"); - Element selfLinkElement2 = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; - if (selfLinkElement2 != null) - { - URI selfLinkInstance2; - selfLinkInstance2 = new URI(selfLinkElement2.getTextContent()); - webSiteInstance.setUri(selfLinkInstance2); - } - - NodeList elements33 = siteElement2.getElementsByTagName("ServerFarm"); - Element serverFarmElement2 = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; - if (serverFarmElement2 != null) - { - String serverFarmInstance; - serverFarmInstance = serverFarmElement2.getTextContent(); - webSiteInstance.setServerFarm(serverFarmInstance); - } - - NodeList elements34 = siteElement2.getElementsByTagName("SiteMode"); - Element siteModeElement2 = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; - if (siteModeElement2 != null) - { - WebSiteMode siteModeInstance; - siteModeInstance = WebSiteMode.valueOf(siteModeElement2.getTextContent()); - webSiteInstance.setSiteMode(siteModeInstance); - } - - NodeList elements35 = siteElement2.getElementsByTagName("SiteProperties"); - Element sitePropertiesElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; - if (sitePropertiesElement != null) - { - WebSite.WebSiteProperties sitePropertiesInstance = new WebSite.WebSiteProperties(); - webSiteInstance.setSiteProperties(sitePropertiesInstance); - NodeList elements36 = sitePropertiesElement.getElementsByTagName("AppSettings"); - Element appSettingsSequenceElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; - if (appSettingsSequenceElement != null) + NodeList elements45 = siteElement2.getElementsByTagName("State"); + Element stateElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; + if (stateElement != null) { - for (int i6 = 0; i6 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i6 = i6 + 1) - { - org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i6)); - NodeList elements37 = appSettingsElement.getElementsByTagName("Name"); - String appSettingsKey = elements37.getLength() > 0 ? ((org.w3c.dom.Element) elements37.item(0)).getTextContent() : null; - NodeList elements38 = appSettingsElement.getElementsByTagName("Value"); - String appSettingsValue = elements38.getLength() > 0 ? ((org.w3c.dom.Element) elements38.item(0)).getTextContent() : null; - sitePropertiesInstance.getAppSettings().put(appSettingsKey, appSettingsValue); - } + WebSiteState stateInstance; + stateInstance = WebSiteState.valueOf(stateElement.getTextContent()); + webSiteInstance.setState(stateInstance); } - NodeList elements39 = sitePropertiesElement.getElementsByTagName("Metadata"); - Element metadataSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; - if (metadataSequenceElement != null) + NodeList elements46 = siteElement2.getElementsByTagName("UsageState"); + Element usageStateElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; + if (usageStateElement != null) { - for (int i7 = 0; i7 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i7 = i7 + 1) - { - org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i7)); - NodeList elements40 = metadataElement.getElementsByTagName("Name"); - String metadataKey = elements40.getLength() > 0 ? ((org.w3c.dom.Element) elements40.item(0)).getTextContent() : null; - NodeList elements41 = metadataElement.getElementsByTagName("Value"); - String metadataValue = elements41.getLength() > 0 ? ((org.w3c.dom.Element) elements41.item(0)).getTextContent() : null; - sitePropertiesInstance.getMetadata().put(metadataKey, metadataValue); - } + WebSiteUsageState usageStateInstance; + usageStateInstance = WebSiteUsageState.valueOf(usageStateElement.getTextContent()); + webSiteInstance.setUsageState(usageStateInstance); } - NodeList elements42 = sitePropertiesElement.getElementsByTagName("Properties"); - Element propertiesSequenceElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; - if (propertiesSequenceElement != null) + NodeList elements47 = siteElement2.getElementsByTagName("WebSpace"); + Element webSpaceElement2 = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; + if (webSpaceElement2 != null) { - for (int i8 = 0; i8 < propertiesSequenceElement.getElementsByTagName("NameValuePair").getLength(); i8 = i8 + 1) - { - org.w3c.dom.Element propertiesElement = ((org.w3c.dom.Element) propertiesSequenceElement.getElementsByTagName("NameValuePair").item(i8)); - NodeList elements43 = propertiesElement.getElementsByTagName("Name"); - String propertiesKey = elements43.getLength() > 0 ? ((org.w3c.dom.Element) elements43.item(0)).getTextContent() : null; - NodeList elements44 = propertiesElement.getElementsByTagName("Value"); - String propertiesValue = elements44.getLength() > 0 ? ((org.w3c.dom.Element) elements44.item(0)).getTextContent() : null; - sitePropertiesInstance.getProperties().put(propertiesKey, propertiesValue); - } + String webSpaceInstance; + webSpaceInstance = webSpaceElement2.getTextContent(); + webSiteInstance.setWebSpace(webSpaceInstance); } } - NodeList elements45 = siteElement2.getElementsByTagName("State"); - Element stateElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; - if (stateElement != null) - { - WebSiteState stateInstance; - stateInstance = WebSiteState.valueOf(stateElement.getTextContent()); - webSiteInstance.setState(stateInstance); - } - - NodeList elements46 = siteElement2.getElementsByTagName("UsageState"); - Element usageStateElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; - if (usageStateElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - WebSiteUsageState usageStateInstance; - usageStateInstance = WebSiteUsageState.valueOf(usageStateElement.getTextContent()); - webSiteInstance.setUsageState(usageStateInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements47 = siteElement2.getElementsByTagName("WebSpace"); - Element webSpaceElement2 = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; - if (webSpaceElement2 != null) + if (shouldTrace) { - String webSpaceInstance; - webSpaceInstance = webSpaceElement2.getTextContent(); - webSiteInstance.setWebSpace(webSpaceInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -800,6 +1332,10 @@ public OperationResponse call() throws Exception * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -840,40 +1376,50 @@ public OperationResponse createRepository(String webSpaceName, String webSiteNam // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -886,20 +1432,18 @@ public OperationResponse createRepository(String webSpaceName, String webSiteNam * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @param deleteEmptyServerFarm If the site being deleted is the last web - * site in a server farm, you can delete the server farm. - * @param deleteMetrics Delete the metrics for the site that you are deleting + * @param parameters The parameters to delete a web site. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public Future deleteAsync(final String webSpaceName, final String webSiteName, final boolean deleteEmptyServerFarm, final boolean deleteMetrics) + public Future deleteAsync(final String webSpaceName, final String webSiteName, final WebSiteDeleteParameters parameters) { return this.getClient().getExecutorService().submit(new Callable() { @Override public OperationResponse call() throws Exception { - return delete(webSpaceName, webSiteName, deleteEmptyServerFarm, deleteMetrics); + return delete(webSpaceName, webSiteName, parameters); } }); } @@ -914,14 +1458,16 @@ public OperationResponse call() throws Exception * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @param deleteEmptyServerFarm If the site being deleted is the last web - * site in a server farm, you can delete the server farm. - * @param deleteMetrics Delete the metrics for the site that you are deleting + * @param parameters The parameters to delete a web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse delete(String webSpaceName, String webSiteName, boolean deleteEmptyServerFarm, boolean deleteMetrics) throws IOException, ServiceException + public OperationResponse delete(String webSpaceName, String webSiteName, WebSiteDeleteParameters parameters) throws IOException, ServiceException { // Validate if (webSpaceName == null) @@ -932,6 +1478,10 @@ public OperationResponse delete(String webSpaceName, String webSiteName, boolean { throw new NullPointerException("webSiteName"); } + if (parameters == null) + { + throw new NullPointerException("parameters"); + } // Tracing boolean shouldTrace = CloudTracing.getIsEnabled(); @@ -942,15 +1492,12 @@ public OperationResponse delete(String webSpaceName, String webSiteName, boolean HashMap tracingParameters = new HashMap(); tracingParameters.put("webSpaceName", webSpaceName); tracingParameters.put("webSiteName", webSiteName); - tracingParameters.put("deleteEmptyServerFarm", deleteEmptyServerFarm); - tracingParameters.put("deleteMetrics", deleteMetrics); + tracingParameters.put("parameters", parameters); CloudTracing.enter(invocationId, this, "deleteAsync", tracingParameters); } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "?"; - url = url + "&deleteEmptyServerFarm=" + URLEncoder.encode(Boolean.toString(deleteEmptyServerFarm).toLowerCase(), "UTF-8"); - url = url + "&deleteMetrics=" + URLEncoder.encode(Boolean.toString(deleteMetrics).toLowerCase(), "UTF-8"); + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "?deleteEmptyServerFarm=" + parameters.isDeleteEmptyServerFarm() + "&deleteMetrics=" + parameters.isDeleteMetrics() + "&deleteAllSlots=" + parameters.isDeleteAllSlots(); // Create HTTP transport objects CustomHttpDelete httpRequest = new CustomHttpDelete(url); @@ -960,40 +1507,50 @@ public OperationResponse delete(String webSpaceName, String webSiteName, boolean // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1032,6 +1589,16 @@ public WebSiteDeleteRepositoryResponse call() throws Exception * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Delete Web Site Repository operation response. */ @Override @@ -1070,53 +1637,63 @@ public WebSiteDeleteRepositoryResponse deleteRepository(String webSpaceName, Str // Send Request HttpResponse httpResponse = null; - if (shouldTrace) + try { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - WebSiteDeleteRepositoryResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSiteDeleteRepositoryResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/", "anyURI"); - Element anyURIElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (anyURIElement != null) - { - result.setUri(new URI(anyURIElement.getTextContent())); - } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + WebSiteDeleteRepositoryResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteDeleteRepositoryResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/", "anyURI"); + Element anyURIElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (anyURIElement != null) + { + result.setUri(new URI(anyURIElement.getTextContent())); + } + + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1160,6 +1737,10 @@ public OperationResponse call() throws Exception * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @@ -1200,40 +1781,50 @@ public OperationResponse generatePassword(String webSpaceName, String webSiteNam // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1266,6 +1857,18 @@ public WebSiteGetResponse call() throws Exception * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. * @param parameters Additional parameters. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Web Site Details operation response. */ @Override @@ -1295,11 +1898,7 @@ public WebSiteGetResponse get(String webSpaceName, String webSiteName, WebSiteGe } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "?"; - if (parameters.getPropertiesToInclude() != null && parameters.getPropertiesToInclude().size() > 0) - { - url = url + "&propertiesToInclude=" + URLEncoder.encode(CommaStringBuilder.join(parameters.getPropertiesToInclude()), "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "?propertiesToInclude=" + CommaStringBuilder.join(parameters.getPropertiesToInclude()); // Create HTTP transport objects HttpGet httpRequest = new HttpGet(url); @@ -1309,517 +1908,1416 @@ public WebSiteGetResponse get(String webSpaceName, String webSiteName, WebSiteGe // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - WebSiteGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSiteGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Site"); - Element siteElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (siteElement != null) - { - WebSite webSiteInstance = new WebSite(); - result.setWebSite(webSiteInstance); - - NodeList elements2 = siteElement.getElementsByTagName("AdminEnabled"); - Element adminEnabledElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (adminEnabledElement != null) - { - boolean adminEnabledInstance; - adminEnabledInstance = Boolean.parseBoolean(adminEnabledElement.getTextContent()); - webSiteInstance.setAdminEnabled(adminEnabledInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements3 = siteElement.getElementsByTagName("AvailabilityState"); - Element availabilityStateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (availabilityStateElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - WebSpaceAvailabilityState availabilityStateInstance; - availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); - webSiteInstance.setAvailabilityState(availabilityStateInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements4 = siteElement.getElementsByTagName("ComputeMode"); - Element computeModeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (computeModeElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - WebSiteComputeMode computeModeInstance; - computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement.getTextContent()); - webSiteInstance.setComputeMode(computeModeInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements5 = siteElement.getElementsByTagName("Enabled"); - Element enabledElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (enabledElement != null) - { - boolean enabledInstance; - enabledInstance = Boolean.parseBoolean(enabledElement.getTextContent()); - webSiteInstance.setEnabled(enabledInstance); - } + // Create Result + WebSiteGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements6 = siteElement.getElementsByTagName("EnabledHostNames"); - Element enabledHostNamesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (enabledHostNamesSequenceElement != null) + NodeList elements = responseDoc.getElementsByTagName("Site"); + Element siteElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (siteElement != null) { - for (int i1 = 0; i1 < enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i1 = i1 + 1) + WebSite webSiteInstance = new WebSite(); + result.setWebSite(webSiteInstance); + + NodeList elements2 = siteElement.getElementsByTagName("AdminEnabled"); + Element adminEnabledElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (adminEnabledElement != null) { - org.w3c.dom.Element enabledHostNamesElement = ((org.w3c.dom.Element) enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i1)); - webSiteInstance.getEnabledHostNames().add(enabledHostNamesElement.getTextContent()); + boolean adminEnabledInstance; + adminEnabledInstance = Boolean.parseBoolean(adminEnabledElement.getTextContent()); + webSiteInstance.setAdminEnabled(adminEnabledInstance); } - } - - NodeList elements7 = siteElement.getElementsByTagName("HostNameSslStates"); - Element hostNameSslStatesSequenceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (hostNameSslStatesSequenceElement != null) - { - for (int i2 = 0; i2 < hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").getLength(); i2 = i2 + 1) + + NodeList elements3 = siteElement.getElementsByTagName("AvailabilityState"); + Element availabilityStateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (availabilityStateElement != null) { - org.w3c.dom.Element hostNameSslStatesElement = ((org.w3c.dom.Element) hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").item(i2)); - WebSite.WebSiteHostNameSslState webSiteHostNameSslStateInstance = new WebSite.WebSiteHostNameSslState(); - webSiteInstance.getHostNameSslStates().add(webSiteHostNameSslStateInstance); - - NodeList elements8 = hostNameSslStatesElement.getElementsByTagName("Name"); - Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - webSiteHostNameSslStateInstance.setName(nameInstance); - } - - NodeList elements9 = hostNameSslStatesElement.getElementsByTagName("SslState"); - Element sslStateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (sslStateElement != null) + WebSpaceAvailabilityState availabilityStateInstance; + availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); + webSiteInstance.setAvailabilityState(availabilityStateInstance); + } + + NodeList elements4 = siteElement.getElementsByTagName("ComputeMode"); + Element computeModeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (computeModeElement != null) + { + WebSiteComputeMode computeModeInstance; + computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement.getTextContent()); + webSiteInstance.setComputeMode(computeModeInstance); + } + + NodeList elements5 = siteElement.getElementsByTagName("Enabled"); + Element enabledElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (enabledElement != null) + { + boolean enabledInstance; + enabledInstance = Boolean.parseBoolean(enabledElement.getTextContent()); + webSiteInstance.setEnabled(enabledInstance); + } + + NodeList elements6 = siteElement.getElementsByTagName("EnabledHostNames"); + Element enabledHostNamesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (enabledHostNamesSequenceElement != null) + { + for (int i1 = 0; i1 < enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i1 = i1 + 1) { - WebSiteSslState sslStateInstance; - sslStateInstance = WebSiteSslState.valueOf(sslStateElement.getTextContent()); - webSiteHostNameSslStateInstance.setSslState(sslStateInstance); + org.w3c.dom.Element enabledHostNamesElement = ((org.w3c.dom.Element) enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i1)); + webSiteInstance.getEnabledHostNames().add(enabledHostNamesElement.getTextContent()); } - - NodeList elements10 = hostNameSslStatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (thumbprintElement != null) + } + + NodeList elements7 = siteElement.getElementsByTagName("HostNameSslStates"); + Element hostNameSslStatesSequenceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (hostNameSslStatesSequenceElement != null) + { + for (int i2 = 0; i2 < hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").getLength(); i2 = i2 + 1) { - boolean isNil = false; - String nilAttribute = thumbprintElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) + org.w3c.dom.Element hostNameSslStatesElement = ((org.w3c.dom.Element) hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").item(i2)); + WebSite.WebSiteHostNameSslState webSiteHostNameSslStateInstance = new WebSite.WebSiteHostNameSslState(); + webSiteInstance.getHostNameSslStates().add(webSiteHostNameSslStateInstance); + + NodeList elements8 = hostNameSslStatesElement.getElementsByTagName("Name"); + Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (nameElement != null) { - isNil = nilAttribute == "true"; + String nameInstance; + nameInstance = nameElement.getTextContent(); + webSiteHostNameSslStateInstance.setName(nameInstance); } - if (isNil == false) + + NodeList elements9 = hostNameSslStatesElement.getElementsByTagName("SslState"); + Element sslStateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (sslStateElement != null) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - webSiteHostNameSslStateInstance.setThumbprint(thumbprintInstance); + WebSiteSslState sslStateInstance; + sslStateInstance = WebSiteSslState.valueOf(sslStateElement.getTextContent()); + webSiteHostNameSslStateInstance.setSslState(sslStateInstance); } - } - - NodeList elements11 = hostNameSslStatesElement.getElementsByTagName("VirtualIP"); - Element virtualIPElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (virtualIPElement != null) - { - boolean isNil2 = false; - String nilAttribute2 = virtualIPElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute2 != null) + + NodeList elements10 = hostNameSslStatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (thumbprintElement != null) { - isNil2 = nilAttribute2 == "true"; + boolean isNil = false; + Attr nilAttribute = thumbprintElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + webSiteHostNameSslStateInstance.setThumbprint(thumbprintInstance); + } } - if (isNil2 == false) + + NodeList elements11 = hostNameSslStatesElement.getElementsByTagName("VirtualIP"); + Element virtualIPElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (virtualIPElement != null) { - InetAddress virtualIPInstance; - virtualIPInstance = InetAddress.getByName(virtualIPElement.getTextContent()); - webSiteHostNameSslStateInstance.setVirtualIP(virtualIPInstance); + boolean isNil2 = false; + Attr nilAttribute2 = virtualIPElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil2 = nilAttribute2.getValue() == "true"; + } + if (isNil2 == false) + { + InetAddress virtualIPInstance; + virtualIPInstance = InetAddress.getByName(virtualIPElement.getTextContent()); + webSiteHostNameSslStateInstance.setVirtualIP(virtualIPInstance); + } } } } - } - - NodeList elements12 = siteElement.getElementsByTagName("HostNames"); - Element hostNamesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (hostNamesSequenceElement != null) - { - for (int i3 = 0; i3 < hostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i3 = i3 + 1) + + NodeList elements12 = siteElement.getElementsByTagName("HostNames"); + Element hostNamesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (hostNamesSequenceElement != null) { - org.w3c.dom.Element hostNamesElement = ((org.w3c.dom.Element) hostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i3)); - webSiteInstance.getHostNames().add(hostNamesElement.getTextContent()); + for (int i3 = 0; i3 < hostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i3 = i3 + 1) + { + org.w3c.dom.Element hostNamesElement = ((org.w3c.dom.Element) hostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i3)); + webSiteInstance.getHostNames().add(hostNamesElement.getTextContent()); + } } - } - - NodeList elements13 = siteElement.getElementsByTagName("LastModifiedTimeUtc"); - Element lastModifiedTimeUtcElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (lastModifiedTimeUtcElement != null) - { - Calendar lastModifiedTimeUtcInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(lastModifiedTimeUtcElement.getTextContent())); - lastModifiedTimeUtcInstance = calendar; - webSiteInstance.setLastModifiedTimeUtc(lastModifiedTimeUtcInstance); - } - - NodeList elements14 = siteElement.getElementsByTagName("Name"); - Element nameElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance2; - nameInstance2 = nameElement2.getTextContent(); - webSiteInstance.setName(nameInstance2); - } - - NodeList elements15 = siteElement.getElementsByTagName("Owner"); - Element ownerElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (ownerElement != null) - { - boolean isNil3 = false; - String nilAttribute3 = ownerElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute3 != null) + + NodeList elements13 = siteElement.getElementsByTagName("LastModifiedTimeUtc"); + Element lastModifiedTimeUtcElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (lastModifiedTimeUtcElement != null) { - isNil3 = nilAttribute3 == "true"; + Calendar lastModifiedTimeUtcInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(lastModifiedTimeUtcElement.getTextContent())); + lastModifiedTimeUtcInstance = calendar; + webSiteInstance.setLastModifiedTimeUtc(lastModifiedTimeUtcInstance); } - if (isNil3 == false) + + NodeList elements14 = siteElement.getElementsByTagName("Name"); + Element nameElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (nameElement2 != null) { - String ownerInstance; - ownerInstance = ownerElement.getTextContent(); - webSiteInstance.setOwner(ownerInstance); + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + webSiteInstance.setName(nameInstance2); } - } - - NodeList elements16 = siteElement.getElementsByTagName("RepositorySiteName"); - Element repositorySiteNameElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (repositorySiteNameElement != null) - { - String repositorySiteNameInstance; - repositorySiteNameInstance = repositorySiteNameElement.getTextContent(); - webSiteInstance.setRepositorySiteName(repositorySiteNameInstance); - } - - NodeList elements17 = siteElement.getElementsByTagName("RuntimeAvailabilityState"); - Element runtimeAvailabilityStateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (runtimeAvailabilityStateElement != null) - { - WebSiteRuntimeAvailabilityState runtimeAvailabilityStateInstance; - runtimeAvailabilityStateInstance = WebSiteRuntimeAvailabilityState.valueOf(runtimeAvailabilityStateElement.getTextContent()); - webSiteInstance.setRuntimeAvailabilityState(runtimeAvailabilityStateInstance); - } - - NodeList elements18 = siteElement.getElementsByTagName("SSLCertificates"); - Element sSLCertificatesSequenceElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (sSLCertificatesSequenceElement != null) - { - for (int i4 = 0; i4 < sSLCertificatesSequenceElement.getElementsByTagName("Certificate").getLength(); i4 = i4 + 1) + + NodeList elements15 = siteElement.getElementsByTagName("Owner"); + Element ownerElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (ownerElement != null) { - org.w3c.dom.Element sSLCertificatesElement = ((org.w3c.dom.Element) sSLCertificatesSequenceElement.getElementsByTagName("Certificate").item(i4)); - WebSite.WebSiteSslCertificate certificateInstance = new WebSite.WebSiteSslCertificate(); - webSiteInstance.getSslCertificates().add(certificateInstance); - - NodeList elements19 = sSLCertificatesElement.getElementsByTagName("ExpirationDate"); - Element expirationDateElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (expirationDateElement != null) - { - Calendar expirationDateInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(expirationDateElement.getTextContent())); - expirationDateInstance = calendar2; - certificateInstance.setExpirationDate(expirationDateInstance); - } - - NodeList elements20 = sSLCertificatesElement.getElementsByTagName("FriendlyName"); - Element friendlyNameElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (friendlyNameElement != null) - { - String friendlyNameInstance; - friendlyNameInstance = friendlyNameElement.getTextContent(); - certificateInstance.setFriendlyName(friendlyNameInstance); - } - - NodeList elements21 = sSLCertificatesElement.getElementsByTagName("HostNames"); - Element hostNamesSequenceElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (hostNamesSequenceElement2 != null) - { - for (int i5 = 0; i5 < hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i5 = i5 + 1) - { - org.w3c.dom.Element hostNamesElement2 = ((org.w3c.dom.Element) hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i5)); - certificateInstance.getHostNames().add(hostNamesElement2.getTextContent()); - } - } - - NodeList elements22 = sSLCertificatesElement.getElementsByTagName("IssueDate"); - Element issueDateElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (issueDateElement != null) - { - Calendar issueDateInstance; - SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar3 = Calendar.getInstance(); - calendar3.setTime(simpleDateFormat3.parse(issueDateElement.getTextContent())); - issueDateInstance = calendar3; - certificateInstance.setIssueDate(issueDateInstance); - } - - NodeList elements23 = sSLCertificatesElement.getElementsByTagName("Issuer"); - Element issuerElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (issuerElement != null) - { - String issuerInstance; - issuerInstance = issuerElement.getTextContent(); - certificateInstance.setIssuer(issuerInstance); - } - - NodeList elements24 = sSLCertificatesElement.getElementsByTagName("Password"); - Element passwordElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (passwordElement != null) - { - String passwordInstance; - passwordInstance = passwordElement.getTextContent(); - certificateInstance.setPassword(passwordInstance); - } - - NodeList elements25 = sSLCertificatesElement.getElementsByTagName("PfxBlob"); - Element pfxBlobElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (pfxBlobElement != null) - { - byte[] pfxBlobInstance; - pfxBlobInstance = pfxBlobElement.getTextContent() != null ? Base64.decodeBase64(pfxBlobElement.getTextContent().getBytes()) : null; - certificateInstance.setPfxBlob(pfxBlobInstance); - } - - NodeList elements26 = sSLCertificatesElement.getElementsByTagName("SelfLink"); - Element selfLinkElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (selfLinkElement != null) - { - URI selfLinkInstance; - selfLinkInstance = new URI(selfLinkElement.getTextContent()); - certificateInstance.setSelfLinkUri(selfLinkInstance); - } - - NodeList elements27 = sSLCertificatesElement.getElementsByTagName("SiteName"); - Element siteNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; - if (siteNameElement != null) - { - String siteNameInstance; - siteNameInstance = siteNameElement.getTextContent(); - certificateInstance.setSiteName(siteNameInstance); - } - - NodeList elements28 = sSLCertificatesElement.getElementsByTagName("SubjectName"); - Element subjectNameElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; - if (subjectNameElement != null) + boolean isNil3 = false; + Attr nilAttribute3 = ownerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute3 != null) { - String subjectNameInstance; - subjectNameInstance = subjectNameElement.getTextContent(); - certificateInstance.setSubjectName(subjectNameInstance); + isNil3 = nilAttribute3.getValue() == "true"; } - - NodeList elements29 = sSLCertificatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement2 = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; - if (thumbprintElement2 != null) - { - String thumbprintInstance2; - thumbprintInstance2 = thumbprintElement2.getTextContent(); - certificateInstance.setThumbprint(thumbprintInstance2); - } - - NodeList elements30 = sSLCertificatesElement.getElementsByTagName("ToDelete"); - Element toDeleteElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; - if (toDeleteElement != null) + if (isNil3 == false) { - boolean toDeleteInstance; - toDeleteInstance = Boolean.parseBoolean(toDeleteElement.getTextContent()); - certificateInstance.setIsToBeDeleted(toDeleteInstance); - } - - NodeList elements31 = sSLCertificatesElement.getElementsByTagName("Valid"); - Element validElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; - if (validElement != null) - { - boolean validInstance; - validInstance = Boolean.parseBoolean(validElement.getTextContent()); - certificateInstance.setIsValid(validInstance); + String ownerInstance; + ownerInstance = ownerElement.getTextContent(); + webSiteInstance.setOwner(ownerInstance); } } - } - - NodeList elements32 = siteElement.getElementsByTagName("SelfLink"); - Element selfLinkElement2 = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; - if (selfLinkElement2 != null) - { - URI selfLinkInstance2; - selfLinkInstance2 = new URI(selfLinkElement2.getTextContent()); - webSiteInstance.setUri(selfLinkInstance2); - } - - NodeList elements33 = siteElement.getElementsByTagName("ServerFarm"); - Element serverFarmElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; - if (serverFarmElement != null) - { - String serverFarmInstance; - serverFarmInstance = serverFarmElement.getTextContent(); - webSiteInstance.setServerFarm(serverFarmInstance); - } - - NodeList elements34 = siteElement.getElementsByTagName("SiteMode"); - Element siteModeElement = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; - if (siteModeElement != null) - { - WebSiteMode siteModeInstance; - siteModeInstance = WebSiteMode.valueOf(siteModeElement.getTextContent()); - webSiteInstance.setSiteMode(siteModeInstance); - } - - NodeList elements35 = siteElement.getElementsByTagName("SiteProperties"); - Element sitePropertiesElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; - if (sitePropertiesElement != null) - { - WebSite.WebSiteProperties sitePropertiesInstance = new WebSite.WebSiteProperties(); - webSiteInstance.setSiteProperties(sitePropertiesInstance); - NodeList elements36 = sitePropertiesElement.getElementsByTagName("AppSettings"); - Element appSettingsSequenceElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; - if (appSettingsSequenceElement != null) + NodeList elements16 = siteElement.getElementsByTagName("RepositorySiteName"); + Element repositorySiteNameElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (repositorySiteNameElement != null) { - for (int i6 = 0; i6 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i6 = i6 + 1) - { - org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i6)); - NodeList elements37 = appSettingsElement.getElementsByTagName("Name"); - String appSettingsKey = elements37.getLength() > 0 ? ((org.w3c.dom.Element) elements37.item(0)).getTextContent() : null; - NodeList elements38 = appSettingsElement.getElementsByTagName("Value"); - String appSettingsValue = elements38.getLength() > 0 ? ((org.w3c.dom.Element) elements38.item(0)).getTextContent() : null; - sitePropertiesInstance.getAppSettings().put(appSettingsKey, appSettingsValue); - } + String repositorySiteNameInstance; + repositorySiteNameInstance = repositorySiteNameElement.getTextContent(); + webSiteInstance.setRepositorySiteName(repositorySiteNameInstance); } - NodeList elements39 = sitePropertiesElement.getElementsByTagName("Metadata"); - Element metadataSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; - if (metadataSequenceElement != null) + NodeList elements17 = siteElement.getElementsByTagName("RuntimeAvailabilityState"); + Element runtimeAvailabilityStateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (runtimeAvailabilityStateElement != null) { - for (int i7 = 0; i7 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i7 = i7 + 1) - { - org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i7)); - NodeList elements40 = metadataElement.getElementsByTagName("Name"); - String metadataKey = elements40.getLength() > 0 ? ((org.w3c.dom.Element) elements40.item(0)).getTextContent() : null; - NodeList elements41 = metadataElement.getElementsByTagName("Value"); - String metadataValue = elements41.getLength() > 0 ? ((org.w3c.dom.Element) elements41.item(0)).getTextContent() : null; - sitePropertiesInstance.getMetadata().put(metadataKey, metadataValue); - } + WebSiteRuntimeAvailabilityState runtimeAvailabilityStateInstance; + runtimeAvailabilityStateInstance = WebSiteRuntimeAvailabilityState.valueOf(runtimeAvailabilityStateElement.getTextContent()); + webSiteInstance.setRuntimeAvailabilityState(runtimeAvailabilityStateInstance); } - NodeList elements42 = sitePropertiesElement.getElementsByTagName("Properties"); - Element propertiesSequenceElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; - if (propertiesSequenceElement != null) + NodeList elements18 = siteElement.getElementsByTagName("SSLCertificates"); + Element sSLCertificatesSequenceElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (sSLCertificatesSequenceElement != null) { - for (int i8 = 0; i8 < propertiesSequenceElement.getElementsByTagName("NameValuePair").getLength(); i8 = i8 + 1) + boolean isNil4 = false; + Attr nilAttribute4 = sSLCertificatesSequenceElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute4 != null) { - org.w3c.dom.Element propertiesElement = ((org.w3c.dom.Element) propertiesSequenceElement.getElementsByTagName("NameValuePair").item(i8)); - NodeList elements43 = propertiesElement.getElementsByTagName("Name"); - String propertiesKey = elements43.getLength() > 0 ? ((org.w3c.dom.Element) elements43.item(0)).getTextContent() : null; - NodeList elements44 = propertiesElement.getElementsByTagName("Value"); - String propertiesValue = elements44.getLength() > 0 ? ((org.w3c.dom.Element) elements44.item(0)).getTextContent() : null; - sitePropertiesInstance.getProperties().put(propertiesKey, propertiesValue); + isNil4 = nilAttribute4.getValue() == "true"; } - } - } - - NodeList elements45 = siteElement.getElementsByTagName("State"); - Element stateElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; - if (stateElement != null) - { - WebSiteState stateInstance; - stateInstance = WebSiteState.valueOf(stateElement.getTextContent()); - webSiteInstance.setState(stateInstance); - } - - NodeList elements46 = siteElement.getElementsByTagName("UsageState"); - Element usageStateElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; - if (usageStateElement != null) - { - WebSiteUsageState usageStateInstance; - usageStateInstance = WebSiteUsageState.valueOf(usageStateElement.getTextContent()); - webSiteInstance.setUsageState(usageStateInstance); - } - - NodeList elements47 = siteElement.getElementsByTagName("WebSpace"); - Element webSpaceElement = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; - if (webSpaceElement != null) - { - String webSpaceInstance; - webSpaceInstance = webSpaceElement.getTextContent(); - webSiteInstance.setWebSpace(webSpaceInstance); - } - } - - 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); - } - return result; - } - - /** - * You can retrieve the config settings for a web site by issuing an HTTP - * GET request, or update them by using HTTP PUT with a request body that - * contains the settings to be updated. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn166985.aspx for - * more information) - * - * @param webSpaceName The name of the web space. - * @param webSiteName The name of the web site. - * @return The Get Web Site Configuration operation response. - */ - @Override - public Future getConfigurationAsync(final String webSpaceName, final String webSiteName) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public WebSiteGetConfigurationResponse call() throws Exception - { - return getConfiguration(webSpaceName, webSiteName); - } - }); - } - - /** - * You can retrieve the config settings for a web site by issuing an HTTP - * GET request, or update them by using HTTP PUT with a request body that + if (isNil4 == false) + { + for (int i4 = 0; i4 < sSLCertificatesSequenceElement.getElementsByTagName("Certificate").getLength(); i4 = i4 + 1) + { + org.w3c.dom.Element sSLCertificatesElement = ((org.w3c.dom.Element) sSLCertificatesSequenceElement.getElementsByTagName("Certificate").item(i4)); + WebSite.WebSiteSslCertificate certificateInstance = new WebSite.WebSiteSslCertificate(); + webSiteInstance.getSslCertificates().add(certificateInstance); + + NodeList elements19 = sSLCertificatesElement.getElementsByTagName("ExpirationDate"); + Element expirationDateElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (expirationDateElement != null && (expirationDateElement.getTextContent() != null && expirationDateElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil5 = false; + Attr nilAttribute5 = expirationDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute5 != null) + { + isNil5 = nilAttribute5.getValue() == "true"; + } + if (isNil5 == false) + { + Calendar expirationDateInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(expirationDateElement.getTextContent())); + expirationDateInstance = calendar2; + certificateInstance.setExpirationDate(expirationDateInstance); + } + } + + NodeList elements20 = sSLCertificatesElement.getElementsByTagName("FriendlyName"); + Element friendlyNameElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (friendlyNameElement != null) + { + boolean isNil6 = false; + Attr nilAttribute6 = friendlyNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute6 != null) + { + isNil6 = nilAttribute6.getValue() == "true"; + } + if (isNil6 == false) + { + String friendlyNameInstance; + friendlyNameInstance = friendlyNameElement.getTextContent(); + certificateInstance.setFriendlyName(friendlyNameInstance); + } + } + + NodeList elements21 = sSLCertificatesElement.getElementsByTagName("HostNames"); + Element hostNamesSequenceElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (hostNamesSequenceElement2 != null) + { + boolean isNil7 = false; + Attr nilAttribute7 = hostNamesSequenceElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute7 != null) + { + isNil7 = nilAttribute7.getValue() == "true"; + } + if (isNil7 == false) + { + for (int i5 = 0; i5 < hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i5 = i5 + 1) + { + org.w3c.dom.Element hostNamesElement2 = ((org.w3c.dom.Element) hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i5)); + certificateInstance.getHostNames().add(hostNamesElement2.getTextContent()); + } + } + } + + NodeList elements22 = sSLCertificatesElement.getElementsByTagName("IssueDate"); + Element issueDateElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (issueDateElement != null && (issueDateElement.getTextContent() != null && issueDateElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil8 = false; + Attr nilAttribute8 = issueDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute8 != null) + { + isNil8 = nilAttribute8.getValue() == "true"; + } + if (isNil8 == false) + { + Calendar issueDateInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(issueDateElement.getTextContent())); + issueDateInstance = calendar3; + certificateInstance.setIssueDate(issueDateInstance); + } + } + + NodeList elements23 = sSLCertificatesElement.getElementsByTagName("Issuer"); + Element issuerElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (issuerElement != null) + { + boolean isNil9 = false; + Attr nilAttribute9 = issuerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute9 != null) + { + isNil9 = nilAttribute9.getValue() == "true"; + } + if (isNil9 == false) + { + String issuerInstance; + issuerInstance = issuerElement.getTextContent(); + certificateInstance.setIssuer(issuerInstance); + } + } + + NodeList elements24 = sSLCertificatesElement.getElementsByTagName("Password"); + Element passwordElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (passwordElement != null) + { + boolean isNil10 = false; + Attr nilAttribute10 = passwordElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute10 != null) + { + isNil10 = nilAttribute10.getValue() == "true"; + } + if (isNil10 == false) + { + String passwordInstance; + passwordInstance = passwordElement.getTextContent(); + certificateInstance.setPassword(passwordInstance); + } + } + + NodeList elements25 = sSLCertificatesElement.getElementsByTagName("PfxBlob"); + Element pfxBlobElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (pfxBlobElement != null) + { + boolean isNil11 = false; + Attr nilAttribute11 = pfxBlobElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute11 != null) + { + isNil11 = nilAttribute11.getValue() == "true"; + } + if (isNil11 == false) + { + byte[] pfxBlobInstance; + pfxBlobInstance = pfxBlobElement.getTextContent() != null ? Base64.decodeBase64(pfxBlobElement.getTextContent().getBytes()) : null; + certificateInstance.setPfxBlob(pfxBlobInstance); + } + } + + NodeList elements26 = sSLCertificatesElement.getElementsByTagName("SelfLink"); + Element selfLinkElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (selfLinkElement != null) + { + boolean isNil12 = false; + Attr nilAttribute12 = selfLinkElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute12 != null) + { + isNil12 = nilAttribute12.getValue() == "true"; + } + if (isNil12 == false) + { + URI selfLinkInstance; + selfLinkInstance = new URI(selfLinkElement.getTextContent()); + certificateInstance.setSelfLinkUri(selfLinkInstance); + } + } + + NodeList elements27 = sSLCertificatesElement.getElementsByTagName("SiteName"); + Element siteNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; + if (siteNameElement != null) + { + boolean isNil13 = false; + Attr nilAttribute13 = siteNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute13 != null) + { + isNil13 = nilAttribute13.getValue() == "true"; + } + if (isNil13 == false) + { + String siteNameInstance; + siteNameInstance = siteNameElement.getTextContent(); + certificateInstance.setSiteName(siteNameInstance); + } + } + + NodeList elements28 = sSLCertificatesElement.getElementsByTagName("SubjectName"); + Element subjectNameElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; + if (subjectNameElement != null) + { + boolean isNil14 = false; + Attr nilAttribute14 = subjectNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute14 != null) + { + isNil14 = nilAttribute14.getValue() == "true"; + } + if (isNil14 == false) + { + String subjectNameInstance; + subjectNameInstance = subjectNameElement.getTextContent(); + certificateInstance.setSubjectName(subjectNameInstance); + } + } + + NodeList elements29 = sSLCertificatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement2 = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; + if (thumbprintElement2 != null) + { + boolean isNil15 = false; + Attr nilAttribute15 = thumbprintElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute15 != null) + { + isNil15 = nilAttribute15.getValue() == "true"; + } + if (isNil15 == false) + { + String thumbprintInstance2; + thumbprintInstance2 = thumbprintElement2.getTextContent(); + certificateInstance.setThumbprint(thumbprintInstance2); + } + } + + NodeList elements30 = sSLCertificatesElement.getElementsByTagName("ToDelete"); + Element toDeleteElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; + if (toDeleteElement != null && (toDeleteElement.getTextContent() != null && toDeleteElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil16 = false; + Attr nilAttribute16 = toDeleteElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute16 != null) + { + isNil16 = nilAttribute16.getValue() == "true"; + } + if (isNil16 == false) + { + boolean toDeleteInstance; + toDeleteInstance = Boolean.parseBoolean(toDeleteElement.getTextContent()); + certificateInstance.setIsToBeDeleted(toDeleteInstance); + } + } + + NodeList elements31 = sSLCertificatesElement.getElementsByTagName("Valid"); + Element validElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; + if (validElement != null && (validElement.getTextContent() != null && validElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil17 = false; + Attr nilAttribute17 = validElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute17 != null) + { + isNil17 = nilAttribute17.getValue() == "true"; + } + if (isNil17 == false) + { + boolean validInstance; + validInstance = Boolean.parseBoolean(validElement.getTextContent()); + certificateInstance.setIsValid(validInstance); + } + } + } + } + } + + NodeList elements32 = siteElement.getElementsByTagName("SelfLink"); + Element selfLinkElement2 = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; + if (selfLinkElement2 != null) + { + URI selfLinkInstance2; + selfLinkInstance2 = new URI(selfLinkElement2.getTextContent()); + webSiteInstance.setUri(selfLinkInstance2); + } + + NodeList elements33 = siteElement.getElementsByTagName("ServerFarm"); + Element serverFarmElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; + if (serverFarmElement != null) + { + String serverFarmInstance; + serverFarmInstance = serverFarmElement.getTextContent(); + webSiteInstance.setServerFarm(serverFarmInstance); + } + + NodeList elements34 = siteElement.getElementsByTagName("SiteMode"); + Element siteModeElement = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; + if (siteModeElement != null) + { + WebSiteMode siteModeInstance; + siteModeInstance = WebSiteMode.valueOf(siteModeElement.getTextContent()); + webSiteInstance.setSiteMode(siteModeInstance); + } + + NodeList elements35 = siteElement.getElementsByTagName("SiteProperties"); + Element sitePropertiesElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; + if (sitePropertiesElement != null) + { + WebSite.WebSiteProperties sitePropertiesInstance = new WebSite.WebSiteProperties(); + webSiteInstance.setSiteProperties(sitePropertiesInstance); + + NodeList elements36 = sitePropertiesElement.getElementsByTagName("AppSettings"); + Element appSettingsSequenceElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; + if (appSettingsSequenceElement != null) + { + for (int i6 = 0; i6 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i6 = i6 + 1) + { + org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i6)); + NodeList elements37 = appSettingsElement.getElementsByTagName("Name"); + String appSettingsKey = elements37.getLength() > 0 ? ((org.w3c.dom.Element) elements37.item(0)).getTextContent() : null; + NodeList elements38 = appSettingsElement.getElementsByTagName("Value"); + String appSettingsValue = elements38.getLength() > 0 ? ((org.w3c.dom.Element) elements38.item(0)).getTextContent() : null; + sitePropertiesInstance.getAppSettings().put(appSettingsKey, appSettingsValue); + } + } + + NodeList elements39 = sitePropertiesElement.getElementsByTagName("Metadata"); + Element metadataSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; + if (metadataSequenceElement != null) + { + for (int i7 = 0; i7 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i7 = i7 + 1) + { + org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i7)); + NodeList elements40 = metadataElement.getElementsByTagName("Name"); + String metadataKey = elements40.getLength() > 0 ? ((org.w3c.dom.Element) elements40.item(0)).getTextContent() : null; + NodeList elements41 = metadataElement.getElementsByTagName("Value"); + String metadataValue = elements41.getLength() > 0 ? ((org.w3c.dom.Element) elements41.item(0)).getTextContent() : null; + sitePropertiesInstance.getMetadata().put(metadataKey, metadataValue); + } + } + + NodeList elements42 = sitePropertiesElement.getElementsByTagName("Properties"); + Element propertiesSequenceElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; + if (propertiesSequenceElement != null) + { + for (int i8 = 0; i8 < propertiesSequenceElement.getElementsByTagName("NameValuePair").getLength(); i8 = i8 + 1) + { + org.w3c.dom.Element propertiesElement = ((org.w3c.dom.Element) propertiesSequenceElement.getElementsByTagName("NameValuePair").item(i8)); + NodeList elements43 = propertiesElement.getElementsByTagName("Name"); + String propertiesKey = elements43.getLength() > 0 ? ((org.w3c.dom.Element) elements43.item(0)).getTextContent() : null; + NodeList elements44 = propertiesElement.getElementsByTagName("Value"); + String propertiesValue = elements44.getLength() > 0 ? ((org.w3c.dom.Element) elements44.item(0)).getTextContent() : null; + sitePropertiesInstance.getProperties().put(propertiesKey, propertiesValue); + } + } + } + + NodeList elements45 = siteElement.getElementsByTagName("State"); + Element stateElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; + if (stateElement != null) + { + WebSiteState stateInstance; + stateInstance = WebSiteState.valueOf(stateElement.getTextContent()); + webSiteInstance.setState(stateInstance); + } + + NodeList elements46 = siteElement.getElementsByTagName("UsageState"); + Element usageStateElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; + if (usageStateElement != null) + { + WebSiteUsageState usageStateInstance; + usageStateInstance = WebSiteUsageState.valueOf(usageStateElement.getTextContent()); + webSiteInstance.setUsageState(usageStateInstance); + } + + NodeList elements47 = siteElement.getElementsByTagName("WebSpace"); + Element webSpaceElement = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; + if (webSpaceElement != null) + { + String webSpaceInstance; + webSpaceInstance = webSpaceElement.getTextContent(); + webSiteInstance.setWebSpace(webSpaceInstance); + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * You can retrieve the config settings for a web site by issuing an HTTP + * GET request, or update them by using HTTP PUT with a request body that + * contains the settings to be updated. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166985.aspx for + * more information) + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @return The Get Web Site Configuration operation response. + */ + @Override + public Future getConfigurationAsync(final String webSpaceName, final String webSiteName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public WebSiteGetConfigurationResponse call() throws Exception + { + return getConfiguration(webSpaceName, webSiteName); + } + }); + } + + /** + * You can retrieve the config settings for a web site by issuing an HTTP + * GET request, or update them by using HTTP PUT with a request body that * contains the settings to be updated. (see * http://msdn.microsoft.com/en-us/library/windowsazure/dn166985.aspx for * more information) * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @return The Get Web Site Configuration operation response. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return The Get Web Site Configuration operation response. + */ + @Override + public WebSiteGetConfigurationResponse getConfiguration(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + { + // Validate + if (webSpaceName == null) + { + throw new NullPointerException("webSpaceName"); + } + if (webSiteName == null) + { + throw new NullPointerException("webSiteName"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("webSpaceName", webSpaceName); + tracingParameters.put("webSiteName", webSiteName); + CloudTracing.enter(invocationId, this, "getConfigurationAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/config"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-08-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + WebSiteGetConfigurationResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteGetConfigurationResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("SiteConfig"); + Element siteConfigElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (siteConfigElement != null) + { + NodeList elements2 = siteConfigElement.getElementsByTagName("AppSettings"); + Element appSettingsSequenceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (appSettingsSequenceElement != null) + { + for (int i1 = 0; i1 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i1)); + NodeList elements3 = appSettingsElement.getElementsByTagName("Name"); + String appSettingsKey = elements3.getLength() > 0 ? ((org.w3c.dom.Element) elements3.item(0)).getTextContent() : null; + NodeList elements4 = appSettingsElement.getElementsByTagName("Value"); + String appSettingsValue = elements4.getLength() > 0 ? ((org.w3c.dom.Element) elements4.item(0)).getTextContent() : null; + result.getAppSettings().put(appSettingsKey, appSettingsValue); + } + } + + NodeList elements5 = siteConfigElement.getElementsByTagName("ConnectionStrings"); + Element connectionStringsSequenceElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (connectionStringsSequenceElement != null) + { + for (int i2 = 0; i2 < connectionStringsSequenceElement.getElementsByTagName("ConnStringInfo").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element connectionStringsElement = ((org.w3c.dom.Element) connectionStringsSequenceElement.getElementsByTagName("ConnStringInfo").item(i2)); + WebSiteGetConfigurationResponse.ConnectionStringInfo connStringInfoInstance = new WebSiteGetConfigurationResponse.ConnectionStringInfo(); + result.getConnectionStrings().add(connStringInfoInstance); + + NodeList elements6 = connectionStringsElement.getElementsByTagName("ConnectionString"); + Element connectionStringElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (connectionStringElement != null) + { + String connectionStringInstance; + connectionStringInstance = connectionStringElement.getTextContent(); + connStringInfoInstance.setConnectionString(connectionStringInstance); + } + + NodeList elements7 = connectionStringsElement.getElementsByTagName("Name"); + Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + connStringInfoInstance.setName(nameInstance); + } + + NodeList elements8 = connectionStringsElement.getElementsByTagName("Type"); + Element typeElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (typeElement != null) + { + String typeInstance; + typeInstance = typeElement.getTextContent(); + connStringInfoInstance.setType(typeInstance); + } + } + } + + NodeList elements9 = siteConfigElement.getElementsByTagName("DefaultDocuments"); + Element defaultDocumentsSequenceElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (defaultDocumentsSequenceElement != null) + { + for (int i3 = 0; i3 < defaultDocumentsSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i3 = i3 + 1) + { + org.w3c.dom.Element defaultDocumentsElement = ((org.w3c.dom.Element) defaultDocumentsSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i3)); + result.getDefaultDocuments().add(defaultDocumentsElement.getTextContent()); + } + } + + NodeList elements10 = siteConfigElement.getElementsByTagName("DetailedErrorLoggingEnabled"); + Element detailedErrorLoggingEnabledElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (detailedErrorLoggingEnabledElement != null && (detailedErrorLoggingEnabledElement.getTextContent() != null && detailedErrorLoggingEnabledElement.getTextContent().isEmpty() != true) == false) + { + boolean detailedErrorLoggingEnabledInstance; + detailedErrorLoggingEnabledInstance = Boolean.parseBoolean(detailedErrorLoggingEnabledElement.getTextContent()); + result.setDetailedErrorLoggingEnabled(detailedErrorLoggingEnabledInstance); + } + + NodeList elements11 = siteConfigElement.getElementsByTagName("DocumentRoot"); + Element documentRootElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (documentRootElement != null) + { + String documentRootInstance; + documentRootInstance = documentRootElement.getTextContent(); + result.setDocumentRoot(documentRootInstance); + } + + NodeList elements12 = siteConfigElement.getElementsByTagName("HandlerMappings"); + Element handlerMappingsSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (handlerMappingsSequenceElement != null) + { + for (int i4 = 0; i4 < handlerMappingsSequenceElement.getElementsByTagName("HandlerMapping").getLength(); i4 = i4 + 1) + { + org.w3c.dom.Element handlerMappingsElement = ((org.w3c.dom.Element) handlerMappingsSequenceElement.getElementsByTagName("HandlerMapping").item(i4)); + WebSiteGetConfigurationResponse.HandlerMapping handlerMappingInstance = new WebSiteGetConfigurationResponse.HandlerMapping(); + result.getHandlerMappings().add(handlerMappingInstance); + + NodeList elements13 = handlerMappingsElement.getElementsByTagName("Arguments"); + Element argumentsElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (argumentsElement != null) + { + String argumentsInstance; + argumentsInstance = argumentsElement.getTextContent(); + handlerMappingInstance.setArguments(argumentsInstance); + } + + NodeList elements14 = handlerMappingsElement.getElementsByTagName("Extension"); + Element extensionElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (extensionElement != null) + { + String extensionInstance; + extensionInstance = extensionElement.getTextContent(); + handlerMappingInstance.setExtension(extensionInstance); + } + + NodeList elements15 = handlerMappingsElement.getElementsByTagName("ScriptProcessor"); + Element scriptProcessorElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (scriptProcessorElement != null) + { + String scriptProcessorInstance; + scriptProcessorInstance = scriptProcessorElement.getTextContent(); + handlerMappingInstance.setScriptProcessor(scriptProcessorInstance); + } + } + } + + NodeList elements16 = siteConfigElement.getElementsByTagName("HttpLoggingEnabled"); + Element httpLoggingEnabledElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (httpLoggingEnabledElement != null && (httpLoggingEnabledElement.getTextContent() != null && httpLoggingEnabledElement.getTextContent().isEmpty() != true) == false) + { + boolean httpLoggingEnabledInstance; + httpLoggingEnabledInstance = Boolean.parseBoolean(httpLoggingEnabledElement.getTextContent()); + result.setHttpLoggingEnabled(httpLoggingEnabledInstance); + } + + NodeList elements17 = siteConfigElement.getElementsByTagName("LogsDirectorySizeLimit"); + Element logsDirectorySizeLimitElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (logsDirectorySizeLimitElement != null && (logsDirectorySizeLimitElement.getTextContent() != null && logsDirectorySizeLimitElement.getTextContent().isEmpty() != true) == false) + { + int logsDirectorySizeLimitInstance; + logsDirectorySizeLimitInstance = Integer.parseInt(logsDirectorySizeLimitElement.getTextContent()); + result.setLogsDirectorySizeLimit(logsDirectorySizeLimitInstance); + } + + NodeList elements18 = siteConfigElement.getElementsByTagName("ManagedPipelineMode"); + Element managedPipelineModeElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (managedPipelineModeElement != null && (managedPipelineModeElement.getTextContent() != null && managedPipelineModeElement.getTextContent().isEmpty() != true) == false) + { + ManagedPipelineMode managedPipelineModeInstance; + managedPipelineModeInstance = ManagedPipelineMode.valueOf(managedPipelineModeElement.getTextContent()); + result.setManagedPipelineMode(managedPipelineModeInstance); + } + + NodeList elements19 = siteConfigElement.getElementsByTagName("Metadata"); + Element metadataSequenceElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (metadataSequenceElement != null) + { + for (int i5 = 0; i5 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i5 = i5 + 1) + { + org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i5)); + NodeList elements20 = metadataElement.getElementsByTagName("Name"); + String metadataKey = elements20.getLength() > 0 ? ((org.w3c.dom.Element) elements20.item(0)).getTextContent() : null; + NodeList elements21 = metadataElement.getElementsByTagName("Value"); + String metadataValue = elements21.getLength() > 0 ? ((org.w3c.dom.Element) elements21.item(0)).getTextContent() : null; + result.getMetadata().put(metadataKey, metadataValue); + } + } + + NodeList elements22 = siteConfigElement.getElementsByTagName("NetFrameworkVersion"); + Element netFrameworkVersionElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (netFrameworkVersionElement != null) + { + String netFrameworkVersionInstance; + netFrameworkVersionInstance = netFrameworkVersionElement.getTextContent(); + result.setNetFrameworkVersion(netFrameworkVersionInstance); + } + + NodeList elements23 = siteConfigElement.getElementsByTagName("NumberOfWorkers"); + Element numberOfWorkersElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (numberOfWorkersElement != null && (numberOfWorkersElement.getTextContent() != null && numberOfWorkersElement.getTextContent().isEmpty() != true) == false) + { + int numberOfWorkersInstance; + numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement.getTextContent()); + result.setNumberOfWorkers(numberOfWorkersInstance); + } + + NodeList elements24 = siteConfigElement.getElementsByTagName("PhpVersion"); + Element phpVersionElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (phpVersionElement != null) + { + String phpVersionInstance; + phpVersionInstance = phpVersionElement.getTextContent(); + result.setPhpVersion(phpVersionInstance); + } + + NodeList elements25 = siteConfigElement.getElementsByTagName("PublishingPassword"); + Element publishingPasswordElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (publishingPasswordElement != null) + { + String publishingPasswordInstance; + publishingPasswordInstance = publishingPasswordElement.getTextContent(); + result.setPublishingPassword(publishingPasswordInstance); + } + + NodeList elements26 = siteConfigElement.getElementsByTagName("PublishingUsername"); + Element publishingUsernameElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (publishingUsernameElement != null) + { + String publishingUsernameInstance; + publishingUsernameInstance = publishingUsernameElement.getTextContent(); + result.setPublishingUserName(publishingUsernameInstance); + } + + NodeList elements27 = siteConfigElement.getElementsByTagName("RemoteDebuggingEnabled"); + Element remoteDebuggingEnabledElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; + if (remoteDebuggingEnabledElement != null && (remoteDebuggingEnabledElement.getTextContent() != null && remoteDebuggingEnabledElement.getTextContent().isEmpty() != true) == false) + { + boolean remoteDebuggingEnabledInstance; + remoteDebuggingEnabledInstance = Boolean.parseBoolean(remoteDebuggingEnabledElement.getTextContent()); + result.setRemoteDebuggingEnabled(remoteDebuggingEnabledInstance); + } + + NodeList elements28 = siteConfigElement.getElementsByTagName("RemoteDebuggingVersion"); + Element remoteDebuggingVersionElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; + if (remoteDebuggingVersionElement != null) + { + boolean isNil = false; + Attr nilAttribute = remoteDebuggingVersionElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + RemoteDebuggingVersion remoteDebuggingVersionInstance; + remoteDebuggingVersionInstance = RemoteDebuggingVersion.valueOf(remoteDebuggingVersionElement.getTextContent()); + result.setRemoteDebuggingVersion(remoteDebuggingVersionInstance); + } + } + + NodeList elements29 = siteConfigElement.getElementsByTagName("RequestTracingEnabled"); + Element requestTracingEnabledElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; + if (requestTracingEnabledElement != null && (requestTracingEnabledElement.getTextContent() != null && requestTracingEnabledElement.getTextContent().isEmpty() != true) == false) + { + boolean requestTracingEnabledInstance; + requestTracingEnabledInstance = Boolean.parseBoolean(requestTracingEnabledElement.getTextContent()); + result.setRequestTracingEnabled(requestTracingEnabledInstance); + } + + NodeList elements30 = siteConfigElement.getElementsByTagName("RequestTracingExpirationTime"); + Element requestTracingExpirationTimeElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; + if (requestTracingExpirationTimeElement != null && (requestTracingExpirationTimeElement.getTextContent() != null && requestTracingExpirationTimeElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil2 = false; + Attr nilAttribute2 = requestTracingExpirationTimeElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil2 = nilAttribute2.getValue() == "true"; + } + if (isNil2 == false) + { + Calendar requestTracingExpirationTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(requestTracingExpirationTimeElement.getTextContent())); + requestTracingExpirationTimeInstance = calendar; + result.setRequestTracingExpirationTime(requestTracingExpirationTimeInstance); + } + } + + NodeList elements31 = siteConfigElement.getElementsByTagName("ScmType"); + Element scmTypeElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; + if (scmTypeElement != null) + { + String scmTypeInstance; + scmTypeInstance = scmTypeElement.getTextContent(); + result.setScmType(scmTypeInstance); + } + + NodeList elements32 = siteConfigElement.getElementsByTagName("Use32BitWorkerProcess"); + Element use32BitWorkerProcessElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; + if (use32BitWorkerProcessElement != null && (use32BitWorkerProcessElement.getTextContent() != null && use32BitWorkerProcessElement.getTextContent().isEmpty() != true) == false) + { + boolean use32BitWorkerProcessInstance; + use32BitWorkerProcessInstance = Boolean.parseBoolean(use32BitWorkerProcessElement.getTextContent()); + result.setUse32BitWorkerProcess(use32BitWorkerProcessInstance); + } + + NodeList elements33 = siteConfigElement.getElementsByTagName("WebSocketsEnabled"); + Element webSocketsEnabledElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; + if (webSocketsEnabledElement != null && (webSocketsEnabledElement.getTextContent() != null && webSocketsEnabledElement.getTextContent().isEmpty() != true) == false) + { + boolean webSocketsEnabledInstance; + webSocketsEnabledInstance = Boolean.parseBoolean(webSocketsEnabledElement.getTextContent()); + result.setWebSocketsEnabled(webSocketsEnabledInstance); + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * You can retrieve historical usage metrics for a site by issuing an HTTP + * GET request. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx for + * more information) + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @param parameters The Get Web Site Historical Usage Metrics parameters. + * @return The Get Web Site Historical Usage Metrics operation response. + */ + @Override + public Future getHistoricalUsageMetricsAsync(final String webSpaceName, final String webSiteName, final WebSiteGetHistoricalUsageMetricsParameters parameters) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public WebSiteGetHistoricalUsageMetricsResponse call() throws Exception + { + return getHistoricalUsageMetrics(webSpaceName, webSiteName, parameters); + } + }); + } + + /** + * You can retrieve historical usage metrics for a site by issuing an HTTP + * GET request. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx for + * more information) + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @param parameters The Get Web Site Historical Usage Metrics parameters. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return The Get Web Site Historical Usage Metrics operation response. + */ + @Override + public WebSiteGetHistoricalUsageMetricsResponse getHistoricalUsageMetrics(String webSpaceName, String webSiteName, WebSiteGetHistoricalUsageMetricsParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + { + // Validate + if (webSpaceName == null) + { + throw new NullPointerException("webSpaceName"); + } + if (webSiteName == null) + { + throw new NullPointerException("webSiteName"); + } + if (parameters == null) + { + throw new NullPointerException("parameters"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("webSpaceName", webSpaceName); + tracingParameters.put("webSiteName", webSiteName); + tracingParameters.put("parameters", parameters); + CloudTracing.enter(invocationId, this, "getHistoricalUsageMetricsAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/metrics?&names=" + CommaStringBuilder.join(parameters.getMetricNames()) + "&StartTime=" + parameters.getStartTime() + "&EndTime=" + parameters.getEndTime(); + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-08-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) + { + CloudTracing.sendRequest(invocationId, httpRequest); + } + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + WebSiteGetHistoricalUsageMetricsResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteGetHistoricalUsageMetricsResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("MetricResponses"); + Element metricResponsesElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (metricResponsesElement != null) + { + if (metricResponsesElement != null) + { + for (int i1 = 0; i1 < metricResponsesElement.getElementsByTagName("MetricResponse").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element usageMetricsElement = ((org.w3c.dom.Element) metricResponsesElement.getElementsByTagName("MetricResponse").item(i1)); + WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetric metricResponseInstance = new WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetric(); + result.getUsageMetrics().add(metricResponseInstance); + + NodeList elements2 = usageMetricsElement.getElementsByTagName("Code"); + Element codeElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (codeElement != null) + { + String codeInstance; + codeInstance = codeElement.getTextContent(); + metricResponseInstance.setCode(codeInstance); + } + + NodeList elements3 = usageMetricsElement.getElementsByTagName("Data"); + Element dataElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (dataElement != null) + { + WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricData dataInstance = new WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricData(); + metricResponseInstance.setData(dataInstance); + + NodeList elements4 = dataElement.getElementsByTagName("DisplayName"); + Element displayNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (displayNameElement != null) + { + String displayNameInstance; + displayNameInstance = displayNameElement.getTextContent(); + dataInstance.setDisplayName(displayNameInstance); + } + + NodeList elements5 = dataElement.getElementsByTagName("EndTime"); + Element endTimeElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (endTimeElement != null) + { + Calendar endTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(endTimeElement.getTextContent())); + endTimeInstance = calendar; + dataInstance.setEndTime(endTimeInstance); + } + + NodeList elements6 = dataElement.getElementsByTagName("Name"); + Element nameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + dataInstance.setName(nameInstance); + } + + NodeList elements7 = dataElement.getElementsByTagName("PrimaryAggregationType"); + Element primaryAggregationTypeElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (primaryAggregationTypeElement != null) + { + String primaryAggregationTypeInstance; + primaryAggregationTypeInstance = primaryAggregationTypeElement.getTextContent(); + dataInstance.setPrimaryAggregationType(primaryAggregationTypeInstance); + } + + NodeList elements8 = dataElement.getElementsByTagName("StartTime"); + Element startTimeElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (startTimeElement != null) + { + Calendar startTimeInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(startTimeElement.getTextContent())); + startTimeInstance = calendar2; + dataInstance.setStartTime(startTimeInstance); + } + + NodeList elements9 = dataElement.getElementsByTagName("TimeGrain"); + Element timeGrainElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (timeGrainElement != null) + { + String timeGrainInstance; + timeGrainInstance = timeGrainElement.getTextContent(); + dataInstance.setTimeGrain(timeGrainInstance); + } + + NodeList elements10 = dataElement.getElementsByTagName("Unit"); + Element unitElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (unitElement != null) + { + String unitInstance; + unitInstance = unitElement.getTextContent(); + dataInstance.setUnit(unitInstance); + } + + NodeList elements11 = dataElement.getElementsByTagName("Values"); + Element valuesSequenceElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (valuesSequenceElement != null) + { + for (int i2 = 0; i2 < valuesSequenceElement.getElementsByTagName("MetricSample").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element valuesElement = ((org.w3c.dom.Element) valuesSequenceElement.getElementsByTagName("MetricSample").item(i2)); + WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricSample metricSampleInstance = new WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricSample(); + dataInstance.getValues().add(metricSampleInstance); + + NodeList elements12 = valuesElement.getElementsByTagName("Count"); + Element countElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (countElement != null) + { + int countInstance; + countInstance = Integer.parseInt(countElement.getTextContent()); + metricSampleInstance.setCount(countInstance); + } + + NodeList elements13 = valuesElement.getElementsByTagName("Maximum"); + Element maximumElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (maximumElement != null) + { + boolean isNil = false; + Attr nilAttribute = maximumElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + String maximumInstance; + maximumInstance = maximumElement.getTextContent(); + metricSampleInstance.setMaximum(maximumInstance); + } + } + + NodeList elements14 = valuesElement.getElementsByTagName("Minimum"); + Element minimumElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (minimumElement != null) + { + boolean isNil2 = false; + Attr nilAttribute2 = minimumElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil2 = nilAttribute2.getValue() == "true"; + } + if (isNil2 == false) + { + String minimumInstance; + minimumInstance = minimumElement.getTextContent(); + metricSampleInstance.setMinimum(minimumInstance); + } + } + + NodeList elements15 = valuesElement.getElementsByTagName("TimeCreated"); + Element timeCreatedElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (timeCreatedElement != null) + { + Calendar timeCreatedInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(timeCreatedElement.getTextContent())); + timeCreatedInstance = calendar3; + metricSampleInstance.setTimeCreated(timeCreatedInstance); + } + + NodeList elements16 = valuesElement.getElementsByTagName("Total"); + Element totalElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (totalElement != null) + { + String totalInstance; + totalInstance = totalElement.getTextContent(); + metricSampleInstance.setTotal(totalInstance); + } + } + } + } + + NodeList elements17 = usageMetricsElement.getElementsByTagName("Message"); + Element messageElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (messageElement != null) + { + String messageInstance; + messageInstance = messageElement.getTextContent(); + metricResponseInstance.setMessage(messageInstance); + } + } + } + } + + 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); + } + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * You can retrieve the publish settings information for a web site by + * issuing an HTTP GET request. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166996.aspx for + * more information) + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @return The Get Web Site Publish Profile operation response. + */ + @Override + public Future getPublishProfileAsync(final String webSpaceName, final String webSiteName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public WebSiteGetPublishProfileResponse call() throws Exception + { + return getPublishProfile(webSpaceName, webSiteName); + } + }); + } + + /** + * You can retrieve the publish settings information for a web site by + * issuing an HTTP GET request. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166996.aspx for + * more information) + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @return The Get Web Site Publish Profile operation response. */ @Override - public WebSiteGetConfigurationResponse getConfiguration(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + public WebSiteGetPublishProfileResponse getPublishProfile(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException { // Validate if (webSpaceName == null) @@ -1840,11 +3338,11 @@ public WebSiteGetConfigurationResponse getConfiguration(String webSpaceName, Str HashMap tracingParameters = new HashMap(); tracingParameters.put("webSpaceName", webSpaceName); tracingParameters.put("webSiteName", webSiteName); - CloudTracing.enter(invocationId, this, "getConfigurationAsync", tracingParameters); + CloudTracing.enter(invocationId, this, "getPublishProfileAsync", tracingParameters); } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/config"; + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/publishxml"; // Create HTTP transport objects HttpGet httpRequest = new HttpGet(url); @@ -1854,382 +3352,374 @@ public WebSiteGetConfigurationResponse getConfiguration(String webSpaceName, Str // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - WebSiteGetConfigurationResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSiteGetConfigurationResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("SiteConfig"); - Element siteConfigElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (siteConfigElement != null) - { - NodeList elements2 = siteConfigElement.getElementsByTagName("AppSettings"); - Element appSettingsSequenceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (appSettingsSequenceElement != null) - { - for (int i1 = 0; i1 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i1 = i1 + 1) - { - org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i1)); - NodeList elements3 = appSettingsElement.getElementsByTagName("Name"); - String appSettingsKey = elements3.getLength() > 0 ? ((org.w3c.dom.Element) elements3.item(0)).getTextContent() : null; - NodeList elements4 = appSettingsElement.getElementsByTagName("Value"); - String appSettingsValue = elements4.getLength() > 0 ? ((org.w3c.dom.Element) elements4.item(0)).getTextContent() : null; - result.getAppSettings().put(appSettingsKey, appSettingsValue); - } + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements5 = siteConfigElement.getElementsByTagName("ConnectionStrings"); - Element connectionStringsSequenceElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (connectionStringsSequenceElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - for (int i2 = 0; i2 < connectionStringsSequenceElement.getElementsByTagName("ConnStringInfo").getLength(); i2 = i2 + 1) - { - org.w3c.dom.Element connectionStringsElement = ((org.w3c.dom.Element) connectionStringsSequenceElement.getElementsByTagName("ConnStringInfo").item(i2)); - WebSiteGetConfigurationResponse.ConnectionStringInfo connStringInfoInstance = new WebSiteGetConfigurationResponse.ConnectionStringInfo(); - result.getConnectionStrings().add(connStringInfoInstance); - - NodeList elements6 = connectionStringsElement.getElementsByTagName("ConnectionString"); - Element connectionStringElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (connectionStringElement != null) - { - String connectionStringInstance; - connectionStringInstance = connectionStringElement.getTextContent(); - connStringInfoInstance.setConnectionString(connectionStringInstance); - } - - NodeList elements7 = connectionStringsElement.getElementsByTagName("Name"); - Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - connStringInfoInstance.setName(nameInstance); - } - - NodeList elements8 = connectionStringsElement.getElementsByTagName("Type"); - Element typeElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (typeElement != null) - { - String typeInstance; - typeInstance = typeElement.getTextContent(); - connStringInfoInstance.setType(typeInstance); - } - } + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements9 = siteConfigElement.getElementsByTagName("DefaultDocuments"); - Element defaultDocumentsSequenceElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (defaultDocumentsSequenceElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - for (int i3 = 0; i3 < defaultDocumentsSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i3 = i3 + 1) + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - org.w3c.dom.Element defaultDocumentsElement = ((org.w3c.dom.Element) defaultDocumentsSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i3)); - result.getDefaultDocuments().add(defaultDocumentsElement.getTextContent()); + CloudTracing.error(invocationId, ex); } + throw ex; } - NodeList elements10 = siteConfigElement.getElementsByTagName("DetailedErrorLoggingEnabled"); - Element detailedErrorLoggingEnabledElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (detailedErrorLoggingEnabledElement != null && (detailedErrorLoggingEnabledElement.getTextContent() != null && detailedErrorLoggingEnabledElement.getTextContent().isEmpty() != true) == false) - { - boolean detailedErrorLoggingEnabledInstance; - detailedErrorLoggingEnabledInstance = Boolean.parseBoolean(detailedErrorLoggingEnabledElement.getTextContent()); - result.setDetailedErrorLoggingEnabled(detailedErrorLoggingEnabledInstance); - } - - NodeList elements11 = siteConfigElement.getElementsByTagName("DocumentRoot"); - Element documentRootElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (documentRootElement != null) - { - String documentRootInstance; - documentRootInstance = documentRootElement.getTextContent(); - result.setDocumentRoot(documentRootInstance); - } + // Create Result + WebSiteGetPublishProfileResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteGetPublishProfileResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements12 = siteConfigElement.getElementsByTagName("HandlerMappings"); - Element handlerMappingsSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (handlerMappingsSequenceElement != null) + NodeList elements = responseDoc.getElementsByTagNameNS("", "publishData"); + Element publishDataElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (publishDataElement != null) { - for (int i4 = 0; i4 < handlerMappingsSequenceElement.getElementsByTagName("HandlerMapping").getLength(); i4 = i4 + 1) + if (publishDataElement != null) { - org.w3c.dom.Element handlerMappingsElement = ((org.w3c.dom.Element) handlerMappingsSequenceElement.getElementsByTagName("HandlerMapping").item(i4)); - WebSiteGetConfigurationResponse.HandlerMapping handlerMappingInstance = new WebSiteGetConfigurationResponse.HandlerMapping(); - result.getHandlerMappings().add(handlerMappingInstance); - - NodeList elements13 = handlerMappingsElement.getElementsByTagName("Arguments"); - Element argumentsElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (argumentsElement != null) - { - String argumentsInstance; - argumentsInstance = argumentsElement.getTextContent(); - handlerMappingInstance.setArguments(argumentsInstance); - } - - NodeList elements14 = handlerMappingsElement.getElementsByTagName("Extension"); - Element extensionElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (extensionElement != null) - { - String extensionInstance; - extensionInstance = extensionElement.getTextContent(); - handlerMappingInstance.setExtension(extensionInstance); - } - - NodeList elements15 = handlerMappingsElement.getElementsByTagName("ScriptProcessor"); - Element scriptProcessorElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (scriptProcessorElement != null) + for (int i1 = 0; i1 < publishDataElement.getElementsByTagNameNS("", "publishProfile").getLength(); i1 = i1 + 1) { - String scriptProcessorInstance; - scriptProcessorInstance = scriptProcessorElement.getTextContent(); - handlerMappingInstance.setScriptProcessor(scriptProcessorInstance); + org.w3c.dom.Element publishProfilesElement = ((org.w3c.dom.Element) publishDataElement.getElementsByTagNameNS("", "publishProfile").item(i1)); + WebSiteGetPublishProfileResponse.PublishProfile publishProfileInstance = new WebSiteGetPublishProfileResponse.PublishProfile(); + result.getPublishProfiles().add(publishProfileInstance); + + Attr profileNameAttribute = publishProfilesElement.getAttributeNodeNS("", "profileName"); + if (profileNameAttribute != null) + { + publishProfileInstance.setProfileName(profileNameAttribute.getValue()); + } + + Attr publishMethodAttribute = publishProfilesElement.getAttributeNodeNS("", "publishMethod"); + if (publishMethodAttribute != null) + { + publishProfileInstance.setPublishMethod(publishMethodAttribute.getValue()); + } + + Attr publishUrlAttribute = publishProfilesElement.getAttributeNodeNS("", "publishUrl"); + if (publishUrlAttribute != null) + { + publishProfileInstance.setPublishUrl(publishUrlAttribute.getValue()); + } + + Attr msdeploySiteAttribute = publishProfilesElement.getAttributeNodeNS("", "msdeploySite"); + if (msdeploySiteAttribute != null) + { + publishProfileInstance.setMSDeploySite(msdeploySiteAttribute.getValue()); + } + + Attr ftpPassiveModeAttribute = publishProfilesElement.getAttributeNodeNS("", "ftpPassiveMode"); + if (ftpPassiveModeAttribute != null) + { + publishProfileInstance.setFtpPassiveMode(Boolean.parseBoolean(ftpPassiveModeAttribute.getValue())); + } + + Attr userNameAttribute = publishProfilesElement.getAttributeNodeNS("", "userName"); + if (userNameAttribute != null) + { + publishProfileInstance.setUserName(userNameAttribute.getValue()); + } + + Attr userPWDAttribute = publishProfilesElement.getAttributeNodeNS("", "userPWD"); + if (userPWDAttribute != null) + { + publishProfileInstance.setUserPassword(userPWDAttribute.getValue()); + } + + Attr destinationAppUrlAttribute = publishProfilesElement.getAttributeNodeNS("", "destinationAppUrl"); + if (destinationAppUrlAttribute != null) + { + publishProfileInstance.setDestinationAppUri(new URI(destinationAppUrlAttribute.getValue())); + } + + Attr sQLServerDBConnectionStringAttribute = publishProfilesElement.getAttributeNodeNS("", "SQLServerDBConnectionString"); + if (sQLServerDBConnectionStringAttribute != null) + { + publishProfileInstance.setSqlServerConnectionString(sQLServerDBConnectionStringAttribute.getValue()); + } + + Attr mySQLDBConnectionStringAttribute = publishProfilesElement.getAttributeNodeNS("", "mySQLDBConnectionString"); + if (mySQLDBConnectionStringAttribute != null) + { + publishProfileInstance.setMySqlConnectionString(mySQLDBConnectionStringAttribute.getValue()); + } + + Attr hostingProviderForumLinkAttribute = publishProfilesElement.getAttributeNodeNS("", "hostingProviderForumLink"); + if (hostingProviderForumLinkAttribute != null) + { + publishProfileInstance.setHostingProviderForumUri(new URI(hostingProviderForumLinkAttribute.getValue())); + } + + Attr controlPanelLinkAttribute = publishProfilesElement.getAttributeNodeNS("", "controlPanelLink"); + if (controlPanelLinkAttribute != null) + { + publishProfileInstance.setControlPanelUri(new URI(controlPanelLinkAttribute.getValue())); + } + + NodeList elements2 = publishProfilesElement.getElementsByTagNameNS("", "databases"); + Element databasesSequenceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (databasesSequenceElement != null) + { + for (int i2 = 0; i2 < databasesSequenceElement.getElementsByTagNameNS("", "add").getLength(); i2 = i2 + 1) + { + org.w3c.dom.Element databasesElement = ((org.w3c.dom.Element) databasesSequenceElement.getElementsByTagNameNS("", "add").item(i2)); + WebSiteGetPublishProfileResponse.Database addInstance = new WebSiteGetPublishProfileResponse.Database(); + publishProfileInstance.getDatabases().add(addInstance); + + Attr nameAttribute = databasesElement.getAttributeNodeNS("", "name"); + if (nameAttribute != null) + { + addInstance.setName(nameAttribute.getValue()); + } + + Attr connectionStringAttribute = databasesElement.getAttributeNodeNS("", "connectionString"); + if (connectionStringAttribute != null) + { + addInstance.setConnectionString(connectionStringAttribute.getValue()); + } + + Attr providerNameAttribute = databasesElement.getAttributeNodeNS("", "providerName"); + if (providerNameAttribute != null) + { + addInstance.setProviderName(providerNameAttribute.getValue()); + } + + Attr typeAttribute = databasesElement.getAttributeNodeNS("", "type"); + if (typeAttribute != null) + { + addInstance.setType(typeAttribute.getValue()); + } + } + } } } } - NodeList elements16 = siteConfigElement.getElementsByTagName("HttpLoggingEnabled"); - Element httpLoggingEnabledElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (httpLoggingEnabledElement != null && (httpLoggingEnabledElement.getTextContent() != null && httpLoggingEnabledElement.getTextContent().isEmpty() != true) == false) - { - boolean httpLoggingEnabledInstance; - httpLoggingEnabledInstance = Boolean.parseBoolean(httpLoggingEnabledElement.getTextContent()); - result.setHttpLoggingEnabled(httpLoggingEnabledInstance); - } - - NodeList elements17 = siteConfigElement.getElementsByTagName("LogsDirectorySizeLimit"); - Element logsDirectorySizeLimitElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (logsDirectorySizeLimitElement != null && (logsDirectorySizeLimitElement.getTextContent() != null && logsDirectorySizeLimitElement.getTextContent().isEmpty() != true) == false) - { - int logsDirectorySizeLimitInstance; - logsDirectorySizeLimitInstance = Integer.parseInt(logsDirectorySizeLimitElement.getTextContent()); - result.setLogsDirectorySizeLimit(logsDirectorySizeLimitInstance); - } - - NodeList elements18 = siteConfigElement.getElementsByTagName("ManagedPipelineMode"); - Element managedPipelineModeElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (managedPipelineModeElement != null && (managedPipelineModeElement.getTextContent() != null && managedPipelineModeElement.getTextContent().isEmpty() != true) == false) - { - ManagedPipelineMode managedPipelineModeInstance; - managedPipelineModeInstance = ManagedPipelineMode.valueOf(managedPipelineModeElement.getTextContent()); - result.setManagedPipelineMode(managedPipelineModeInstance); - } - - NodeList elements19 = siteConfigElement.getElementsByTagName("Metadata"); - Element metadataSequenceElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (metadataSequenceElement != null) - { - for (int i5 = 0; i5 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i5 = i5 + 1) - { - org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i5)); - NodeList elements20 = metadataElement.getElementsByTagName("Name"); - String metadataKey = elements20.getLength() > 0 ? ((org.w3c.dom.Element) elements20.item(0)).getTextContent() : null; - NodeList elements21 = metadataElement.getElementsByTagName("Value"); - String metadataValue = elements21.getLength() > 0 ? ((org.w3c.dom.Element) elements21.item(0)).getTextContent() : null; - result.getMetadata().put(metadataKey, metadataValue); - } - } - - NodeList elements22 = siteConfigElement.getElementsByTagName("NetFrameworkVersion"); - Element netFrameworkVersionElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (netFrameworkVersionElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - String netFrameworkVersionInstance; - netFrameworkVersionInstance = netFrameworkVersionElement.getTextContent(); - result.setNetFrameworkVersion(netFrameworkVersionInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements23 = siteConfigElement.getElementsByTagName("NumberOfWorkers"); - Element numberOfWorkersElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (numberOfWorkersElement != null && (numberOfWorkersElement.getTextContent() != null && numberOfWorkersElement.getTextContent().isEmpty() != true) == false) + if (shouldTrace) { - int numberOfWorkersInstance; - numberOfWorkersInstance = Integer.parseInt(numberOfWorkersElement.getTextContent()); - result.setNumberOfWorkers(numberOfWorkersInstance); + CloudTracing.exit(invocationId, result); } - - NodeList elements24 = siteConfigElement.getElementsByTagName("PhpVersion"); - Element phpVersionElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (phpVersionElement != null) + return result; + } + finally + { + if (httpResponse != null && httpResponse.getEntity() != null) { - String phpVersionInstance; - phpVersionInstance = phpVersionElement.getTextContent(); - result.setPhpVersion(phpVersionInstance); + httpResponse.getEntity().getContent().close(); } - - NodeList elements25 = siteConfigElement.getElementsByTagName("PublishingPassword"); - Element publishingPasswordElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (publishingPasswordElement != null) + } + } + + /** + * A web site repository is essentially a GIT repository that you can use to + * manage your web site content. By using GIT source control tools, you can + * push or pull version controlled changes to your site. You can create a + * repository for your web site by issuing an HTTP POST request, or + * retrieve information about the repository by using HTTP GET. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx for + * more information) + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @return The Get Web Site Repository operation response. + */ + @Override + public Future getRepositoryAsync(final String webSpaceName, final String webSiteName) + { + return this.getClient().getExecutorService().submit(new Callable() { + @Override + public WebSiteGetRepositoryResponse call() throws Exception { - String publishingPasswordInstance; - publishingPasswordInstance = publishingPasswordElement.getTextContent(); - result.setPublishingPassword(publishingPasswordInstance); + return getRepository(webSpaceName, webSiteName); } - - NodeList elements26 = siteConfigElement.getElementsByTagName("PublishingUsername"); - Element publishingUsernameElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (publishingUsernameElement != null) + }); + } + + /** + * A web site repository is essentially a GIT repository that you can use to + * manage your web site content. By using GIT source control tools, you can + * push or pull version controlled changes to your site. You can create a + * repository for your web site by issuing an HTTP POST request, or + * retrieve information about the repository by using HTTP GET. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx for + * more information) + * + * @param webSpaceName The name of the web space. + * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. + * @return The Get Web Site Repository operation response. + */ + @Override + public WebSiteGetRepositoryResponse getRepository(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException + { + // Validate + if (webSpaceName == null) + { + throw new NullPointerException("webSpaceName"); + } + if (webSiteName == null) + { + throw new NullPointerException("webSiteName"); + } + + // Tracing + boolean shouldTrace = CloudTracing.getIsEnabled(); + String invocationId = null; + if (shouldTrace) + { + invocationId = Long.toString(CloudTracing.getNextInvocationId()); + HashMap tracingParameters = new HashMap(); + tracingParameters.put("webSpaceName", webSpaceName); + tracingParameters.put("webSiteName", webSiteName); + CloudTracing.enter(invocationId, this, "getRepositoryAsync", tracingParameters); + } + + // Construct URL + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/repository"; + + // Create HTTP transport objects + HttpGet httpRequest = new HttpGet(url); + + // Set Headers + httpRequest.setHeader("x-ms-version", "2013-08-01"); + + // Send Request + HttpResponse httpResponse = null; + try + { + if (shouldTrace) { - String publishingUsernameInstance; - publishingUsernameInstance = publishingUsernameElement.getTextContent(); - result.setPublishingUserName(publishingUsernameInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements27 = siteConfigElement.getElementsByTagName("RemoteDebuggingEnabled"); - Element remoteDebuggingEnabledElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; - if (remoteDebuggingEnabledElement != null && (remoteDebuggingEnabledElement.getTextContent() != null && remoteDebuggingEnabledElement.getTextContent().isEmpty() != true) == false) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - boolean remoteDebuggingEnabledInstance; - remoteDebuggingEnabledInstance = Boolean.parseBoolean(remoteDebuggingEnabledElement.getTextContent()); - result.setRemoteDebuggingEnabled(remoteDebuggingEnabledInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements28 = siteConfigElement.getElementsByTagName("RemoteDebuggingVersion"); - Element remoteDebuggingVersionElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; - if (remoteDebuggingVersionElement != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - boolean isNil = false; - String nilAttribute = remoteDebuggingVersionElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) - { - isNil = nilAttribute == "true"; - } - if (isNil == false) + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - RemoteDebuggingVersion remoteDebuggingVersionInstance; - remoteDebuggingVersionInstance = RemoteDebuggingVersion.valueOf(remoteDebuggingVersionElement.getTextContent()); - result.setRemoteDebuggingVersion(remoteDebuggingVersionInstance); + CloudTracing.error(invocationId, ex); } + throw ex; } - NodeList elements29 = siteConfigElement.getElementsByTagName("RequestTracingEnabled"); - Element requestTracingEnabledElement = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; - if (requestTracingEnabledElement != null && (requestTracingEnabledElement.getTextContent() != null && requestTracingEnabledElement.getTextContent().isEmpty() != true) == false) - { - boolean requestTracingEnabledInstance; - requestTracingEnabledInstance = Boolean.parseBoolean(requestTracingEnabledElement.getTextContent()); - result.setRequestTracingEnabled(requestTracingEnabledInstance); - } - - NodeList elements30 = siteConfigElement.getElementsByTagName("RequestTracingExpirationTime"); - Element requestTracingExpirationTimeElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; - if (requestTracingExpirationTimeElement != null && (requestTracingExpirationTimeElement.getTextContent() != null && requestTracingExpirationTimeElement.getTextContent().isEmpty() != true) == false) - { - boolean isNil2 = false; - String nilAttribute2 = requestTracingExpirationTimeElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute2 != null) - { - isNil2 = nilAttribute2 == "true"; - } - if (isNil2 == false) - { - Calendar requestTracingExpirationTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(requestTracingExpirationTimeElement.getTextContent())); - requestTracingExpirationTimeInstance = calendar; - result.setRequestTracingExpirationTime(requestTracingExpirationTimeInstance); - } - } + // Create Result + WebSiteGetRepositoryResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteGetRepositoryResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); - NodeList elements31 = siteConfigElement.getElementsByTagName("ScmType"); - Element scmTypeElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; - if (scmTypeElement != null) + NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/", "anyURI"); + Element anyURIElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (anyURIElement != null) { - String scmTypeInstance; - scmTypeInstance = scmTypeElement.getTextContent(); - result.setScmType(scmTypeInstance); + result.setUri(new URI(anyURIElement.getTextContent())); } - NodeList elements32 = siteConfigElement.getElementsByTagName("Use32BitWorkerProcess"); - Element use32BitWorkerProcessElement = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; - if (use32BitWorkerProcessElement != null && (use32BitWorkerProcessElement.getTextContent() != null && use32BitWorkerProcessElement.getTextContent().isEmpty() != true) == false) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - boolean use32BitWorkerProcessInstance; - use32BitWorkerProcessInstance = Boolean.parseBoolean(use32BitWorkerProcessElement.getTextContent()); - result.setUse32BitWorkerProcess(use32BitWorkerProcessInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements33 = siteConfigElement.getElementsByTagName("WebSocketsEnabled"); - Element webSocketsEnabledElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; - if (webSocketsEnabledElement != null && (webSocketsEnabledElement.getTextContent() != null && webSocketsEnabledElement.getTextContent().isEmpty() != true) == false) + if (shouldTrace) { - boolean webSocketsEnabledInstance; - webSocketsEnabledInstance = Boolean.parseBoolean(webSocketsEnabledElement.getTextContent()); - result.setWebSocketsEnabled(webSocketsEnabledInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** - * You can retrieve historical usage metrics for a site by issuing an HTTP - * GET request. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx for + * You can retrieve a site's current usage metrics by issuing an HTTP GET + * request. The metrics returned include CPU Time, Data In, Data Out, Local + * bytes read, Local bytes written, Network bytes read, Network bytes + * written, WP stop requests, Memory Usage, CPU Time - Minute Limit, and + * File System Storage. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166991.aspx for * more information) * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @param parameters The Get Web Site Historical Usage Metrics parameters. - * @return The Get Web Site Historical Usage Metrics operation response. + * @return The Get Web Site Usage Metrics operation response. */ @Override - public Future getHistoricalUsageMetricsAsync(final String webSpaceName, final String webSiteName, final WebSiteGetHistoricalUsageMetricsParameters parameters) + public Future getUsageMetricsAsync(final String webSpaceName, final String webSiteName) { - return this.getClient().getExecutorService().submit(new Callable() { + return this.getClient().getExecutorService().submit(new Callable() { @Override - public WebSiteGetHistoricalUsageMetricsResponse call() throws Exception + public WebSiteGetUsageMetricsResponse call() throws Exception { - return getHistoricalUsageMetrics(webSpaceName, webSiteName, parameters); + return getUsageMetrics(webSpaceName, webSiteName); } }); } - /** - * You can retrieve historical usage metrics for a site by issuing an HTTP - * GET request. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn166964.aspx for + /** + * You can retrieve a site's current usage metrics by issuing an HTTP GET + * request. The metrics returned include CPU Time, Data In, Data Out, Local + * bytes read, Local bytes written, Network bytes read, Network bytes + * written, WP stop requests, Memory Usage, CPU Time - Minute Limit, and + * File System Storage. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166991.aspx for * more information) * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @param parameters The Get Web Site Historical Usage Metrics parameters. - * @return The Get Web Site Historical Usage Metrics operation response. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @return The Get Web Site Usage Metrics operation response. */ @Override - public WebSiteGetHistoricalUsageMetricsResponse getHistoricalUsageMetrics(String webSpaceName, String webSiteName, WebSiteGetHistoricalUsageMetricsParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + public WebSiteGetUsageMetricsResponse getUsageMetrics(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException { // Validate if (webSpaceName == null) @@ -2240,10 +3730,6 @@ public WebSiteGetHistoricalUsageMetricsResponse getHistoricalUsageMetrics(String { throw new NullPointerException("webSiteName"); } - if (parameters == null) - { - throw new NullPointerException("parameters"); - } // Tracing boolean shouldTrace = CloudTracing.getIsEnabled(); @@ -2254,28 +3740,11 @@ public WebSiteGetHistoricalUsageMetricsResponse getHistoricalUsageMetrics(String HashMap tracingParameters = new HashMap(); tracingParameters.put("webSpaceName", webSpaceName); tracingParameters.put("webSiteName", webSiteName); - tracingParameters.put("parameters", parameters); - CloudTracing.enter(invocationId, this, "getHistoricalUsageMetricsAsync", tracingParameters); + CloudTracing.enter(invocationId, this, "getUsageMetricsAsync", tracingParameters); } // Construct URL - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmZ"); - simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmZ"); - simpleDateFormat2.setTimeZone(TimeZone.getTimeZone("UTC")); - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/metrics?"; - if (parameters.getMetricNames() != null && parameters.getMetricNames().size() > 0) - { - url = url + "&names=" + URLEncoder.encode(CommaStringBuilder.join(parameters.getMetricNames()), "UTF-8"); - } - if (parameters.getStartTime() != null) - { - url = url + "&StartTime=" + URLEncoder.encode(simpleDateFormat.format(parameters.getStartTime().getTime()), "UTF-8"); - } - if (parameters.getEndTime() != null) - { - url = url + "&EndTime=" + URLEncoder.encode(simpleDateFormat2.format(parameters.getEndTime().getTime()), "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/usages"; // Create HTTP transport objects HttpGet httpRequest = new HttpGet(url); @@ -2285,509 +3754,195 @@ public WebSiteGetHistoricalUsageMetricsResponse getHistoricalUsageMetrics(String // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - WebSiteGetHistoricalUsageMetricsResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSiteGetHistoricalUsageMetricsResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("MetricResponses"); - Element metricResponsesElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (metricResponsesElement != null) - { - if (metricResponsesElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - for (int i1 = 0; i1 < metricResponsesElement.getElementsByTagName("MetricResponse").getLength(); i1 = i1 + 1) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - org.w3c.dom.Element usageMetricsElement = ((org.w3c.dom.Element) metricResponsesElement.getElementsByTagName("MetricResponse").item(i1)); - WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetric metricResponseInstance = new WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetric(); - result.getUsageMetrics().add(metricResponseInstance); - - NodeList elements2 = usageMetricsElement.getElementsByTagName("Code"); - Element codeElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (codeElement != null) - { - String codeInstance; - codeInstance = codeElement.getTextContent(); - metricResponseInstance.setCode(codeInstance); - } - - NodeList elements3 = usageMetricsElement.getElementsByTagName("Data"); - Element dataElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (dataElement != null) + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + WebSiteGetUsageMetricsResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteGetUsageMetricsResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Usages"); + Element usagesElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (usagesElement != null) + { + if (usagesElement != null) + { + for (int i1 = 0; i1 < usagesElement.getElementsByTagName("Usage").getLength(); i1 = i1 + 1) { - WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricData dataInstance = new WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricData(); - metricResponseInstance.setData(dataInstance); + org.w3c.dom.Element usageMetricsElement = ((org.w3c.dom.Element) usagesElement.getElementsByTagName("Usage").item(i1)); + WebSiteGetUsageMetricsResponse.UsageMetric usageInstance = new WebSiteGetUsageMetricsResponse.UsageMetric(); + result.getUsageMetrics().add(usageInstance); + + NodeList elements2 = usageMetricsElement.getElementsByTagName("ComputeMode"); + Element computeModeElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (computeModeElement != null) + { + WebSiteComputeMode computeModeInstance; + computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement.getTextContent()); + usageInstance.setComputeMode(computeModeInstance); + } - NodeList elements4 = dataElement.getElementsByTagName("DisplayName"); + NodeList elements3 = usageMetricsElement.getElementsByTagName("CurrentValue"); + Element currentValueElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (currentValueElement != null) + { + String currentValueInstance; + currentValueInstance = currentValueElement.getTextContent(); + usageInstance.setCurrentValue(currentValueInstance); + } + + NodeList elements4 = usageMetricsElement.getElementsByTagName("DisplayName"); Element displayNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; if (displayNameElement != null) { String displayNameInstance; displayNameInstance = displayNameElement.getTextContent(); - dataInstance.setDisplayName(displayNameInstance); + usageInstance.setDisplayName(displayNameInstance); } - NodeList elements5 = dataElement.getElementsByTagName("EndTime"); - Element endTimeElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (endTimeElement != null) + NodeList elements5 = usageMetricsElement.getElementsByTagName("Limit"); + Element limitElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (limitElement != null) { - Calendar endTimeInstance; - SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat3.parse(endTimeElement.getTextContent())); - endTimeInstance = calendar; - dataInstance.setEndTime(endTimeInstance); + String limitInstance; + limitInstance = limitElement.getTextContent(); + usageInstance.setLimit(limitInstance); } - NodeList elements6 = dataElement.getElementsByTagName("Name"); + NodeList elements6 = usageMetricsElement.getElementsByTagName("Name"); Element nameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; if (nameElement != null) { String nameInstance; nameInstance = nameElement.getTextContent(); - dataInstance.setName(nameInstance); + usageInstance.setName(nameInstance); } - NodeList elements7 = dataElement.getElementsByTagName("PrimaryAggregationType"); - Element primaryAggregationTypeElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (primaryAggregationTypeElement != null) + NodeList elements7 = usageMetricsElement.getElementsByTagName("NextResetTime"); + Element nextResetTimeElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (nextResetTimeElement != null) { - String primaryAggregationTypeInstance; - primaryAggregationTypeInstance = primaryAggregationTypeElement.getTextContent(); - dataInstance.setPrimaryAggregationType(primaryAggregationTypeInstance); + Calendar nextResetTimeInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(nextResetTimeElement.getTextContent())); + nextResetTimeInstance = calendar; + usageInstance.setNextResetTime(nextResetTimeInstance); } - NodeList elements8 = dataElement.getElementsByTagName("StartTime"); - Element startTimeElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (startTimeElement != null) + NodeList elements8 = usageMetricsElement.getElementsByTagName("ResourceName"); + Element resourceNameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (resourceNameElement != null) { - Calendar startTimeInstance; - SimpleDateFormat simpleDateFormat4 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat4.parse(startTimeElement.getTextContent())); - startTimeInstance = calendar2; - dataInstance.setStartTime(startTimeInstance); + String resourceNameInstance; + resourceNameInstance = resourceNameElement.getTextContent(); + usageInstance.setResourceName(resourceNameInstance); } - NodeList elements9 = dataElement.getElementsByTagName("TimeGrain"); - Element timeGrainElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (timeGrainElement != null) + NodeList elements9 = usageMetricsElement.getElementsByTagName("SiteMode"); + Element siteModeElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (siteModeElement != null) { - String timeGrainInstance; - timeGrainInstance = timeGrainElement.getTextContent(); - dataInstance.setTimeGrain(timeGrainInstance); + WebSiteMode siteModeInstance; + siteModeInstance = WebSiteMode.valueOf(siteModeElement.getTextContent()); + usageInstance.setSiteMode(siteModeInstance); } - NodeList elements10 = dataElement.getElementsByTagName("Unit"); + NodeList elements10 = usageMetricsElement.getElementsByTagName("Unit"); Element unitElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; if (unitElement != null) { String unitInstance; unitInstance = unitElement.getTextContent(); - dataInstance.setUnit(unitInstance); - } - - NodeList elements11 = dataElement.getElementsByTagName("Values"); - Element valuesSequenceElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (valuesSequenceElement != null) - { - for (int i2 = 0; i2 < valuesSequenceElement.getElementsByTagName("MetricSample").getLength(); i2 = i2 + 1) - { - org.w3c.dom.Element valuesElement = ((org.w3c.dom.Element) valuesSequenceElement.getElementsByTagName("MetricSample").item(i2)); - WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricSample metricSampleInstance = new WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricSample(); - dataInstance.getValues().add(metricSampleInstance); - - NodeList elements12 = valuesElement.getElementsByTagName("Count"); - Element countElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (countElement != null) - { - int countInstance; - countInstance = Integer.parseInt(countElement.getTextContent()); - metricSampleInstance.setCount(countInstance); - } - - NodeList elements13 = valuesElement.getElementsByTagName("Maximum"); - Element maximumElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (maximumElement != null) - { - boolean isNil = false; - String nilAttribute = maximumElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) - { - isNil = nilAttribute == "true"; - } - if (isNil == false) - { - String maximumInstance; - maximumInstance = maximumElement.getTextContent(); - metricSampleInstance.setMaximum(maximumInstance); - } - } - - NodeList elements14 = valuesElement.getElementsByTagName("Minimum"); - Element minimumElement = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (minimumElement != null) - { - boolean isNil2 = false; - String nilAttribute2 = minimumElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute2 != null) - { - isNil2 = nilAttribute2 == "true"; - } - if (isNil2 == false) - { - String minimumInstance; - minimumInstance = minimumElement.getTextContent(); - metricSampleInstance.setMinimum(minimumInstance); - } - } - - NodeList elements15 = valuesElement.getElementsByTagName("TimeCreated"); - Element timeCreatedElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (timeCreatedElement != null) - { - Calendar timeCreatedInstance; - SimpleDateFormat simpleDateFormat5 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar3 = Calendar.getInstance(); - calendar3.setTime(simpleDateFormat5.parse(timeCreatedElement.getTextContent())); - timeCreatedInstance = calendar3; - metricSampleInstance.setTimeCreated(timeCreatedInstance); - } - - NodeList elements16 = valuesElement.getElementsByTagName("Total"); - Element totalElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (totalElement != null) - { - String totalInstance; - totalInstance = totalElement.getTextContent(); - metricSampleInstance.setTotal(totalInstance); - } - } + usageInstance.setUnit(unitInstance); } } - - NodeList elements17 = usageMetricsElement.getElementsByTagName("Message"); - Element messageElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (messageElement != null) - { - String messageInstance; - messageInstance = messageElement.getTextContent(); - metricResponseInstance.setMessage(messageInstance); - } } } - } - - 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); - } - return result; - } - - /** - * You can retrieve the publish settings information for a web site by - * issuing an HTTP GET request. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn166996.aspx for - * more information) - * - * @param webSpaceName The name of the web space. - * @param webSiteName The name of the web site. - * @return The Get Web Site Publish Profile operation response. - */ - @Override - public Future getPublishProfileAsync(final String webSpaceName, final String webSiteName) - { - return this.getClient().getExecutorService().submit(new Callable() { - @Override - public WebSiteGetPublishProfileResponse call() throws Exception + + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - return getPublishProfile(webSpaceName, webSiteName); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - }); - } - - /** - * You can retrieve the publish settings information for a web site by - * issuing an HTTP GET request. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn166996.aspx for - * more information) - * - * @param webSpaceName The name of the web space. - * @param webSiteName The name of the web site. - * @return The Get Web Site Publish Profile operation response. - */ - @Override - public WebSiteGetPublishProfileResponse getPublishProfile(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException - { - // Validate - if (webSpaceName == null) - { - throw new NullPointerException("webSpaceName"); - } - if (webSiteName == null) - { - throw new NullPointerException("webSiteName"); - } - - // Tracing - boolean shouldTrace = CloudTracing.getIsEnabled(); - String invocationId = null; - if (shouldTrace) - { - invocationId = Long.toString(CloudTracing.getNextInvocationId()); - HashMap tracingParameters = new HashMap(); - tracingParameters.put("webSpaceName", webSpaceName); - tracingParameters.put("webSiteName", webSiteName); - CloudTracing.enter(invocationId, this, "getPublishProfileAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/publishxml"; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2013-08-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.exit(invocationId, result); } - throw ex; + return result; } - - // Create Result - WebSiteGetPublishProfileResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSiteGetPublishProfileResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("", "publishData"); - Element publishDataElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (publishDataElement != null) + finally { - if (publishDataElement != null) + if (httpResponse != null && httpResponse.getEntity() != null) { - for (int i1 = 0; i1 < publishDataElement.getElementsByTagNameNS("", "publishProfile").getLength(); i1 = i1 + 1) - { - org.w3c.dom.Element publishProfilesElement = ((org.w3c.dom.Element) publishDataElement.getElementsByTagNameNS("", "publishProfile").item(i1)); - WebSiteGetPublishProfileResponse.PublishProfile publishProfileInstance = new WebSiteGetPublishProfileResponse.PublishProfile(); - result.getPublishProfiles().add(publishProfileInstance); - - String profileNameAttribute = publishProfilesElement.getAttributeNS("", "profileName"); - if (profileNameAttribute != null) - { - publishProfileInstance.setProfileName(profileNameAttribute); - } - - String publishMethodAttribute = publishProfilesElement.getAttributeNS("", "publishMethod"); - if (publishMethodAttribute != null) - { - publishProfileInstance.setPublishMethod(publishMethodAttribute); - } - - String publishUrlAttribute = publishProfilesElement.getAttributeNS("", "publishUrl"); - if (publishUrlAttribute != null) - { - publishProfileInstance.setPublishUrl(publishUrlAttribute); - } - - String msdeploySiteAttribute = publishProfilesElement.getAttributeNS("", "msdeploySite"); - if (msdeploySiteAttribute != null) - { - publishProfileInstance.setMSDeploySite(msdeploySiteAttribute); - } - - String ftpPassiveModeAttribute = publishProfilesElement.getAttributeNS("", "ftpPassiveMode"); - if (ftpPassiveModeAttribute != null) - { - publishProfileInstance.setFtpPassiveMode(Boolean.parseBoolean(ftpPassiveModeAttribute)); - } - - String userNameAttribute = publishProfilesElement.getAttributeNS("", "userName"); - if (userNameAttribute != null) - { - publishProfileInstance.setUserName(userNameAttribute); - } - - String userPWDAttribute = publishProfilesElement.getAttributeNS("", "userPWD"); - if (userPWDAttribute != null) - { - publishProfileInstance.setUserPassword(userPWDAttribute); - } - - String destinationAppUrlAttribute = publishProfilesElement.getAttributeNS("", "destinationAppUrl"); - if (destinationAppUrlAttribute != null) - { - publishProfileInstance.setDestinationAppUri(new URI(destinationAppUrlAttribute)); - } - - String sQLServerDBConnectionStringAttribute = publishProfilesElement.getAttributeNS("", "SQLServerDBConnectionString"); - if (sQLServerDBConnectionStringAttribute != null) - { - publishProfileInstance.setSqlServerConnectionString(sQLServerDBConnectionStringAttribute); - } - - String mySQLDBConnectionStringAttribute = publishProfilesElement.getAttributeNS("", "mySQLDBConnectionString"); - if (mySQLDBConnectionStringAttribute != null) - { - publishProfileInstance.setMySqlConnectionString(mySQLDBConnectionStringAttribute); - } - - String hostingProviderForumLinkAttribute = publishProfilesElement.getAttributeNS("", "hostingProviderForumLink"); - if (hostingProviderForumLinkAttribute != null) - { - publishProfileInstance.setHostingProviderForumUri(new URI(hostingProviderForumLinkAttribute)); - } - - String controlPanelLinkAttribute = publishProfilesElement.getAttributeNS("", "controlPanelLink"); - if (controlPanelLinkAttribute != null) - { - publishProfileInstance.setControlPanelUri(new URI(controlPanelLinkAttribute)); - } - - NodeList elements2 = publishProfilesElement.getElementsByTagNameNS("", "databases"); - Element databasesSequenceElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (databasesSequenceElement != null) - { - for (int i2 = 0; i2 < databasesSequenceElement.getElementsByTagNameNS("", "add").getLength(); i2 = i2 + 1) - { - org.w3c.dom.Element databasesElement = ((org.w3c.dom.Element) databasesSequenceElement.getElementsByTagNameNS("", "add").item(i2)); - WebSiteGetPublishProfileResponse.Database addInstance = new WebSiteGetPublishProfileResponse.Database(); - publishProfileInstance.getDatabases().add(addInstance); - - String nameAttribute = databasesElement.getAttributeNS("", "name"); - if (nameAttribute != null) - { - addInstance.setName(nameAttribute); - } - - String connectionStringAttribute = databasesElement.getAttributeNS("", "connectionString"); - if (connectionStringAttribute != null) - { - addInstance.setConnectionString(connectionStringAttribute); - } - - String providerNameAttribute = databasesElement.getAttributeNS("", "providerName"); - if (providerNameAttribute != null) - { - addInstance.setProviderName(providerNameAttribute); - } - - String typeAttribute = databasesElement.getAttributeNS("", "type"); - if (typeAttribute != null) - { - addInstance.setType(typeAttribute); - } - } - } - } - } - } - - 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); - } - return result; - } - - /** - * A web site repository is essentially a GIT repository that you can use to - * manage your web site content. By using GIT source control tools, you can - * push or pull version controlled changes to your site. You can create a - * repository for your web site by issuing an HTTP POST request, or - * retrieve information about the repository by using HTTP GET. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx for + httpResponse.getEntity().getContent().close(); + } + } + } + + /** + * You can restart a web site by issuing an HTTP POST request. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn236425.aspx for * more information) * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @return The Get Web Site Repository operation response. + * @return A standard service response including an HTTP status code and + * request ID. */ @Override - public Future getRepositoryAsync(final String webSpaceName, final String webSiteName) + public Future restartAsync(final String webSpaceName, final String webSiteName) { - return this.getClient().getExecutorService().submit(new Callable() { + return this.getClient().getExecutorService().submit(new Callable() { @Override - public WebSiteGetRepositoryResponse call() throws Exception + public OperationResponse call() throws Exception { - return getRepository(webSpaceName, webSiteName); + return restart(webSpaceName, webSiteName); } }); } /** - * A web site repository is essentially a GIT repository that you can use to - * manage your web site content. By using GIT source control tools, you can - * push or pull version controlled changes to your site. You can create a - * repository for your web site by issuing an HTTP POST request, or - * retrieve information about the repository by using HTTP GET. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx for + * You can restart a web site by issuing an HTTP POST request. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn236425.aspx for * more information) * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @return The Get Web Site Repository operation response. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @return A standard service response including an HTTP status code and + * request ID. */ @Override - public WebSiteGetRepositoryResponse getRepository(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException + public OperationResponse restart(String webSpaceName, String webSiteName) throws IOException, ServiceException { // Validate if (webSpaceName == null) @@ -2808,121 +3963,123 @@ public WebSiteGetRepositoryResponse getRepository(String webSpaceName, String we HashMap tracingParameters = new HashMap(); tracingParameters.put("webSpaceName", webSpaceName); tracingParameters.put("webSiteName", webSiteName); - CloudTracing.enter(invocationId, this, "getRepositoryAsync", tracingParameters); + CloudTracing.enter(invocationId, this, "restartAsync", tracingParameters); } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/repository"; + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/restart"; // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); + HttpPost httpRequest = new HttpPost(url); // Set Headers + httpRequest.setHeader("Content-Length", "0"); httpRequest.setHeader("x-ms-version", "2013-08-01"); // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - WebSiteGetRepositoryResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSiteGetRepositoryResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/", "anyURI"); - Element anyURIElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (anyURIElement != null) - { - result.setUri(new URI(anyURIElement.getTextContent())); - } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** - * You can retrieve a site's current usage metrics by issuing an HTTP GET - * request. The metrics returned include CPU Time, Data In, Data Out, Local - * bytes read, Local bytes written, Network bytes read, Network bytes - * written, WP stop requests, Memory Usage, CPU Time - Minute Limit, and - * File System Storage. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn166991.aspx for - * more information) + * You can swap a web site from one slot to the production slot. * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @return The Get Web Site Usage Metrics operation response. + * @param slotName The name of the web site slot to swap with the production + * slot. + * @return The response body contains the status of the specified + * long-running operation, indicating whether it has succeeded, is + * inprogress, has time dout, or has failed. Note that this status is + * distinct from the HTTP status code returned for the Get Operation Status + * operation itself. If the long-running operation failed, the response + * body includes error information regarding the failure. */ @Override - public Future getUsageMetricsAsync(final String webSpaceName, final String webSiteName) + public Future swapSlotsAsync(final String webSpaceName, final String webSiteName, final String slotName) { - return this.getClient().getExecutorService().submit(new Callable() { + return this.getClient().getExecutorService().submit(new Callable() { @Override - public WebSiteGetUsageMetricsResponse call() throws Exception + public WebSiteOperationStatusResponse call() throws Exception { - return getUsageMetrics(webSpaceName, webSiteName); + return swapSlots(webSpaceName, webSiteName, slotName); } }); } /** - * You can retrieve a site's current usage metrics by issuing an HTTP GET - * request. The metrics returned include CPU Time, Data In, Data Out, Local - * bytes read, Local bytes written, Network bytes read, Network bytes - * written, WP stop requests, Memory Usage, CPU Time - Minute Limit, and - * File System Storage. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn166991.aspx for - * more information) + * You can swap a web site from one slot to the production slot. * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. - * @return The Get Web Site Usage Metrics operation response. + * @param slotName The name of the web site slot to swap with the production + * slot. + * @throws InterruptedException Thrown when a thread is waiting, sleeping, + * or otherwise occupied, and the thread is interrupted, either before or + * during the activity. Occasionally a method may wish to test whether the + * current thread has been interrupted, and if so, to immediately throw + * this exception. The following code can be used to achieve this effect: + * @throws ExecutionException Thrown when attempting to retrieve the result + * of a task that aborted by throwing an exception. This exception can be + * inspected using the Throwable.getCause() method. + * @throws ServiceException Thrown if the server returned an error for the + * request. + * @throws IOException Thrown if there was an error setting up tracing for + * the request. + * @return The response body contains the status of the specified + * long-running operation, indicating whether it has succeeded, is + * inprogress, has time dout, or has failed. Note that this status is + * distinct from the HTTP status code returned for the Get Operation Status + * operation itself. If the long-running operation failed, the response + * body includes error information regarding the failure. */ @Override - public WebSiteGetUsageMetricsResponse getUsageMetrics(String webSpaceName, String webSiteName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException + public WebSiteOperationStatusResponse swapSlots(String webSpaceName, String webSiteName, String slotName) throws InterruptedException, ExecutionException, ServiceException, IOException { - // Validate - if (webSpaceName == null) - { - throw new NullPointerException("webSpaceName"); - } - if (webSiteName == null) - { - throw new NullPointerException("webSiteName"); - } - - // Tracing + WebSiteManagementClient client2 = this.getClient(); boolean shouldTrace = CloudTracing.getIsEnabled(); String invocationId = null; if (shouldTrace) @@ -2931,164 +4088,72 @@ public WebSiteGetUsageMetricsResponse getUsageMetrics(String webSpaceName, Strin HashMap tracingParameters = new HashMap(); tracingParameters.put("webSpaceName", webSpaceName); tracingParameters.put("webSiteName", webSiteName); - CloudTracing.enter(invocationId, this, "getUsageMetricsAsync", tracingParameters); - } - - // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/usages"; - - // Create HTTP transport objects - HttpGet httpRequest = new HttpGet(url); - - // Set Headers - httpRequest.setHeader("x-ms-version", "2013-08-01"); - - // Send Request - HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); + tracingParameters.put("slotName", slotName); + CloudTracing.enter(invocationId, this, "swapSlotsAsync", tracingParameters); } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + client2 = this.getClient().withRequestFilterLast(new ClientRequestTrackingHandler(invocationId)).withResponseFilterLast(new ClientRequestTrackingHandler(invocationId)); } - throw ex; - } - - // Create Result - WebSiteGetUsageMetricsResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSiteGetUsageMetricsResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Usages"); - Element usagesElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (usagesElement != null) - { - if (usagesElement != null) + + WebSiteOperationStatusResponse response = client2.getWebSitesOperations().beginSwapingSlotsAsync(webSpaceName, webSiteName, slotName).get(); + WebSiteOperationStatusResponse result = client2.getOperationStatusAsync(webSpaceName, webSiteName, response.getOperationId()).get(); + int delayInSeconds = 30; + while ((result.getStatus() != WebSiteOperationStatus.InProgress) == false) + { + Thread.sleep(delayInSeconds * 1000); + result = client2.getOperationStatusAsync(webSpaceName, webSiteName, response.getOperationId()).get(); + delayInSeconds = 30; + } + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + + if (result.getStatus() != WebSiteOperationStatus.Succeeded) { - for (int i1 = 0; i1 < usagesElement.getElementsByTagName("Usage").getLength(); i1 = i1 + 1) + if (result.getErrors() != null && result.getErrors().size() > 0) { - org.w3c.dom.Element usageMetricsElement = ((org.w3c.dom.Element) usagesElement.getElementsByTagName("Usage").item(i1)); - WebSiteGetUsageMetricsResponse.UsageMetric usageInstance = new WebSiteGetUsageMetricsResponse.UsageMetric(); - result.getUsageMetrics().add(usageInstance); - - NodeList elements2 = usageMetricsElement.getElementsByTagName("ComputeMode"); - Element computeModeElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (computeModeElement != null) - { - WebSiteComputeMode computeModeInstance; - computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement.getTextContent()); - usageInstance.setComputeMode(computeModeInstance); - } - - NodeList elements3 = usageMetricsElement.getElementsByTagName("CurrentValue"); - Element currentValueElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (currentValueElement != null) - { - String currentValueInstance; - currentValueInstance = currentValueElement.getTextContent(); - usageInstance.setCurrentValue(currentValueInstance); - } - - NodeList elements4 = usageMetricsElement.getElementsByTagName("DisplayName"); - Element displayNameElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (displayNameElement != null) - { - String displayNameInstance; - displayNameInstance = displayNameElement.getTextContent(); - usageInstance.setDisplayName(displayNameInstance); - } - - NodeList elements5 = usageMetricsElement.getElementsByTagName("Limit"); - Element limitElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (limitElement != null) - { - String limitInstance; - limitInstance = limitElement.getTextContent(); - usageInstance.setLimit(limitInstance); - } - - NodeList elements6 = usageMetricsElement.getElementsByTagName("Name"); - Element nameElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - usageInstance.setName(nameInstance); - } - - NodeList elements7 = usageMetricsElement.getElementsByTagName("NextResetTime"); - Element nextResetTimeElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (nextResetTimeElement != null) - { - Calendar nextResetTimeInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(nextResetTimeElement.getTextContent())); - nextResetTimeInstance = calendar; - usageInstance.setNextResetTime(nextResetTimeInstance); - } - - NodeList elements8 = usageMetricsElement.getElementsByTagName("ResourceName"); - Element resourceNameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (resourceNameElement != null) + ServiceException ex = new ServiceException(result.getErrors().get(0).getCode() + " : " + result.getErrors().get(0).getMessage()); + ex.setErrorCode(result.getErrors().get(0).getCode()); + ex.setErrorMessage(result.getErrors().get(0).getMessage()); + if (shouldTrace) { - String resourceNameInstance; - resourceNameInstance = resourceNameElement.getTextContent(); - usageInstance.setResourceName(resourceNameInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements9 = usageMetricsElement.getElementsByTagName("SiteMode"); - Element siteModeElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (siteModeElement != null) - { - WebSiteMode siteModeInstance; - siteModeInstance = WebSiteMode.valueOf(siteModeElement.getTextContent()); - usageInstance.setSiteMode(siteModeInstance); - } - - NodeList elements10 = usageMetricsElement.getElementsByTagName("Unit"); - Element unitElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (unitElement != null) + throw ex; + } + else + { + ServiceException ex = new ServiceException(""); + if (shouldTrace) { - String unitInstance; - unitInstance = unitElement.getTextContent(); - usageInstance.setUnit(unitInstance); + CloudTracing.error(invocationId, ex); } + throw ex; } } + + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (this.getClient() != null && shouldTrace) + { + this.getClient().close(); + } } - return result; } /** - * You can restart a web site by issuing an HTTP POST request. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn236425.aspx for + * A web site repository is essentially a GIT repository that you can use to + * manage your web site content. By using GIT source control tools, you can + * push or pull version controlled changes to your site. This API executes + * a repository sync operation. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx for * more information) * * @param webSpaceName The name of the web space. @@ -3097,29 +4162,36 @@ public WebSiteGetUsageMetricsResponse getUsageMetrics(String webSpaceName, Strin * request ID. */ @Override - public Future restartAsync(final String webSpaceName, final String webSiteName) + public Future syncRepositoryAsync(final String webSpaceName, final String webSiteName) { return this.getClient().getExecutorService().submit(new Callable() { @Override public OperationResponse call() throws Exception { - return restart(webSpaceName, webSiteName); + return syncRepository(webSpaceName, webSiteName); } }); } /** - * You can restart a web site by issuing an HTTP POST request. (see - * http://msdn.microsoft.com/en-us/library/windowsazure/dn236425.aspx for + * A web site repository is essentially a GIT repository that you can use to + * manage your web site content. By using GIT source control tools, you can + * push or pull version controlled changes to your site. This API executes + * a repository sync operation. (see + * http://msdn.microsoft.com/en-us/library/windowsazure/dn166967.aspx for * more information) * * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse restart(String webSpaceName, String webSiteName) throws IOException, ServiceException + public OperationResponse syncRepository(String webSpaceName, String webSiteName) throws IOException, ServiceException { // Validate if (webSpaceName == null) @@ -3140,11 +4212,11 @@ public OperationResponse restart(String webSpaceName, String webSiteName) throws HashMap tracingParameters = new HashMap(); tracingParameters.put("webSpaceName", webSpaceName); tracingParameters.put("webSiteName", webSiteName); - CloudTracing.enter(invocationId, this, "restartAsync", tracingParameters); + CloudTracing.enter(invocationId, this, "syncRepositoryAsync", tracingParameters); } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/restart"; + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites/" + webSiteName + "/repository?action=sync"; // Create HTTP transport objects HttpPost httpRequest = new HttpPost(url); @@ -3155,40 +4227,50 @@ public OperationResponse restart(String webSpaceName, String webSiteName) throws // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -3223,10 +4305,24 @@ public WebSiteUpdateResponse call() throws Exception * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. * @param parameters Parameters supplied to the Update Web Site operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Update Web Site operation response. */ @Override - public WebSiteUpdateResponse update(String webSpaceName, String webSiteName, WebSiteUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException, ParseException, URISyntaxException + public WebSiteUpdateResponse update(String webSpaceName, String webSiteName, WebSiteUpdateParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException, ParseException, URISyntaxException { // Validate if (webSpaceName == null) @@ -3319,7 +4415,9 @@ public WebSiteUpdateResponse update(String webSpaceName, String webSiteName, Web else { Element emptyElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "Thumbprint"); - String nilAttribute = null; + Attr nilAttribute = requestDoc.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + nilAttribute.setValue("true"); + emptyElement.setAttributeNode(nilAttribute); webSiteHostNameSslStateElement.appendChild(emptyElement); } @@ -3425,479 +4523,615 @@ public WebSiteUpdateResponse update(String webSpaceName, String webSiteName, Web // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); - } - throw ex; - } - - // Create Result - WebSiteUpdateResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSiteUpdateResponse(); - DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); - Document responseDoc = documentBuilder2.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Site"); - Element siteElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (siteElement2 != null) - { - WebSite webSiteInstance = new WebSite(); - result.setWebSite(webSiteInstance); - - NodeList elements2 = siteElement2.getElementsByTagName("AdminEnabled"); - Element adminEnabledElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (adminEnabledElement != null) - { - boolean adminEnabledInstance; - adminEnabledInstance = Boolean.parseBoolean(adminEnabledElement.getTextContent()); - webSiteInstance.setAdminEnabled(adminEnabledInstance); + CloudTracing.sendRequest(invocationId, httpRequest); } - - NodeList elements3 = siteElement2.getElementsByTagName("AvailabilityState"); - Element availabilityStateElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (availabilityStateElement2 != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - WebSpaceAvailabilityState availabilityStateInstance; - availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement2.getTextContent()); - webSiteInstance.setAvailabilityState(availabilityStateInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements4 = siteElement2.getElementsByTagName("ComputeMode"); - Element computeModeElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (computeModeElement2 != null) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - WebSiteComputeMode computeModeInstance; - computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement2.getTextContent()); - webSiteInstance.setComputeMode(computeModeInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements5 = siteElement2.getElementsByTagName("Enabled"); - Element enabledElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (enabledElement2 != null) - { - boolean enabledInstance; - enabledInstance = Boolean.parseBoolean(enabledElement2.getTextContent()); - webSiteInstance.setEnabled(enabledInstance); - } + // Create Result + WebSiteUpdateResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSiteUpdateResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); - NodeList elements6 = siteElement2.getElementsByTagName("EnabledHostNames"); - Element enabledHostNamesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (enabledHostNamesSequenceElement != null) + NodeList elements = responseDoc.getElementsByTagName("Site"); + Element siteElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (siteElement2 != null) { - for (int i1 = 0; i1 < enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i1 = i1 + 1) + WebSite webSiteInstance = new WebSite(); + result.setWebSite(webSiteInstance); + + NodeList elements2 = siteElement2.getElementsByTagName("AdminEnabled"); + Element adminEnabledElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (adminEnabledElement != null) { - org.w3c.dom.Element enabledHostNamesElement = ((org.w3c.dom.Element) enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i1)); - webSiteInstance.getEnabledHostNames().add(enabledHostNamesElement.getTextContent()); + boolean adminEnabledInstance; + adminEnabledInstance = Boolean.parseBoolean(adminEnabledElement.getTextContent()); + webSiteInstance.setAdminEnabled(adminEnabledInstance); } - } - - NodeList elements7 = siteElement2.getElementsByTagName("HostNameSslStates"); - Element hostNameSslStatesSequenceElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (hostNameSslStatesSequenceElement2 != null) - { - for (int i2 = 0; i2 < hostNameSslStatesSequenceElement2.getElementsByTagName("WebSiteHostNameSslState").getLength(); i2 = i2 + 1) + + NodeList elements3 = siteElement2.getElementsByTagName("AvailabilityState"); + Element availabilityStateElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (availabilityStateElement2 != null) { - org.w3c.dom.Element hostNameSslStatesElement = ((org.w3c.dom.Element) hostNameSslStatesSequenceElement2.getElementsByTagName("WebSiteHostNameSslState").item(i2)); - WebSite.WebSiteHostNameSslState webSiteHostNameSslStateInstance = new WebSite.WebSiteHostNameSslState(); - webSiteInstance.getHostNameSslStates().add(webSiteHostNameSslStateInstance); - - NodeList elements8 = hostNameSslStatesElement.getElementsByTagName("Name"); - Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - webSiteHostNameSslStateInstance.setName(nameInstance); - } - - NodeList elements9 = hostNameSslStatesElement.getElementsByTagName("SslState"); - Element sslStateElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (sslStateElement2 != null) + WebSpaceAvailabilityState availabilityStateInstance; + availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement2.getTextContent()); + webSiteInstance.setAvailabilityState(availabilityStateInstance); + } + + NodeList elements4 = siteElement2.getElementsByTagName("ComputeMode"); + Element computeModeElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (computeModeElement2 != null) + { + WebSiteComputeMode computeModeInstance; + computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement2.getTextContent()); + webSiteInstance.setComputeMode(computeModeInstance); + } + + NodeList elements5 = siteElement2.getElementsByTagName("Enabled"); + Element enabledElement2 = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (enabledElement2 != null) + { + boolean enabledInstance; + enabledInstance = Boolean.parseBoolean(enabledElement2.getTextContent()); + webSiteInstance.setEnabled(enabledInstance); + } + + NodeList elements6 = siteElement2.getElementsByTagName("EnabledHostNames"); + Element enabledHostNamesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (enabledHostNamesSequenceElement != null) + { + for (int i1 = 0; i1 < enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i1 = i1 + 1) { - WebSiteSslState sslStateInstance; - sslStateInstance = WebSiteSslState.valueOf(sslStateElement2.getTextContent()); - webSiteHostNameSslStateInstance.setSslState(sslStateInstance); + org.w3c.dom.Element enabledHostNamesElement = ((org.w3c.dom.Element) enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i1)); + webSiteInstance.getEnabledHostNames().add(enabledHostNamesElement.getTextContent()); } - - NodeList elements10 = hostNameSslStatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement3 = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (thumbprintElement3 != null) + } + + NodeList elements7 = siteElement2.getElementsByTagName("HostNameSslStates"); + Element hostNameSslStatesSequenceElement2 = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (hostNameSslStatesSequenceElement2 != null) + { + for (int i2 = 0; i2 < hostNameSslStatesSequenceElement2.getElementsByTagName("WebSiteHostNameSslState").getLength(); i2 = i2 + 1) { - boolean isNil = false; - String nilAttribute2 = thumbprintElement3.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute2 != null) + org.w3c.dom.Element hostNameSslStatesElement = ((org.w3c.dom.Element) hostNameSslStatesSequenceElement2.getElementsByTagName("WebSiteHostNameSslState").item(i2)); + WebSite.WebSiteHostNameSslState webSiteHostNameSslStateInstance = new WebSite.WebSiteHostNameSslState(); + webSiteInstance.getHostNameSslStates().add(webSiteHostNameSslStateInstance); + + NodeList elements8 = hostNameSslStatesElement.getElementsByTagName("Name"); + Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (nameElement != null) { - isNil = nilAttribute2 == "true"; + String nameInstance; + nameInstance = nameElement.getTextContent(); + webSiteHostNameSslStateInstance.setName(nameInstance); } - if (isNil == false) + + NodeList elements9 = hostNameSslStatesElement.getElementsByTagName("SslState"); + Element sslStateElement2 = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (sslStateElement2 != null) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement3.getTextContent(); - webSiteHostNameSslStateInstance.setThumbprint(thumbprintInstance); + WebSiteSslState sslStateInstance; + sslStateInstance = WebSiteSslState.valueOf(sslStateElement2.getTextContent()); + webSiteHostNameSslStateInstance.setSslState(sslStateInstance); } - } - - NodeList elements11 = hostNameSslStatesElement.getElementsByTagName("VirtualIP"); - Element virtualIPElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (virtualIPElement != null) - { - boolean isNil2 = false; - String nilAttribute3 = virtualIPElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute3 != null) + + NodeList elements10 = hostNameSslStatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement3 = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (thumbprintElement3 != null) { - isNil2 = nilAttribute3 == "true"; + boolean isNil = false; + Attr nilAttribute2 = thumbprintElement3.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil = nilAttribute2.getValue() == "true"; + } + if (isNil == false) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement3.getTextContent(); + webSiteHostNameSslStateInstance.setThumbprint(thumbprintInstance); + } } - if (isNil2 == false) + + NodeList elements11 = hostNameSslStatesElement.getElementsByTagName("VirtualIP"); + Element virtualIPElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (virtualIPElement != null) { - InetAddress virtualIPInstance; - virtualIPInstance = InetAddress.getByName(virtualIPElement.getTextContent()); - webSiteHostNameSslStateInstance.setVirtualIP(virtualIPInstance); + boolean isNil2 = false; + Attr nilAttribute3 = virtualIPElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute3 != null) + { + isNil2 = nilAttribute3.getValue() == "true"; + } + if (isNil2 == false) + { + InetAddress virtualIPInstance; + virtualIPInstance = InetAddress.getByName(virtualIPElement.getTextContent()); + webSiteHostNameSslStateInstance.setVirtualIP(virtualIPInstance); + } } } } - } - - NodeList elements12 = siteElement2.getElementsByTagName("HostNames"); - Element hostNamesSequenceElement2 = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (hostNamesSequenceElement2 != null) - { - for (int i3 = 0; i3 < hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i3 = i3 + 1) + + NodeList elements12 = siteElement2.getElementsByTagName("HostNames"); + Element hostNamesSequenceElement2 = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (hostNamesSequenceElement2 != null) { - org.w3c.dom.Element hostNamesElement = ((org.w3c.dom.Element) hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i3)); - webSiteInstance.getHostNames().add(hostNamesElement.getTextContent()); + for (int i3 = 0; i3 < hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i3 = i3 + 1) + { + org.w3c.dom.Element hostNamesElement = ((org.w3c.dom.Element) hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i3)); + webSiteInstance.getHostNames().add(hostNamesElement.getTextContent()); + } } - } - - NodeList elements13 = siteElement2.getElementsByTagName("LastModifiedTimeUtc"); - Element lastModifiedTimeUtcElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (lastModifiedTimeUtcElement != null) - { - Calendar lastModifiedTimeUtcInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(lastModifiedTimeUtcElement.getTextContent())); - lastModifiedTimeUtcInstance = calendar; - webSiteInstance.setLastModifiedTimeUtc(lastModifiedTimeUtcInstance); - } - - NodeList elements14 = siteElement2.getElementsByTagName("Name"); - Element nameElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance2; - nameInstance2 = nameElement2.getTextContent(); - webSiteInstance.setName(nameInstance2); - } - - NodeList elements15 = siteElement2.getElementsByTagName("Owner"); - Element ownerElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (ownerElement != null) - { - boolean isNil3 = false; - String nilAttribute4 = ownerElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute4 != null) + + NodeList elements13 = siteElement2.getElementsByTagName("LastModifiedTimeUtc"); + Element lastModifiedTimeUtcElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (lastModifiedTimeUtcElement != null) { - isNil3 = nilAttribute4 == "true"; + Calendar lastModifiedTimeUtcInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(lastModifiedTimeUtcElement.getTextContent())); + lastModifiedTimeUtcInstance = calendar; + webSiteInstance.setLastModifiedTimeUtc(lastModifiedTimeUtcInstance); } - if (isNil3 == false) + + NodeList elements14 = siteElement2.getElementsByTagName("Name"); + Element nameElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (nameElement2 != null) { - String ownerInstance; - ownerInstance = ownerElement.getTextContent(); - webSiteInstance.setOwner(ownerInstance); + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + webSiteInstance.setName(nameInstance2); } - } - - NodeList elements16 = siteElement2.getElementsByTagName("RepositorySiteName"); - Element repositorySiteNameElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (repositorySiteNameElement != null) - { - String repositorySiteNameInstance; - repositorySiteNameInstance = repositorySiteNameElement.getTextContent(); - webSiteInstance.setRepositorySiteName(repositorySiteNameInstance); - } - - NodeList elements17 = siteElement2.getElementsByTagName("RuntimeAvailabilityState"); - Element runtimeAvailabilityStateElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (runtimeAvailabilityStateElement2 != null) - { - WebSiteRuntimeAvailabilityState runtimeAvailabilityStateInstance; - runtimeAvailabilityStateInstance = WebSiteRuntimeAvailabilityState.valueOf(runtimeAvailabilityStateElement2.getTextContent()); - webSiteInstance.setRuntimeAvailabilityState(runtimeAvailabilityStateInstance); - } - - NodeList elements18 = siteElement2.getElementsByTagName("SSLCertificates"); - Element sSLCertificatesSequenceElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (sSLCertificatesSequenceElement2 != null) - { - for (int i4 = 0; i4 < sSLCertificatesSequenceElement2.getElementsByTagName("Certificate").getLength(); i4 = i4 + 1) + + NodeList elements15 = siteElement2.getElementsByTagName("Owner"); + Element ownerElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (ownerElement != null) { - org.w3c.dom.Element sSLCertificatesElement = ((org.w3c.dom.Element) sSLCertificatesSequenceElement2.getElementsByTagName("Certificate").item(i4)); - WebSite.WebSiteSslCertificate certificateInstance = new WebSite.WebSiteSslCertificate(); - webSiteInstance.getSslCertificates().add(certificateInstance); - - NodeList elements19 = sSLCertificatesElement.getElementsByTagName("ExpirationDate"); - Element expirationDateElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (expirationDateElement != null) - { - Calendar expirationDateInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(expirationDateElement.getTextContent())); - expirationDateInstance = calendar2; - certificateInstance.setExpirationDate(expirationDateInstance); - } - - NodeList elements20 = sSLCertificatesElement.getElementsByTagName("FriendlyName"); - Element friendlyNameElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (friendlyNameElement != null) - { - String friendlyNameInstance; - friendlyNameInstance = friendlyNameElement.getTextContent(); - certificateInstance.setFriendlyName(friendlyNameInstance); - } - - NodeList elements21 = sSLCertificatesElement.getElementsByTagName("HostNames"); - Element hostNamesSequenceElement3 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (hostNamesSequenceElement3 != null) - { - for (int i5 = 0; i5 < hostNamesSequenceElement3.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i5 = i5 + 1) - { - org.w3c.dom.Element hostNamesElement2 = ((org.w3c.dom.Element) hostNamesSequenceElement3.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i5)); - certificateInstance.getHostNames().add(hostNamesElement2.getTextContent()); - } - } - - NodeList elements22 = sSLCertificatesElement.getElementsByTagName("IssueDate"); - Element issueDateElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (issueDateElement != null) - { - Calendar issueDateInstance; - SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar3 = Calendar.getInstance(); - calendar3.setTime(simpleDateFormat3.parse(issueDateElement.getTextContent())); - issueDateInstance = calendar3; - certificateInstance.setIssueDate(issueDateInstance); - } - - NodeList elements23 = sSLCertificatesElement.getElementsByTagName("Issuer"); - Element issuerElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (issuerElement != null) - { - String issuerInstance; - issuerInstance = issuerElement.getTextContent(); - certificateInstance.setIssuer(issuerInstance); - } - - NodeList elements24 = sSLCertificatesElement.getElementsByTagName("Password"); - Element passwordElement2 = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (passwordElement2 != null) - { - String passwordInstance; - passwordInstance = passwordElement2.getTextContent(); - certificateInstance.setPassword(passwordInstance); - } - - NodeList elements25 = sSLCertificatesElement.getElementsByTagName("PfxBlob"); - Element pfxBlobElement2 = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (pfxBlobElement2 != null) + boolean isNil3 = false; + Attr nilAttribute4 = ownerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute4 != null) { - byte[] pfxBlobInstance; - pfxBlobInstance = pfxBlobElement2.getTextContent() != null ? Base64.decodeBase64(pfxBlobElement2.getTextContent().getBytes()) : null; - certificateInstance.setPfxBlob(pfxBlobInstance); + isNil3 = nilAttribute4.getValue() == "true"; } - - NodeList elements26 = sSLCertificatesElement.getElementsByTagName("SelfLink"); - Element selfLinkElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (selfLinkElement != null) + if (isNil3 == false) { - URI selfLinkInstance; - selfLinkInstance = new URI(selfLinkElement.getTextContent()); - certificateInstance.setSelfLinkUri(selfLinkInstance); + String ownerInstance; + ownerInstance = ownerElement.getTextContent(); + webSiteInstance.setOwner(ownerInstance); } - - NodeList elements27 = sSLCertificatesElement.getElementsByTagName("SiteName"); - Element siteNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; - if (siteNameElement != null) + } + + NodeList elements16 = siteElement2.getElementsByTagName("RepositorySiteName"); + Element repositorySiteNameElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (repositorySiteNameElement != null) + { + String repositorySiteNameInstance; + repositorySiteNameInstance = repositorySiteNameElement.getTextContent(); + webSiteInstance.setRepositorySiteName(repositorySiteNameInstance); + } + + NodeList elements17 = siteElement2.getElementsByTagName("RuntimeAvailabilityState"); + Element runtimeAvailabilityStateElement2 = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (runtimeAvailabilityStateElement2 != null) + { + WebSiteRuntimeAvailabilityState runtimeAvailabilityStateInstance; + runtimeAvailabilityStateInstance = WebSiteRuntimeAvailabilityState.valueOf(runtimeAvailabilityStateElement2.getTextContent()); + webSiteInstance.setRuntimeAvailabilityState(runtimeAvailabilityStateInstance); + } + + NodeList elements18 = siteElement2.getElementsByTagName("SSLCertificates"); + Element sSLCertificatesSequenceElement2 = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (sSLCertificatesSequenceElement2 != null) + { + boolean isNil4 = false; + Attr nilAttribute5 = sSLCertificatesSequenceElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute5 != null) { - String siteNameInstance; - siteNameInstance = siteNameElement.getTextContent(); - certificateInstance.setSiteName(siteNameInstance); + isNil4 = nilAttribute5.getValue() == "true"; } - - NodeList elements28 = sSLCertificatesElement.getElementsByTagName("SubjectName"); - Element subjectNameElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; - if (subjectNameElement != null) + if (isNil4 == false) { - String subjectNameInstance; - subjectNameInstance = subjectNameElement.getTextContent(); - certificateInstance.setSubjectName(subjectNameInstance); + for (int i4 = 0; i4 < sSLCertificatesSequenceElement2.getElementsByTagName("Certificate").getLength(); i4 = i4 + 1) + { + org.w3c.dom.Element sSLCertificatesElement = ((org.w3c.dom.Element) sSLCertificatesSequenceElement2.getElementsByTagName("Certificate").item(i4)); + WebSite.WebSiteSslCertificate certificateInstance = new WebSite.WebSiteSslCertificate(); + webSiteInstance.getSslCertificates().add(certificateInstance); + + NodeList elements19 = sSLCertificatesElement.getElementsByTagName("ExpirationDate"); + Element expirationDateElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (expirationDateElement != null && (expirationDateElement.getTextContent() != null && expirationDateElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil5 = false; + Attr nilAttribute6 = expirationDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute6 != null) + { + isNil5 = nilAttribute6.getValue() == "true"; + } + if (isNil5 == false) + { + Calendar expirationDateInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(expirationDateElement.getTextContent())); + expirationDateInstance = calendar2; + certificateInstance.setExpirationDate(expirationDateInstance); + } + } + + NodeList elements20 = sSLCertificatesElement.getElementsByTagName("FriendlyName"); + Element friendlyNameElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (friendlyNameElement != null) + { + boolean isNil6 = false; + Attr nilAttribute7 = friendlyNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute7 != null) + { + isNil6 = nilAttribute7.getValue() == "true"; + } + if (isNil6 == false) + { + String friendlyNameInstance; + friendlyNameInstance = friendlyNameElement.getTextContent(); + certificateInstance.setFriendlyName(friendlyNameInstance); + } + } + + NodeList elements21 = sSLCertificatesElement.getElementsByTagName("HostNames"); + Element hostNamesSequenceElement3 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (hostNamesSequenceElement3 != null) + { + boolean isNil7 = false; + Attr nilAttribute8 = hostNamesSequenceElement3.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute8 != null) + { + isNil7 = nilAttribute8.getValue() == "true"; + } + if (isNil7 == false) + { + for (int i5 = 0; i5 < hostNamesSequenceElement3.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i5 = i5 + 1) + { + org.w3c.dom.Element hostNamesElement2 = ((org.w3c.dom.Element) hostNamesSequenceElement3.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i5)); + certificateInstance.getHostNames().add(hostNamesElement2.getTextContent()); + } + } + } + + NodeList elements22 = sSLCertificatesElement.getElementsByTagName("IssueDate"); + Element issueDateElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (issueDateElement != null && (issueDateElement.getTextContent() != null && issueDateElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil8 = false; + Attr nilAttribute9 = issueDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute9 != null) + { + isNil8 = nilAttribute9.getValue() == "true"; + } + if (isNil8 == false) + { + Calendar issueDateInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(issueDateElement.getTextContent())); + issueDateInstance = calendar3; + certificateInstance.setIssueDate(issueDateInstance); + } + } + + NodeList elements23 = sSLCertificatesElement.getElementsByTagName("Issuer"); + Element issuerElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (issuerElement != null) + { + boolean isNil9 = false; + Attr nilAttribute10 = issuerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute10 != null) + { + isNil9 = nilAttribute10.getValue() == "true"; + } + if (isNil9 == false) + { + String issuerInstance; + issuerInstance = issuerElement.getTextContent(); + certificateInstance.setIssuer(issuerInstance); + } + } + + NodeList elements24 = sSLCertificatesElement.getElementsByTagName("Password"); + Element passwordElement2 = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (passwordElement2 != null) + { + boolean isNil10 = false; + Attr nilAttribute11 = passwordElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute11 != null) + { + isNil10 = nilAttribute11.getValue() == "true"; + } + if (isNil10 == false) + { + String passwordInstance; + passwordInstance = passwordElement2.getTextContent(); + certificateInstance.setPassword(passwordInstance); + } + } + + NodeList elements25 = sSLCertificatesElement.getElementsByTagName("PfxBlob"); + Element pfxBlobElement2 = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (pfxBlobElement2 != null) + { + boolean isNil11 = false; + Attr nilAttribute12 = pfxBlobElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute12 != null) + { + isNil11 = nilAttribute12.getValue() == "true"; + } + if (isNil11 == false) + { + byte[] pfxBlobInstance; + pfxBlobInstance = pfxBlobElement2.getTextContent() != null ? Base64.decodeBase64(pfxBlobElement2.getTextContent().getBytes()) : null; + certificateInstance.setPfxBlob(pfxBlobInstance); + } + } + + NodeList elements26 = sSLCertificatesElement.getElementsByTagName("SelfLink"); + Element selfLinkElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (selfLinkElement != null) + { + boolean isNil12 = false; + Attr nilAttribute13 = selfLinkElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute13 != null) + { + isNil12 = nilAttribute13.getValue() == "true"; + } + if (isNil12 == false) + { + URI selfLinkInstance; + selfLinkInstance = new URI(selfLinkElement.getTextContent()); + certificateInstance.setSelfLinkUri(selfLinkInstance); + } + } + + NodeList elements27 = sSLCertificatesElement.getElementsByTagName("SiteName"); + Element siteNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; + if (siteNameElement != null) + { + boolean isNil13 = false; + Attr nilAttribute14 = siteNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute14 != null) + { + isNil13 = nilAttribute14.getValue() == "true"; + } + if (isNil13 == false) + { + String siteNameInstance; + siteNameInstance = siteNameElement.getTextContent(); + certificateInstance.setSiteName(siteNameInstance); + } + } + + NodeList elements28 = sSLCertificatesElement.getElementsByTagName("SubjectName"); + Element subjectNameElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; + if (subjectNameElement != null) + { + boolean isNil14 = false; + Attr nilAttribute15 = subjectNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute15 != null) + { + isNil14 = nilAttribute15.getValue() == "true"; + } + if (isNil14 == false) + { + String subjectNameInstance; + subjectNameInstance = subjectNameElement.getTextContent(); + certificateInstance.setSubjectName(subjectNameInstance); + } + } + + NodeList elements29 = sSLCertificatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement4 = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; + if (thumbprintElement4 != null) + { + boolean isNil15 = false; + Attr nilAttribute16 = thumbprintElement4.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute16 != null) + { + isNil15 = nilAttribute16.getValue() == "true"; + } + if (isNil15 == false) + { + String thumbprintInstance2; + thumbprintInstance2 = thumbprintElement4.getTextContent(); + certificateInstance.setThumbprint(thumbprintInstance2); + } + } + + NodeList elements30 = sSLCertificatesElement.getElementsByTagName("ToDelete"); + Element toDeleteElement2 = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; + if (toDeleteElement2 != null && (toDeleteElement2.getTextContent() != null && toDeleteElement2.getTextContent().isEmpty() != true) == false) + { + boolean isNil16 = false; + Attr nilAttribute17 = toDeleteElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute17 != null) + { + isNil16 = nilAttribute17.getValue() == "true"; + } + if (isNil16 == false) + { + boolean toDeleteInstance; + toDeleteInstance = Boolean.parseBoolean(toDeleteElement2.getTextContent()); + certificateInstance.setIsToBeDeleted(toDeleteInstance); + } + } + + NodeList elements31 = sSLCertificatesElement.getElementsByTagName("Valid"); + Element validElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; + if (validElement != null && (validElement.getTextContent() != null && validElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil17 = false; + Attr nilAttribute18 = validElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute18 != null) + { + isNil17 = nilAttribute18.getValue() == "true"; + } + if (isNil17 == false) + { + boolean validInstance; + validInstance = Boolean.parseBoolean(validElement.getTextContent()); + certificateInstance.setIsValid(validInstance); + } + } + } } + } + + NodeList elements32 = siteElement2.getElementsByTagName("SelfLink"); + Element selfLinkElement2 = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; + if (selfLinkElement2 != null) + { + URI selfLinkInstance2; + selfLinkInstance2 = new URI(selfLinkElement2.getTextContent()); + webSiteInstance.setUri(selfLinkInstance2); + } + + NodeList elements33 = siteElement2.getElementsByTagName("ServerFarm"); + Element serverFarmElement2 = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; + if (serverFarmElement2 != null) + { + String serverFarmInstance; + serverFarmInstance = serverFarmElement2.getTextContent(); + webSiteInstance.setServerFarm(serverFarmInstance); + } + + NodeList elements34 = siteElement2.getElementsByTagName("SiteMode"); + Element siteModeElement2 = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; + if (siteModeElement2 != null) + { + WebSiteMode siteModeInstance; + siteModeInstance = WebSiteMode.valueOf(siteModeElement2.getTextContent()); + webSiteInstance.setSiteMode(siteModeInstance); + } + + NodeList elements35 = siteElement2.getElementsByTagName("SiteProperties"); + Element sitePropertiesElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; + if (sitePropertiesElement != null) + { + WebSite.WebSiteProperties sitePropertiesInstance = new WebSite.WebSiteProperties(); + webSiteInstance.setSiteProperties(sitePropertiesInstance); - NodeList elements29 = sSLCertificatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement4 = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; - if (thumbprintElement4 != null) + NodeList elements36 = sitePropertiesElement.getElementsByTagName("AppSettings"); + Element appSettingsSequenceElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; + if (appSettingsSequenceElement != null) { - String thumbprintInstance2; - thumbprintInstance2 = thumbprintElement4.getTextContent(); - certificateInstance.setThumbprint(thumbprintInstance2); + for (int i6 = 0; i6 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i6 = i6 + 1) + { + org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i6)); + NodeList elements37 = appSettingsElement.getElementsByTagName("Name"); + String appSettingsKey = elements37.getLength() > 0 ? ((org.w3c.dom.Element) elements37.item(0)).getTextContent() : null; + NodeList elements38 = appSettingsElement.getElementsByTagName("Value"); + String appSettingsValue = elements38.getLength() > 0 ? ((org.w3c.dom.Element) elements38.item(0)).getTextContent() : null; + sitePropertiesInstance.getAppSettings().put(appSettingsKey, appSettingsValue); + } } - NodeList elements30 = sSLCertificatesElement.getElementsByTagName("ToDelete"); - Element toDeleteElement2 = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; - if (toDeleteElement2 != null) + NodeList elements39 = sitePropertiesElement.getElementsByTagName("Metadata"); + Element metadataSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; + if (metadataSequenceElement != null) { - boolean toDeleteInstance; - toDeleteInstance = Boolean.parseBoolean(toDeleteElement2.getTextContent()); - certificateInstance.setIsToBeDeleted(toDeleteInstance); + for (int i7 = 0; i7 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i7 = i7 + 1) + { + org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i7)); + NodeList elements40 = metadataElement.getElementsByTagName("Name"); + String metadataKey = elements40.getLength() > 0 ? ((org.w3c.dom.Element) elements40.item(0)).getTextContent() : null; + NodeList elements41 = metadataElement.getElementsByTagName("Value"); + String metadataValue = elements41.getLength() > 0 ? ((org.w3c.dom.Element) elements41.item(0)).getTextContent() : null; + sitePropertiesInstance.getMetadata().put(metadataKey, metadataValue); + } } - NodeList elements31 = sSLCertificatesElement.getElementsByTagName("Valid"); - Element validElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; - if (validElement != null) + NodeList elements42 = sitePropertiesElement.getElementsByTagName("Properties"); + Element propertiesSequenceElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; + if (propertiesSequenceElement != null) { - boolean validInstance; - validInstance = Boolean.parseBoolean(validElement.getTextContent()); - certificateInstance.setIsValid(validInstance); + for (int i8 = 0; i8 < propertiesSequenceElement.getElementsByTagName("NameValuePair").getLength(); i8 = i8 + 1) + { + org.w3c.dom.Element propertiesElement = ((org.w3c.dom.Element) propertiesSequenceElement.getElementsByTagName("NameValuePair").item(i8)); + NodeList elements43 = propertiesElement.getElementsByTagName("Name"); + String propertiesKey = elements43.getLength() > 0 ? ((org.w3c.dom.Element) elements43.item(0)).getTextContent() : null; + NodeList elements44 = propertiesElement.getElementsByTagName("Value"); + String propertiesValue = elements44.getLength() > 0 ? ((org.w3c.dom.Element) elements44.item(0)).getTextContent() : null; + sitePropertiesInstance.getProperties().put(propertiesKey, propertiesValue); + } } } - } - - NodeList elements32 = siteElement2.getElementsByTagName("SelfLink"); - Element selfLinkElement2 = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; - if (selfLinkElement2 != null) - { - URI selfLinkInstance2; - selfLinkInstance2 = new URI(selfLinkElement2.getTextContent()); - webSiteInstance.setUri(selfLinkInstance2); - } - - NodeList elements33 = siteElement2.getElementsByTagName("ServerFarm"); - Element serverFarmElement2 = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; - if (serverFarmElement2 != null) - { - String serverFarmInstance; - serverFarmInstance = serverFarmElement2.getTextContent(); - webSiteInstance.setServerFarm(serverFarmInstance); - } - - NodeList elements34 = siteElement2.getElementsByTagName("SiteMode"); - Element siteModeElement2 = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; - if (siteModeElement2 != null) - { - WebSiteMode siteModeInstance; - siteModeInstance = WebSiteMode.valueOf(siteModeElement2.getTextContent()); - webSiteInstance.setSiteMode(siteModeInstance); - } - - NodeList elements35 = siteElement2.getElementsByTagName("SiteProperties"); - Element sitePropertiesElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; - if (sitePropertiesElement != null) - { - WebSite.WebSiteProperties sitePropertiesInstance = new WebSite.WebSiteProperties(); - webSiteInstance.setSiteProperties(sitePropertiesInstance); - NodeList elements36 = sitePropertiesElement.getElementsByTagName("AppSettings"); - Element appSettingsSequenceElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; - if (appSettingsSequenceElement != null) + NodeList elements45 = siteElement2.getElementsByTagName("State"); + Element stateElement2 = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; + if (stateElement2 != null) { - for (int i6 = 0; i6 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i6 = i6 + 1) - { - org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i6)); - NodeList elements37 = appSettingsElement.getElementsByTagName("Name"); - String appSettingsKey = elements37.getLength() > 0 ? ((org.w3c.dom.Element) elements37.item(0)).getTextContent() : null; - NodeList elements38 = appSettingsElement.getElementsByTagName("Value"); - String appSettingsValue = elements38.getLength() > 0 ? ((org.w3c.dom.Element) elements38.item(0)).getTextContent() : null; - sitePropertiesInstance.getAppSettings().put(appSettingsKey, appSettingsValue); - } + WebSiteState stateInstance; + stateInstance = WebSiteState.valueOf(stateElement2.getTextContent()); + webSiteInstance.setState(stateInstance); } - NodeList elements39 = sitePropertiesElement.getElementsByTagName("Metadata"); - Element metadataSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; - if (metadataSequenceElement != null) + NodeList elements46 = siteElement2.getElementsByTagName("UsageState"); + Element usageStateElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; + if (usageStateElement != null) { - for (int i7 = 0; i7 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i7 = i7 + 1) - { - org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i7)); - NodeList elements40 = metadataElement.getElementsByTagName("Name"); - String metadataKey = elements40.getLength() > 0 ? ((org.w3c.dom.Element) elements40.item(0)).getTextContent() : null; - NodeList elements41 = metadataElement.getElementsByTagName("Value"); - String metadataValue = elements41.getLength() > 0 ? ((org.w3c.dom.Element) elements41.item(0)).getTextContent() : null; - sitePropertiesInstance.getMetadata().put(metadataKey, metadataValue); - } + WebSiteUsageState usageStateInstance; + usageStateInstance = WebSiteUsageState.valueOf(usageStateElement.getTextContent()); + webSiteInstance.setUsageState(usageStateInstance); } - NodeList elements42 = sitePropertiesElement.getElementsByTagName("Properties"); - Element propertiesSequenceElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; - if (propertiesSequenceElement != null) + NodeList elements47 = siteElement2.getElementsByTagName("WebSpace"); + Element webSpaceElement = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; + if (webSpaceElement != null) { - for (int i8 = 0; i8 < propertiesSequenceElement.getElementsByTagName("NameValuePair").getLength(); i8 = i8 + 1) - { - org.w3c.dom.Element propertiesElement = ((org.w3c.dom.Element) propertiesSequenceElement.getElementsByTagName("NameValuePair").item(i8)); - NodeList elements43 = propertiesElement.getElementsByTagName("Name"); - String propertiesKey = elements43.getLength() > 0 ? ((org.w3c.dom.Element) elements43.item(0)).getTextContent() : null; - NodeList elements44 = propertiesElement.getElementsByTagName("Value"); - String propertiesValue = elements44.getLength() > 0 ? ((org.w3c.dom.Element) elements44.item(0)).getTextContent() : null; - sitePropertiesInstance.getProperties().put(propertiesKey, propertiesValue); - } + String webSpaceInstance; + webSpaceInstance = webSpaceElement.getTextContent(); + webSiteInstance.setWebSpace(webSpaceInstance); } } - NodeList elements45 = siteElement2.getElementsByTagName("State"); - Element stateElement2 = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; - if (stateElement2 != null) - { - WebSiteState stateInstance; - stateInstance = WebSiteState.valueOf(stateElement2.getTextContent()); - webSiteInstance.setState(stateInstance); - } - - NodeList elements46 = siteElement2.getElementsByTagName("UsageState"); - Element usageStateElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; - if (usageStateElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - WebSiteUsageState usageStateInstance; - usageStateInstance = WebSiteUsageState.valueOf(usageStateElement.getTextContent()); - webSiteInstance.setUsageState(usageStateInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements47 = siteElement2.getElementsByTagName("WebSpace"); - Element webSpaceElement = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; - if (webSpaceElement != null) + if (shouldTrace) { - String webSpaceInstance; - webSpaceInstance = webSpaceElement.getTextContent(); - webSiteInstance.setWebSpace(webSpaceInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -3935,11 +5169,21 @@ public OperationResponse call() throws Exception * @param webSpaceName The name of the web space. * @param webSiteName The name of the web site. * @param parameters The Update Web Site Configuration parameters. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return A standard service response including an HTTP status code and * request ID. */ @Override - public OperationResponse updateConfiguration(String webSpaceName, String webSiteName, WebSiteUpdateConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException + public OperationResponse updateConfiguration(String webSpaceName, String webSiteName, WebSiteUpdateConfigurationParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException { // Validate if (webSpaceName == null) @@ -4236,39 +5480,49 @@ public OperationResponse updateConfiguration(String webSpaceName, String webSite // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - OperationResponse result = null; - result = new OperationResponse(); - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + OperationResponse result = null; + result = new OperationResponse(); + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSpaceOperations.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSpaceOperations.java index f43367905edf4..3e504f461305f 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSpaceOperations.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSpaceOperations.java @@ -34,12 +34,10 @@ import com.microsoft.windowsazure.management.websites.models.WebSpacesListResponse; import com.microsoft.windowsazure.management.websites.models.WebSpacesListWebSitesResponse; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.text.ParseException; import java.util.concurrent.Future; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; @@ -55,9 +53,19 @@ public interface WebSpaceOperations * @param password The user password. * @param parameters Parameters supplied to the Create Publishing User * operation. + * @throws ParserConfigurationException Thrown if there was an error + * configuring the parser for the response body. + * @throws SAXException Thrown if there was an error parsing the response + * body. + * @throws TransformerException Thrown if there was an error creating the + * DOM transformer. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. * @return The Create Publishing User operation response. */ - WebSpacesCreatePublishingUserResponse createPublishingUser(String username, String password, WebSpacesCreatePublishingUserParameters parameters) throws ParserConfigurationException, SAXException, TransformerConfigurationException, TransformerException, UnsupportedEncodingException, IOException, ServiceException; + WebSpacesCreatePublishingUserResponse createPublishingUser(String username, String password, WebSpacesCreatePublishingUserParameters parameters) throws ParserConfigurationException, SAXException, TransformerException, IOException, ServiceException; /** * Creates a source control user allowed to publish to this web space. @@ -77,6 +85,18 @@ public interface WebSpaceOperations * more information) * * @param webSpaceName The name of the web space. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Web Space Details operation response. */ WebSpacesGetResponse get(String webSpaceName) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException, URISyntaxException; @@ -95,6 +115,14 @@ public interface WebSpaceOperations /** * Get the dns suffix for this subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Get DNS Suffix operation response. */ WebSpacesGetDnsSuffixResponse getDnsSuffix() throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -112,6 +140,14 @@ public interface WebSpaceOperations * http://msdn.microsoft.com/en-us/library/windowsazure/dn166961.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Web Spaces operation response. */ WebSpacesListResponse list() throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -129,6 +165,14 @@ public interface WebSpaceOperations /** * Get the available geo regions for this webspace. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Get DNS Suffix operation response. */ WebSpacesListGeoRegionsResponse listGeoRegions() throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -143,6 +187,14 @@ public interface WebSpaceOperations /** * Get the source control users allowed to publish to this web space. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Publishing Users operation response. */ WebSpacesListPublishingUsersResponse listPublishingUsers() throws IOException, ServiceException, ParserConfigurationException, SAXException; @@ -162,6 +214,18 @@ public interface WebSpaceOperations * * @param webSpaceName The name of the web space. * @param parameters Additional parameters. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The List Web Sites operation response. */ WebSpacesListWebSitesResponse listWebSites(String webSpaceName, WebSiteListParameters parameters) throws IOException, ServiceException, ParserConfigurationException, SAXException, ParseException, URISyntaxException; diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSpaceOperationsImpl.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSpaceOperationsImpl.java index 7ba61d09ff2f1..d892a383f10e5 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSpaceOperationsImpl.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/WebSpaceOperationsImpl.java @@ -49,11 +49,9 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.io.UnsupportedEncodingException; import java.net.InetAddress; import java.net.URI; import java.net.URISyntaxException; -import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -64,7 +62,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; @@ -75,6 +72,7 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.StringEntity; +import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -100,6 +98,7 @@ public class WebSpaceOperationsImpl implements ServiceOperations 0 ? ((Element) elements.item(0)) : null; - if (userElement2 != null) - { - NodeList elements2 = userElement2.getElementsByTagName("Name"); - Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (nameElement2 != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_CREATED) { - String nameInstance; - nameInstance = nameElement2.getTextContent(); - result.setName(nameInstance); + ServiceException ex = ServiceException.createFromXml(httpRequest, requestContent, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; } - NodeList elements3 = userElement2.getElementsByTagName("PublishingPassword"); - Element publishingPasswordElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (publishingPasswordElement2 != null) + // Create Result + WebSpacesCreatePublishingUserResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSpacesCreatePublishingUserResponse(); + DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder(); + Document responseDoc = documentBuilder2.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("User"); + Element userElement2 = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (userElement2 != null) { - String publishingPasswordInstance; - publishingPasswordInstance = publishingPasswordElement2.getTextContent(); - result.setPublishingPassword(publishingPasswordInstance); + NodeList elements2 = userElement2.getElementsByTagName("Name"); + Element nameElement2 = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (nameElement2 != null) + { + String nameInstance; + nameInstance = nameElement2.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements3 = userElement2.getElementsByTagName("PublishingPassword"); + Element publishingPasswordElement2 = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (publishingPasswordElement2 != null) + { + String publishingPasswordInstance; + publishingPasswordInstance = publishingPasswordElement2.getTextContent(); + result.setPublishingPassword(publishingPasswordInstance); + } + + NodeList elements4 = userElement2.getElementsByTagName("PublishingUserName"); + Element publishingUserNameElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (publishingUserNameElement2 != null) + { + String publishingUserNameInstance; + publishingUserNameInstance = publishingUserNameElement2.getTextContent(); + result.setPublishingUserName(publishingUserNameInstance); + } } - NodeList elements4 = userElement2.getElementsByTagName("PublishingUserName"); - Element publishingUserNameElement2 = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (publishingUserNameElement2 != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - String publishingUserNameInstance; - publishingUserNameInstance = publishingUserNameElement2.getTextContent(); - result.setPublishingUserName(publishingUserNameInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } + + if (shouldTrace) + { + CloudTracing.exit(invocationId, result); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -325,6 +344,18 @@ public WebSpacesGetResponse call() throws Exception * more information) * * @param webSpaceName The name of the web space. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The Get Web Space Details operation response. */ @Override @@ -358,159 +389,169 @@ public WebSpacesGetResponse get(String webSpaceName) throws IOException, Service // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - WebSpacesGetResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSpacesGetResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("WebSpaces"); - Element webSpacesElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (webSpacesElement != null) - { - NodeList elements2 = webSpacesElement.getElementsByTagName("AvailabilityState"); - Element availabilityStateElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (availabilityStateElement != null) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - WebSpaceAvailabilityState availabilityStateInstance; - availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); - result.setAvailabilityState(availabilityStateInstance); + CloudTracing.receiveResponse(invocationId, httpResponse); } - - NodeList elements3 = webSpacesElement.getElementsByTagName("CurrentNumberOfWorkers"); - Element currentNumberOfWorkersElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (currentNumberOfWorkersElement != null && (currentNumberOfWorkersElement.getTextContent() != null && currentNumberOfWorkersElement.getTextContent().isEmpty() != true) == false) + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) { - boolean isNil = false; - String nilAttribute = currentNumberOfWorkersElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) - { - isNil = nilAttribute == "true"; - } - if (isNil == false) + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - int currentNumberOfWorkersInstance; - currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement.getTextContent()); - result.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + CloudTracing.error(invocationId, ex); } + throw ex; } - NodeList elements4 = webSpacesElement.getElementsByTagName("CurrentWorkerSize"); - Element currentWorkerSizeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (currentWorkerSizeElement != null && (currentWorkerSizeElement.getTextContent() != null && currentWorkerSizeElement.getTextContent().isEmpty() != true) == false) + // Create Result + WebSpacesGetResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSpacesGetResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("WebSpaces"); + Element webSpacesElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (webSpacesElement != null) { - boolean isNil2 = false; - String nilAttribute2 = currentWorkerSizeElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute2 != null) + NodeList elements2 = webSpacesElement.getElementsByTagName("AvailabilityState"); + Element availabilityStateElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (availabilityStateElement != null) + { + WebSpaceAvailabilityState availabilityStateInstance; + availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); + result.setAvailabilityState(availabilityStateInstance); + } + + NodeList elements3 = webSpacesElement.getElementsByTagName("CurrentNumberOfWorkers"); + Element currentNumberOfWorkersElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (currentNumberOfWorkersElement != null && (currentNumberOfWorkersElement.getTextContent() != null && currentNumberOfWorkersElement.getTextContent().isEmpty() != true) == false) { - isNil2 = nilAttribute2 == "true"; + boolean isNil = false; + Attr nilAttribute = currentNumberOfWorkersElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + int currentNumberOfWorkersInstance; + currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement.getTextContent()); + result.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + } } - if (isNil2 == false) + + NodeList elements4 = webSpacesElement.getElementsByTagName("CurrentWorkerSize"); + Element currentWorkerSizeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (currentWorkerSizeElement != null && (currentWorkerSizeElement.getTextContent() != null && currentWorkerSizeElement.getTextContent().isEmpty() != true) == false) { - WebSpaceWorkerSize currentWorkerSizeInstance; - currentWorkerSizeInstance = WebSpaceWorkerSize.valueOf(currentWorkerSizeElement.getTextContent()); - result.setCurrentWorkerSize(currentWorkerSizeInstance); + boolean isNil2 = false; + Attr nilAttribute2 = currentWorkerSizeElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil2 = nilAttribute2.getValue() == "true"; + } + if (isNil2 == false) + { + WebSpaceWorkerSize currentWorkerSizeInstance; + currentWorkerSizeInstance = WebSpaceWorkerSize.valueOf(currentWorkerSizeElement.getTextContent()); + result.setCurrentWorkerSize(currentWorkerSizeInstance); + } + } + + NodeList elements5 = webSpacesElement.getElementsByTagName("GeoLocation"); + Element geoLocationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (geoLocationElement != null) + { + String geoLocationInstance; + geoLocationInstance = geoLocationElement.getTextContent(); + result.setGeoLocation(geoLocationInstance); + } + + NodeList elements6 = webSpacesElement.getElementsByTagName("GeoRegion"); + Element geoRegionElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (geoRegionElement != null) + { + String geoRegionInstance; + geoRegionInstance = geoRegionElement.getTextContent(); + result.setGeoRegion(geoRegionInstance); + } + + NodeList elements7 = webSpacesElement.getElementsByTagName("Name"); + Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + result.setName(nameInstance); + } + + NodeList elements8 = webSpacesElement.getElementsByTagName("Plan"); + Element planElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (planElement != null) + { + String planInstance; + planInstance = planElement.getTextContent(); + result.setPlan(planInstance); + } + + NodeList elements9 = webSpacesElement.getElementsByTagName("Status"); + Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (statusElement != null) + { + WebSpaceStatus statusInstance; + statusInstance = WebSpaceStatus.valueOf(statusElement.getTextContent()); + result.setStatus(statusInstance); + } + + NodeList elements10 = webSpacesElement.getElementsByTagName("Subscription"); + Element subscriptionElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (subscriptionElement != null) + { + String subscriptionInstance; + subscriptionInstance = subscriptionElement.getTextContent(); + result.setSubscription(subscriptionInstance); + } + + NodeList elements11 = webSpacesElement.getElementsByTagName("WorkerSize"); + Element workerSizeElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (workerSizeElement != null && (workerSizeElement.getTextContent() != null && workerSizeElement.getTextContent().isEmpty() != true) == false) + { + WebSpaceWorkerSize workerSizeInstance; + workerSizeInstance = WebSpaceWorkerSize.valueOf(workerSizeElement.getTextContent()); + result.setWorkerSize(workerSizeInstance); } } - NodeList elements5 = webSpacesElement.getElementsByTagName("GeoLocation"); - Element geoLocationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (geoLocationElement != null) - { - String geoLocationInstance; - geoLocationInstance = geoLocationElement.getTextContent(); - result.setGeoLocation(geoLocationInstance); - } - - NodeList elements6 = webSpacesElement.getElementsByTagName("GeoRegion"); - Element geoRegionElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (geoRegionElement != null) - { - String geoRegionInstance; - geoRegionInstance = geoRegionElement.getTextContent(); - result.setGeoRegion(geoRegionInstance); - } - - NodeList elements7 = webSpacesElement.getElementsByTagName("Name"); - Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - result.setName(nameInstance); - } - - NodeList elements8 = webSpacesElement.getElementsByTagName("Plan"); - Element planElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (planElement != null) - { - String planInstance; - planInstance = planElement.getTextContent(); - result.setPlan(planInstance); - } - - NodeList elements9 = webSpacesElement.getElementsByTagName("Status"); - Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (statusElement != null) - { - WebSpaceStatus statusInstance; - statusInstance = WebSpaceStatus.valueOf(statusElement.getTextContent()); - result.setStatus(statusInstance); - } - - NodeList elements10 = webSpacesElement.getElementsByTagName("Subscription"); - Element subscriptionElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (subscriptionElement != null) + result.setStatusCode(statusCode); + if (httpResponse.getHeaders("x-ms-request-id").length > 0) { - String subscriptionInstance; - subscriptionInstance = subscriptionElement.getTextContent(); - result.setSubscription(subscriptionInstance); + result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); } - NodeList elements11 = webSpacesElement.getElementsByTagName("WorkerSize"); - Element workerSizeElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (workerSizeElement != null && (workerSizeElement.getTextContent() != null && workerSizeElement.getTextContent().isEmpty() != true) == false) + if (shouldTrace) { - WebSpaceWorkerSize workerSizeInstance; - workerSizeInstance = WebSpaceWorkerSize.valueOf(workerSizeElement.getTextContent()); - result.setWorkerSize(workerSizeInstance); + CloudTracing.exit(invocationId, result); } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -533,6 +574,14 @@ public WebSpacesGetDnsSuffixResponse call() throws Exception /** * Get the dns suffix for this subscription. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Get DNS Suffix operation response. */ @Override @@ -561,53 +610,63 @@ public WebSpacesGetDnsSuffixResponse getDnsSuffix() throws IOException, ServiceE // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - WebSpacesGetDnsSuffixResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSpacesGetDnsSuffixResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/", "string"); - Element stringElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (stringElement != null) - { - result.setDnsSuffix(stringElement.getTextContent()); - } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) + { + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + WebSpacesGetDnsSuffixResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSpacesGetDnsSuffixResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/", "string"); + Element stringElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (stringElement != null) + { + result.setDnsSuffix(stringElement.getTextContent()); + } + + 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); + } + return result; } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -636,6 +695,14 @@ public WebSpacesListResponse call() throws Exception * http://msdn.microsoft.com/en-us/library/windowsazure/dn166961.aspx for * more information) * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Web Spaces operation response. */ @Override @@ -664,166 +731,176 @@ public WebSpacesListResponse list() throws IOException, ServiceException, Parser // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - WebSpacesListResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSpacesListResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("WebSpaces"); - Element webSpacesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (webSpacesSequenceElement != null) - { - for (int i1 = 0; i1 < webSpacesSequenceElement.getElementsByTagName("WebSpace").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element webSpacesElement = ((org.w3c.dom.Element) webSpacesSequenceElement.getElementsByTagName("WebSpace").item(i1)); - WebSpacesListResponse.WebSpace webSpaceInstance = new WebSpacesListResponse.WebSpace(); - result.getWebSpaces().add(webSpaceInstance); - - NodeList elements2 = webSpacesElement.getElementsByTagName("AvailabilityState"); - Element availabilityStateElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (availabilityStateElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - WebSpaceAvailabilityState availabilityStateInstance; - availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); - webSpaceInstance.setAvailabilityState(availabilityStateInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements3 = webSpacesElement.getElementsByTagName("CurrentNumberOfWorkers"); - Element currentNumberOfWorkersElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (currentNumberOfWorkersElement != null && (currentNumberOfWorkersElement.getTextContent() != null && currentNumberOfWorkersElement.getTextContent().isEmpty() != true) == false) + throw ex; + } + + // Create Result + WebSpacesListResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSpacesListResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("WebSpaces"); + Element webSpacesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (webSpacesSequenceElement != null) + { + for (int i1 = 0; i1 < webSpacesSequenceElement.getElementsByTagName("WebSpace").getLength(); i1 = i1 + 1) { - boolean isNil = false; - String nilAttribute = currentNumberOfWorkersElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) + org.w3c.dom.Element webSpacesElement = ((org.w3c.dom.Element) webSpacesSequenceElement.getElementsByTagName("WebSpace").item(i1)); + WebSpacesListResponse.WebSpace webSpaceInstance = new WebSpacesListResponse.WebSpace(); + result.getWebSpaces().add(webSpaceInstance); + + NodeList elements2 = webSpacesElement.getElementsByTagName("AvailabilityState"); + Element availabilityStateElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (availabilityStateElement != null) { - isNil = nilAttribute == "true"; + WebSpaceAvailabilityState availabilityStateInstance; + availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); + webSpaceInstance.setAvailabilityState(availabilityStateInstance); } - if (isNil == false) + + NodeList elements3 = webSpacesElement.getElementsByTagName("CurrentNumberOfWorkers"); + Element currentNumberOfWorkersElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (currentNumberOfWorkersElement != null && (currentNumberOfWorkersElement.getTextContent() != null && currentNumberOfWorkersElement.getTextContent().isEmpty() != true) == false) { - int currentNumberOfWorkersInstance; - currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement.getTextContent()); - webSpaceInstance.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + boolean isNil = false; + Attr nilAttribute = currentNumberOfWorkersElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + int currentNumberOfWorkersInstance; + currentNumberOfWorkersInstance = Integer.parseInt(currentNumberOfWorkersElement.getTextContent()); + webSpaceInstance.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance); + } } - } - - NodeList elements4 = webSpacesElement.getElementsByTagName("CurrentWorkerSize"); - Element currentWorkerSizeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (currentWorkerSizeElement != null && (currentWorkerSizeElement.getTextContent() != null && currentWorkerSizeElement.getTextContent().isEmpty() != true) == false) - { - boolean isNil2 = false; - String nilAttribute2 = currentWorkerSizeElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute2 != null) + + NodeList elements4 = webSpacesElement.getElementsByTagName("CurrentWorkerSize"); + Element currentWorkerSizeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (currentWorkerSizeElement != null && (currentWorkerSizeElement.getTextContent() != null && currentWorkerSizeElement.getTextContent().isEmpty() != true) == false) { - isNil2 = nilAttribute2 == "true"; + boolean isNil2 = false; + Attr nilAttribute2 = currentWorkerSizeElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil2 = nilAttribute2.getValue() == "true"; + } + if (isNil2 == false) + { + WebSpaceWorkerSize currentWorkerSizeInstance; + currentWorkerSizeInstance = WebSpaceWorkerSize.valueOf(currentWorkerSizeElement.getTextContent()); + webSpaceInstance.setCurrentWorkerSize(currentWorkerSizeInstance); + } } - if (isNil2 == false) + + NodeList elements5 = webSpacesElement.getElementsByTagName("GeoLocation"); + Element geoLocationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (geoLocationElement != null) { - WebSpaceWorkerSize currentWorkerSizeInstance; - currentWorkerSizeInstance = WebSpaceWorkerSize.valueOf(currentWorkerSizeElement.getTextContent()); - webSpaceInstance.setCurrentWorkerSize(currentWorkerSizeInstance); + String geoLocationInstance; + geoLocationInstance = geoLocationElement.getTextContent(); + webSpaceInstance.setGeoLocation(geoLocationInstance); + } + + NodeList elements6 = webSpacesElement.getElementsByTagName("GeoRegion"); + Element geoRegionElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (geoRegionElement != null) + { + String geoRegionInstance; + geoRegionInstance = geoRegionElement.getTextContent(); + webSpaceInstance.setGeoRegion(geoRegionInstance); + } + + NodeList elements7 = webSpacesElement.getElementsByTagName("Name"); + Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (nameElement != null) + { + String nameInstance; + nameInstance = nameElement.getTextContent(); + webSpaceInstance.setName(nameInstance); + } + + NodeList elements8 = webSpacesElement.getElementsByTagName("Plan"); + Element planElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (planElement != null) + { + String planInstance; + planInstance = planElement.getTextContent(); + webSpaceInstance.setPlan(planInstance); + } + + NodeList elements9 = webSpacesElement.getElementsByTagName("Status"); + Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (statusElement != null) + { + WebSpaceStatus statusInstance; + statusInstance = WebSpaceStatus.valueOf(statusElement.getTextContent()); + webSpaceInstance.setStatus(statusInstance); + } + + NodeList elements10 = webSpacesElement.getElementsByTagName("Subscription"); + Element subscriptionElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (subscriptionElement != null) + { + String subscriptionInstance; + subscriptionInstance = subscriptionElement.getTextContent(); + webSpaceInstance.setSubscription(subscriptionInstance); + } + + NodeList elements11 = webSpacesElement.getElementsByTagName("WorkerSize"); + Element workerSizeElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (workerSizeElement != null && (workerSizeElement.getTextContent() != null && workerSizeElement.getTextContent().isEmpty() != true) == false) + { + WebSpaceWorkerSize workerSizeInstance; + workerSizeInstance = WebSpaceWorkerSize.valueOf(workerSizeElement.getTextContent()); + webSpaceInstance.setWorkerSize(workerSizeInstance); } - } - - NodeList elements5 = webSpacesElement.getElementsByTagName("GeoLocation"); - Element geoLocationElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (geoLocationElement != null) - { - String geoLocationInstance; - geoLocationInstance = geoLocationElement.getTextContent(); - webSpaceInstance.setGeoLocation(geoLocationInstance); - } - - NodeList elements6 = webSpacesElement.getElementsByTagName("GeoRegion"); - Element geoRegionElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (geoRegionElement != null) - { - String geoRegionInstance; - geoRegionInstance = geoRegionElement.getTextContent(); - webSpaceInstance.setGeoRegion(geoRegionInstance); - } - - NodeList elements7 = webSpacesElement.getElementsByTagName("Name"); - Element nameElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - webSpaceInstance.setName(nameInstance); - } - - NodeList elements8 = webSpacesElement.getElementsByTagName("Plan"); - Element planElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (planElement != null) - { - String planInstance; - planInstance = planElement.getTextContent(); - webSpaceInstance.setPlan(planInstance); - } - - NodeList elements9 = webSpacesElement.getElementsByTagName("Status"); - Element statusElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (statusElement != null) - { - WebSpaceStatus statusInstance; - statusInstance = WebSpaceStatus.valueOf(statusElement.getTextContent()); - webSpaceInstance.setStatus(statusInstance); - } - - NodeList elements10 = webSpacesElement.getElementsByTagName("Subscription"); - Element subscriptionElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (subscriptionElement != null) - { - String subscriptionInstance; - subscriptionInstance = subscriptionElement.getTextContent(); - webSpaceInstance.setSubscription(subscriptionInstance); - } - - NodeList elements11 = webSpacesElement.getElementsByTagName("WorkerSize"); - Element workerSizeElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (workerSizeElement != null && (workerSizeElement.getTextContent() != null && workerSizeElement.getTextContent().isEmpty() != true) == false) - { - WebSpaceWorkerSize workerSizeInstance; - workerSizeInstance = WebSpaceWorkerSize.valueOf(workerSizeElement.getTextContent()); - webSpaceInstance.setWorkerSize(workerSizeInstance); } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -846,6 +923,14 @@ public WebSpacesListGeoRegionsResponse call() throws Exception /** * Get the available geo regions for this webspace. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The Get DNS Suffix operation response. */ @Override @@ -874,94 +959,104 @@ public WebSpacesListGeoRegionsResponse listGeoRegions() throws IOException, Serv // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - WebSpacesListGeoRegionsResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSpacesListGeoRegionsResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("GeoRegions"); - Element geoRegionsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (geoRegionsSequenceElement != null) - { - for (int i1 = 0; i1 < geoRegionsSequenceElement.getElementsByTagName("GeoRegion").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element geoRegionsElement = ((org.w3c.dom.Element) geoRegionsSequenceElement.getElementsByTagName("GeoRegion").item(i1)); - WebSpacesListGeoRegionsResponse.GeoRegion geoRegionInstance = new WebSpacesListGeoRegionsResponse.GeoRegion(); - result.getGeoRegions().add(geoRegionInstance); - - NodeList elements2 = geoRegionsElement.getElementsByTagName("Description"); - Element descriptionElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (descriptionElement != null) - { - String descriptionInstance; - descriptionInstance = descriptionElement.getTextContent(); - geoRegionInstance.setDescription(descriptionInstance); - } - - NodeList elements3 = geoRegionsElement.getElementsByTagName("Name"); - Element nameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (nameElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - String nameInstance; - nameInstance = nameElement.getTextContent(); - geoRegionInstance.setName(nameInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements4 = geoRegionsElement.getElementsByTagName("SortOrder"); - Element sortOrderElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (sortOrderElement != null) + throw ex; + } + + // Create Result + WebSpacesListGeoRegionsResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSpacesListGeoRegionsResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("GeoRegions"); + Element geoRegionsSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (geoRegionsSequenceElement != null) + { + for (int i1 = 0; i1 < geoRegionsSequenceElement.getElementsByTagName("GeoRegion").getLength(); i1 = i1 + 1) { - boolean isNil = false; - String nilAttribute = sortOrderElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) + org.w3c.dom.Element geoRegionsElement = ((org.w3c.dom.Element) geoRegionsSequenceElement.getElementsByTagName("GeoRegion").item(i1)); + WebSpacesListGeoRegionsResponse.GeoRegion geoRegionInstance = new WebSpacesListGeoRegionsResponse.GeoRegion(); + result.getGeoRegions().add(geoRegionInstance); + + NodeList elements2 = geoRegionsElement.getElementsByTagName("Description"); + Element descriptionElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (descriptionElement != null) { - isNil = nilAttribute == "true"; + String descriptionInstance; + descriptionInstance = descriptionElement.getTextContent(); + geoRegionInstance.setDescription(descriptionInstance); } - if (isNil == false) + + NodeList elements3 = geoRegionsElement.getElementsByTagName("Name"); + Element nameElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (nameElement != null) { - int sortOrderInstance; - sortOrderInstance = Integer.parseInt(sortOrderElement.getTextContent()); - geoRegionInstance.setSortOrder(sortOrderInstance); + String nameInstance; + nameInstance = nameElement.getTextContent(); + geoRegionInstance.setName(nameInstance); + } + + NodeList elements4 = geoRegionsElement.getElementsByTagName("SortOrder"); + Element sortOrderElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (sortOrderElement != null) + { + boolean isNil = false; + Attr nilAttribute = sortOrderElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + int sortOrderInstance; + sortOrderInstance = Integer.parseInt(sortOrderElement.getTextContent()); + geoRegionInstance.setSortOrder(sortOrderInstance); + } } } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -984,6 +1079,14 @@ public WebSpacesListPublishingUsersResponse call() throws Exception /** * Get the source control users allowed to publish to this web space. * + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. * @return The List Publishing Users operation response. */ @Override @@ -1012,62 +1115,72 @@ public WebSpacesListPublishingUsersResponse listPublishingUsers() throws IOExcep // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) + try { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) - { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - WebSpacesListPublishingUsersResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSpacesListPublishingUsersResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "ArrayOfstring"); - Element arrayOfstringSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (arrayOfstringSequenceElement != null) - { - for (int i1 = 0; i1 < arrayOfstringSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element arrayOfstringElement = ((org.w3c.dom.Element) arrayOfstringSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i1)); - WebSpacesListPublishingUsersResponse.User stringInstance = new WebSpacesListPublishingUsersResponse.User(); - result.getUsers().add(stringInstance); - - String stringInstance2; - stringInstance2 = arrayOfstringElement.getTextContent(); - stringInstance.setName(stringInstance2); + CloudTracing.receiveResponse(invocationId, httpResponse); } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) + { + CloudTracing.error(invocationId, ex); + } + throw ex; + } + + // Create Result + WebSpacesListPublishingUsersResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSpacesListPublishingUsersResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "ArrayOfstring"); + Element arrayOfstringSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (arrayOfstringSequenceElement != null) + { + for (int i1 = 0; i1 < arrayOfstringSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i1 = i1 + 1) + { + org.w3c.dom.Element arrayOfstringElement = ((org.w3c.dom.Element) arrayOfstringSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i1)); + WebSpacesListPublishingUsersResponse.User stringInstance = new WebSpacesListPublishingUsersResponse.User(); + result.getUsers().add(stringInstance); + + String stringInstance2; + stringInstance2 = arrayOfstringElement.getTextContent(); + stringInstance.setName(stringInstance2); + } + } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } /** @@ -1100,6 +1213,18 @@ public WebSpacesListWebSitesResponse call() throws Exception * * @param webSpaceName The name of the web space. * @param parameters Additional parameters. + * @throws IOException Signals that an I/O exception of some sort has + * occurred. This class is the general class of exceptions produced by + * failed or interrupted I/O operations. + * @throws ServiceException Thrown if an unexpected response is found. + * @throws ParserConfigurationException Thrown if there was a serious + * configuration error with the document parser. + * @throws SAXException Thrown if there was an error parsing the XML + * response. + * @throws ParseException Thrown if there was an error parsing a string in + * the response. + * @throws URISyntaxException Thrown if there was an error parsing a URI in + * the response. * @return The List Web Sites operation response. */ @Override @@ -1124,11 +1249,7 @@ public WebSpacesListWebSitesResponse listWebSites(String webSpaceName, WebSiteLi } // Construct URL - String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites?"; - if (parameters.getPropertiesToInclude() != null && parameters.getPropertiesToInclude().size() > 0) - { - url = url + "&propertiesToInclude=" + URLEncoder.encode(CommaStringBuilder.join(parameters.getPropertiesToInclude()), "UTF-8"); - } + String url = this.getClient().getBaseUri() + "/" + this.getClient().getCredentials().getSubscriptionId() + "/services/WebSpaces/" + webSpaceName + "/sites?&propertiesToInclude=" + CommaStringBuilder.join(parameters.getPropertiesToInclude()); // Create HTTP transport objects HttpGet httpRequest = new HttpGet(url); @@ -1138,482 +1259,618 @@ public WebSpacesListWebSitesResponse listWebSites(String webSpaceName, WebSiteLi // Send Request HttpResponse httpResponse = null; - if (shouldTrace) - { - CloudTracing.sendRequest(invocationId, httpRequest); - } - httpResponse = this.getClient().getHttpClient().execute(httpRequest); - if (shouldTrace) - { - CloudTracing.receiveResponse(invocationId, httpResponse); - } - int statusCode = httpResponse.getStatusLine().getStatusCode(); - if (statusCode != HttpStatus.SC_OK) + try { - ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); if (shouldTrace) { - CloudTracing.error(invocationId, ex); + CloudTracing.sendRequest(invocationId, httpRequest); } - throw ex; - } - - // Create Result - WebSpacesListWebSitesResponse result = null; - // Deserialize Response - InputStream responseContent = httpResponse.getEntity().getContent(); - result = new WebSpacesListWebSitesResponse(); - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); - Document responseDoc = documentBuilder.parse(responseContent); - - NodeList elements = responseDoc.getElementsByTagName("Sites"); - Element sitesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; - if (sitesSequenceElement != null) - { - for (int i1 = 0; i1 < sitesSequenceElement.getElementsByTagName("Site").getLength(); i1 = i1 + 1) + httpResponse = this.getClient().getHttpClient().execute(httpRequest); + if (shouldTrace) { - org.w3c.dom.Element sitesElement = ((org.w3c.dom.Element) sitesSequenceElement.getElementsByTagName("Site").item(i1)); - WebSite siteInstance = new WebSite(); - result.getWebSites().add(siteInstance); - - NodeList elements2 = sitesElement.getElementsByTagName("AdminEnabled"); - Element adminEnabledElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; - if (adminEnabledElement != null) - { - boolean adminEnabledInstance; - adminEnabledInstance = Boolean.parseBoolean(adminEnabledElement.getTextContent()); - siteInstance.setAdminEnabled(adminEnabledInstance); - } - - NodeList elements3 = sitesElement.getElementsByTagName("AvailabilityState"); - Element availabilityStateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; - if (availabilityStateElement != null) - { - WebSpaceAvailabilityState availabilityStateInstance; - availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); - siteInstance.setAvailabilityState(availabilityStateInstance); - } - - NodeList elements4 = sitesElement.getElementsByTagName("ComputeMode"); - Element computeModeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; - if (computeModeElement != null) - { - WebSiteComputeMode computeModeInstance; - computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement.getTextContent()); - siteInstance.setComputeMode(computeModeInstance); - } - - NodeList elements5 = sitesElement.getElementsByTagName("Enabled"); - Element enabledElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; - if (enabledElement != null) + CloudTracing.receiveResponse(invocationId, httpResponse); + } + int statusCode = httpResponse.getStatusLine().getStatusCode(); + if (statusCode != HttpStatus.SC_OK) + { + ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity()); + if (shouldTrace) { - boolean enabledInstance; - enabledInstance = Boolean.parseBoolean(enabledElement.getTextContent()); - siteInstance.setEnabled(enabledInstance); + CloudTracing.error(invocationId, ex); } - - NodeList elements6 = sitesElement.getElementsByTagName("EnabledHostNames"); - Element enabledHostNamesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; - if (enabledHostNamesSequenceElement != null) + throw ex; + } + + // Create Result + WebSpacesListWebSitesResponse result = null; + // Deserialize Response + InputStream responseContent = httpResponse.getEntity().getContent(); + result = new WebSpacesListWebSitesResponse(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document responseDoc = documentBuilder.parse(responseContent); + + NodeList elements = responseDoc.getElementsByTagName("Sites"); + Element sitesSequenceElement = elements.getLength() > 0 ? ((Element) elements.item(0)) : null; + if (sitesSequenceElement != null) + { + for (int i1 = 0; i1 < sitesSequenceElement.getElementsByTagName("Site").getLength(); i1 = i1 + 1) { - for (int i2 = 0; i2 < enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i2 = i2 + 1) + org.w3c.dom.Element sitesElement = ((org.w3c.dom.Element) sitesSequenceElement.getElementsByTagName("Site").item(i1)); + WebSite siteInstance = new WebSite(); + result.getWebSites().add(siteInstance); + + NodeList elements2 = sitesElement.getElementsByTagName("AdminEnabled"); + Element adminEnabledElement = elements2.getLength() > 0 ? ((Element) elements2.item(0)) : null; + if (adminEnabledElement != null) { - org.w3c.dom.Element enabledHostNamesElement = ((org.w3c.dom.Element) enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i2)); - siteInstance.getEnabledHostNames().add(enabledHostNamesElement.getTextContent()); + boolean adminEnabledInstance; + adminEnabledInstance = Boolean.parseBoolean(adminEnabledElement.getTextContent()); + siteInstance.setAdminEnabled(adminEnabledInstance); } - } - - NodeList elements7 = sitesElement.getElementsByTagName("HostNameSslStates"); - Element hostNameSslStatesSequenceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; - if (hostNameSslStatesSequenceElement != null) - { - for (int i3 = 0; i3 < hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").getLength(); i3 = i3 + 1) + + NodeList elements3 = sitesElement.getElementsByTagName("AvailabilityState"); + Element availabilityStateElement = elements3.getLength() > 0 ? ((Element) elements3.item(0)) : null; + if (availabilityStateElement != null) { - org.w3c.dom.Element hostNameSslStatesElement = ((org.w3c.dom.Element) hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").item(i3)); - WebSite.WebSiteHostNameSslState webSiteHostNameSslStateInstance = new WebSite.WebSiteHostNameSslState(); - siteInstance.getHostNameSslStates().add(webSiteHostNameSslStateInstance); - - NodeList elements8 = hostNameSslStatesElement.getElementsByTagName("Name"); - Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; - if (nameElement != null) - { - String nameInstance; - nameInstance = nameElement.getTextContent(); - webSiteHostNameSslStateInstance.setName(nameInstance); - } - - NodeList elements9 = hostNameSslStatesElement.getElementsByTagName("SslState"); - Element sslStateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; - if (sslStateElement != null) + WebSpaceAvailabilityState availabilityStateInstance; + availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent()); + siteInstance.setAvailabilityState(availabilityStateInstance); + } + + NodeList elements4 = sitesElement.getElementsByTagName("ComputeMode"); + Element computeModeElement = elements4.getLength() > 0 ? ((Element) elements4.item(0)) : null; + if (computeModeElement != null) + { + WebSiteComputeMode computeModeInstance; + computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement.getTextContent()); + siteInstance.setComputeMode(computeModeInstance); + } + + NodeList elements5 = sitesElement.getElementsByTagName("Enabled"); + Element enabledElement = elements5.getLength() > 0 ? ((Element) elements5.item(0)) : null; + if (enabledElement != null) + { + boolean enabledInstance; + enabledInstance = Boolean.parseBoolean(enabledElement.getTextContent()); + siteInstance.setEnabled(enabledInstance); + } + + NodeList elements6 = sitesElement.getElementsByTagName("EnabledHostNames"); + Element enabledHostNamesSequenceElement = elements6.getLength() > 0 ? ((Element) elements6.item(0)) : null; + if (enabledHostNamesSequenceElement != null) + { + for (int i2 = 0; i2 < enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i2 = i2 + 1) { - WebSiteSslState sslStateInstance; - sslStateInstance = WebSiteSslState.valueOf(sslStateElement.getTextContent()); - webSiteHostNameSslStateInstance.setSslState(sslStateInstance); + org.w3c.dom.Element enabledHostNamesElement = ((org.w3c.dom.Element) enabledHostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i2)); + siteInstance.getEnabledHostNames().add(enabledHostNamesElement.getTextContent()); } - - NodeList elements10 = hostNameSslStatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; - if (thumbprintElement != null) + } + + NodeList elements7 = sitesElement.getElementsByTagName("HostNameSslStates"); + Element hostNameSslStatesSequenceElement = elements7.getLength() > 0 ? ((Element) elements7.item(0)) : null; + if (hostNameSslStatesSequenceElement != null) + { + for (int i3 = 0; i3 < hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").getLength(); i3 = i3 + 1) { - boolean isNil = false; - String nilAttribute = thumbprintElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute != null) + org.w3c.dom.Element hostNameSslStatesElement = ((org.w3c.dom.Element) hostNameSslStatesSequenceElement.getElementsByTagName("WebSiteHostNameSslState").item(i3)); + WebSite.WebSiteHostNameSslState webSiteHostNameSslStateInstance = new WebSite.WebSiteHostNameSslState(); + siteInstance.getHostNameSslStates().add(webSiteHostNameSslStateInstance); + + NodeList elements8 = hostNameSslStatesElement.getElementsByTagName("Name"); + Element nameElement = elements8.getLength() > 0 ? ((Element) elements8.item(0)) : null; + if (nameElement != null) { - isNil = nilAttribute == "true"; + String nameInstance; + nameInstance = nameElement.getTextContent(); + webSiteHostNameSslStateInstance.setName(nameInstance); } - if (isNil == false) + + NodeList elements9 = hostNameSslStatesElement.getElementsByTagName("SslState"); + Element sslStateElement = elements9.getLength() > 0 ? ((Element) elements9.item(0)) : null; + if (sslStateElement != null) { - String thumbprintInstance; - thumbprintInstance = thumbprintElement.getTextContent(); - webSiteHostNameSslStateInstance.setThumbprint(thumbprintInstance); + WebSiteSslState sslStateInstance; + sslStateInstance = WebSiteSslState.valueOf(sslStateElement.getTextContent()); + webSiteHostNameSslStateInstance.setSslState(sslStateInstance); } - } - - NodeList elements11 = hostNameSslStatesElement.getElementsByTagName("VirtualIP"); - Element virtualIPElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; - if (virtualIPElement != null) - { - boolean isNil2 = false; - String nilAttribute2 = virtualIPElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute2 != null) + + NodeList elements10 = hostNameSslStatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement = elements10.getLength() > 0 ? ((Element) elements10.item(0)) : null; + if (thumbprintElement != null) { - isNil2 = nilAttribute2 == "true"; + boolean isNil = false; + Attr nilAttribute = thumbprintElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute != null) + { + isNil = nilAttribute.getValue() == "true"; + } + if (isNil == false) + { + String thumbprintInstance; + thumbprintInstance = thumbprintElement.getTextContent(); + webSiteHostNameSslStateInstance.setThumbprint(thumbprintInstance); + } } - if (isNil2 == false) + + NodeList elements11 = hostNameSslStatesElement.getElementsByTagName("VirtualIP"); + Element virtualIPElement = elements11.getLength() > 0 ? ((Element) elements11.item(0)) : null; + if (virtualIPElement != null) { - InetAddress virtualIPInstance; - virtualIPInstance = InetAddress.getByName(virtualIPElement.getTextContent()); - webSiteHostNameSslStateInstance.setVirtualIP(virtualIPInstance); + boolean isNil2 = false; + Attr nilAttribute2 = virtualIPElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute2 != null) + { + isNil2 = nilAttribute2.getValue() == "true"; + } + if (isNil2 == false) + { + InetAddress virtualIPInstance; + virtualIPInstance = InetAddress.getByName(virtualIPElement.getTextContent()); + webSiteHostNameSslStateInstance.setVirtualIP(virtualIPInstance); + } } } } - } - - NodeList elements12 = sitesElement.getElementsByTagName("HostNames"); - Element hostNamesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; - if (hostNamesSequenceElement != null) - { - for (int i4 = 0; i4 < hostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i4 = i4 + 1) + + NodeList elements12 = sitesElement.getElementsByTagName("HostNames"); + Element hostNamesSequenceElement = elements12.getLength() > 0 ? ((Element) elements12.item(0)) : null; + if (hostNamesSequenceElement != null) { - org.w3c.dom.Element hostNamesElement = ((org.w3c.dom.Element) hostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i4)); - siteInstance.getHostNames().add(hostNamesElement.getTextContent()); + for (int i4 = 0; i4 < hostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i4 = i4 + 1) + { + org.w3c.dom.Element hostNamesElement = ((org.w3c.dom.Element) hostNamesSequenceElement.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i4)); + siteInstance.getHostNames().add(hostNamesElement.getTextContent()); + } } - } - - NodeList elements13 = sitesElement.getElementsByTagName("LastModifiedTimeUtc"); - Element lastModifiedTimeUtcElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; - if (lastModifiedTimeUtcElement != null) - { - Calendar lastModifiedTimeUtcInstance; - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDateFormat.parse(lastModifiedTimeUtcElement.getTextContent())); - lastModifiedTimeUtcInstance = calendar; - siteInstance.setLastModifiedTimeUtc(lastModifiedTimeUtcInstance); - } - - NodeList elements14 = sitesElement.getElementsByTagName("Name"); - Element nameElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; - if (nameElement2 != null) - { - String nameInstance2; - nameInstance2 = nameElement2.getTextContent(); - siteInstance.setName(nameInstance2); - } - - NodeList elements15 = sitesElement.getElementsByTagName("Owner"); - Element ownerElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; - if (ownerElement != null) - { - boolean isNil3 = false; - String nilAttribute3 = ownerElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (nilAttribute3 != null) + + NodeList elements13 = sitesElement.getElementsByTagName("LastModifiedTimeUtc"); + Element lastModifiedTimeUtcElement = elements13.getLength() > 0 ? ((Element) elements13.item(0)) : null; + if (lastModifiedTimeUtcElement != null) { - isNil3 = nilAttribute3 == "true"; + Calendar lastModifiedTimeUtcInstance; + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(simpleDateFormat.parse(lastModifiedTimeUtcElement.getTextContent())); + lastModifiedTimeUtcInstance = calendar; + siteInstance.setLastModifiedTimeUtc(lastModifiedTimeUtcInstance); } - if (isNil3 == false) + + NodeList elements14 = sitesElement.getElementsByTagName("Name"); + Element nameElement2 = elements14.getLength() > 0 ? ((Element) elements14.item(0)) : null; + if (nameElement2 != null) { - String ownerInstance; - ownerInstance = ownerElement.getTextContent(); - siteInstance.setOwner(ownerInstance); + String nameInstance2; + nameInstance2 = nameElement2.getTextContent(); + siteInstance.setName(nameInstance2); } - } - - NodeList elements16 = sitesElement.getElementsByTagName("RepositorySiteName"); - Element repositorySiteNameElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; - if (repositorySiteNameElement != null) - { - String repositorySiteNameInstance; - repositorySiteNameInstance = repositorySiteNameElement.getTextContent(); - siteInstance.setRepositorySiteName(repositorySiteNameInstance); - } - - NodeList elements17 = sitesElement.getElementsByTagName("RuntimeAvailabilityState"); - Element runtimeAvailabilityStateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; - if (runtimeAvailabilityStateElement != null) - { - WebSiteRuntimeAvailabilityState runtimeAvailabilityStateInstance; - runtimeAvailabilityStateInstance = WebSiteRuntimeAvailabilityState.valueOf(runtimeAvailabilityStateElement.getTextContent()); - siteInstance.setRuntimeAvailabilityState(runtimeAvailabilityStateInstance); - } - - NodeList elements18 = sitesElement.getElementsByTagName("SSLCertificates"); - Element sSLCertificatesSequenceElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; - if (sSLCertificatesSequenceElement != null) - { - for (int i5 = 0; i5 < sSLCertificatesSequenceElement.getElementsByTagName("Certificate").getLength(); i5 = i5 + 1) + + NodeList elements15 = sitesElement.getElementsByTagName("Owner"); + Element ownerElement = elements15.getLength() > 0 ? ((Element) elements15.item(0)) : null; + if (ownerElement != null) { - org.w3c.dom.Element sSLCertificatesElement = ((org.w3c.dom.Element) sSLCertificatesSequenceElement.getElementsByTagName("Certificate").item(i5)); - WebSite.WebSiteSslCertificate certificateInstance = new WebSite.WebSiteSslCertificate(); - siteInstance.getSslCertificates().add(certificateInstance); - - NodeList elements19 = sSLCertificatesElement.getElementsByTagName("ExpirationDate"); - Element expirationDateElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; - if (expirationDateElement != null) + boolean isNil3 = false; + Attr nilAttribute3 = ownerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute3 != null) { - Calendar expirationDateInstance; - SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar2 = Calendar.getInstance(); - calendar2.setTime(simpleDateFormat2.parse(expirationDateElement.getTextContent())); - expirationDateInstance = calendar2; - certificateInstance.setExpirationDate(expirationDateInstance); + isNil3 = nilAttribute3.getValue() == "true"; } - - NodeList elements20 = sSLCertificatesElement.getElementsByTagName("FriendlyName"); - Element friendlyNameElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; - if (friendlyNameElement != null) + if (isNil3 == false) { - String friendlyNameInstance; - friendlyNameInstance = friendlyNameElement.getTextContent(); - certificateInstance.setFriendlyName(friendlyNameInstance); + String ownerInstance; + ownerInstance = ownerElement.getTextContent(); + siteInstance.setOwner(ownerInstance); } - - NodeList elements21 = sSLCertificatesElement.getElementsByTagName("HostNames"); - Element hostNamesSequenceElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; - if (hostNamesSequenceElement2 != null) - { - for (int i6 = 0; i6 < hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i6 = i6 + 1) - { - org.w3c.dom.Element hostNamesElement2 = ((org.w3c.dom.Element) hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i6)); - certificateInstance.getHostNames().add(hostNamesElement2.getTextContent()); - } - } - - NodeList elements22 = sSLCertificatesElement.getElementsByTagName("IssueDate"); - Element issueDateElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; - if (issueDateElement != null) - { - Calendar issueDateInstance; - SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); - Calendar calendar3 = Calendar.getInstance(); - calendar3.setTime(simpleDateFormat3.parse(issueDateElement.getTextContent())); - issueDateInstance = calendar3; - certificateInstance.setIssueDate(issueDateInstance); - } - - NodeList elements23 = sSLCertificatesElement.getElementsByTagName("Issuer"); - Element issuerElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; - if (issuerElement != null) - { - String issuerInstance; - issuerInstance = issuerElement.getTextContent(); - certificateInstance.setIssuer(issuerInstance); - } - - NodeList elements24 = sSLCertificatesElement.getElementsByTagName("Password"); - Element passwordElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; - if (passwordElement != null) - { - String passwordInstance; - passwordInstance = passwordElement.getTextContent(); - certificateInstance.setPassword(passwordInstance); - } - - NodeList elements25 = sSLCertificatesElement.getElementsByTagName("PfxBlob"); - Element pfxBlobElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; - if (pfxBlobElement != null) - { - byte[] pfxBlobInstance; - pfxBlobInstance = pfxBlobElement.getTextContent() != null ? Base64.decodeBase64(pfxBlobElement.getTextContent().getBytes()) : null; - certificateInstance.setPfxBlob(pfxBlobInstance); - } - - NodeList elements26 = sSLCertificatesElement.getElementsByTagName("SelfLink"); - Element selfLinkElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; - if (selfLinkElement != null) - { - URI selfLinkInstance; - selfLinkInstance = new URI(selfLinkElement.getTextContent()); - certificateInstance.setSelfLinkUri(selfLinkInstance); - } - - NodeList elements27 = sSLCertificatesElement.getElementsByTagName("SiteName"); - Element siteNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; - if (siteNameElement != null) + } + + NodeList elements16 = sitesElement.getElementsByTagName("RepositorySiteName"); + Element repositorySiteNameElement = elements16.getLength() > 0 ? ((Element) elements16.item(0)) : null; + if (repositorySiteNameElement != null) + { + String repositorySiteNameInstance; + repositorySiteNameInstance = repositorySiteNameElement.getTextContent(); + siteInstance.setRepositorySiteName(repositorySiteNameInstance); + } + + NodeList elements17 = sitesElement.getElementsByTagName("RuntimeAvailabilityState"); + Element runtimeAvailabilityStateElement = elements17.getLength() > 0 ? ((Element) elements17.item(0)) : null; + if (runtimeAvailabilityStateElement != null) + { + WebSiteRuntimeAvailabilityState runtimeAvailabilityStateInstance; + runtimeAvailabilityStateInstance = WebSiteRuntimeAvailabilityState.valueOf(runtimeAvailabilityStateElement.getTextContent()); + siteInstance.setRuntimeAvailabilityState(runtimeAvailabilityStateInstance); + } + + NodeList elements18 = sitesElement.getElementsByTagName("SSLCertificates"); + Element sSLCertificatesSequenceElement = elements18.getLength() > 0 ? ((Element) elements18.item(0)) : null; + if (sSLCertificatesSequenceElement != null) + { + boolean isNil4 = false; + Attr nilAttribute4 = sSLCertificatesSequenceElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute4 != null) { - String siteNameInstance; - siteNameInstance = siteNameElement.getTextContent(); - certificateInstance.setSiteName(siteNameInstance); + isNil4 = nilAttribute4.getValue() == "true"; } - - NodeList elements28 = sSLCertificatesElement.getElementsByTagName("SubjectName"); - Element subjectNameElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; - if (subjectNameElement != null) + if (isNil4 == false) { - String subjectNameInstance; - subjectNameInstance = subjectNameElement.getTextContent(); - certificateInstance.setSubjectName(subjectNameInstance); + for (int i5 = 0; i5 < sSLCertificatesSequenceElement.getElementsByTagName("Certificate").getLength(); i5 = i5 + 1) + { + org.w3c.dom.Element sSLCertificatesElement = ((org.w3c.dom.Element) sSLCertificatesSequenceElement.getElementsByTagName("Certificate").item(i5)); + WebSite.WebSiteSslCertificate certificateInstance = new WebSite.WebSiteSslCertificate(); + siteInstance.getSslCertificates().add(certificateInstance); + + NodeList elements19 = sSLCertificatesElement.getElementsByTagName("ExpirationDate"); + Element expirationDateElement = elements19.getLength() > 0 ? ((Element) elements19.item(0)) : null; + if (expirationDateElement != null && (expirationDateElement.getTextContent() != null && expirationDateElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil5 = false; + Attr nilAttribute5 = expirationDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute5 != null) + { + isNil5 = nilAttribute5.getValue() == "true"; + } + if (isNil5 == false) + { + Calendar expirationDateInstance; + SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar2 = Calendar.getInstance(); + calendar2.setTime(simpleDateFormat2.parse(expirationDateElement.getTextContent())); + expirationDateInstance = calendar2; + certificateInstance.setExpirationDate(expirationDateInstance); + } + } + + NodeList elements20 = sSLCertificatesElement.getElementsByTagName("FriendlyName"); + Element friendlyNameElement = elements20.getLength() > 0 ? ((Element) elements20.item(0)) : null; + if (friendlyNameElement != null) + { + boolean isNil6 = false; + Attr nilAttribute6 = friendlyNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute6 != null) + { + isNil6 = nilAttribute6.getValue() == "true"; + } + if (isNil6 == false) + { + String friendlyNameInstance; + friendlyNameInstance = friendlyNameElement.getTextContent(); + certificateInstance.setFriendlyName(friendlyNameInstance); + } + } + + NodeList elements21 = sSLCertificatesElement.getElementsByTagName("HostNames"); + Element hostNamesSequenceElement2 = elements21.getLength() > 0 ? ((Element) elements21.item(0)) : null; + if (hostNamesSequenceElement2 != null) + { + boolean isNil7 = false; + Attr nilAttribute7 = hostNamesSequenceElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute7 != null) + { + isNil7 = nilAttribute7.getValue() == "true"; + } + if (isNil7 == false) + { + for (int i6 = 0; i6 < hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").getLength(); i6 = i6 + 1) + { + org.w3c.dom.Element hostNamesElement2 = ((org.w3c.dom.Element) hostNamesSequenceElement2.getElementsByTagNameNS("http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").item(i6)); + certificateInstance.getHostNames().add(hostNamesElement2.getTextContent()); + } + } + } + + NodeList elements22 = sSLCertificatesElement.getElementsByTagName("IssueDate"); + Element issueDateElement = elements22.getLength() > 0 ? ((Element) elements22.item(0)) : null; + if (issueDateElement != null && (issueDateElement.getTextContent() != null && issueDateElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil8 = false; + Attr nilAttribute8 = issueDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute8 != null) + { + isNil8 = nilAttribute8.getValue() == "true"; + } + if (isNil8 == false) + { + Calendar issueDateInstance; + SimpleDateFormat simpleDateFormat3 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); + Calendar calendar3 = Calendar.getInstance(); + calendar3.setTime(simpleDateFormat3.parse(issueDateElement.getTextContent())); + issueDateInstance = calendar3; + certificateInstance.setIssueDate(issueDateInstance); + } + } + + NodeList elements23 = sSLCertificatesElement.getElementsByTagName("Issuer"); + Element issuerElement = elements23.getLength() > 0 ? ((Element) elements23.item(0)) : null; + if (issuerElement != null) + { + boolean isNil9 = false; + Attr nilAttribute9 = issuerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute9 != null) + { + isNil9 = nilAttribute9.getValue() == "true"; + } + if (isNil9 == false) + { + String issuerInstance; + issuerInstance = issuerElement.getTextContent(); + certificateInstance.setIssuer(issuerInstance); + } + } + + NodeList elements24 = sSLCertificatesElement.getElementsByTagName("Password"); + Element passwordElement = elements24.getLength() > 0 ? ((Element) elements24.item(0)) : null; + if (passwordElement != null) + { + boolean isNil10 = false; + Attr nilAttribute10 = passwordElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute10 != null) + { + isNil10 = nilAttribute10.getValue() == "true"; + } + if (isNil10 == false) + { + String passwordInstance; + passwordInstance = passwordElement.getTextContent(); + certificateInstance.setPassword(passwordInstance); + } + } + + NodeList elements25 = sSLCertificatesElement.getElementsByTagName("PfxBlob"); + Element pfxBlobElement = elements25.getLength() > 0 ? ((Element) elements25.item(0)) : null; + if (pfxBlobElement != null) + { + boolean isNil11 = false; + Attr nilAttribute11 = pfxBlobElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute11 != null) + { + isNil11 = nilAttribute11.getValue() == "true"; + } + if (isNil11 == false) + { + byte[] pfxBlobInstance; + pfxBlobInstance = pfxBlobElement.getTextContent() != null ? Base64.decodeBase64(pfxBlobElement.getTextContent().getBytes()) : null; + certificateInstance.setPfxBlob(pfxBlobInstance); + } + } + + NodeList elements26 = sSLCertificatesElement.getElementsByTagName("SelfLink"); + Element selfLinkElement = elements26.getLength() > 0 ? ((Element) elements26.item(0)) : null; + if (selfLinkElement != null) + { + boolean isNil12 = false; + Attr nilAttribute12 = selfLinkElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute12 != null) + { + isNil12 = nilAttribute12.getValue() == "true"; + } + if (isNil12 == false) + { + URI selfLinkInstance; + selfLinkInstance = new URI(selfLinkElement.getTextContent()); + certificateInstance.setSelfLinkUri(selfLinkInstance); + } + } + + NodeList elements27 = sSLCertificatesElement.getElementsByTagName("SiteName"); + Element siteNameElement = elements27.getLength() > 0 ? ((Element) elements27.item(0)) : null; + if (siteNameElement != null) + { + boolean isNil13 = false; + Attr nilAttribute13 = siteNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute13 != null) + { + isNil13 = nilAttribute13.getValue() == "true"; + } + if (isNil13 == false) + { + String siteNameInstance; + siteNameInstance = siteNameElement.getTextContent(); + certificateInstance.setSiteName(siteNameInstance); + } + } + + NodeList elements28 = sSLCertificatesElement.getElementsByTagName("SubjectName"); + Element subjectNameElement = elements28.getLength() > 0 ? ((Element) elements28.item(0)) : null; + if (subjectNameElement != null) + { + boolean isNil14 = false; + Attr nilAttribute14 = subjectNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute14 != null) + { + isNil14 = nilAttribute14.getValue() == "true"; + } + if (isNil14 == false) + { + String subjectNameInstance; + subjectNameInstance = subjectNameElement.getTextContent(); + certificateInstance.setSubjectName(subjectNameInstance); + } + } + + NodeList elements29 = sSLCertificatesElement.getElementsByTagName("Thumbprint"); + Element thumbprintElement2 = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; + if (thumbprintElement2 != null) + { + boolean isNil15 = false; + Attr nilAttribute15 = thumbprintElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute15 != null) + { + isNil15 = nilAttribute15.getValue() == "true"; + } + if (isNil15 == false) + { + String thumbprintInstance2; + thumbprintInstance2 = thumbprintElement2.getTextContent(); + certificateInstance.setThumbprint(thumbprintInstance2); + } + } + + NodeList elements30 = sSLCertificatesElement.getElementsByTagName("ToDelete"); + Element toDeleteElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; + if (toDeleteElement != null && (toDeleteElement.getTextContent() != null && toDeleteElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil16 = false; + Attr nilAttribute16 = toDeleteElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute16 != null) + { + isNil16 = nilAttribute16.getValue() == "true"; + } + if (isNil16 == false) + { + boolean toDeleteInstance; + toDeleteInstance = Boolean.parseBoolean(toDeleteElement.getTextContent()); + certificateInstance.setIsToBeDeleted(toDeleteInstance); + } + } + + NodeList elements31 = sSLCertificatesElement.getElementsByTagName("Valid"); + Element validElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; + if (validElement != null && (validElement.getTextContent() != null && validElement.getTextContent().isEmpty() != true) == false) + { + boolean isNil17 = false; + Attr nilAttribute17 = validElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil"); + if (nilAttribute17 != null) + { + isNil17 = nilAttribute17.getValue() == "true"; + } + if (isNil17 == false) + { + boolean validInstance; + validInstance = Boolean.parseBoolean(validElement.getTextContent()); + certificateInstance.setIsValid(validInstance); + } + } + } } + } + + NodeList elements32 = sitesElement.getElementsByTagName("SelfLink"); + Element selfLinkElement2 = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; + if (selfLinkElement2 != null) + { + URI selfLinkInstance2; + selfLinkInstance2 = new URI(selfLinkElement2.getTextContent()); + siteInstance.setUri(selfLinkInstance2); + } + + NodeList elements33 = sitesElement.getElementsByTagName("ServerFarm"); + Element serverFarmElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; + if (serverFarmElement != null) + { + String serverFarmInstance; + serverFarmInstance = serverFarmElement.getTextContent(); + siteInstance.setServerFarm(serverFarmInstance); + } + + NodeList elements34 = sitesElement.getElementsByTagName("SiteMode"); + Element siteModeElement = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; + if (siteModeElement != null) + { + WebSiteMode siteModeInstance; + siteModeInstance = WebSiteMode.valueOf(siteModeElement.getTextContent()); + siteInstance.setSiteMode(siteModeInstance); + } + + NodeList elements35 = sitesElement.getElementsByTagName("SiteProperties"); + Element sitePropertiesElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; + if (sitePropertiesElement != null) + { + WebSite.WebSiteProperties sitePropertiesInstance = new WebSite.WebSiteProperties(); + siteInstance.setSiteProperties(sitePropertiesInstance); - NodeList elements29 = sSLCertificatesElement.getElementsByTagName("Thumbprint"); - Element thumbprintElement2 = elements29.getLength() > 0 ? ((Element) elements29.item(0)) : null; - if (thumbprintElement2 != null) + NodeList elements36 = sitePropertiesElement.getElementsByTagName("AppSettings"); + Element appSettingsSequenceElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; + if (appSettingsSequenceElement != null) { - String thumbprintInstance2; - thumbprintInstance2 = thumbprintElement2.getTextContent(); - certificateInstance.setThumbprint(thumbprintInstance2); + for (int i7 = 0; i7 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i7 = i7 + 1) + { + org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i7)); + NodeList elements37 = appSettingsElement.getElementsByTagName("Name"); + String appSettingsKey = elements37.getLength() > 0 ? ((org.w3c.dom.Element) elements37.item(0)).getTextContent() : null; + NodeList elements38 = appSettingsElement.getElementsByTagName("Value"); + String appSettingsValue = elements38.getLength() > 0 ? ((org.w3c.dom.Element) elements38.item(0)).getTextContent() : null; + sitePropertiesInstance.getAppSettings().put(appSettingsKey, appSettingsValue); + } } - NodeList elements30 = sSLCertificatesElement.getElementsByTagName("ToDelete"); - Element toDeleteElement = elements30.getLength() > 0 ? ((Element) elements30.item(0)) : null; - if (toDeleteElement != null) + NodeList elements39 = sitePropertiesElement.getElementsByTagName("Metadata"); + Element metadataSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; + if (metadataSequenceElement != null) { - boolean toDeleteInstance; - toDeleteInstance = Boolean.parseBoolean(toDeleteElement.getTextContent()); - certificateInstance.setIsToBeDeleted(toDeleteInstance); + for (int i8 = 0; i8 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i8 = i8 + 1) + { + org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i8)); + NodeList elements40 = metadataElement.getElementsByTagName("Name"); + String metadataKey = elements40.getLength() > 0 ? ((org.w3c.dom.Element) elements40.item(0)).getTextContent() : null; + NodeList elements41 = metadataElement.getElementsByTagName("Value"); + String metadataValue = elements41.getLength() > 0 ? ((org.w3c.dom.Element) elements41.item(0)).getTextContent() : null; + sitePropertiesInstance.getMetadata().put(metadataKey, metadataValue); + } } - NodeList elements31 = sSLCertificatesElement.getElementsByTagName("Valid"); - Element validElement = elements31.getLength() > 0 ? ((Element) elements31.item(0)) : null; - if (validElement != null) + NodeList elements42 = sitePropertiesElement.getElementsByTagName("Properties"); + Element propertiesSequenceElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; + if (propertiesSequenceElement != null) { - boolean validInstance; - validInstance = Boolean.parseBoolean(validElement.getTextContent()); - certificateInstance.setIsValid(validInstance); + for (int i9 = 0; i9 < propertiesSequenceElement.getElementsByTagName("NameValuePair").getLength(); i9 = i9 + 1) + { + org.w3c.dom.Element propertiesElement = ((org.w3c.dom.Element) propertiesSequenceElement.getElementsByTagName("NameValuePair").item(i9)); + NodeList elements43 = propertiesElement.getElementsByTagName("Name"); + String propertiesKey = elements43.getLength() > 0 ? ((org.w3c.dom.Element) elements43.item(0)).getTextContent() : null; + NodeList elements44 = propertiesElement.getElementsByTagName("Value"); + String propertiesValue = elements44.getLength() > 0 ? ((org.w3c.dom.Element) elements44.item(0)).getTextContent() : null; + sitePropertiesInstance.getProperties().put(propertiesKey, propertiesValue); + } } } - } - - NodeList elements32 = sitesElement.getElementsByTagName("SelfLink"); - Element selfLinkElement2 = elements32.getLength() > 0 ? ((Element) elements32.item(0)) : null; - if (selfLinkElement2 != null) - { - URI selfLinkInstance2; - selfLinkInstance2 = new URI(selfLinkElement2.getTextContent()); - siteInstance.setUri(selfLinkInstance2); - } - - NodeList elements33 = sitesElement.getElementsByTagName("ServerFarm"); - Element serverFarmElement = elements33.getLength() > 0 ? ((Element) elements33.item(0)) : null; - if (serverFarmElement != null) - { - String serverFarmInstance; - serverFarmInstance = serverFarmElement.getTextContent(); - siteInstance.setServerFarm(serverFarmInstance); - } - - NodeList elements34 = sitesElement.getElementsByTagName("SiteMode"); - Element siteModeElement = elements34.getLength() > 0 ? ((Element) elements34.item(0)) : null; - if (siteModeElement != null) - { - WebSiteMode siteModeInstance; - siteModeInstance = WebSiteMode.valueOf(siteModeElement.getTextContent()); - siteInstance.setSiteMode(siteModeInstance); - } - - NodeList elements35 = sitesElement.getElementsByTagName("SiteProperties"); - Element sitePropertiesElement = elements35.getLength() > 0 ? ((Element) elements35.item(0)) : null; - if (sitePropertiesElement != null) - { - WebSite.WebSiteProperties sitePropertiesInstance = new WebSite.WebSiteProperties(); - siteInstance.setSiteProperties(sitePropertiesInstance); - NodeList elements36 = sitePropertiesElement.getElementsByTagName("AppSettings"); - Element appSettingsSequenceElement = elements36.getLength() > 0 ? ((Element) elements36.item(0)) : null; - if (appSettingsSequenceElement != null) + NodeList elements45 = sitesElement.getElementsByTagName("State"); + Element stateElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; + if (stateElement != null) { - for (int i7 = 0; i7 < appSettingsSequenceElement.getElementsByTagName("NameValuePair").getLength(); i7 = i7 + 1) - { - org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) appSettingsSequenceElement.getElementsByTagName("NameValuePair").item(i7)); - NodeList elements37 = appSettingsElement.getElementsByTagName("Name"); - String appSettingsKey = elements37.getLength() > 0 ? ((org.w3c.dom.Element) elements37.item(0)).getTextContent() : null; - NodeList elements38 = appSettingsElement.getElementsByTagName("Value"); - String appSettingsValue = elements38.getLength() > 0 ? ((org.w3c.dom.Element) elements38.item(0)).getTextContent() : null; - sitePropertiesInstance.getAppSettings().put(appSettingsKey, appSettingsValue); - } + WebSiteState stateInstance; + stateInstance = WebSiteState.valueOf(stateElement.getTextContent()); + siteInstance.setState(stateInstance); } - NodeList elements39 = sitePropertiesElement.getElementsByTagName("Metadata"); - Element metadataSequenceElement = elements39.getLength() > 0 ? ((Element) elements39.item(0)) : null; - if (metadataSequenceElement != null) + NodeList elements46 = sitesElement.getElementsByTagName("UsageState"); + Element usageStateElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; + if (usageStateElement != null) { - for (int i8 = 0; i8 < metadataSequenceElement.getElementsByTagName("NameValuePair").getLength(); i8 = i8 + 1) - { - org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) metadataSequenceElement.getElementsByTagName("NameValuePair").item(i8)); - NodeList elements40 = metadataElement.getElementsByTagName("Name"); - String metadataKey = elements40.getLength() > 0 ? ((org.w3c.dom.Element) elements40.item(0)).getTextContent() : null; - NodeList elements41 = metadataElement.getElementsByTagName("Value"); - String metadataValue = elements41.getLength() > 0 ? ((org.w3c.dom.Element) elements41.item(0)).getTextContent() : null; - sitePropertiesInstance.getMetadata().put(metadataKey, metadataValue); - } + WebSiteUsageState usageStateInstance; + usageStateInstance = WebSiteUsageState.valueOf(usageStateElement.getTextContent()); + siteInstance.setUsageState(usageStateInstance); } - NodeList elements42 = sitePropertiesElement.getElementsByTagName("Properties"); - Element propertiesSequenceElement = elements42.getLength() > 0 ? ((Element) elements42.item(0)) : null; - if (propertiesSequenceElement != null) + NodeList elements47 = sitesElement.getElementsByTagName("WebSpace"); + Element webSpaceElement = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; + if (webSpaceElement != null) { - for (int i9 = 0; i9 < propertiesSequenceElement.getElementsByTagName("NameValuePair").getLength(); i9 = i9 + 1) - { - org.w3c.dom.Element propertiesElement = ((org.w3c.dom.Element) propertiesSequenceElement.getElementsByTagName("NameValuePair").item(i9)); - NodeList elements43 = propertiesElement.getElementsByTagName("Name"); - String propertiesKey = elements43.getLength() > 0 ? ((org.w3c.dom.Element) elements43.item(0)).getTextContent() : null; - NodeList elements44 = propertiesElement.getElementsByTagName("Value"); - String propertiesValue = elements44.getLength() > 0 ? ((org.w3c.dom.Element) elements44.item(0)).getTextContent() : null; - sitePropertiesInstance.getProperties().put(propertiesKey, propertiesValue); - } + String webSpaceInstance; + webSpaceInstance = webSpaceElement.getTextContent(); + siteInstance.setWebSpace(webSpaceInstance); } } - - NodeList elements45 = sitesElement.getElementsByTagName("State"); - Element stateElement = elements45.getLength() > 0 ? ((Element) elements45.item(0)) : null; - if (stateElement != null) - { - WebSiteState stateInstance; - stateInstance = WebSiteState.valueOf(stateElement.getTextContent()); - siteInstance.setState(stateInstance); - } - - NodeList elements46 = sitesElement.getElementsByTagName("UsageState"); - Element usageStateElement = elements46.getLength() > 0 ? ((Element) elements46.item(0)) : null; - if (usageStateElement != null) - { - WebSiteUsageState usageStateInstance; - usageStateInstance = WebSiteUsageState.valueOf(usageStateElement.getTextContent()); - siteInstance.setUsageState(usageStateInstance); - } - - NodeList elements47 = sitesElement.getElementsByTagName("WebSpace"); - Element webSpaceElement = elements47.getLength() > 0 ? ((Element) elements47.item(0)) : null; - if (webSpaceElement != null) - { - String webSpaceInstance; - webSpaceInstance = webSpaceElement.getTextContent(); - siteInstance.setWebSpace(webSpaceInstance); - } } + + 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); + } + return result; } - - result.setStatusCode(statusCode); - if (httpResponse.getHeaders("x-ms-request-id").length > 0) - { - result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue()); - } - - if (shouldTrace) + finally { - CloudTracing.exit(invocationId, result); + if (httpResponse != null && httpResponse.getEntity() != null) + { + httpResponse.getEntity().getContent().close(); + } } - return result; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmCreateParameters.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmCreateParameters.java index 05e83c5b9910f..8bc8661e8f06d 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmCreateParameters.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmCreateParameters.java @@ -32,6 +32,7 @@ public class ServerFarmCreateParameters /** * The current number of Virtual Machines (VMs) in the server farm. + * @return The CurrentNumberOfWorkers value. */ public Integer getCurrentNumberOfWorkers() { @@ -40,16 +41,18 @@ public Integer getCurrentNumberOfWorkers() /** * The current number of Virtual Machines (VMs) in the server farm. + * @param currentNumberOfWorkersValue The CurrentNumberOfWorkers value. */ - public void setCurrentNumberOfWorkers(Integer currentNumberOfWorkers) + public void setCurrentNumberOfWorkers(final Integer currentNumberOfWorkersValue) { - this.currentNumberOfWorkers = currentNumberOfWorkers; + this.currentNumberOfWorkers = currentNumberOfWorkersValue; } private ServerFarmWorkerSize currentWorkerSize; /** * The current worker size Possible values are Small, Medium, or Large. + * @return The CurrentWorkerSize value. */ public ServerFarmWorkerSize getCurrentWorkerSize() { @@ -58,10 +61,11 @@ public ServerFarmWorkerSize getCurrentWorkerSize() /** * The current worker size Possible values are Small, Medium, or Large. + * @param currentWorkerSizeValue The CurrentWorkerSize value. */ - public void setCurrentWorkerSize(ServerFarmWorkerSize currentWorkerSize) + public void setCurrentWorkerSize(final ServerFarmWorkerSize currentWorkerSizeValue) { - this.currentWorkerSize = currentWorkerSize; + this.currentWorkerSize = currentWorkerSizeValue; } private int numberOfWorkers; @@ -69,6 +73,7 @@ public void setCurrentWorkerSize(ServerFarmWorkerSize currentWorkerSize) /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @return The NumberOfWorkers value. */ public int getNumberOfWorkers() { @@ -78,16 +83,18 @@ public int getNumberOfWorkers() /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @param numberOfWorkersValue The NumberOfWorkers value. */ - public void setNumberOfWorkers(int numberOfWorkers) + public void setNumberOfWorkers(final int numberOfWorkersValue) { - this.numberOfWorkers = numberOfWorkers; + this.numberOfWorkers = numberOfWorkersValue; } private ServerFarmStatus status; /** * Server farm status. Possible values are Ready or Pending. + * @return The Status value. */ public ServerFarmStatus getStatus() { @@ -96,16 +103,18 @@ public ServerFarmStatus getStatus() /** * Server farm status. Possible values are Ready or Pending. + * @param statusValue The Status value. */ - public void setStatus(ServerFarmStatus status) + public void setStatus(final ServerFarmStatus statusValue) { - this.status = status; + this.status = statusValue; } private ServerFarmWorkerSize workerSize; /** * The instance size. Possible values are Small, Medium, or Large. + * @return The WorkerSize value. */ public ServerFarmWorkerSize getWorkerSize() { @@ -114,9 +123,10 @@ public ServerFarmWorkerSize getWorkerSize() /** * The instance size. Possible values are Small, Medium, or Large. + * @param workerSizeValue The WorkerSize value. */ - public void setWorkerSize(ServerFarmWorkerSize workerSize) + public void setWorkerSize(final ServerFarmWorkerSize workerSizeValue) { - this.workerSize = workerSize; + this.workerSize = workerSizeValue; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmCreateResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmCreateResponse.java index 70dbf4e8d5b93..cd7127006b3f9 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmCreateResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmCreateResponse.java @@ -34,6 +34,7 @@ public class ServerFarmCreateResponse extends OperationResponse /** * The current number of Virtual Machines (VMs) in the server farm. + * @return The CurrentNumberOfWorkers value. */ public int getCurrentNumberOfWorkers() { @@ -42,16 +43,18 @@ public int getCurrentNumberOfWorkers() /** * The current number of Virtual Machines (VMs) in the server farm. + * @param currentNumberOfWorkersValue The CurrentNumberOfWorkers value. */ - public void setCurrentNumberOfWorkers(int currentNumberOfWorkers) + public void setCurrentNumberOfWorkers(final int currentNumberOfWorkersValue) { - this.currentNumberOfWorkers = currentNumberOfWorkers; + this.currentNumberOfWorkers = currentNumberOfWorkersValue; } private ServerFarmWorkerSize currentWorkerSize; /** * The current worker size Possible values are Small, Medium, or Large. + * @return The CurrentWorkerSize value. */ public ServerFarmWorkerSize getCurrentWorkerSize() { @@ -60,16 +63,18 @@ public ServerFarmWorkerSize getCurrentWorkerSize() /** * The current worker size Possible values are Small, Medium, or Large. + * @param currentWorkerSizeValue The CurrentWorkerSize value. */ - public void setCurrentWorkerSize(ServerFarmWorkerSize currentWorkerSize) + public void setCurrentWorkerSize(final ServerFarmWorkerSize currentWorkerSizeValue) { - this.currentWorkerSize = currentWorkerSize; + this.currentWorkerSize = currentWorkerSizeValue; } private String name; /** * The name of the server farm. + * @return The Name value. */ public String getName() { @@ -78,10 +83,11 @@ public String getName() /** * The name of the server farm. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private int numberOfWorkers; @@ -89,6 +95,7 @@ public void setName(String name) /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @return The NumberOfWorkers value. */ public int getNumberOfWorkers() { @@ -98,16 +105,18 @@ public int getNumberOfWorkers() /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @param numberOfWorkersValue The NumberOfWorkers value. */ - public void setNumberOfWorkers(int numberOfWorkers) + public void setNumberOfWorkers(final int numberOfWorkersValue) { - this.numberOfWorkers = numberOfWorkers; + this.numberOfWorkers = numberOfWorkersValue; } private ServerFarmStatus status; /** * Server farm status. Possible values are Ready or Pending. + * @return The Status value. */ public ServerFarmStatus getStatus() { @@ -116,16 +125,18 @@ public ServerFarmStatus getStatus() /** * Server farm status. Possible values are Ready or Pending. + * @param statusValue The Status value. */ - public void setStatus(ServerFarmStatus status) + public void setStatus(final ServerFarmStatus statusValue) { - this.status = status; + this.status = statusValue; } private ServerFarmWorkerSize workerSize; /** * The instance size. Possible values are Small, Medium, or Large. + * @return The WorkerSize value. */ public ServerFarmWorkerSize getWorkerSize() { @@ -134,9 +145,10 @@ public ServerFarmWorkerSize getWorkerSize() /** * The instance size. Possible values are Small, Medium, or Large. + * @param workerSizeValue The WorkerSize value. */ - public void setWorkerSize(ServerFarmWorkerSize workerSize) + public void setWorkerSize(final ServerFarmWorkerSize workerSizeValue) { - this.workerSize = workerSize; + this.workerSize = workerSizeValue; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmGetResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmGetResponse.java index d2fcbf7ecf49b..978817620e968 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmGetResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmGetResponse.java @@ -34,6 +34,7 @@ public class ServerFarmGetResponse extends OperationResponse /** * The current number of Virtual Machines (VMs) in the server farm. + * @return The CurrentNumberOfWorkers value. */ public int getCurrentNumberOfWorkers() { @@ -42,16 +43,18 @@ public int getCurrentNumberOfWorkers() /** * The current number of Virtual Machines (VMs) in the server farm. + * @param currentNumberOfWorkersValue The CurrentNumberOfWorkers value. */ - public void setCurrentNumberOfWorkers(int currentNumberOfWorkers) + public void setCurrentNumberOfWorkers(final int currentNumberOfWorkersValue) { - this.currentNumberOfWorkers = currentNumberOfWorkers; + this.currentNumberOfWorkers = currentNumberOfWorkersValue; } private ServerFarmWorkerSize currentWorkerSize; /** * The current worker size Possible values are Small, Medium, or Large. + * @return The CurrentWorkerSize value. */ public ServerFarmWorkerSize getCurrentWorkerSize() { @@ -60,16 +63,18 @@ public ServerFarmWorkerSize getCurrentWorkerSize() /** * The current worker size Possible values are Small, Medium, or Large. + * @param currentWorkerSizeValue The CurrentWorkerSize value. */ - public void setCurrentWorkerSize(ServerFarmWorkerSize currentWorkerSize) + public void setCurrentWorkerSize(final ServerFarmWorkerSize currentWorkerSizeValue) { - this.currentWorkerSize = currentWorkerSize; + this.currentWorkerSize = currentWorkerSizeValue; } private String name; /** * The name of the server farm. + * @return The Name value. */ public String getName() { @@ -78,10 +83,11 @@ public String getName() /** * The name of the server farm. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private int numberOfWorkers; @@ -89,6 +95,7 @@ public void setName(String name) /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @return The NumberOfWorkers value. */ public int getNumberOfWorkers() { @@ -98,16 +105,18 @@ public int getNumberOfWorkers() /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @param numberOfWorkersValue The NumberOfWorkers value. */ - public void setNumberOfWorkers(int numberOfWorkers) + public void setNumberOfWorkers(final int numberOfWorkersValue) { - this.numberOfWorkers = numberOfWorkers; + this.numberOfWorkers = numberOfWorkersValue; } private ServerFarmStatus status; /** * Server farm status. Possible values are Ready or Pending. + * @return The Status value. */ public ServerFarmStatus getStatus() { @@ -116,16 +125,18 @@ public ServerFarmStatus getStatus() /** * Server farm status. Possible values are Ready or Pending. + * @param statusValue The Status value. */ - public void setStatus(ServerFarmStatus status) + public void setStatus(final ServerFarmStatus statusValue) { - this.status = status; + this.status = statusValue; } private ServerFarmWorkerSize workerSize; /** * The instance size. Possible values are Small, Medium, or Large. + * @return The WorkerSize value. */ public ServerFarmWorkerSize getWorkerSize() { @@ -134,9 +145,10 @@ public ServerFarmWorkerSize getWorkerSize() /** * The instance size. Possible values are Small, Medium, or Large. + * @param workerSizeValue The WorkerSize value. */ - public void setWorkerSize(ServerFarmWorkerSize workerSize) + public void setWorkerSize(final ServerFarmWorkerSize workerSizeValue) { - this.workerSize = workerSize; + this.workerSize = workerSizeValue; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmListResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmListResponse.java index 14e1d1dd64c52..e47d066196135 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmListResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmListResponse.java @@ -36,6 +36,7 @@ public class ServerFarmListResponse extends OperationResponse implements Iterabl /** * The server farms associated with the specified subscription. + * @return The ServerFarms value. */ public ArrayList getServerFarms() { @@ -44,10 +45,11 @@ public ArrayList getServerFarms() /** * The server farms associated with the specified subscription. + * @param serverFarmsValue The ServerFarms value. */ - public void setServerFarms(ArrayList serverFarms) + public void setServerFarms(final ArrayList serverFarmsValue) { - this.serverFarms = serverFarms; + this.serverFarms = serverFarmsValue; } /** @@ -78,6 +80,7 @@ public static class ServerFarm /** * The current number of Virtual Machines (VMs) in the server farm. + * @return The CurrentNumberOfWorkers value. */ public int getCurrentNumberOfWorkers() { @@ -86,16 +89,18 @@ public int getCurrentNumberOfWorkers() /** * The current number of Virtual Machines (VMs) in the server farm. + * @param currentNumberOfWorkersValue The CurrentNumberOfWorkers value. */ - public void setCurrentNumberOfWorkers(int currentNumberOfWorkers) + public void setCurrentNumberOfWorkers(final int currentNumberOfWorkersValue) { - this.currentNumberOfWorkers = currentNumberOfWorkers; + this.currentNumberOfWorkers = currentNumberOfWorkersValue; } private ServerFarmWorkerSize currentWorkerSize; /** * The current worker size Possible values are Small, Medium, or Large. + * @return The CurrentWorkerSize value. */ public ServerFarmWorkerSize getCurrentWorkerSize() { @@ -104,16 +109,18 @@ public ServerFarmWorkerSize getCurrentWorkerSize() /** * The current worker size Possible values are Small, Medium, or Large. + * @param currentWorkerSizeValue The CurrentWorkerSize value. */ - public void setCurrentWorkerSize(ServerFarmWorkerSize currentWorkerSize) + public void setCurrentWorkerSize(final ServerFarmWorkerSize currentWorkerSizeValue) { - this.currentWorkerSize = currentWorkerSize; + this.currentWorkerSize = currentWorkerSizeValue; } private String name; /** * The name of the server farm. + * @return The Name value. */ public String getName() { @@ -122,10 +129,11 @@ public String getName() /** * The name of the server farm. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private int numberOfWorkers; @@ -133,6 +141,7 @@ public void setName(String name) /** * The instance count, which is the number of virtual machines dedicated * to the farm. Supported values are 1-10. + * @return The NumberOfWorkers value. */ public int getNumberOfWorkers() { @@ -142,16 +151,18 @@ public int getNumberOfWorkers() /** * The instance count, which is the number of virtual machines dedicated * to the farm. Supported values are 1-10. + * @param numberOfWorkersValue The NumberOfWorkers value. */ - public void setNumberOfWorkers(int numberOfWorkers) + public void setNumberOfWorkers(final int numberOfWorkersValue) { - this.numberOfWorkers = numberOfWorkers; + this.numberOfWorkers = numberOfWorkersValue; } private ServerFarmStatus status; /** * Server farm status. Possible values are Ready or Pending. + * @return The Status value. */ public ServerFarmStatus getStatus() { @@ -160,16 +171,18 @@ public ServerFarmStatus getStatus() /** * Server farm status. Possible values are Ready or Pending. + * @param statusValue The Status value. */ - public void setStatus(ServerFarmStatus status) + public void setStatus(final ServerFarmStatus statusValue) { - this.status = status; + this.status = statusValue; } private ServerFarmWorkerSize workerSize; /** * The instance size. Possible values are Small, Medium, or Large. + * @return The WorkerSize value. */ public ServerFarmWorkerSize getWorkerSize() { @@ -178,10 +191,11 @@ public ServerFarmWorkerSize getWorkerSize() /** * The instance size. Possible values are Small, Medium, or Large. + * @param workerSizeValue The WorkerSize value. */ - public void setWorkerSize(ServerFarmWorkerSize workerSize) + public void setWorkerSize(final ServerFarmWorkerSize workerSizeValue) { - this.workerSize = workerSize; + this.workerSize = workerSizeValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmUpdateParameters.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmUpdateParameters.java index 2c3c5fec1af4c..f1795aa038402 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmUpdateParameters.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmUpdateParameters.java @@ -32,6 +32,7 @@ public class ServerFarmUpdateParameters /** * The current number of Virtual Machines (VMs) in the server farm. + * @return The CurrentNumberOfWorkers value. */ public Integer getCurrentNumberOfWorkers() { @@ -40,16 +41,18 @@ public Integer getCurrentNumberOfWorkers() /** * The current number of Virtual Machines (VMs) in the server farm. + * @param currentNumberOfWorkersValue The CurrentNumberOfWorkers value. */ - public void setCurrentNumberOfWorkers(Integer currentNumberOfWorkers) + public void setCurrentNumberOfWorkers(final Integer currentNumberOfWorkersValue) { - this.currentNumberOfWorkers = currentNumberOfWorkers; + this.currentNumberOfWorkers = currentNumberOfWorkersValue; } private ServerFarmWorkerSize currentWorkerSize; /** * The current worker size Possible values are Small, Medium, or Large. + * @return The CurrentWorkerSize value. */ public ServerFarmWorkerSize getCurrentWorkerSize() { @@ -58,10 +61,11 @@ public ServerFarmWorkerSize getCurrentWorkerSize() /** * The current worker size Possible values are Small, Medium, or Large. + * @param currentWorkerSizeValue The CurrentWorkerSize value. */ - public void setCurrentWorkerSize(ServerFarmWorkerSize currentWorkerSize) + public void setCurrentWorkerSize(final ServerFarmWorkerSize currentWorkerSizeValue) { - this.currentWorkerSize = currentWorkerSize; + this.currentWorkerSize = currentWorkerSizeValue; } private int numberOfWorkers; @@ -69,6 +73,7 @@ public void setCurrentWorkerSize(ServerFarmWorkerSize currentWorkerSize) /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @return The NumberOfWorkers value. */ public int getNumberOfWorkers() { @@ -78,16 +83,18 @@ public int getNumberOfWorkers() /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @param numberOfWorkersValue The NumberOfWorkers value. */ - public void setNumberOfWorkers(int numberOfWorkers) + public void setNumberOfWorkers(final int numberOfWorkersValue) { - this.numberOfWorkers = numberOfWorkers; + this.numberOfWorkers = numberOfWorkersValue; } private ServerFarmStatus status; /** * Server farm status. Possible values are Ready or Pending. + * @return The Status value. */ public ServerFarmStatus getStatus() { @@ -96,16 +103,18 @@ public ServerFarmStatus getStatus() /** * Server farm status. Possible values are Ready or Pending. + * @param statusValue The Status value. */ - public void setStatus(ServerFarmStatus status) + public void setStatus(final ServerFarmStatus statusValue) { - this.status = status; + this.status = statusValue; } private ServerFarmWorkerSize workerSize; /** * The instance size. Possible values are Small, Medium, or Large. + * @return The WorkerSize value. */ public ServerFarmWorkerSize getWorkerSize() { @@ -114,9 +123,10 @@ public ServerFarmWorkerSize getWorkerSize() /** * The instance size. Possible values are Small, Medium, or Large. + * @param workerSizeValue The WorkerSize value. */ - public void setWorkerSize(ServerFarmWorkerSize workerSize) + public void setWorkerSize(final ServerFarmWorkerSize workerSizeValue) { - this.workerSize = workerSize; + this.workerSize = workerSizeValue; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmUpdateResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmUpdateResponse.java index b80719f3f27d4..5c1222926cc52 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmUpdateResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/ServerFarmUpdateResponse.java @@ -34,6 +34,7 @@ public class ServerFarmUpdateResponse extends OperationResponse /** * The current number of Virtual Machines (VMs) in the server farm. + * @return The CurrentNumberOfWorkers value. */ public int getCurrentNumberOfWorkers() { @@ -42,16 +43,18 @@ public int getCurrentNumberOfWorkers() /** * The current number of Virtual Machines (VMs) in the server farm. + * @param currentNumberOfWorkersValue The CurrentNumberOfWorkers value. */ - public void setCurrentNumberOfWorkers(int currentNumberOfWorkers) + public void setCurrentNumberOfWorkers(final int currentNumberOfWorkersValue) { - this.currentNumberOfWorkers = currentNumberOfWorkers; + this.currentNumberOfWorkers = currentNumberOfWorkersValue; } private ServerFarmWorkerSize currentWorkerSize; /** * The current worker size Possible values are Small, Medium, or Large. + * @return The CurrentWorkerSize value. */ public ServerFarmWorkerSize getCurrentWorkerSize() { @@ -60,16 +63,18 @@ public ServerFarmWorkerSize getCurrentWorkerSize() /** * The current worker size Possible values are Small, Medium, or Large. + * @param currentWorkerSizeValue The CurrentWorkerSize value. */ - public void setCurrentWorkerSize(ServerFarmWorkerSize currentWorkerSize) + public void setCurrentWorkerSize(final ServerFarmWorkerSize currentWorkerSizeValue) { - this.currentWorkerSize = currentWorkerSize; + this.currentWorkerSize = currentWorkerSizeValue; } private String name; /** * The name of the server farm. + * @return The Name value. */ public String getName() { @@ -78,10 +83,11 @@ public String getName() /** * The name of the server farm. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private int numberOfWorkers; @@ -89,6 +95,7 @@ public void setName(String name) /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @return The NumberOfWorkers value. */ public int getNumberOfWorkers() { @@ -98,16 +105,18 @@ public int getNumberOfWorkers() /** * The instance count, which is the number of virtual machines dedicated to * the farm. Supported values are 1-10. + * @param numberOfWorkersValue The NumberOfWorkers value. */ - public void setNumberOfWorkers(int numberOfWorkers) + public void setNumberOfWorkers(final int numberOfWorkersValue) { - this.numberOfWorkers = numberOfWorkers; + this.numberOfWorkers = numberOfWorkersValue; } private ServerFarmStatus status; /** * Server farm status. Possible values are Ready or Pending. + * @return The Status value. */ public ServerFarmStatus getStatus() { @@ -116,16 +125,18 @@ public ServerFarmStatus getStatus() /** * Server farm status. Possible values are Ready or Pending. + * @param statusValue The Status value. */ - public void setStatus(ServerFarmStatus status) + public void setStatus(final ServerFarmStatus statusValue) { - this.status = status; + this.status = statusValue; } private ServerFarmWorkerSize workerSize; /** * The instance size. Possible values are Small, Medium, or Large. + * @return The WorkerSize value. */ public ServerFarmWorkerSize getWorkerSize() { @@ -134,9 +145,10 @@ public ServerFarmWorkerSize getWorkerSize() /** * The instance size. Possible values are Small, Medium, or Large. + * @param workerSizeValue The WorkerSize value. */ - public void setWorkerSize(ServerFarmWorkerSize workerSize) + public void setWorkerSize(final ServerFarmWorkerSize workerSizeValue) { - this.workerSize = workerSize; + this.workerSize = workerSizeValue; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSite.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSite.java index f626bae4fe19f..fc7c2743ec1dc 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSite.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSite.java @@ -38,6 +38,7 @@ public class WebSite /** * Read-only. This value is always true. + * @return The AdminEnabled value. */ public boolean isAdminEnabled() { @@ -46,10 +47,11 @@ public boolean isAdminEnabled() /** * Read-only. This value is always true. + * @param adminEnabledValue The AdminEnabled value. */ - public void setAdminEnabled(boolean adminEnabled) + public void setAdminEnabled(final boolean adminEnabledValue) { - this.adminEnabled = adminEnabled; + this.adminEnabled = adminEnabledValue; } private WebSpaceAvailabilityState availabilityState; @@ -60,6 +62,7 @@ public void setAdminEnabled(boolean adminEnabled) * running correctly and that management information for the site is * available. Limited means that only partial management information for * the site is available and that detailed site information is unavailable. + * @return The AvailabilityState value. */ public WebSpaceAvailabilityState getAvailabilityState() { @@ -72,10 +75,11 @@ public WebSpaceAvailabilityState getAvailabilityState() * running correctly and that management information for the site is * available. Limited means that only partial management information for * the site is available and that detailed site information is unavailable. + * @param availabilityStateValue The AvailabilityState value. */ - public void setAvailabilityState(WebSpaceAvailabilityState availabilityState) + public void setAvailabilityState(final WebSpaceAvailabilityState availabilityStateValue) { - this.availabilityState = availabilityState; + this.availabilityState = availabilityStateValue; } private WebSiteComputeMode computeMode; @@ -83,6 +87,7 @@ public void setAvailabilityState(WebSpaceAvailabilityState availabilityState) /** * The Compute Mode for the web site. Possible values are Shared or * Dedicated. + * @return The ComputeMode value. */ public WebSiteComputeMode getComputeMode() { @@ -92,10 +97,11 @@ public WebSiteComputeMode getComputeMode() /** * The Compute Mode for the web site. Possible values are Shared or * Dedicated. + * @param computeModeValue The ComputeMode value. */ - public void setComputeMode(WebSiteComputeMode computeMode) + public void setComputeMode(final WebSiteComputeMode computeModeValue) { - this.computeMode = computeMode; + this.computeMode = computeModeValue; } private boolean enabled; @@ -103,6 +109,7 @@ public void setComputeMode(WebSiteComputeMode computeMode) /** * true if the site is enabled; otherwise, false. Setting this value to * false disables the site (takes the site off line). + * @return The Enabled value. */ public boolean isEnabled() { @@ -112,10 +119,11 @@ public boolean isEnabled() /** * true if the site is enabled; otherwise, false. Setting this value to * false disables the site (takes the site off line). + * @param enabledValue The Enabled value. */ - public void setEnabled(boolean enabled) + public void setEnabled(final boolean enabledValue) { - this.enabled = enabled; + this.enabled = enabledValue; } private ArrayList enabledHostNames; @@ -124,6 +132,7 @@ public void setEnabled(boolean enabled) * An array of strings that contains enabled hostnames for the site. By * default, these are [SiteName].azurewebsites.net and * [SiteName].scm.azurewebsites.net. + * @return The EnabledHostNames value. */ public ArrayList getEnabledHostNames() { @@ -134,10 +143,11 @@ public ArrayList getEnabledHostNames() * An array of strings that contains enabled hostnames for the site. By * default, these are [SiteName].azurewebsites.net and * [SiteName].scm.azurewebsites.net. + * @param enabledHostNamesValue The EnabledHostNames value. */ - public void setEnabledHostNames(ArrayList enabledHostNames) + public void setEnabledHostNames(final ArrayList enabledHostNamesValue) { - this.enabledHostNames = enabledHostNames; + this.enabledHostNames = enabledHostNamesValue; } private ArrayList hostNames; @@ -149,6 +159,7 @@ public void setEnabledHostNames(ArrayList enabledHostNames) * web site. To delete a custom domain name in a PUT operation, include all * of the hostnames for the site that you want to keep, but leave out the * one that you wangt to delete. + * @return The HostNames value. */ public ArrayList getHostNames() { @@ -162,16 +173,18 @@ public ArrayList getHostNames() * web site. To delete a custom domain name in a PUT operation, include all * of the hostnames for the site that you want to keep, but leave out the * one that you wangt to delete. + * @param hostNamesValue The HostNames value. */ - public void setHostNames(ArrayList hostNames) + public void setHostNames(final ArrayList hostNamesValue) { - this.hostNames = hostNames; + this.hostNames = hostNamesValue; } private ArrayList hostNameSslStates; /** * SSL states bound to the website. + * @return The HostNameSslStates value. */ public ArrayList getHostNameSslStates() { @@ -180,10 +193,11 @@ public ArrayList getHostNameSslStates() /** * SSL states bound to the website. + * @param hostNameSslStatesValue The HostNameSslStates value. */ - public void setHostNameSslStates(ArrayList hostNameSslStates) + public void setHostNameSslStates(final ArrayList hostNameSslStatesValue) { - this.hostNameSslStates = hostNameSslStates; + this.hostNameSslStates = hostNameSslStatesValue; } private Calendar lastModifiedTimeUtc; @@ -191,6 +205,7 @@ public void setHostNameSslStates(ArrayList host /** * A dateTime value that contains, in Coordinated Universal Time, the last * time the web site was modified. + * @return The LastModifiedTimeUtc value. */ public Calendar getLastModifiedTimeUtc() { @@ -200,16 +215,18 @@ public Calendar getLastModifiedTimeUtc() /** * A dateTime value that contains, in Coordinated Universal Time, the last * time the web site was modified. + * @param lastModifiedTimeUtcValue The LastModifiedTimeUtc value. */ - public void setLastModifiedTimeUtc(Calendar lastModifiedTimeUtc) + public void setLastModifiedTimeUtc(final Calendar lastModifiedTimeUtcValue) { - this.lastModifiedTimeUtc = lastModifiedTimeUtc; + this.lastModifiedTimeUtc = lastModifiedTimeUtcValue; } private String name; /** * The name of the web site. + * @return The Name value. */ public String getName() { @@ -218,16 +235,18 @@ public String getName() /** * The name of the web site. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String owner; /** * Owner of the web site. + * @return The Owner value. */ public String getOwner() { @@ -236,16 +255,18 @@ public String getOwner() /** * Owner of the web site. + * @param ownerValue The Owner value. */ - public void setOwner(String owner) + public void setOwner(final String ownerValue) { - this.owner = owner; + this.owner = ownerValue; } private String repositorySiteName; /** * The name of the repository web site. + * @return The RepositorySiteName value. */ public String getRepositorySiteName() { @@ -254,10 +275,11 @@ public String getRepositorySiteName() /** * The name of the repository web site. + * @param repositorySiteNameValue The RepositorySiteName value. */ - public void setRepositorySiteName(String repositorySiteName) + public void setRepositorySiteName(final String repositorySiteNameValue) { - this.repositorySiteName = repositorySiteName; + this.repositorySiteName = repositorySiteNameValue; } private WebSiteRuntimeAvailabilityState runtimeAvailabilityState; @@ -268,6 +290,7 @@ public void setRepositorySiteName(String repositorySiteName) * in a degraded mode (typically with less memory and a shared instance.) * Not Available: due to an unexpected issue, the site has been excluded * from provisioning. This typically occurs only for free sites. + * @return The RuntimeAvailabilityState value. */ public WebSiteRuntimeAvailabilityState getRuntimeAvailabilityState() { @@ -280,16 +303,18 @@ public WebSiteRuntimeAvailabilityState getRuntimeAvailabilityState() * in a degraded mode (typically with less memory and a shared instance.) * Not Available: due to an unexpected issue, the site has been excluded * from provisioning. This typically occurs only for free sites. + * @param runtimeAvailabilityStateValue The RuntimeAvailabilityState value. */ - public void setRuntimeAvailabilityState(WebSiteRuntimeAvailabilityState runtimeAvailabilityState) + public void setRuntimeAvailabilityState(final WebSiteRuntimeAvailabilityState runtimeAvailabilityStateValue) { - this.runtimeAvailabilityState = runtimeAvailabilityState; + this.runtimeAvailabilityState = runtimeAvailabilityStateValue; } private String serverFarm; /** * String. If a server farm exists, this value is DefaultServerFarm. + * @return The ServerFarm value. */ public String getServerFarm() { @@ -298,10 +323,11 @@ public String getServerFarm() /** * String. If a server farm exists, this value is DefaultServerFarm. + * @param serverFarmValue The ServerFarm value. */ - public void setServerFarm(String serverFarm) + public void setServerFarm(final String serverFarmValue) { - this.serverFarm = serverFarm; + this.serverFarm = serverFarmValue; } private WebSiteMode siteMode; @@ -311,6 +337,7 @@ public void setServerFarm(String serverFarm) * this value is Limited. If the web site mode is Shared, this value is * Basic. Note: The SiteMode value is not used for Reserved mode. Reserved * mode uses the ComputeMode setting. + * @return The SiteMode value. */ public WebSiteMode getSiteMode() { @@ -322,16 +349,18 @@ public WebSiteMode getSiteMode() * this value is Limited. If the web site mode is Shared, this value is * Basic. Note: The SiteMode value is not used for Reserved mode. Reserved * mode uses the ComputeMode setting. + * @param siteModeValue The SiteMode value. */ - public void setSiteMode(WebSiteMode siteMode) + public void setSiteMode(final WebSiteMode siteModeValue) { - this.siteMode = siteMode; + this.siteMode = siteModeValue; } private WebSite.WebSiteProperties siteProperties; /** * Contains AppSettings, Metadata, and Properties for a site. + * @return The SiteProperties value. */ public WebSite.WebSiteProperties getSiteProperties() { @@ -340,16 +369,18 @@ public WebSite.WebSiteProperties getSiteProperties() /** * Contains AppSettings, Metadata, and Properties for a site. + * @param sitePropertiesValue The SiteProperties value. */ - public void setSiteProperties(WebSite.WebSiteProperties siteProperties) + public void setSiteProperties(final WebSite.WebSiteProperties sitePropertiesValue) { - this.siteProperties = siteProperties; + this.siteProperties = sitePropertiesValue; } private ArrayList sslCertificates; /** * SSL certificates bound to the web site. + * @return The SslCertificates value. */ public ArrayList getSslCertificates() { @@ -358,10 +389,11 @@ public ArrayList getSslCertificates() /** * SSL certificates bound to the web site. + * @param sslCertificatesValue The SslCertificates value. */ - public void setSslCertificates(ArrayList sslCertificates) + public void setSslCertificates(final ArrayList sslCertificatesValue) { - this.sslCertificates = sslCertificates; + this.sslCertificates = sslCertificatesValue; } private WebSiteState state; @@ -369,6 +401,7 @@ public void setSslCertificates(ArrayList sslCerti /** * A string that describes the state of the web site. Possible values are * Stopped or Running. + * @return The State value. */ public WebSiteState getState() { @@ -378,10 +411,11 @@ public WebSiteState getState() /** * A string that describes the state of the web site. Possible values are * Stopped or Running. + * @param stateValue The State value. */ - public void setState(WebSiteState state) + public void setState(final WebSiteState stateValue) { - this.state = state; + this.state = stateValue; } private URI uri; @@ -389,6 +423,7 @@ public void setState(WebSiteState state) /** * Direct URL to the web site endpoint on Windows Azure Web Sites, including * the subscription ID, webspace name, and site name. + * @return The Uri value. */ public URI getUri() { @@ -398,10 +433,11 @@ public URI getUri() /** * Direct URL to the web site endpoint on Windows Azure Web Sites, including * the subscription ID, webspace name, and site name. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } private WebSiteUsageState usageState; @@ -409,6 +445,7 @@ public void setUri(URI uri) /** * Possible values are Normal or Exceeded. If any quota is exceeded, the * UsageState value changes to Exceeded and the site goes off line. + * @return The UsageState value. */ public WebSiteUsageState getUsageState() { @@ -418,10 +455,11 @@ public WebSiteUsageState getUsageState() /** * Possible values are Normal or Exceeded. If any quota is exceeded, the * UsageState value changes to Exceeded and the site goes off line. + * @param usageStateValue The UsageState value. */ - public void setUsageState(WebSiteUsageState usageState) + public void setUsageState(final WebSiteUsageState usageStateValue) { - this.usageState = usageState; + this.usageState = usageStateValue; } private String webSpace; @@ -429,6 +467,7 @@ public void setUsageState(WebSiteUsageState usageState) /** * The name of the webspace in which the web site is located. This property * is read-only. + * @return The WebSpace value. */ public String getWebSpace() { @@ -438,10 +477,11 @@ public String getWebSpace() /** * The name of the webspace in which the web site is located. This property * is read-only. + * @param webSpaceValue The WebSpace value. */ - public void setWebSpace(String webSpace) + public void setWebSpace(final String webSpaceValue) { - this.webSpace = webSpace; + this.webSpace = webSpaceValue; } /** @@ -465,6 +505,7 @@ public static class WebSiteHostNameSslState /** * The URL of the web site. + * @return The Name value. */ public String getName() { @@ -473,10 +514,11 @@ public String getName() /** * The URL of the web site. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private WebSiteSslState sslState; @@ -484,6 +526,7 @@ public void setName(String name) /** * The SSL state. Possible values are Disabled, SniEnabled, or * IpBasedEnabled. + * @return The SslState value. */ public WebSiteSslState getSslState() { @@ -493,16 +536,18 @@ public WebSiteSslState getSslState() /** * The SSL state. Possible values are Disabled, SniEnabled, or * IpBasedEnabled. + * @param sslStateValue The SslState value. */ - public void setSslState(WebSiteSslState sslState) + public void setSslState(final WebSiteSslState sslStateValue) { - this.sslState = sslState; + this.sslState = sslStateValue; } private String thumbprint; /** * A string that contains the thumbprint of the SSL certificate. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -511,10 +556,11 @@ public String getThumbprint() /** * A string that contains the thumbprint of the SSL certificate. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } private InetAddress virtualIP; @@ -522,6 +568,7 @@ public void setThumbprint(String thumbprint) /** * String. The IP address assigned to the hostname if the hostname uses * IP SSL. + * @return The VirtualIP value. */ public InetAddress getVirtualIP() { @@ -531,10 +578,11 @@ public InetAddress getVirtualIP() /** * String. The IP address assigned to the hostname if the hostname uses * IP SSL. + * @param virtualIPValue The VirtualIP value. */ - public void setVirtualIP(InetAddress virtualIP) + public void setVirtualIP(final InetAddress virtualIPValue) { - this.virtualIP = virtualIP; + this.virtualIP = virtualIPValue; } } @@ -545,6 +593,7 @@ public static class WebSiteProperties /** * A set of name/value pairs that contain application settings for a * site. + * @return The AppSettings value. */ public HashMap getAppSettings() { @@ -554,10 +603,11 @@ public HashMap getAppSettings() /** * A set of name/value pairs that contain application settings for a * site. + * @param appSettingsValue The AppSettings value. */ - public void setAppSettings(HashMap appSettings) + public void setAppSettings(final HashMap appSettingsValue) { - this.appSettings = appSettings; + this.appSettings = appSettingsValue; } private HashMap metadata; @@ -565,6 +615,7 @@ public void setAppSettings(HashMap appSettings) /** * A set of name/value pairs that contain metadata information for a * site. + * @return The Metadata value. */ public HashMap getMetadata() { @@ -574,16 +625,18 @@ public HashMap getMetadata() /** * A set of name/value pairs that contain metadata information for a * site. + * @param metadataValue The Metadata value. */ - public void setMetadata(HashMap metadata) + public void setMetadata(final HashMap metadataValue) { - this.metadata = metadata; + this.metadata = metadataValue; } private HashMap properties; /** * A set of name/value pairs that contain properties for a site. + * @return The Properties value. */ public HashMap getProperties() { @@ -592,10 +645,11 @@ public HashMap getProperties() /** * A set of name/value pairs that contain properties for a site. + * @param propertiesValue The Properties value. */ - public void setProperties(HashMap properties) + public void setProperties(final HashMap propertiesValue) { - this.properties = properties; + this.properties = propertiesValue; } /** @@ -619,6 +673,7 @@ public static class WebSiteSslCertificate /** * A dateTime value that contains the expiration date of the certificate. + * @return The ExpirationDate value. */ public Calendar getExpirationDate() { @@ -627,16 +682,18 @@ public Calendar getExpirationDate() /** * A dateTime value that contains the expiration date of the certificate. + * @param expirationDateValue The ExpirationDate value. */ - public void setExpirationDate(Calendar expirationDate) + public void setExpirationDate(final Calendar expirationDateValue) { - this.expirationDate = expirationDate; + this.expirationDate = expirationDateValue; } private String friendlyName; /** * A string that contains the friendly name of the certificate. + * @return The FriendlyName value. */ public String getFriendlyName() { @@ -645,10 +702,11 @@ public String getFriendlyName() /** * A string that contains the friendly name of the certificate. + * @param friendlyNameValue The FriendlyName value. */ - public void setFriendlyName(String friendlyName) + public void setFriendlyName(final String friendlyNameValue) { - this.friendlyName = friendlyName; + this.friendlyName = friendlyNameValue; } private ArrayList hostNames; @@ -656,6 +714,7 @@ public void setFriendlyName(String friendlyName) /** * An array of strings that contain the hostnames to which the * certificate is bound. + * @return The HostNames value. */ public ArrayList getHostNames() { @@ -665,10 +724,11 @@ public ArrayList getHostNames() /** * An array of strings that contain the hostnames to which the * certificate is bound. + * @param hostNamesValue The HostNames value. */ - public void setHostNames(ArrayList hostNames) + public void setHostNames(final ArrayList hostNamesValue) { - this.hostNames = hostNames; + this.hostNames = hostNamesValue; } private Calendar issueDate; @@ -676,6 +736,7 @@ public void setHostNames(ArrayList hostNames) /** * A dateTime value that contains the date that the certificate was * issued. + * @return The IssueDate value. */ public Calendar getIssueDate() { @@ -685,16 +746,18 @@ public Calendar getIssueDate() /** * A dateTime value that contains the date that the certificate was * issued. + * @param issueDateValue The IssueDate value. */ - public void setIssueDate(Calendar issueDate) + public void setIssueDate(final Calendar issueDateValue) { - this.issueDate = issueDate; + this.issueDate = issueDateValue; } private String issuer; /** * A string that identifies the issuer of the certificate. + * @return The Issuer value. */ public String getIssuer() { @@ -703,52 +766,58 @@ public String getIssuer() /** * A string that identifies the issuer of the certificate. + * @param issuerValue The Issuer value. */ - public void setIssuer(String issuer) + public void setIssuer(final String issuerValue) { - this.issuer = issuer; + this.issuer = issuerValue; } - private boolean isToBeDeleted; + private Boolean isToBeDeleted; /** * Boolean. true if the certificate is to be deleted. + * @return The IsToBeDeleted value. */ - public boolean isToBeDeleted() + public Boolean isToBeDeleted() { return this.isToBeDeleted; } /** * Boolean. true if the certificate is to be deleted. + * @param isToBeDeletedValue The IsToBeDeleted value. */ - public void setIsToBeDeleted(boolean isToBeDeleted) + public void setIsToBeDeleted(final Boolean isToBeDeletedValue) { - this.isToBeDeleted = isToBeDeleted; + this.isToBeDeleted = isToBeDeletedValue; } - private boolean isValid; + private Boolean isValid; /** * Boolean. true if the certificate is valid; otherwise, false. + * @return The IsValid value. */ - public boolean isValid() + public Boolean isValid() { return this.isValid; } /** * Boolean. true if the certificate is valid; otherwise, false. + * @param isValidValue The IsValid value. */ - public void setIsValid(boolean isValid) + public void setIsValid(final Boolean isValidValue) { - this.isValid = isValid; + this.isValid = isValidValue; } private String password; /** * A string that contains the password for the certificate. + * @return The Password value. */ public String getPassword() { @@ -757,16 +826,18 @@ public String getPassword() /** * A string that contains the password for the certificate. + * @param passwordValue The Password value. */ - public void setPassword(String password) + public void setPassword(final String passwordValue) { - this.password = password; + this.password = passwordValue; } private byte[] pfxBlob; /** * A base64Binary value that contains the PfxBlob of the certificate. + * @return The PfxBlob value. */ public byte[] getPfxBlob() { @@ -775,10 +846,11 @@ public byte[] getPfxBlob() /** * A base64Binary value that contains the PfxBlob of the certificate. + * @param pfxBlobValue The PfxBlob value. */ - public void setPfxBlob(byte[] pfxBlob) + public void setPfxBlob(final byte[] pfxBlobValue) { - this.pfxBlob = pfxBlob; + this.pfxBlob = pfxBlobValue; } private URI selfLinkUri; @@ -786,6 +858,7 @@ public void setPfxBlob(byte[] pfxBlob) /** * An anyURI value that contains the endpoint of the site to which the * certificate is bound. + * @return The SelfLinkUri value. */ public URI getSelfLinkUri() { @@ -795,10 +868,11 @@ public URI getSelfLinkUri() /** * An anyURI value that contains the endpoint of the site to which the * certificate is bound. + * @param selfLinkUriValue The SelfLinkUri value. */ - public void setSelfLinkUri(URI selfLinkUri) + public void setSelfLinkUri(final URI selfLinkUriValue) { - this.selfLinkUri = selfLinkUri; + this.selfLinkUri = selfLinkUriValue; } private String siteName; @@ -806,6 +880,7 @@ public void setSelfLinkUri(URI selfLinkUri) /** * A string that contains the name of the site to which the certificate * is bound. + * @return The SiteName value. */ public String getSiteName() { @@ -815,10 +890,11 @@ public String getSiteName() /** * A string that contains the name of the site to which the certificate * is bound. + * @param siteNameValue The SiteName value. */ - public void setSiteName(String siteName) + public void setSiteName(final String siteNameValue) { - this.siteName = siteName; + this.siteName = siteNameValue; } private String subjectName; @@ -826,6 +902,7 @@ public void setSiteName(String siteName) /** * A string that contains the name of the entity to whom the certificate * was issued. + * @return The SubjectName value. */ public String getSubjectName() { @@ -835,16 +912,18 @@ public String getSubjectName() /** * A string that contains the name of the entity to whom the certificate * was issued. + * @param subjectNameValue The SubjectName value. */ - public void setSubjectName(String subjectName) + public void setSubjectName(final String subjectNameValue) { - this.subjectName = subjectName; + this.subjectName = subjectNameValue; } private String thumbprint; /** * A string that contains the certificate thumbprint. + * @return The Thumbprint value. */ public String getThumbprint() { @@ -853,10 +932,11 @@ public String getThumbprint() /** * A string that contains the certificate thumbprint. + * @param thumbprintValue The Thumbprint value. */ - public void setThumbprint(String thumbprint) + public void setThumbprint(final String thumbprintValue) { - this.thumbprint = thumbprint; + this.thumbprint = thumbprintValue; } /** diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteCreateParameters.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteCreateParameters.java index 7f9c56eda9f58..2b940e21c8354 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteCreateParameters.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteCreateParameters.java @@ -37,6 +37,7 @@ public class WebSiteCreateParameters * Dedicated for the Standard offering. The default value is Shared. If you * set ComputeMode to Dedicated, you must specify a value for the * ServerFarm element. + * @return The ComputeMode value. */ public WebSiteComputeMode getComputeMode() { @@ -48,10 +49,11 @@ public WebSiteComputeMode getComputeMode() * Dedicated for the Standard offering. The default value is Shared. If you * set ComputeMode to Dedicated, you must specify a value for the * ServerFarm element. + * @param computeModeValue The ComputeMode value. */ - public void setComputeMode(WebSiteComputeMode computeMode) + public void setComputeMode(final WebSiteComputeMode computeModeValue) { - this.computeMode = computeMode; + this.computeMode = computeModeValue; } private ArrayList hostNames; @@ -61,6 +63,7 @@ public void setComputeMode(WebSiteComputeMode computeMode) * can be specified in the azurewebsites.net domain. The hostname should * match the name of the website. Custom domains can only be specified for * Shared or Standard websites. + * @return The HostNames value. */ public ArrayList getHostNames() { @@ -72,10 +75,11 @@ public ArrayList getHostNames() * can be specified in the azurewebsites.net domain. The hostname should * match the name of the website. Custom domains can only be specified for * Shared or Standard websites. + * @param hostNamesValue The HostNames value. */ - public void setHostNames(ArrayList hostNames) + public void setHostNames(final ArrayList hostNamesValue) { - this.hostNames = hostNames; + this.hostNames = hostNamesValue; } private String name; @@ -83,6 +87,7 @@ public void setHostNames(ArrayList hostNames) /** * Required. The name of the website. This should match the hostname in the * default domain. + * @return The Name value. */ public String getName() { @@ -92,10 +97,11 @@ public String getName() /** * Required. The name of the website. This should match the hostname in the * default domain. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String serverFarm; @@ -103,6 +109,7 @@ public void setName(String name) /** * The name of the Server Farm associated with this website. This is a * required value for Standard mode. + * @return The ServerFarm value. */ public String getServerFarm() { @@ -112,10 +119,11 @@ public String getServerFarm() /** * The name of the Server Farm associated with this website. This is a * required value for Standard mode. + * @param serverFarmValue The ServerFarm value. */ - public void setServerFarm(String serverFarm) + public void setServerFarm(final String serverFarmValue) { - this.serverFarm = serverFarm; + this.serverFarm = serverFarmValue; } private WebSiteMode siteMode; @@ -125,6 +133,7 @@ public void setServerFarm(String serverFarm) * offering. The default value is Limited. Note: Standard mode does not use * the SiteMode setting; it uses the ComputeMode setting. For more * information, see Upgrade or Downgrade a Web Site. + * @return The SiteMode value. */ public WebSiteMode getSiteMode() { @@ -136,16 +145,18 @@ public WebSiteMode getSiteMode() * offering. The default value is Limited. Note: Standard mode does not use * the SiteMode setting; it uses the ComputeMode setting. For more * information, see Upgrade or Downgrade a Web Site. + * @param siteModeValue The SiteMode value. */ - public void setSiteMode(WebSiteMode siteMode) + public void setSiteMode(final WebSiteMode siteModeValue) { - this.siteMode = siteMode; + this.siteMode = siteModeValue; } private WebSiteCreateParameters.WebSpaceDetails webSpace; /** * Information about the web space to create. + * @return The WebSpace value. */ public WebSiteCreateParameters.WebSpaceDetails getWebSpace() { @@ -154,16 +165,18 @@ public WebSiteCreateParameters.WebSpaceDetails getWebSpace() /** * Information about the web space to create. + * @param webSpaceValue The WebSpace value. */ - public void setWebSpace(WebSiteCreateParameters.WebSpaceDetails webSpace) + public void setWebSpace(final WebSiteCreateParameters.WebSpaceDetails webSpaceValue) { - this.webSpace = webSpace; + this.webSpace = webSpaceValue; } private String webSpaceName; /** * The name of the webspace. + * @return The WebSpaceName value. */ public String getWebSpaceName() { @@ -172,10 +185,11 @@ public String getWebSpaceName() /** * The name of the webspace. + * @param webSpaceNameValue The WebSpaceName value. */ - public void setWebSpaceName(String webSpaceName) + public void setWebSpaceName(final String webSpaceNameValue) { - this.webSpaceName = webSpaceName; + this.webSpaceName = webSpaceNameValue; } /** @@ -197,6 +211,7 @@ public static class WebSpaceDetails /** * Required. The geographical region of the webspace that will be * created. + * @return The GeoRegion value. */ public String getGeoRegion() { @@ -206,16 +221,18 @@ public String getGeoRegion() /** * Required. The geographical region of the webspace that will be * created. + * @param geoRegionValue The GeoRegion value. */ - public void setGeoRegion(String geoRegion) + public void setGeoRegion(final String geoRegionValue) { - this.geoRegion = geoRegion; + this.geoRegion = geoRegionValue; } private String name; /** * Required. The name of the webspace. + * @return The Name value. */ public String getName() { @@ -224,16 +241,18 @@ public String getName() /** * Required. The name of the webspace. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String plan; /** * Required. This value must be VirtualDedicatedPlan. + * @return The Plan value. */ public String getPlan() { @@ -242,10 +261,11 @@ public String getPlan() /** * Required. This value must be VirtualDedicatedPlan. + * @param planValue The Plan value. */ - public void setPlan(String plan) + public void setPlan(final String planValue) { - this.plan = plan; + this.plan = planValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteCreateResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteCreateResponse.java index a3cf7756cc633..838acb94b6173 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteCreateResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteCreateResponse.java @@ -34,6 +34,7 @@ public class WebSiteCreateResponse extends OperationResponse /** * Details of the created website. + * @return The WebSite value. */ public WebSite getWebSite() { @@ -42,9 +43,10 @@ public WebSite getWebSite() /** * Details of the created website. + * @param webSiteValue The WebSite value. */ - public void setWebSite(WebSite webSite) + public void setWebSite(final WebSite webSiteValue) { - this.webSite = webSite; + this.webSite = webSiteValue; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteDeleteParameters.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteDeleteParameters.java new file mode 100644 index 0000000000000..c5a3116868a3d --- /dev/null +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteDeleteParameters.java @@ -0,0 +1,92 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.websites.models; + +/** +* The Delete Web Site operation parameters. +*/ +public class WebSiteDeleteParameters +{ + private boolean deleteAllSlots; + + /** + * Delete all slots for the web site. + * @return The DeleteAllSlots value. + */ + public boolean isDeleteAllSlots() + { + return this.deleteAllSlots; + } + + /** + * Delete all slots for the web site. + * @param deleteAllSlotsValue The DeleteAllSlots value. + */ + public void setDeleteAllSlots(final boolean deleteAllSlotsValue) + { + this.deleteAllSlots = deleteAllSlotsValue; + } + + private boolean deleteEmptyServerFarm; + + /** + * If the site being deleted is the last web site in a server farm, you can + * delete the server farm. + * @return The DeleteEmptyServerFarm value. + */ + public boolean isDeleteEmptyServerFarm() + { + return this.deleteEmptyServerFarm; + } + + /** + * If the site being deleted is the last web site in a server farm, you can + * delete the server farm. + * @param deleteEmptyServerFarmValue The DeleteEmptyServerFarm value. + */ + public void setDeleteEmptyServerFarm(final boolean deleteEmptyServerFarmValue) + { + this.deleteEmptyServerFarm = deleteEmptyServerFarmValue; + } + + private boolean deleteMetrics; + + /** + * Delete the metrics for the web site. + * @return The DeleteMetrics value. + */ + public boolean isDeleteMetrics() + { + return this.deleteMetrics; + } + + /** + * Delete the metrics for the web site. + * @param deleteMetricsValue The DeleteMetrics value. + */ + public void setDeleteMetrics(final boolean deleteMetricsValue) + { + this.deleteMetrics = deleteMetricsValue; + } +} diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteDeleteRepositoryResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteDeleteRepositoryResponse.java index 9e22316834058..a589192397b1c 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteDeleteRepositoryResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteDeleteRepositoryResponse.java @@ -35,6 +35,7 @@ public class WebSiteDeleteRepositoryResponse extends OperationResponse /** * Contains the URI of the web site repository. + * @return The Uri value. */ public URI getUri() { @@ -43,9 +44,10 @@ public URI getUri() /** * Contains the URI of the web site repository. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetConfigurationResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetConfigurationResponse.java index 730a946b4426c..8f5946b54e93d 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetConfigurationResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetConfigurationResponse.java @@ -37,6 +37,7 @@ public class WebSiteGetConfigurationResponse extends OperationResponse /** * A set of name/value pairs that contain application settings for a site. + * @return The AppSettings value. */ public HashMap getAppSettings() { @@ -45,16 +46,18 @@ public HashMap getAppSettings() /** * A set of name/value pairs that contain application settings for a site. + * @param appSettingsValue The AppSettings value. */ - public void setAppSettings(HashMap appSettings) + public void setAppSettings(final HashMap appSettingsValue) { - this.appSettings = appSettings; + this.appSettings = appSettingsValue; } private ArrayList connectionStrings; /** * Contains connection strings for database and other external resources. + * @return The ConnectionStrings value. */ public ArrayList getConnectionStrings() { @@ -63,10 +66,11 @@ public ArrayList getConnec /** * Contains connection strings for database and other external resources. + * @param connectionStringsValue The ConnectionStrings value. */ - public void setConnectionStrings(ArrayList connectionStrings) + public void setConnectionStrings(final ArrayList connectionStringsValue) { - this.connectionStrings = connectionStrings; + this.connectionStrings = connectionStringsValue; } private ArrayList defaultDocuments; @@ -78,6 +82,7 @@ public void setConnectionStrings(ArrayList getDefaultDocuments() { @@ -91,16 +96,18 @@ public ArrayList getDefaultDocuments() * http://contoso.com is default.htm, the page * http://www.contoso.com/default.htm is returned when the browser is * pointed to http://www.contoso.com. + * @param defaultDocumentsValue The DefaultDocuments value. */ - public void setDefaultDocuments(ArrayList defaultDocuments) + public void setDefaultDocuments(final ArrayList defaultDocumentsValue) { - this.defaultDocuments = defaultDocuments; + this.defaultDocuments = defaultDocumentsValue; } private Boolean detailedErrorLoggingEnabled; /** * True if detailed error logging is enabled; otherwise, false. + * @return The DetailedErrorLoggingEnabled value. */ public Boolean isDetailedErrorLoggingEnabled() { @@ -109,16 +116,19 @@ public Boolean isDetailedErrorLoggingEnabled() /** * True if detailed error logging is enabled; otherwise, false. + * @param detailedErrorLoggingEnabledValue The DetailedErrorLoggingEnabled + * value. */ - public void setDetailedErrorLoggingEnabled(Boolean detailedErrorLoggingEnabled) + public void setDetailedErrorLoggingEnabled(final Boolean detailedErrorLoggingEnabledValue) { - this.detailedErrorLoggingEnabled = detailedErrorLoggingEnabled; + this.detailedErrorLoggingEnabled = detailedErrorLoggingEnabledValue; } private String documentRoot; /** * The document root. + * @return The DocumentRoot value. */ public String getDocumentRoot() { @@ -127,10 +137,11 @@ public String getDocumentRoot() /** * The document root. + * @param documentRootValue The DocumentRoot value. */ - public void setDocumentRoot(String documentRoot) + public void setDocumentRoot(final String documentRootValue) { - this.documentRoot = documentRoot; + this.documentRoot = documentRootValue; } private ArrayList handlerMappings; @@ -138,6 +149,7 @@ public void setDocumentRoot(String documentRoot) /** * Specifies custom executable programs for handling requests for specific * file name extensions. + * @return The HandlerMappings value. */ public ArrayList getHandlerMappings() { @@ -147,16 +159,18 @@ public ArrayList getHandlerMappi /** * Specifies custom executable programs for handling requests for specific * file name extensions. + * @param handlerMappingsValue The HandlerMappings value. */ - public void setHandlerMappings(ArrayList handlerMappings) + public void setHandlerMappings(final ArrayList handlerMappingsValue) { - this.handlerMappings = handlerMappings; + this.handlerMappings = handlerMappingsValue; } private Boolean httpLoggingEnabled; /** * True if HTTP error logging is enabled; otherwise, false. + * @return The HttpLoggingEnabled value. */ public Boolean isHttpLoggingEnabled() { @@ -165,16 +179,18 @@ public Boolean isHttpLoggingEnabled() /** * True if HTTP error logging is enabled; otherwise, false. + * @param httpLoggingEnabledValue The HttpLoggingEnabled value. */ - public void setHttpLoggingEnabled(Boolean httpLoggingEnabled) + public void setHttpLoggingEnabled(final Boolean httpLoggingEnabledValue) { - this.httpLoggingEnabled = httpLoggingEnabled; + this.httpLoggingEnabled = httpLoggingEnabledValue; } private Integer logsDirectorySizeLimit; /** * The limit of the logs directory. + * @return The LogsDirectorySizeLimit value. */ public Integer getLogsDirectorySizeLimit() { @@ -183,16 +199,18 @@ public Integer getLogsDirectorySizeLimit() /** * The limit of the logs directory. + * @param logsDirectorySizeLimitValue The LogsDirectorySizeLimit value. */ - public void setLogsDirectorySizeLimit(Integer logsDirectorySizeLimit) + public void setLogsDirectorySizeLimit(final Integer logsDirectorySizeLimitValue) { - this.logsDirectorySizeLimit = logsDirectorySizeLimit; + this.logsDirectorySizeLimit = logsDirectorySizeLimitValue; } private ManagedPipelineMode managedPipelineMode; /** * Managed pipeline modes. + * @return The ManagedPipelineMode value. */ public ManagedPipelineMode getManagedPipelineMode() { @@ -201,16 +219,18 @@ public ManagedPipelineMode getManagedPipelineMode() /** * Managed pipeline modes. + * @param managedPipelineModeValue The ManagedPipelineMode value. */ - public void setManagedPipelineMode(ManagedPipelineMode managedPipelineMode) + public void setManagedPipelineMode(final ManagedPipelineMode managedPipelineModeValue) { - this.managedPipelineMode = managedPipelineMode; + this.managedPipelineMode = managedPipelineModeValue; } private HashMap metadata; /** * Contains name/value pairs for source control or other information. + * @return The Metadata value. */ public HashMap getMetadata() { @@ -219,16 +239,18 @@ public HashMap getMetadata() /** * Contains name/value pairs for source control or other information. + * @param metadataValue The Metadata value. */ - public void setMetadata(HashMap metadata) + public void setMetadata(final HashMap metadataValue) { - this.metadata = metadata; + this.metadata = metadataValue; } private String netFrameworkVersion; /** * The .NET Framework version. Supported values are v2.0 and v4.0. + * @return The NetFrameworkVersion value. */ public String getNetFrameworkVersion() { @@ -237,10 +259,11 @@ public String getNetFrameworkVersion() /** * The .NET Framework version. Supported values are v2.0 and v4.0. + * @param netFrameworkVersionValue The NetFrameworkVersion value. */ - public void setNetFrameworkVersion(String netFrameworkVersion) + public void setNetFrameworkVersion(final String netFrameworkVersionValue) { - this.netFrameworkVersion = netFrameworkVersion; + this.netFrameworkVersion = netFrameworkVersionValue; } private Integer numberOfWorkers; @@ -250,6 +273,7 @@ public void setNetFrameworkVersion(String netFrameworkVersion) * Free, this value is 1. If the site mode is Shared, this value can range * from 1 through 6. If the site mode is Standard, this value can range * from 1 through 10. + * @return The NumberOfWorkers value. */ public Integer getNumberOfWorkers() { @@ -261,10 +285,11 @@ public Integer getNumberOfWorkers() * Free, this value is 1. If the site mode is Shared, this value can range * from 1 through 6. If the site mode is Standard, this value can range * from 1 through 10. + * @param numberOfWorkersValue The NumberOfWorkers value. */ - public void setNumberOfWorkers(Integer numberOfWorkers) + public void setNumberOfWorkers(final Integer numberOfWorkersValue) { - this.numberOfWorkers = numberOfWorkers; + this.numberOfWorkers = numberOfWorkersValue; } private String phpVersion; @@ -272,6 +297,7 @@ public void setNumberOfWorkers(Integer numberOfWorkers) /** * Supported values are an empty string (an empty string disables PHP), 5.3, * and 5.4. + * @return The PhpVersion value. */ public String getPhpVersion() { @@ -281,16 +307,18 @@ public String getPhpVersion() /** * Supported values are an empty string (an empty string disables PHP), 5.3, * and 5.4. + * @param phpVersionValue The PhpVersion value. */ - public void setPhpVersion(String phpVersion) + public void setPhpVersion(final String phpVersionValue) { - this.phpVersion = phpVersion; + this.phpVersion = phpVersionValue; } private String publishingPassword; /** * Hash value of the password used for publishing the web site. + * @return The PublishingPassword value. */ public String getPublishingPassword() { @@ -299,10 +327,11 @@ public String getPublishingPassword() /** * Hash value of the password used for publishing the web site. + * @param publishingPasswordValue The PublishingPassword value. */ - public void setPublishingPassword(String publishingPassword) + public void setPublishingPassword(final String publishingPasswordValue) { - this.publishingPassword = publishingPassword; + this.publishingPassword = publishingPasswordValue; } private String publishingUserName; @@ -310,6 +339,7 @@ public void setPublishingPassword(String publishingPassword) /** * The username used for publishing the web site. This is normally a dollar * sign prepended to the web site name (for example, “$contoso”). + * @return The PublishingUserName value. */ public String getPublishingUserName() { @@ -319,16 +349,18 @@ public String getPublishingUserName() /** * The username used for publishing the web site. This is normally a dollar * sign prepended to the web site name (for example, “$contoso”). + * @param publishingUserNameValue The PublishingUserName value. */ - public void setPublishingUserName(String publishingUserName) + public void setPublishingUserName(final String publishingUserNameValue) { - this.publishingUserName = publishingUserName; + this.publishingUserName = publishingUserNameValue; } private Boolean remoteDebuggingEnabled; /** * True remote debugging is enabled; otherwise, false. + * @return The RemoteDebuggingEnabled value. */ public Boolean isRemoteDebuggingEnabled() { @@ -337,16 +369,18 @@ public Boolean isRemoteDebuggingEnabled() /** * True remote debugging is enabled; otherwise, false. + * @param remoteDebuggingEnabledValue The RemoteDebuggingEnabled value. */ - public void setRemoteDebuggingEnabled(Boolean remoteDebuggingEnabled) + public void setRemoteDebuggingEnabled(final Boolean remoteDebuggingEnabledValue) { - this.remoteDebuggingEnabled = remoteDebuggingEnabled; + this.remoteDebuggingEnabled = remoteDebuggingEnabledValue; } private RemoteDebuggingVersion remoteDebuggingVersion; /** * True remote debugging version. + * @return The RemoteDebuggingVersion value. */ public RemoteDebuggingVersion getRemoteDebuggingVersion() { @@ -355,16 +389,18 @@ public RemoteDebuggingVersion getRemoteDebuggingVersion() /** * True remote debugging version. + * @param remoteDebuggingVersionValue The RemoteDebuggingVersion value. */ - public void setRemoteDebuggingVersion(RemoteDebuggingVersion remoteDebuggingVersion) + public void setRemoteDebuggingVersion(final RemoteDebuggingVersion remoteDebuggingVersionValue) { - this.remoteDebuggingVersion = remoteDebuggingVersion; + this.remoteDebuggingVersion = remoteDebuggingVersionValue; } private Boolean requestTracingEnabled; /** * True if request tracing is enabled; otherwise, false. + * @return The RequestTracingEnabled value. */ public Boolean isRequestTracingEnabled() { @@ -373,16 +409,18 @@ public Boolean isRequestTracingEnabled() /** * True if request tracing is enabled; otherwise, false. + * @param requestTracingEnabledValue The RequestTracingEnabled value. */ - public void setRequestTracingEnabled(Boolean requestTracingEnabled) + public void setRequestTracingEnabled(final Boolean requestTracingEnabledValue) { - this.requestTracingEnabled = requestTracingEnabled; + this.requestTracingEnabled = requestTracingEnabledValue; } private Calendar requestTracingExpirationTime; /** * Time remaining until request tracing expires. + * @return The RequestTracingExpirationTime value. */ public Calendar getRequestTracingExpirationTime() { @@ -391,10 +429,12 @@ public Calendar getRequestTracingExpirationTime() /** * Time remaining until request tracing expires. + * @param requestTracingExpirationTimeValue The RequestTracingExpirationTime + * value. */ - public void setRequestTracingExpirationTime(Calendar requestTracingExpirationTime) + public void setRequestTracingExpirationTime(final Calendar requestTracingExpirationTimeValue) { - this.requestTracingExpirationTime = requestTracingExpirationTime; + this.requestTracingExpirationTime = requestTracingExpirationTimeValue; } private String scmType; @@ -403,6 +443,7 @@ public void setRequestTracingExpirationTime(Calendar requestTracingExpirationTim * The source control method that the web site is using (for example, Local * Git). If deployment from source control has not been set up for the web * site, this value is None. + * @return The ScmType value. */ public String getScmType() { @@ -413,16 +454,18 @@ public String getScmType() * The source control method that the web site is using (for example, Local * Git). If deployment from source control has not been set up for the web * site, this value is None. + * @param scmTypeValue The ScmType value. */ - public void setScmType(String scmType) + public void setScmType(final String scmTypeValue) { - this.scmType = scmType; + this.scmType = scmTypeValue; } private Boolean use32BitWorkerProcess; /** * True if 32-bit mode is enabled; otherwise, false. + * @return The Use32BitWorkerProcess value. */ public Boolean isUse32BitWorkerProcess() { @@ -431,16 +474,18 @@ public Boolean isUse32BitWorkerProcess() /** * True if 32-bit mode is enabled; otherwise, false. + * @param use32BitWorkerProcessValue The Use32BitWorkerProcess value. */ - public void setUse32BitWorkerProcess(Boolean use32BitWorkerProcess) + public void setUse32BitWorkerProcess(final Boolean use32BitWorkerProcessValue) { - this.use32BitWorkerProcess = use32BitWorkerProcess; + this.use32BitWorkerProcess = use32BitWorkerProcessValue; } private Boolean webSocketsEnabled; /** * True if Web Sockets are enabled; otherwise, false. + * @return The WebSocketsEnabled value. */ public Boolean isWebSocketsEnabled() { @@ -449,10 +494,11 @@ public Boolean isWebSocketsEnabled() /** * True if Web Sockets are enabled; otherwise, false. + * @param webSocketsEnabledValue The WebSocketsEnabled value. */ - public void setWebSocketsEnabled(Boolean webSocketsEnabled) + public void setWebSocketsEnabled(final Boolean webSocketsEnabledValue) { - this.webSocketsEnabled = webSocketsEnabled; + this.webSocketsEnabled = webSocketsEnabledValue; } /** @@ -478,6 +524,7 @@ public static class ConnectionStringInfo /** * A database connection string. + * @return The ConnectionString value. */ public String getConnectionString() { @@ -486,16 +533,18 @@ public String getConnectionString() /** * A database connection string. + * @param connectionStringValue The ConnectionString value. */ - public void setConnectionString(String connectionString) + public void setConnectionString(final String connectionStringValue) { - this.connectionString = connectionString; + this.connectionString = connectionStringValue; } private String name; /** * The name of the connection string. + * @return The Name value. */ public String getName() { @@ -504,16 +553,18 @@ public String getName() /** * The name of the connection string. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String type; /** * The type of the connection string (for example, "MySQL"). + * @return The Type value. */ public String getType() { @@ -522,10 +573,11 @@ public String getType() /** * The type of the connection string (for example, "MySQL"). + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } @@ -541,6 +593,7 @@ public static class HandlerMapping * A string that contains optional arguments for the script processor * specified by the * SiteConfig.HandlerMappings.HandlerMapping.ScriptProcessor element. + * @return The Arguments value. */ public String getArguments() { @@ -551,10 +604,11 @@ public String getArguments() * A string that contains optional arguments for the script processor * specified by the * SiteConfig.HandlerMappings.HandlerMapping.ScriptProcessor element. + * @param argumentsValue The Arguments value. */ - public void setArguments(String arguments) + public void setArguments(final String argumentsValue) { - this.arguments = arguments; + this.arguments = argumentsValue; } private String extension; @@ -562,6 +616,7 @@ public void setArguments(String arguments) /** * A string that specifies the extension of the file type that the * script processor will handle (for example, *.php). + * @return The Extension value. */ public String getExtension() { @@ -571,10 +626,11 @@ public String getExtension() /** * A string that specifies the extension of the file type that the * script processor will handle (for example, *.php). + * @param extensionValue The Extension value. */ - public void setExtension(String extension) + public void setExtension(final String extensionValue) { - this.extension = extension; + this.extension = extensionValue; } private String scriptProcessor; @@ -583,6 +639,7 @@ public void setExtension(String extension) * The absolute path to the location of the executable file that will * handle the files specified in the * SiteConfig.HandlerMappings.HandlerMapping.Extension element. + * @return The ScriptProcessor value. */ public String getScriptProcessor() { @@ -593,10 +650,11 @@ public String getScriptProcessor() * The absolute path to the location of the executable file that will * handle the files specified in the * SiteConfig.HandlerMappings.HandlerMapping.Extension element. + * @param scriptProcessorValue The ScriptProcessor value. */ - public void setScriptProcessor(String scriptProcessor) + public void setScriptProcessor(final String scriptProcessorValue) { - this.scriptProcessor = scriptProcessor; + this.scriptProcessor = scriptProcessorValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetHistoricalUsageMetricsParameters.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetHistoricalUsageMetricsParameters.java index d4e8603844649..2ca3881acc687 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetHistoricalUsageMetricsParameters.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetHistoricalUsageMetricsParameters.java @@ -36,6 +36,7 @@ public class WebSiteGetHistoricalUsageMetricsParameters /** * The ending time of the metrics to return. If this parameter is not * specified, the current time is used. + * @return The EndTime value. */ public Calendar getEndTime() { @@ -45,10 +46,11 @@ public Calendar getEndTime() /** * The ending time of the metrics to return. If this parameter is not * specified, the current time is used. + * @param endTimeValue The EndTime value. */ - public void setEndTime(Calendar endTime) + public void setEndTime(final Calendar endTimeValue) { - this.endTime = endTime; + this.endTime = endTimeValue; } private ArrayList metricNames; @@ -57,6 +59,7 @@ public void setEndTime(Calendar endTime) * Specifies a comma-separated list of the names of the metrics to return. * If the names parameter is not specified, then all available metrics are * returned. + * @return The MetricNames value. */ public ArrayList getMetricNames() { @@ -67,10 +70,11 @@ public ArrayList getMetricNames() * Specifies a comma-separated list of the names of the metrics to return. * If the names parameter is not specified, then all available metrics are * returned. + * @param metricNamesValue The MetricNames value. */ - public void setMetricNames(ArrayList metricNames) + public void setMetricNames(final ArrayList metricNamesValue) { - this.metricNames = metricNames; + this.metricNames = metricNamesValue; } private Calendar startTime; @@ -78,6 +82,7 @@ public void setMetricNames(ArrayList metricNames) /** * The starting time of the metrics to return. If this parameter is not * specified, the beginning of the current hour is used. + * @return The StartTime value. */ public Calendar getStartTime() { @@ -87,10 +92,11 @@ public Calendar getStartTime() /** * The starting time of the metrics to return. If this parameter is not * specified, the beginning of the current hour is used. + * @param startTimeValue The StartTime value. */ - public void setStartTime(Calendar startTime) + public void setStartTime(final Calendar startTimeValue) { - this.startTime = startTime; + this.startTime = startTimeValue; } /** diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetHistoricalUsageMetricsResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetHistoricalUsageMetricsResponse.java index 4c9b6b2aa0ce3..6c1d5d8f4b4a3 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetHistoricalUsageMetricsResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetHistoricalUsageMetricsResponse.java @@ -37,6 +37,7 @@ public class WebSiteGetHistoricalUsageMetricsResponse extends OperationResponse /** * Historical metric snapshots for the web site. + * @return The UsageMetrics value. */ public ArrayList getUsageMetrics() { @@ -45,10 +46,11 @@ public ArrayList /** * Historical metric snapshots for the web site. + * @param usageMetricsValue The UsageMetrics value. */ - public void setUsageMetrics(ArrayList usageMetrics) + public void setUsageMetrics(final ArrayList usageMetricsValue) { - this.usageMetrics = usageMetrics; + this.usageMetrics = usageMetricsValue; } /** @@ -80,6 +82,7 @@ public static class HistoricalUsageMetric /** * Reports whether the metric data was returned successfully. + * @return The Code value. */ public String getCode() { @@ -88,16 +91,18 @@ public String getCode() /** * Reports whether the metric data was returned successfully. + * @param codeValue The Code value. */ - public void setCode(String code) + public void setCode(final String codeValue) { - this.code = code; + this.code = codeValue; } private WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricData data; /** * Historical metric snapshot data for the web site. + * @return The Data value. */ public WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricData getData() { @@ -106,16 +111,18 @@ public WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricData getDat /** * Historical metric snapshot data for the web site. + * @param dataValue The Data value. */ - public void setData(WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricData data) + public void setData(final WebSiteGetHistoricalUsageMetricsResponse.HistoricalUsageMetricData dataValue) { - this.data = data; + this.data = dataValue; } private String message; /** * A string for optional message content. + * @return The Message value. */ public String getMessage() { @@ -124,10 +131,11 @@ public String getMessage() /** * A string for optional message content. + * @param messageValue The Message value. */ - public void setMessage(String message) + public void setMessage(final String messageValue) { - this.message = message; + this.message = messageValue; } } @@ -140,6 +148,7 @@ public static class HistoricalUsageMetricData /** * The display name of the metric, including spaces. + * @return The DisplayName value. */ public String getDisplayName() { @@ -148,16 +157,18 @@ public String getDisplayName() /** * The display name of the metric, including spaces. + * @param displayNameValue The DisplayName value. */ - public void setDisplayName(String displayName) + public void setDisplayName(final String displayNameValue) { - this.displayName = displayName; + this.displayName = displayNameValue; } private Calendar endTime; /** * The end time of the data reported. + * @return The EndTime value. */ public Calendar getEndTime() { @@ -166,16 +177,18 @@ public Calendar getEndTime() /** * The end time of the data reported. + * @param endTimeValue The EndTime value. */ - public void setEndTime(Calendar endTime) + public void setEndTime(final Calendar endTimeValue) { - this.endTime = endTime; + this.endTime = endTimeValue; } private String name; /** * The name of the metric. + * @return The Name value. */ public String getName() { @@ -184,16 +197,18 @@ public String getName() /** * The name of the metric. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String primaryAggregationType; /** * The primary data aggregation type. This value is usually Total. + * @return The PrimaryAggregationType value. */ public String getPrimaryAggregationType() { @@ -202,16 +217,18 @@ public String getPrimaryAggregationType() /** * The primary data aggregation type. This value is usually Total. + * @param primaryAggregationTypeValue The PrimaryAggregationType value. */ - public void setPrimaryAggregationType(String primaryAggregationType) + public void setPrimaryAggregationType(final String primaryAggregationTypeValue) { - this.primaryAggregationType = primaryAggregationType; + this.primaryAggregationType = primaryAggregationTypeValue; } private Calendar startTime; /** * The start time of the data reported. + * @return The StartTime value. */ public Calendar getStartTime() { @@ -220,10 +237,11 @@ public Calendar getStartTime() /** * The start time of the data reported. + * @param startTimeValue The StartTime value. */ - public void setStartTime(Calendar startTime) + public void setStartTime(final Calendar startTimeValue) { - this.startTime = startTime; + this.startTime = startTimeValue; } private String timeGrain; @@ -231,6 +249,7 @@ public void setStartTime(Calendar startTime) /** * Length of time (rollup) during which the information was gathered. * For more information, see Supported Rollups. + * @return The TimeGrain value. */ public String getTimeGrain() { @@ -240,10 +259,11 @@ public String getTimeGrain() /** * Length of time (rollup) during which the information was gathered. * For more information, see Supported Rollups. + * @param timeGrainValue The TimeGrain value. */ - public void setTimeGrain(String timeGrain) + public void setTimeGrain(final String timeGrainValue) { - this.timeGrain = timeGrain; + this.timeGrain = timeGrainValue; } private String unit; @@ -251,6 +271,7 @@ public void setTimeGrain(String timeGrain) /** * The unit of measurement for the metric (for example, milliseconds, * bytes, or count). + * @return The Unit value. */ public String getUnit() { @@ -260,16 +281,18 @@ public String getUnit() /** * The unit of measurement for the metric (for example, milliseconds, * bytes, or count). + * @param unitValue The Unit value. */ - public void setUnit(String unit) + public void setUnit(final String unitValue) { - this.unit = unit; + this.unit = unitValue; } private ArrayList values; /** * One or more MetricSample elements. + * @return The Values value. */ public ArrayList getValues() { @@ -278,10 +301,11 @@ public ArrayList values) + public void setValues(final ArrayList valuesValue) { - this.values = values; + this.values = valuesValue; } /** @@ -303,6 +327,7 @@ public static class HistoricalUsageMetricSample /** * The metric sample count. This value is usually 1. + * @return The Count value. */ public int getCount() { @@ -311,16 +336,18 @@ public int getCount() /** * The metric sample count. This value is usually 1. + * @param countValue The Count value. */ - public void setCount(int count) + public void setCount(final int countValue) { - this.count = count; + this.count = countValue; } private String maximum; /** * Maximum value recorded. + * @return The Maximum value. */ public String getMaximum() { @@ -329,16 +356,18 @@ public String getMaximum() /** * Maximum value recorded. + * @param maximumValue The Maximum value. */ - public void setMaximum(String maximum) + public void setMaximum(final String maximumValue) { - this.maximum = maximum; + this.maximum = maximumValue; } private String minimum; /** * Minimum value recorded. + * @return The Minimum value. */ public String getMinimum() { @@ -347,16 +376,18 @@ public String getMinimum() /** * Minimum value recorded. + * @param minimumValue The Minimum value. */ - public void setMinimum(String minimum) + public void setMinimum(final String minimumValue) { - this.minimum = minimum; + this.minimum = minimumValue; } private Calendar timeCreated; /** * Time the metric was taken. + * @return The TimeCreated value. */ public Calendar getTimeCreated() { @@ -365,16 +396,18 @@ public Calendar getTimeCreated() /** * Time the metric was taken. + * @param timeCreatedValue The TimeCreated value. */ - public void setTimeCreated(Calendar timeCreated) + public void setTimeCreated(final Calendar timeCreatedValue) { - this.timeCreated = timeCreated; + this.timeCreated = timeCreatedValue; } private String total; /** * Value of the metric sample for the time taken. + * @return The Total value. */ public String getTotal() { @@ -383,10 +416,11 @@ public String getTotal() /** * Value of the metric sample for the time taken. + * @param totalValue The Total value. */ - public void setTotal(String total) + public void setTotal(final String totalValue) { - this.total = total; + this.total = totalValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetParameters.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetParameters.java index d43a8cef97c99..1577bd5c98d27 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetParameters.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetParameters.java @@ -34,6 +34,7 @@ public class WebSiteGetParameters /** * Specifies a list of the names of any addtional parameters to return. + * @return The PropertiesToInclude value. */ public ArrayList getPropertiesToInclude() { @@ -42,10 +43,11 @@ public ArrayList getPropertiesToInclude() /** * Specifies a list of the names of any addtional parameters to return. + * @param propertiesToIncludeValue The PropertiesToInclude value. */ - public void setPropertiesToInclude(ArrayList propertiesToInclude) + public void setPropertiesToInclude(final ArrayList propertiesToIncludeValue) { - this.propertiesToInclude = propertiesToInclude; + this.propertiesToInclude = propertiesToIncludeValue; } /** diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetPublishProfileResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetPublishProfileResponse.java index ed2cb988a56e1..94191cb31513b 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetPublishProfileResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetPublishProfileResponse.java @@ -37,6 +37,7 @@ public class WebSiteGetPublishProfileResponse extends OperationResponse implemen /** * Contains one or more publish profiles. + * @return The PublishProfiles value. */ public ArrayList getPublishProfiles() { @@ -45,10 +46,11 @@ public ArrayList getPublishProf /** * Contains one or more publish profiles. + * @param publishProfilesValue The PublishProfiles value. */ - public void setPublishProfiles(ArrayList publishProfiles) + public void setPublishProfiles(final ArrayList publishProfilesValue) { - this.publishProfiles = publishProfiles; + this.publishProfiles = publishProfilesValue; } /** @@ -80,6 +82,7 @@ public static class Database /** * Contains a database connection string. + * @return The ConnectionString value. */ public String getConnectionString() { @@ -88,16 +91,18 @@ public String getConnectionString() /** * Contains a database connection string. + * @param connectionStringValue The ConnectionString value. */ - public void setConnectionString(String connectionString) + public void setConnectionString(final String connectionStringValue) { - this.connectionString = connectionString; + this.connectionString = connectionStringValue; } private String name; /** * Contains the friendly name of the connection string. + * @return The Name value. */ public String getName() { @@ -106,10 +111,11 @@ public String getName() /** * Contains the friendly name of the connection string. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String providerName; @@ -117,6 +123,7 @@ public void setName(String name) /** * Contains the type of database provider (for example, "SQL" or * "MySQL"). + * @return The ProviderName value. */ public String getProviderName() { @@ -126,22 +133,29 @@ public String getProviderName() /** * Contains the type of database provider (for example, "SQL" or * "MySQL"). + * @param providerNameValue The ProviderName value. */ - public void setProviderName(String providerName) + public void setProviderName(final String providerNameValue) { - this.providerName = providerName; + this.providerName = providerNameValue; } private String type; + /** + * @return The Type value. + */ public String getType() { return this.type; } - public void setType(String type) + /** + * @param typeValue The Type value. + */ + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } @@ -154,6 +168,7 @@ public static class PublishProfile /** * The URL of the control panel for the web site. + * @return The ControlPanelUri value. */ public URI getControlPanelUri() { @@ -162,10 +177,11 @@ public URI getControlPanelUri() /** * The URL of the control panel for the web site. + * @param controlPanelUriValue The ControlPanelUri value. */ - public void setControlPanelUri(URI controlPanelUri) + public void setControlPanelUri(final URI controlPanelUriValue) { - this.controlPanelUri = controlPanelUri; + this.controlPanelUri = controlPanelUriValue; } private ArrayList databases; @@ -173,6 +189,7 @@ public void setControlPanelUri(URI controlPanelUri) /** * Contains connection information for the databases used by the web * site application. + * @return The Databases value. */ public ArrayList getDatabases() { @@ -182,16 +199,18 @@ public ArrayList getDatabases() /** * Contains connection information for the databases used by the web * site application. + * @param databasesValue The Databases value. */ - public void setDatabases(ArrayList databases) + public void setDatabases(final ArrayList databasesValue) { - this.databases = databases; + this.databases = databasesValue; } private URI destinationAppUri; /** * The URL of the website that will be published to. + * @return The DestinationAppUri value. */ public URI getDestinationAppUri() { @@ -200,10 +219,11 @@ public URI getDestinationAppUri() /** * The URL of the website that will be published to. + * @param destinationAppUriValue The DestinationAppUri value. */ - public void setDestinationAppUri(URI destinationAppUri) + public void setDestinationAppUri(final URI destinationAppUriValue) { - this.destinationAppUri = destinationAppUri; + this.destinationAppUri = destinationAppUriValue; } private boolean ftpPassiveMode; @@ -211,6 +231,7 @@ public void setDestinationAppUri(URI destinationAppUri) /** * True or False depending on whether FTP passive mode is being used. * This attribute applies only if publishMethod is set to FTP. + * @return The FtpPassiveMode value. */ public boolean isFtpPassiveMode() { @@ -220,16 +241,18 @@ public boolean isFtpPassiveMode() /** * True or False depending on whether FTP passive mode is being used. * This attribute applies only if publishMethod is set to FTP. + * @param ftpPassiveModeValue The FtpPassiveMode value. */ - public void setFtpPassiveMode(boolean ftpPassiveMode) + public void setFtpPassiveMode(final boolean ftpPassiveModeValue) { - this.ftpPassiveMode = ftpPassiveMode; + this.ftpPassiveMode = ftpPassiveModeValue; } private URI hostingProviderForumUri; /** * The URL of the forum of the hosting provider. + * @return The HostingProviderForumUri value. */ public URI getHostingProviderForumUri() { @@ -238,10 +261,11 @@ public URI getHostingProviderForumUri() /** * The URL of the forum of the hosting provider. + * @param hostingProviderForumUriValue The HostingProviderForumUri value. */ - public void setHostingProviderForumUri(URI hostingProviderForumUri) + public void setHostingProviderForumUri(final URI hostingProviderForumUriValue) { - this.hostingProviderForumUri = hostingProviderForumUri; + this.hostingProviderForumUri = hostingProviderForumUriValue; } private String mSDeploySite; @@ -249,6 +273,7 @@ public void setHostingProviderForumUri(URI hostingProviderForumUri) /** * The name of the site that will be published to. This attribute * applies only if publishMethod is set to MSDeploy. + * @return The MSDeploySite value. */ public String getMSDeploySite() { @@ -258,10 +283,11 @@ public String getMSDeploySite() /** * The name of the site that will be published to. This attribute * applies only if publishMethod is set to MSDeploy. + * @param mSDeploySiteValue The MSDeploySite value. */ - public void setMSDeploySite(String mSDeploySite) + public void setMSDeploySite(final String mSDeploySiteValue) { - this.mSDeploySite = mSDeploySite; + this.mSDeploySite = mSDeploySiteValue; } private String mySqlConnectionString; @@ -269,6 +295,7 @@ public void setMSDeploySite(String mSDeploySite) /** * The MySQL database connection string for the web site application, if * the web site connects to a MySQL database. + * @return The MySqlConnectionString value. */ public String getMySqlConnectionString() { @@ -278,16 +305,18 @@ public String getMySqlConnectionString() /** * The MySQL database connection string for the web site application, if * the web site connects to a MySQL database. + * @param mySqlConnectionStringValue The MySqlConnectionString value. */ - public void setMySqlConnectionString(String mySqlConnectionString) + public void setMySqlConnectionString(final String mySqlConnectionStringValue) { - this.mySqlConnectionString = mySqlConnectionString; + this.mySqlConnectionString = mySqlConnectionStringValue; } private String profileName; /** * The unique name of the publish profile. + * @return The ProfileName value. */ public String getProfileName() { @@ -296,16 +325,18 @@ public String getProfileName() /** * The unique name of the publish profile. + * @param profileNameValue The ProfileName value. */ - public void setProfileName(String profileName) + public void setProfileName(final String profileNameValue) { - this.profileName = profileName; + this.profileName = profileNameValue; } private String publishMethod; /** * The publish method, such as MSDeploy or FTP. + * @return The PublishMethod value. */ public String getPublishMethod() { @@ -314,16 +345,18 @@ public String getPublishMethod() /** * The publish method, such as MSDeploy or FTP. + * @param publishMethodValue The PublishMethod value. */ - public void setPublishMethod(String publishMethod) + public void setPublishMethod(final String publishMethodValue) { - this.publishMethod = publishMethod; + this.publishMethod = publishMethodValue; } private String publishUrl; /** * The URL to which content will be uploaded. + * @return The PublishUrl value. */ public String getPublishUrl() { @@ -332,10 +365,11 @@ public String getPublishUrl() /** * The URL to which content will be uploaded. + * @param publishUrlValue The PublishUrl value. */ - public void setPublishUrl(String publishUrl) + public void setPublishUrl(final String publishUrlValue) { - this.publishUrl = publishUrl; + this.publishUrl = publishUrlValue; } private String sqlServerConnectionString; @@ -343,6 +377,7 @@ public void setPublishUrl(String publishUrl) /** * The SQL Server database connection string for the web site * application, if the web site connects to a SQL Server database. + * @return The SqlServerConnectionString value. */ public String getSqlServerConnectionString() { @@ -352,16 +387,19 @@ public String getSqlServerConnectionString() /** * The SQL Server database connection string for the web site * application, if the web site connects to a SQL Server database. + * @param sqlServerConnectionStringValue The SqlServerConnectionString + * value. */ - public void setSqlServerConnectionString(String sqlServerConnectionString) + public void setSqlServerConnectionString(final String sqlServerConnectionStringValue) { - this.sqlServerConnectionString = sqlServerConnectionString; + this.sqlServerConnectionString = sqlServerConnectionStringValue; } private String userName; /** * The name for the identity that will be used for publishing. + * @return The UserName value. */ public String getUserName() { @@ -370,16 +408,18 @@ public String getUserName() /** * The name for the identity that will be used for publishing. + * @param userNameValue The UserName value. */ - public void setUserName(String userName) + public void setUserName(final String userNameValue) { - this.userName = userName; + this.userName = userNameValue; } private String userPassword; /** * Hash value of the password that will be used for publishing. + * @return The UserPassword value. */ public String getUserPassword() { @@ -388,10 +428,11 @@ public String getUserPassword() /** * Hash value of the password that will be used for publishing. + * @param userPasswordValue The UserPassword value. */ - public void setUserPassword(String userPassword) + public void setUserPassword(final String userPasswordValue) { - this.userPassword = userPassword; + this.userPassword = userPasswordValue; } /** diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetRepositoryResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetRepositoryResponse.java index 2657c43a44c5d..2e704ea5db540 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetRepositoryResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetRepositoryResponse.java @@ -35,6 +35,7 @@ public class WebSiteGetRepositoryResponse extends OperationResponse /** * Contains the URI of the web site repository. + * @return The Uri value. */ public URI getUri() { @@ -43,9 +44,10 @@ public URI getUri() /** * Contains the URI of the web site repository. + * @param uriValue The Uri value. */ - public void setUri(URI uri) + public void setUri(final URI uriValue) { - this.uri = uri; + this.uri = uriValue; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetResponse.java index a61bb382bb4f7..27b83806a742a 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetResponse.java @@ -34,6 +34,7 @@ public class WebSiteGetResponse extends OperationResponse /** * Details for the requested website. + * @return The WebSite value. */ public WebSite getWebSite() { @@ -42,9 +43,10 @@ public WebSite getWebSite() /** * Details for the requested website. + * @param webSiteValue The WebSite value. */ - public void setWebSite(WebSite webSite) + public void setWebSite(final WebSite webSiteValue) { - this.webSite = webSite; + this.webSite = webSiteValue; } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetUsageMetricsResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetUsageMetricsResponse.java index 65940e2e1e844..c76802328b647 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetUsageMetricsResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteGetUsageMetricsResponse.java @@ -37,6 +37,7 @@ public class WebSiteGetUsageMetricsResponse extends OperationResponse implements /** * The usage metrics for the web site. + * @return The UsageMetrics value. */ public ArrayList getUsageMetrics() { @@ -45,10 +46,11 @@ public ArrayList getUsageMetrics() /** * The usage metrics for the web site. + * @param usageMetricsValue The UsageMetrics value. */ - public void setUsageMetrics(ArrayList usageMetrics) + public void setUsageMetrics(final ArrayList usageMetricsValue) { - this.usageMetrics = usageMetrics; + this.usageMetrics = usageMetricsValue; } /** @@ -81,6 +83,7 @@ public static class UsageMetric * The compute mode of the web site. For web sites in Standard Mode, the * return value is Dedicated. For web sites in Free or Shared mode, the * return value is Shared. + * @return The ComputeMode value. */ public WebSiteComputeMode getComputeMode() { @@ -91,10 +94,11 @@ public WebSiteComputeMode getComputeMode() * The compute mode of the web site. For web sites in Standard Mode, the * return value is Dedicated. For web sites in Free or Shared mode, the * return value is Shared. + * @param computeModeValue The ComputeMode value. */ - public void setComputeMode(WebSiteComputeMode computeMode) + public void setComputeMode(final WebSiteComputeMode computeModeValue) { - this.computeMode = computeMode; + this.computeMode = computeModeValue; } private String currentValue; @@ -102,6 +106,7 @@ public void setComputeMode(WebSiteComputeMode computeMode) /** * The current value of the metric specified, expressed in terms of the * measurement specified by the Unit element. + * @return The CurrentValue value. */ public String getCurrentValue() { @@ -111,16 +116,18 @@ public String getCurrentValue() /** * The current value of the metric specified, expressed in terms of the * measurement specified by the Unit element. + * @param currentValueValue The CurrentValue value. */ - public void setCurrentValue(String currentValue) + public void setCurrentValue(final String currentValueValue) { - this.currentValue = currentValue; + this.currentValue = currentValueValue; } private String displayName; /** * The display name of the metric (includes spaces). + * @return The DisplayName value. */ public String getDisplayName() { @@ -129,10 +136,11 @@ public String getDisplayName() /** * The display name of the metric (includes spaces). + * @param displayNameValue The DisplayName value. */ - public void setDisplayName(String displayName) + public void setDisplayName(final String displayNameValue) { - this.displayName = displayName; + this.displayName = displayNameValue; } private String limit; @@ -145,6 +153,7 @@ public void setDisplayName(String displayName) * Time, Memory Usage, and File System Storage. Important: Site level * Limits information is only meaningful for Shared and Standard web * sites. For free web sites, limits are enforced at the webspace level. + * @return The Limit value. */ public String getLimit() { @@ -159,10 +168,11 @@ public String getLimit() * Time, Memory Usage, and File System Storage. Important: Site level * Limits information is only meaningful for Shared and Standard web * sites. For free web sites, limits are enforced at the webspace level. + * @param limitValue The Limit value. */ - public void setLimit(String limit) + public void setLimit(final String limitValue) { - this.limit = limit; + this.limit = limitValue; } private String name; @@ -170,6 +180,7 @@ public void setLimit(String limit) /** * The name of the metric, without spaces. The value is usually the same * as that of the ResourceName element. + * @return The Name value. */ public String getName() { @@ -179,16 +190,18 @@ public String getName() /** * The name of the metric, without spaces. The value is usually the same * as that of the ResourceName element. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private Calendar nextResetTime; /** * The time at which the metric will be reset. + * @return The NextResetTime value. */ public Calendar getNextResetTime() { @@ -197,16 +210,18 @@ public Calendar getNextResetTime() /** * The time at which the metric will be reset. + * @param nextResetTimeValue The NextResetTime value. */ - public void setNextResetTime(Calendar nextResetTime) + public void setNextResetTime(final Calendar nextResetTimeValue) { - this.nextResetTime = nextResetTime; + this.nextResetTime = nextResetTimeValue; } private String resourceName; /** * The name of the resource being measured. + * @return The ResourceName value. */ public String getResourceName() { @@ -215,10 +230,11 @@ public String getResourceName() /** * The name of the resource being measured. + * @param resourceNameValue The ResourceName value. */ - public void setResourceName(String resourceName) + public void setResourceName(final String resourceNameValue) { - this.resourceName = resourceName; + this.resourceName = resourceNameValue; } private WebSiteMode siteMode; @@ -227,6 +243,7 @@ public void setResourceName(String resourceName) * The scaling for the web site. Web sites in Free Mode return a value * of Limited. Web sites in Shared Mode return a value of Basic. Sites * in Standard Mode return null. + * @return The SiteMode value. */ public WebSiteMode getSiteMode() { @@ -237,16 +254,18 @@ public WebSiteMode getSiteMode() * The scaling for the web site. Web sites in Free Mode return a value * of Limited. Web sites in Shared Mode return a value of Basic. Sites * in Standard Mode return null. + * @param siteModeValue The SiteMode value. */ - public void setSiteMode(WebSiteMode siteMode) + public void setSiteMode(final WebSiteMode siteModeValue) { - this.siteMode = siteMode; + this.siteMode = siteModeValue; } private String unit; /** * The unit of measure for the given metric. + * @return The Unit value. */ public String getUnit() { @@ -255,10 +274,11 @@ public String getUnit() /** * The unit of measure for the given metric. + * @param unitValue The Unit value. */ - public void setUnit(String unit) + public void setUnit(final String unitValue) { - this.unit = unit; + this.unit = unitValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteListParameters.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteListParameters.java index c8cf2ecddfede..cc62def2bc904 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteListParameters.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteListParameters.java @@ -34,6 +34,7 @@ public class WebSiteListParameters /** * Specifies a list of the names of any addtional parameters to return. + * @return The PropertiesToInclude value. */ public ArrayList getPropertiesToInclude() { @@ -42,10 +43,11 @@ public ArrayList getPropertiesToInclude() /** * Specifies a list of the names of any addtional parameters to return. + * @param propertiesToIncludeValue The PropertiesToInclude value. */ - public void setPropertiesToInclude(ArrayList propertiesToInclude) + public void setPropertiesToInclude(final ArrayList propertiesToIncludeValue) { - this.propertiesToInclude = propertiesToInclude; + this.propertiesToInclude = propertiesToIncludeValue; } /** diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteOperationStatus.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteOperationStatus.java new file mode 100644 index 0000000000000..71d7a6debcea6 --- /dev/null +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteOperationStatus.java @@ -0,0 +1,55 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.websites.models; + +/** +* The status of the asynchronous operation. +*/ +public enum WebSiteOperationStatus +{ + /** + * The asynchronous request is in progress. + */ + InProgress, + + /** + * The asynchronous request failed. + */ + Failed, + + /** + * The asynchronous request succeeded. + */ + Succeeded, + + /** + * The asynchronous request timed out. + */ + TimedOut, + + /** + * The asynchronous request was created. + */ + Created, +} diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteOperationStatusResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteOperationStatusResponse.java new file mode 100644 index 0000000000000..df22296cd8773 --- /dev/null +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteOperationStatusResponse.java @@ -0,0 +1,344 @@ +/** + * + * Copyright (c) Microsoft and contributors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Warning: This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if the +// code is regenerated. + +package com.microsoft.windowsazure.management.websites.models; + +import com.microsoft.windowsazure.core.OperationResponse; +import java.util.ArrayList; +import java.util.Calendar; + +/** +* The response body contains the status of the specified long-running +* operation, indicating whether it has succeeded, is inprogress, has time +* dout, or has failed. Note that this status is distinct from the HTTP status +* code returned for the Get Operation Status operation itself. If the +* long-running operation failed, the response body includes error information +* regarding the failure. +*/ +public class WebSiteOperationStatusResponse extends OperationResponse +{ + private Calendar createdTime; + + /** + * The time when the operation was created. + * @return The CreatedTime value. + */ + public Calendar getCreatedTime() + { + return this.createdTime; + } + + /** + * The time when the operation was created. + * @param createdTimeValue The CreatedTime value. + */ + public void setCreatedTime(final Calendar createdTimeValue) + { + this.createdTime = createdTimeValue; + } + + private ArrayList errors; + + /** + * The list of errors that occurred during the operation. + * @return The Errors value. + */ + public ArrayList getErrors() + { + return this.errors; + } + + /** + * The list of errors that occurred during the operation. + * @param errorsValue The Errors value. + */ + public void setErrors(final ArrayList errorsValue) + { + this.errors = errorsValue; + } + + private Calendar expirationTime; + + /** + * The time when the operation will time out. + * @return The ExpirationTime value. + */ + public Calendar getExpirationTime() + { + return this.expirationTime; + } + + /** + * The time when the operation will time out. + * @param expirationTimeValue The ExpirationTime value. + */ + public void setExpirationTime(final Calendar expirationTimeValue) + { + this.expirationTime = expirationTimeValue; + } + + private String geoMasterOperationId; + + /** + * The GeoMaster Operation Id for this operation, if any. + * @return The GeoMasterOperationId value. + */ + public String getGeoMasterOperationId() + { + return this.geoMasterOperationId; + } + + /** + * The GeoMaster Operation Id for this operation, if any. + * @param geoMasterOperationIdValue The GeoMasterOperationId value. + */ + public void setGeoMasterOperationId(final String geoMasterOperationIdValue) + { + this.geoMasterOperationId = geoMasterOperationIdValue; + } + + private Calendar modifiedTime; + + /** + * The time when the operation was last modified. + * @return The ModifiedTime value. + */ + public Calendar getModifiedTime() + { + return this.modifiedTime; + } + + /** + * The time when the operation was last modified. + * @param modifiedTimeValue The ModifiedTime value. + */ + public void setModifiedTime(final Calendar modifiedTimeValue) + { + this.modifiedTime = modifiedTimeValue; + } + + private String name; + + /** + * The name of the operation. + * @return The Name value. + */ + public String getName() + { + return this.name; + } + + /** + * The name of the operation. + * @param nameValue The Name value. + */ + public void setName(final String nameValue) + { + this.name = nameValue; + } + + private String operationId; + + /** + * The operation Id for this operation. Used to poll for operation status. + * @return The OperationId value. + */ + public String getOperationId() + { + return this.operationId; + } + + /** + * The operation Id for this operation. Used to poll for operation status. + * @param operationIdValue The OperationId value. + */ + public void setOperationId(final String operationIdValue) + { + this.operationId = operationIdValue; + } + + private WebSiteOperationStatus status; + + /** + * The status of the asynchronous operation. + * @return The Status value. + */ + public WebSiteOperationStatus getStatus() + { + return this.status; + } + + /** + * The status of the asynchronous operation. + * @param statusValue The Status value. + */ + public void setStatus(final WebSiteOperationStatus statusValue) + { + this.status = statusValue; + } + + /** + * Initializes a new instance of the WebSiteOperationStatusResponse class. + * + */ + public WebSiteOperationStatusResponse() + { + super(); + this.errors = new ArrayList(); + } + + /** + * Information about an error that occured suring the operation. + */ + public static class Error + { + private String code; + + /** + * The error code. + * @return The Code value. + */ + public String getCode() + { + return this.code; + } + + /** + * The error code. + * @param codeValue The Code value. + */ + public void setCode(final String codeValue) + { + this.code = codeValue; + } + + private String extendedCode; + + /** + * The error extended code. + * @return The ExtendedCode value. + */ + public String getExtendedCode() + { + return this.extendedCode; + } + + /** + * The error extended code. + * @param extendedCodeValue The ExtendedCode value. + */ + public void setExtendedCode(final String extendedCodeValue) + { + this.extendedCode = extendedCodeValue; + } + + private String innerErrors; + + /** + * The inner errors for this operation. + * @return The InnerErrors value. + */ + public String getInnerErrors() + { + return this.innerErrors; + } + + /** + * The inner errors for this operation. + * @param innerErrorsValue The InnerErrors value. + */ + public void setInnerErrors(final String innerErrorsValue) + { + this.innerErrors = innerErrorsValue; + } + + private String message; + + /** + * The error message. + * @return The Message value. + */ + public String getMessage() + { + return this.message; + } + + /** + * The error message. + * @param messageValue The Message value. + */ + public void setMessage(final String messageValue) + { + this.message = messageValue; + } + + private String messageTemplate; + + /** + * The message template. + * @return The MessageTemplate value. + */ + public String getMessageTemplate() + { + return this.messageTemplate; + } + + /** + * The message template. + * @param messageTemplateValue The MessageTemplate value. + */ + public void setMessageTemplate(final String messageTemplateValue) + { + this.messageTemplate = messageTemplateValue; + } + + private ArrayList parameters; + + /** + * The parameters for the message template. + * @return The Parameters value. + */ + public ArrayList getParameters() + { + return this.parameters; + } + + /** + * The parameters for the message template. + * @param parametersValue The Parameters value. + */ + public void setParameters(final ArrayList parametersValue) + { + this.parameters = parametersValue; + } + + /** + * Initializes a new instance of the Error class. + * + */ + public Error() + { + this.parameters = new ArrayList(); + } + } +} diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteUpdateConfigurationParameters.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteUpdateConfigurationParameters.java index d2475d05b9c74..ecbafd423c167 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteUpdateConfigurationParameters.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteUpdateConfigurationParameters.java @@ -36,6 +36,7 @@ public class WebSiteUpdateConfigurationParameters /** * A set of name/value pairs that contain application settings for a site. + * @return The AppSettings value. */ public HashMap getAppSettings() { @@ -44,16 +45,18 @@ public HashMap getAppSettings() /** * A set of name/value pairs that contain application settings for a site. + * @param appSettingsValue The AppSettings value. */ - public void setAppSettings(HashMap appSettings) + public void setAppSettings(final HashMap appSettingsValue) { - this.appSettings = appSettings; + this.appSettings = appSettingsValue; } private ArrayList connectionStrings; /** * Contains connection strings for database and other external resources. + * @return The ConnectionStrings value. */ public ArrayList getConnectionStrings() { @@ -62,10 +65,11 @@ public ArrayList getC /** * Contains connection strings for database and other external resources. + * @param connectionStringsValue The ConnectionStrings value. */ - public void setConnectionStrings(ArrayList connectionStrings) + public void setConnectionStrings(final ArrayList connectionStringsValue) { - this.connectionStrings = connectionStrings; + this.connectionStrings = connectionStringsValue; } private ArrayList defaultDocuments; @@ -77,6 +81,7 @@ public void setConnectionStrings(ArrayList getDefaultDocuments() { @@ -90,16 +95,18 @@ public ArrayList getDefaultDocuments() * http://contoso.com is default.htm, the page * http://www.contoso.com/default.htm is returned when the browser is * pointed to http://www.contoso.com. + * @param defaultDocumentsValue The DefaultDocuments value. */ - public void setDefaultDocuments(ArrayList defaultDocuments) + public void setDefaultDocuments(final ArrayList defaultDocumentsValue) { - this.defaultDocuments = defaultDocuments; + this.defaultDocuments = defaultDocumentsValue; } private Boolean detailedErrorLoggingEnabled; /** * True if detailed error logging is enabled; otherwise, false. + * @return The DetailedErrorLoggingEnabled value. */ public Boolean isDetailedErrorLoggingEnabled() { @@ -108,16 +115,19 @@ public Boolean isDetailedErrorLoggingEnabled() /** * True if detailed error logging is enabled; otherwise, false. + * @param detailedErrorLoggingEnabledValue The DetailedErrorLoggingEnabled + * value. */ - public void setDetailedErrorLoggingEnabled(Boolean detailedErrorLoggingEnabled) + public void setDetailedErrorLoggingEnabled(final Boolean detailedErrorLoggingEnabledValue) { - this.detailedErrorLoggingEnabled = detailedErrorLoggingEnabled; + this.detailedErrorLoggingEnabled = detailedErrorLoggingEnabledValue; } private String documentRoot; /** * The document root. + * @return The DocumentRoot value. */ public String getDocumentRoot() { @@ -126,10 +136,11 @@ public String getDocumentRoot() /** * The document root. + * @param documentRootValue The DocumentRoot value. */ - public void setDocumentRoot(String documentRoot) + public void setDocumentRoot(final String documentRootValue) { - this.documentRoot = documentRoot; + this.documentRoot = documentRootValue; } private ArrayList handlerMappings; @@ -137,6 +148,7 @@ public void setDocumentRoot(String documentRoot) /** * Specifies custom executable programs for handling requests for specific * file name extensions. + * @return The HandlerMappings value. */ public ArrayList getHandlerMappings() { @@ -146,16 +158,18 @@ public ArrayList getHandler /** * Specifies custom executable programs for handling requests for specific * file name extensions. + * @param handlerMappingsValue The HandlerMappings value. */ - public void setHandlerMappings(ArrayList handlerMappings) + public void setHandlerMappings(final ArrayList handlerMappingsValue) { - this.handlerMappings = handlerMappings; + this.handlerMappings = handlerMappingsValue; } private Boolean httpLoggingEnabled; /** * True if HTTP error logging is enabled; otherwise, false. + * @return The HttpLoggingEnabled value. */ public Boolean isHttpLoggingEnabled() { @@ -164,16 +178,18 @@ public Boolean isHttpLoggingEnabled() /** * True if HTTP error logging is enabled; otherwise, false. + * @param httpLoggingEnabledValue The HttpLoggingEnabled value. */ - public void setHttpLoggingEnabled(Boolean httpLoggingEnabled) + public void setHttpLoggingEnabled(final Boolean httpLoggingEnabledValue) { - this.httpLoggingEnabled = httpLoggingEnabled; + this.httpLoggingEnabled = httpLoggingEnabledValue; } private Integer logsDirectorySizeLimit; /** * The limit of the logs directory. + * @return The LogsDirectorySizeLimit value. */ public Integer getLogsDirectorySizeLimit() { @@ -182,16 +198,18 @@ public Integer getLogsDirectorySizeLimit() /** * The limit of the logs directory. + * @param logsDirectorySizeLimitValue The LogsDirectorySizeLimit value. */ - public void setLogsDirectorySizeLimit(Integer logsDirectorySizeLimit) + public void setLogsDirectorySizeLimit(final Integer logsDirectorySizeLimitValue) { - this.logsDirectorySizeLimit = logsDirectorySizeLimit; + this.logsDirectorySizeLimit = logsDirectorySizeLimitValue; } private ManagedPipelineMode managedPipelineMode; /** * Managed pipeline modes. + * @return The ManagedPipelineMode value. */ public ManagedPipelineMode getManagedPipelineMode() { @@ -200,16 +218,18 @@ public ManagedPipelineMode getManagedPipelineMode() /** * Managed pipeline modes. + * @param managedPipelineModeValue The ManagedPipelineMode value. */ - public void setManagedPipelineMode(ManagedPipelineMode managedPipelineMode) + public void setManagedPipelineMode(final ManagedPipelineMode managedPipelineModeValue) { - this.managedPipelineMode = managedPipelineMode; + this.managedPipelineMode = managedPipelineModeValue; } private HashMap metadata; /** * Contains name/value pairs for source control or other information. + * @return The Metadata value. */ public HashMap getMetadata() { @@ -218,16 +238,18 @@ public HashMap getMetadata() /** * Contains name/value pairs for source control or other information. + * @param metadataValue The Metadata value. */ - public void setMetadata(HashMap metadata) + public void setMetadata(final HashMap metadataValue) { - this.metadata = metadata; + this.metadata = metadataValue; } private String netFrameworkVersion; /** * The .NET Framework version. Supported values are v2.0 and v4.0. + * @return The NetFrameworkVersion value. */ public String getNetFrameworkVersion() { @@ -236,10 +258,11 @@ public String getNetFrameworkVersion() /** * The .NET Framework version. Supported values are v2.0 and v4.0. + * @param netFrameworkVersionValue The NetFrameworkVersion value. */ - public void setNetFrameworkVersion(String netFrameworkVersion) + public void setNetFrameworkVersion(final String netFrameworkVersionValue) { - this.netFrameworkVersion = netFrameworkVersion; + this.netFrameworkVersion = netFrameworkVersionValue; } private Integer numberOfWorkers; @@ -249,6 +272,7 @@ public void setNetFrameworkVersion(String netFrameworkVersion) * Free, this value is 1. If the site mode is Shared, this value can range * from 1 through 6. If the site mode is Standard, this value can range * from 1 through 10. + * @return The NumberOfWorkers value. */ public Integer getNumberOfWorkers() { @@ -260,10 +284,11 @@ public Integer getNumberOfWorkers() * Free, this value is 1. If the site mode is Shared, this value can range * from 1 through 6. If the site mode is Standard, this value can range * from 1 through 10. + * @param numberOfWorkersValue The NumberOfWorkers value. */ - public void setNumberOfWorkers(Integer numberOfWorkers) + public void setNumberOfWorkers(final Integer numberOfWorkersValue) { - this.numberOfWorkers = numberOfWorkers; + this.numberOfWorkers = numberOfWorkersValue; } private String phpVersion; @@ -271,6 +296,7 @@ public void setNumberOfWorkers(Integer numberOfWorkers) /** * Supported values are an empty string (an empty string disables PHP), 5.3, * and 5.4. + * @return The PhpVersion value. */ public String getPhpVersion() { @@ -280,16 +306,18 @@ public String getPhpVersion() /** * Supported values are an empty string (an empty string disables PHP), 5.3, * and 5.4. + * @param phpVersionValue The PhpVersion value. */ - public void setPhpVersion(String phpVersion) + public void setPhpVersion(final String phpVersionValue) { - this.phpVersion = phpVersion; + this.phpVersion = phpVersionValue; } private String publishingPassword; /** * Hash value of the password used for publishing the web site. + * @return The PublishingPassword value. */ public String getPublishingPassword() { @@ -298,10 +326,11 @@ public String getPublishingPassword() /** * Hash value of the password used for publishing the web site. + * @param publishingPasswordValue The PublishingPassword value. */ - public void setPublishingPassword(String publishingPassword) + public void setPublishingPassword(final String publishingPasswordValue) { - this.publishingPassword = publishingPassword; + this.publishingPassword = publishingPasswordValue; } private String publishingUserName; @@ -309,6 +338,7 @@ public void setPublishingPassword(String publishingPassword) /** * The username used for publishing the web site. This is normally a dollar * sign prepended to the web site name (for example, “$contoso”). + * @return The PublishingUserName value. */ public String getPublishingUserName() { @@ -318,16 +348,18 @@ public String getPublishingUserName() /** * The username used for publishing the web site. This is normally a dollar * sign prepended to the web site name (for example, “$contoso”). + * @param publishingUserNameValue The PublishingUserName value. */ - public void setPublishingUserName(String publishingUserName) + public void setPublishingUserName(final String publishingUserNameValue) { - this.publishingUserName = publishingUserName; + this.publishingUserName = publishingUserNameValue; } private Boolean remoteDebuggingEnabled; /** * True remote debugging is enabled; otherwise, false. + * @return The RemoteDebuggingEnabled value. */ public Boolean isRemoteDebuggingEnabled() { @@ -336,16 +368,18 @@ public Boolean isRemoteDebuggingEnabled() /** * True remote debugging is enabled; otherwise, false. + * @param remoteDebuggingEnabledValue The RemoteDebuggingEnabled value. */ - public void setRemoteDebuggingEnabled(Boolean remoteDebuggingEnabled) + public void setRemoteDebuggingEnabled(final Boolean remoteDebuggingEnabledValue) { - this.remoteDebuggingEnabled = remoteDebuggingEnabled; + this.remoteDebuggingEnabled = remoteDebuggingEnabledValue; } private RemoteDebuggingVersion remoteDebuggingVersion; /** * True remote debugging version. + * @return The RemoteDebuggingVersion value. */ public RemoteDebuggingVersion getRemoteDebuggingVersion() { @@ -354,16 +388,18 @@ public RemoteDebuggingVersion getRemoteDebuggingVersion() /** * True remote debugging version. + * @param remoteDebuggingVersionValue The RemoteDebuggingVersion value. */ - public void setRemoteDebuggingVersion(RemoteDebuggingVersion remoteDebuggingVersion) + public void setRemoteDebuggingVersion(final RemoteDebuggingVersion remoteDebuggingVersionValue) { - this.remoteDebuggingVersion = remoteDebuggingVersion; + this.remoteDebuggingVersion = remoteDebuggingVersionValue; } private Boolean requestTracingEnabled; /** * True if request tracing is enabled; otherwise, false. + * @return The RequestTracingEnabled value. */ public Boolean isRequestTracingEnabled() { @@ -372,16 +408,18 @@ public Boolean isRequestTracingEnabled() /** * True if request tracing is enabled; otherwise, false. + * @param requestTracingEnabledValue The RequestTracingEnabled value. */ - public void setRequestTracingEnabled(Boolean requestTracingEnabled) + public void setRequestTracingEnabled(final Boolean requestTracingEnabledValue) { - this.requestTracingEnabled = requestTracingEnabled; + this.requestTracingEnabled = requestTracingEnabledValue; } private Calendar requestTracingExpirationTime; /** * Time remaining until request tracing expires. + * @return The RequestTracingExpirationTime value. */ public Calendar getRequestTracingExpirationTime() { @@ -390,10 +428,12 @@ public Calendar getRequestTracingExpirationTime() /** * Time remaining until request tracing expires. + * @param requestTracingExpirationTimeValue The RequestTracingExpirationTime + * value. */ - public void setRequestTracingExpirationTime(Calendar requestTracingExpirationTime) + public void setRequestTracingExpirationTime(final Calendar requestTracingExpirationTimeValue) { - this.requestTracingExpirationTime = requestTracingExpirationTime; + this.requestTracingExpirationTime = requestTracingExpirationTimeValue; } private String scmType; @@ -402,6 +442,7 @@ public void setRequestTracingExpirationTime(Calendar requestTracingExpirationTim * The source control method that the web site is using (for example, Local * Git). If deployment from source control has not been set up for the web * site, this value is None. + * @return The ScmType value. */ public String getScmType() { @@ -412,16 +453,18 @@ public String getScmType() * The source control method that the web site is using (for example, Local * Git). If deployment from source control has not been set up for the web * site, this value is None. + * @param scmTypeValue The ScmType value. */ - public void setScmType(String scmType) + public void setScmType(final String scmTypeValue) { - this.scmType = scmType; + this.scmType = scmTypeValue; } private Boolean use32BitWorkerProcess; /** * True if 32-bit mode is enabled; otherwise, false. + * @return The Use32BitWorkerProcess value. */ public Boolean isUse32BitWorkerProcess() { @@ -430,16 +473,18 @@ public Boolean isUse32BitWorkerProcess() /** * True if 32-bit mode is enabled; otherwise, false. + * @param use32BitWorkerProcessValue The Use32BitWorkerProcess value. */ - public void setUse32BitWorkerProcess(Boolean use32BitWorkerProcess) + public void setUse32BitWorkerProcess(final Boolean use32BitWorkerProcessValue) { - this.use32BitWorkerProcess = use32BitWorkerProcess; + this.use32BitWorkerProcess = use32BitWorkerProcessValue; } private Boolean webSocketsEnabled; /** * True if Web Sockets are enabled; otherwise, false. + * @return The WebSocketsEnabled value. */ public Boolean isWebSocketsEnabled() { @@ -448,10 +493,11 @@ public Boolean isWebSocketsEnabled() /** * True if Web Sockets are enabled; otherwise, false. + * @param webSocketsEnabledValue The WebSocketsEnabled value. */ - public void setWebSocketsEnabled(Boolean webSocketsEnabled) + public void setWebSocketsEnabled(final Boolean webSocketsEnabledValue) { - this.webSocketsEnabled = webSocketsEnabled; + this.webSocketsEnabled = webSocketsEnabledValue; } /** @@ -477,6 +523,7 @@ public static class ConnectionStringInfo /** * A database connection string. + * @return The ConnectionString value. */ public String getConnectionString() { @@ -485,16 +532,18 @@ public String getConnectionString() /** * A database connection string. + * @param connectionStringValue The ConnectionString value. */ - public void setConnectionString(String connectionString) + public void setConnectionString(final String connectionStringValue) { - this.connectionString = connectionString; + this.connectionString = connectionStringValue; } private String name; /** * The name of the connection string. + * @return The Name value. */ public String getName() { @@ -503,16 +552,18 @@ public String getName() /** * The name of the connection string. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String type; /** * The type of the connection string (for example, "MySQL"). + * @return The Type value. */ public String getType() { @@ -521,10 +572,11 @@ public String getType() /** * The type of the connection string (for example, "MySQL"). + * @param typeValue The Type value. */ - public void setType(String type) + public void setType(final String typeValue) { - this.type = type; + this.type = typeValue; } } @@ -540,6 +592,7 @@ public static class HandlerMapping * A string that contains optional arguments for the script processor * specified by the * SiteConfig.HandlerMappings.HandlerMapping.ScriptProcessor element. + * @return The Arguments value. */ public String getArguments() { @@ -550,10 +603,11 @@ public String getArguments() * A string that contains optional arguments for the script processor * specified by the * SiteConfig.HandlerMappings.HandlerMapping.ScriptProcessor element. + * @param argumentsValue The Arguments value. */ - public void setArguments(String arguments) + public void setArguments(final String argumentsValue) { - this.arguments = arguments; + this.arguments = argumentsValue; } private String extension; @@ -561,6 +615,7 @@ public void setArguments(String arguments) /** * A string that specifies the extension of the file type that the * script processor will handle (for example, *.php). + * @return The Extension value. */ public String getExtension() { @@ -570,10 +625,11 @@ public String getExtension() /** * A string that specifies the extension of the file type that the * script processor will handle (for example, *.php). + * @param extensionValue The Extension value. */ - public void setExtension(String extension) + public void setExtension(final String extensionValue) { - this.extension = extension; + this.extension = extensionValue; } private String scriptProcessor; @@ -582,6 +638,7 @@ public void setExtension(String extension) * The absolute path to the location of the executable file that will * handle the files specified in the * SiteConfig.HandlerMappings.HandlerMapping.Extension element. + * @return The ScriptProcessor value. */ public String getScriptProcessor() { @@ -592,10 +649,11 @@ public String getScriptProcessor() * The absolute path to the location of the executable file that will * handle the files specified in the * SiteConfig.HandlerMappings.HandlerMapping.Extension element. + * @param scriptProcessorValue The ScriptProcessor value. */ - public void setScriptProcessor(String scriptProcessor) + public void setScriptProcessor(final String scriptProcessorValue) { - this.scriptProcessor = scriptProcessor; + this.scriptProcessor = scriptProcessorValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteUpdateParameters.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteUpdateParameters.java index e4af1e16cf135..1fcedd711f2a3 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteUpdateParameters.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSiteUpdateParameters.java @@ -38,6 +38,7 @@ public class WebSiteUpdateParameters * running correctly and that management information for the site is * available. Limited means that only partial management information for * the site is available and that detailed site information is unavailable. + * @return The AvailabilityState value. */ public WebSpaceAvailabilityState getAvailabilityState() { @@ -50,10 +51,11 @@ public WebSpaceAvailabilityState getAvailabilityState() * running correctly and that management information for the site is * available. Limited means that only partial management information for * the site is available and that detailed site information is unavailable. + * @param availabilityStateValue The AvailabilityState value. */ - public void setAvailabilityState(WebSpaceAvailabilityState availabilityState) + public void setAvailabilityState(final WebSpaceAvailabilityState availabilityStateValue) { - this.availabilityState = availabilityState; + this.availabilityState = availabilityStateValue; } private WebSiteComputeMode computeMode; @@ -61,6 +63,7 @@ public void setAvailabilityState(WebSpaceAvailabilityState availabilityState) /** * The Compute Mode for the web site. Possible values are Shared or * Dedicated. + * @return The ComputeMode value. */ public WebSiteComputeMode getComputeMode() { @@ -70,10 +73,11 @@ public WebSiteComputeMode getComputeMode() /** * The Compute Mode for the web site. Possible values are Shared or * Dedicated. + * @param computeModeValue The ComputeMode value. */ - public void setComputeMode(WebSiteComputeMode computeMode) + public void setComputeMode(final WebSiteComputeMode computeModeValue) { - this.computeMode = computeMode; + this.computeMode = computeModeValue; } private Boolean enabled; @@ -81,6 +85,7 @@ public void setComputeMode(WebSiteComputeMode computeMode) /** * true if the site is enabled; otherwise, false. Setting this value to * false disables the site (takes the site off line). + * @return The Enabled value. */ public Boolean isEnabled() { @@ -90,10 +95,11 @@ public Boolean isEnabled() /** * true if the site is enabled; otherwise, false. Setting this value to * false disables the site (takes the site off line). + * @param enabledValue The Enabled value. */ - public void setEnabled(Boolean enabled) + public void setEnabled(final Boolean enabledValue) { - this.enabled = enabled; + this.enabled = enabledValue; } private ArrayList hostNames; @@ -105,6 +111,7 @@ public void setEnabled(Boolean enabled) * web site. To delete a custom domain name in a PUT operation, include all * of the hostnames for the site that you want to keep, but leave out the * one that you wangt to delete. + * @return The HostNames value. */ public ArrayList getHostNames() { @@ -118,16 +125,18 @@ public ArrayList getHostNames() * web site. To delete a custom domain name in a PUT operation, include all * of the hostnames for the site that you want to keep, but leave out the * one that you wangt to delete. + * @param hostNamesValue The HostNames value. */ - public void setHostNames(ArrayList hostNames) + public void setHostNames(final ArrayList hostNamesValue) { - this.hostNames = hostNames; + this.hostNames = hostNamesValue; } private ArrayList hostNameSslStates; /** * SSL states bound to the website. + * @return The HostNameSslStates value. */ public ArrayList getHostNameSslStates() { @@ -136,10 +145,11 @@ public ArrayList getHostNameSsl /** * SSL states bound to the website. + * @param hostNameSslStatesValue The HostNameSslStates value. */ - public void setHostNameSslStates(ArrayList hostNameSslStates) + public void setHostNameSslStates(final ArrayList hostNameSslStatesValue) { - this.hostNameSslStates = hostNameSslStates; + this.hostNameSslStates = hostNameSslStatesValue; } private WebSiteRuntimeAvailabilityState runtimeAvailabilityState; @@ -150,6 +160,7 @@ public void setHostNameSslStates(ArrayList sslCertificates; /** * SSL certificates bound to the web site. + * @return The SslCertificates value. */ public ArrayList getSslCertificates() { @@ -222,10 +239,11 @@ public ArrayList getSslCertificat /** * SSL certificates bound to the web site. + * @param sslCertificatesValue The SslCertificates value. */ - public void setSslCertificates(ArrayList sslCertificates) + public void setSslCertificates(final ArrayList sslCertificatesValue) { - this.sslCertificates = sslCertificates; + this.sslCertificates = sslCertificatesValue; } private WebSiteState state; @@ -233,6 +251,7 @@ public void setSslCertificates(ArrayList getGeoRegions() { @@ -44,10 +45,11 @@ public ArrayList getGeoRegions() /** * The available geo regions. + * @param geoRegionsValue The GeoRegions value. */ - public void setGeoRegions(ArrayList geoRegions) + public void setGeoRegions(final ArrayList geoRegionsValue) { - this.geoRegions = geoRegions; + this.geoRegions = geoRegionsValue; } /** @@ -78,6 +80,7 @@ public static class GeoRegion /** * Geo Region description. + * @return The Description value. */ public String getDescription() { @@ -86,16 +89,18 @@ public String getDescription() /** * Geo Region description. + * @param descriptionValue The Description value. */ - public void setDescription(String description) + public void setDescription(final String descriptionValue) { - this.description = description; + this.description = descriptionValue; } private String name; /** * Name of the region. + * @return The Name value. */ public String getName() { @@ -104,16 +109,18 @@ public String getName() /** * Name of the region. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private int sortOrder; /** * Sort order. + * @return The SortOrder value. */ public int getSortOrder() { @@ -122,10 +129,11 @@ public int getSortOrder() /** * Sort order. + * @param sortOrderValue The SortOrder value. */ - public void setSortOrder(int sortOrder) + public void setSortOrder(final int sortOrderValue) { - this.sortOrder = sortOrder; + this.sortOrder = sortOrderValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListPublishingUsersResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListPublishingUsersResponse.java index 0a4f2538fb423..450c993de4e42 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListPublishingUsersResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListPublishingUsersResponse.java @@ -36,6 +36,7 @@ public class WebSpacesListPublishingUsersResponse extends OperationResponse impl /** * The publishing users. + * @return The Users value. */ public ArrayList getUsers() { @@ -44,10 +45,11 @@ public ArrayList getUsers() /** * The publishing users. + * @param usersValue The Users value. */ - public void setUsers(ArrayList users) + public void setUsers(final ArrayList usersValue) { - this.users = users; + this.users = usersValue; } /** @@ -79,6 +81,7 @@ public static class User /** * The publishing user name. + * @return The Name value. */ public String getName() { @@ -87,10 +90,11 @@ public String getName() /** * The publishing user name. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListResponse.java index 40b92a7fccfd0..e699198e18a6f 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListResponse.java @@ -36,6 +36,7 @@ public class WebSpacesListResponse extends OperationResponse implements Iterable /** * The web spaces associated with the specified subscription. + * @return The WebSpaces value. */ public ArrayList getWebSpaces() { @@ -44,10 +45,11 @@ public ArrayList getWebSpaces() /** * The web spaces associated with the specified subscription. + * @param webSpacesValue The WebSpaces value. */ - public void setWebSpaces(ArrayList webSpaces) + public void setWebSpaces(final ArrayList webSpacesValue) { - this.webSpaces = webSpaces; + this.webSpaces = webSpacesValue; } /** @@ -78,6 +80,7 @@ public static class WebSpace /** * Possible values are Normal or Limited. + * @return The AvailabilityState value. */ public WebSpaceAvailabilityState getAvailabilityState() { @@ -86,16 +89,18 @@ public WebSpaceAvailabilityState getAvailabilityState() /** * Possible values are Normal or Limited. + * @param availabilityStateValue The AvailabilityState value. */ - public void setAvailabilityState(WebSpaceAvailabilityState availabilityState) + public void setAvailabilityState(final WebSpaceAvailabilityState availabilityStateValue) { - this.availabilityState = availabilityState; + this.availabilityState = availabilityStateValue; } private Integer currentNumberOfWorkers; /** * The current number of workers. + * @return The CurrentNumberOfWorkers value. */ public Integer getCurrentNumberOfWorkers() { @@ -104,16 +109,18 @@ public Integer getCurrentNumberOfWorkers() /** * The current number of workers. + * @param currentNumberOfWorkersValue The CurrentNumberOfWorkers value. */ - public void setCurrentNumberOfWorkers(Integer currentNumberOfWorkers) + public void setCurrentNumberOfWorkers(final Integer currentNumberOfWorkersValue) { - this.currentNumberOfWorkers = currentNumberOfWorkers; + this.currentNumberOfWorkers = currentNumberOfWorkersValue; } private WebSpaceWorkerSize currentWorkerSize; /** * The current worker size. Possible values are Small, Medium, or Large. + * @return The CurrentWorkerSize value. */ public WebSpaceWorkerSize getCurrentWorkerSize() { @@ -122,16 +129,18 @@ public WebSpaceWorkerSize getCurrentWorkerSize() /** * The current worker size. Possible values are Small, Medium, or Large. + * @param currentWorkerSizeValue The CurrentWorkerSize value. */ - public void setCurrentWorkerSize(WebSpaceWorkerSize currentWorkerSize) + public void setCurrentWorkerSize(final WebSpaceWorkerSize currentWorkerSizeValue) { - this.currentWorkerSize = currentWorkerSize; + this.currentWorkerSize = currentWorkerSizeValue; } private String geoLocation; /** * The location of the datacenter for the web space. + * @return The GeoLocation value. */ public String getGeoLocation() { @@ -140,16 +149,18 @@ public String getGeoLocation() /** * The location of the datacenter for the web space. + * @param geoLocationValue The GeoLocation value. */ - public void setGeoLocation(String geoLocation) + public void setGeoLocation(final String geoLocationValue) { - this.geoLocation = geoLocation; + this.geoLocation = geoLocationValue; } private String geoRegion; /** * The geographical region where the webspace is located. + * @return The GeoRegion value. */ public String getGeoRegion() { @@ -158,16 +169,18 @@ public String getGeoRegion() /** * The geographical region where the webspace is located. + * @param geoRegionValue The GeoRegion value. */ - public void setGeoRegion(String geoRegion) + public void setGeoRegion(final String geoRegionValue) { - this.geoRegion = geoRegion; + this.geoRegion = geoRegionValue; } private String name; /** * The name of the webspace. + * @return The Name value. */ public String getName() { @@ -176,16 +189,18 @@ public String getName() /** * The name of the webspace. + * @param nameValue The Name value. */ - public void setName(String name) + public void setName(final String nameValue) { - this.name = name; + this.name = nameValue; } private String plan; /** * The name of the webspace. + * @return The Plan value. */ public String getPlan() { @@ -194,10 +209,11 @@ public String getPlan() /** * The name of the webspace. + * @param planValue The Plan value. */ - public void setPlan(String plan) + public void setPlan(final String planValue) { - this.plan = plan; + this.plan = planValue; } private WebSpaceStatus status; @@ -206,6 +222,7 @@ public void setPlan(String plan) * The status of the Web Space. Possible values are Ready or Limited. * Note: The Limited status occurs only if the datacenter is * encountering an operational issue. + * @return The Status value. */ public WebSpaceStatus getStatus() { @@ -216,16 +233,18 @@ public WebSpaceStatus getStatus() * The status of the Web Space. Possible values are Ready or Limited. * Note: The Limited status occurs only if the datacenter is * encountering an operational issue. + * @param statusValue The Status value. */ - public void setStatus(WebSpaceStatus status) + public void setStatus(final WebSpaceStatus statusValue) { - this.status = status; + this.status = statusValue; } private String subscription; /** * The subscription ID. + * @return The Subscription value. */ public String getSubscription() { @@ -234,10 +253,11 @@ public String getSubscription() /** * The subscription ID. + * @param subscriptionValue The Subscription value. */ - public void setSubscription(String subscription) + public void setSubscription(final String subscriptionValue) { - this.subscription = subscription; + this.subscription = subscriptionValue; } private WebSpaceWorkerSize workerSize; @@ -245,6 +265,7 @@ public void setSubscription(String subscription) /** * The worker size. Possible values are Small, Medium, and Large. For * JSON, the equivalents are 0 = Small, 1 = Medium, 2 = Large. + * @return The WorkerSize value. */ public WebSpaceWorkerSize getWorkerSize() { @@ -254,10 +275,11 @@ public WebSpaceWorkerSize getWorkerSize() /** * The worker size. Possible values are Small, Medium, and Large. For * JSON, the equivalents are 0 = Small, 1 = Medium, 2 = Large. + * @param workerSizeValue The WorkerSize value. */ - public void setWorkerSize(WebSpaceWorkerSize workerSize) + public void setWorkerSize(final WebSpaceWorkerSize workerSizeValue) { - this.workerSize = workerSize; + this.workerSize = workerSizeValue; } } } diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListWebSitesResponse.java b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListWebSitesResponse.java index caed7b42a038b..432a8a5917801 100644 --- a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListWebSitesResponse.java +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListWebSitesResponse.java @@ -36,6 +36,7 @@ public class WebSpacesListWebSitesResponse extends OperationResponse implements /** * The websites associated with the specified web space. + * @return The WebSites value. */ public ArrayList getWebSites() { @@ -44,10 +45,11 @@ public ArrayList getWebSites() /** * The websites associated with the specified web space. + * @param webSitesValue The WebSites value. */ - public void setWebSites(ArrayList webSites) + public void setWebSites(final ArrayList webSitesValue) { - this.webSites = webSites; + this.webSites = webSitesValue; } /** diff --git a/parent/src/config/checkstyle.xml b/parent/src/config/checkstyle.xml index 452b50be5b2fe..bd1536aa69684 100644 --- a/parent/src/config/checkstyle.xml +++ b/parent/src/config/checkstyle.xml @@ -58,7 +58,9 @@ - + @@ -143,7 +145,11 @@ --> - + From 65a08d02964200081c731aa300930b8862d7c1fa Mon Sep 17 00:00:00 2001 From: Andre Rodrigues Date: Mon, 20 Jan 2014 14:25:18 +0100 Subject: [PATCH 4/4] add missing package.info files --- .../windowsazure/management/compute/models/package.html | 4 ++++ .../management/monitoring/alerts/models/package.html | 4 ++++ .../management/monitoring/autoscale/models/package.html | 4 ++++ .../management/monitoring/metrics/models/package.html | 4 ++++ .../windowsazure/management/monitoring/models/package.html | 4 ++++ .../windowsazure/management/scheduler/models/package.html | 4 ++++ .../windowsazure/management/servicebus/models/package.html | 4 ++++ .../windowsazure/management/storage/models/package.html | 4 ++++ .../windowsazure/management/store/models/package.html | 4 ++++ .../management/virtualnetworks/models/package.html | 4 ++++ .../windowsazure/management/websites/models/package.html | 4 ++++ .../com/microsoft/windowsazure/management/models/package.html | 4 ++++ 12 files changed, 48 insertions(+) create mode 100644 management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/package.html create mode 100644 management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/package.html create mode 100644 management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/package.html create mode 100644 management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/package.html create mode 100644 management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/models/package.html create mode 100644 management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/package.html create mode 100644 management-serviceBus/src/main/java/com/microsoft/windowsazure/management/servicebus/models/package.html create mode 100644 management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/package.html create mode 100644 management-store/src/main/java/com/microsoft/windowsazure/management/store/models/package.html create mode 100644 management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/package.html create mode 100644 management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/package.html create mode 100644 management/src/main/java/com/microsoft/windowsazure/management/models/package.html diff --git a/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/package.html b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/package.html new file mode 100644 index 0000000000000..caa6149ed1a2e --- /dev/null +++ b/management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the compute management service. + diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/package.html b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/package.html new file mode 100644 index 0000000000000..1d26a72d61b6d --- /dev/null +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/alerts/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the monitoring alerts management service. + diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/package.html b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/package.html new file mode 100644 index 0000000000000..6b8cd8e871de7 --- /dev/null +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/autoscale/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the monitoring autoscale management service. + diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/package.html b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/package.html new file mode 100644 index 0000000000000..05ce2a6bb138c --- /dev/null +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/metrics/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the monitoring metrics management service. + diff --git a/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/models/package.html b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/models/package.html new file mode 100644 index 0000000000000..e0a9cea06c3f5 --- /dev/null +++ b/management-monitoring/src/main/java/com/microsoft/windowsazure/management/monitoring/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the monitoring management service. + diff --git a/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/package.html b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/package.html new file mode 100644 index 0000000000000..91593ac98429f --- /dev/null +++ b/management-scheduler/src/main/java/com/microsoft/windowsazure/management/scheduler/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the scheduler management service. + diff --git a/management-serviceBus/src/main/java/com/microsoft/windowsazure/management/servicebus/models/package.html b/management-serviceBus/src/main/java/com/microsoft/windowsazure/management/servicebus/models/package.html new file mode 100644 index 0000000000000..fdac66b0e963c --- /dev/null +++ b/management-serviceBus/src/main/java/com/microsoft/windowsazure/management/servicebus/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the store management service. + diff --git a/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/package.html b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/package.html new file mode 100644 index 0000000000000..95f1452dd90a2 --- /dev/null +++ b/management-storage/src/main/java/com/microsoft/windowsazure/management/storage/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the storage management service. + diff --git a/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/package.html b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/package.html new file mode 100644 index 0000000000000..fdac66b0e963c --- /dev/null +++ b/management-store/src/main/java/com/microsoft/windowsazure/management/store/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the store management service. + diff --git a/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/package.html b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/package.html new file mode 100644 index 0000000000000..ae919f980e318 --- /dev/null +++ b/management-virtualnetwork/src/main/java/com/microsoft/windowsazure/management/virtualnetworks/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the virtual network management service. + diff --git a/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/package.html b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/package.html new file mode 100644 index 0000000000000..2f77719db6299 --- /dev/null +++ b/management-website/src/main/java/com/microsoft/windowsazure/management/websites/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the service bus management service. + diff --git a/management/src/main/java/com/microsoft/windowsazure/management/models/package.html b/management/src/main/java/com/microsoft/windowsazure/management/models/package.html new file mode 100644 index 0000000000000..59ca7af26eb47 --- /dev/null +++ b/management/src/main/java/com/microsoft/windowsazure/management/models/package.html @@ -0,0 +1,4 @@ + + +This package contains the models for the management service. +