}
throw ex;
}
// Create Result
RestorableDroppedDatabaseListResponse result = null;
// Deserialize Response
InputStream responseContent = httpResponse.getEntity().getContent();
result = new RestorableDroppedDatabaseListResponse();
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
Element serviceResourcesSequenceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "ServiceResources");
if (serviceResourcesSequenceElement != null) {
for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(serviceResourcesSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").size(); i1 = i1 + 1) {
org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(serviceResourcesSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").get(i1));
RestorableDroppedDatabase serviceResourceInstance = new RestorableDroppedDatabase();
result.getDatabases().add(serviceResourceInstance);
Element entityIdElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "EntityId");
if (entityIdElement != null) {
String entityIdInstance;
entityIdInstance = entityIdElement.getTextContent();
serviceResourceInstance.setEntityId(entityIdInstance);
}
Element serverNameElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "ServerName");
if (serverNameElement != null) {
String serverNameInstance;
serverNameInstance = serverNameElement.getTextContent();
serviceResourceInstance.setServerName(serverNameInstance);
}
Element editionElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Edition");
if (editionElement != null) {
String editionInstance;
editionInstance = editionElement.getTextContent();
serviceResourceInstance.setEdition(editionInstance);
}
Element maxSizeBytesElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "MaxSizeBytes");
if (maxSizeBytesElement != null) {
long maxSizeBytesInstance;
maxSizeBytesInstance = DatatypeConverter.parseLong(maxSizeBytesElement.getTextContent());
serviceResourceInstance.setMaximumDatabaseSizeInBytes(maxSizeBytesInstance);
}
Element creationDateElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "CreationDate");
if (creationDateElement != null) {
Calendar creationDateInstance;
creationDateInstance = DatatypeConverter.parseDateTime(creationDateElement.getTextContent());
serviceResourceInstance.setCreationDate(creationDateInstance);
}
Element deletionDateElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "DeletionDate");
if (deletionDateElement != null) {
Calendar deletionDateInstance;
deletionDateInstance = DatatypeConverter.parseDateTime(deletionDateElement.getTextContent());
serviceResourceInstance.setDeletionDate(deletionDateInstance);
}
Element recoveryPeriodStartDateElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "RecoveryPeriodStartDate");
if (recoveryPeriodStartDateElement != null && (recoveryPeriodStartDateElement.getTextContent() == null || recoveryPeriodStartDateElement.getTextContent().isEmpty() == true) == false) {
Calendar recoveryPeriodStartDateInstance;
recoveryPeriodStartDateInstance = DatatypeConverter.parseDateTime(recoveryPeriodStartDateElement.getTextContent());
serviceResourceInstance.setRecoveryPeriodStartDate(recoveryPeriodStartDateInstance);
}
Element nameElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Name");
if (nameElement != null) {
String nameInstance;
nameInstance = nameElement.getTextContent();
serviceResourceInstance.setName(nameInstance);
}
Element typeElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Type");
if (typeElement != null) {
String typeInstance;
typeInstance = typeElement.getTextContent();
serviceResourceInstance.setType(typeInstance);
}
Element stateElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "State");
if (stateElement != null) {
String stateInstance;
stateInstance = stateElement.getTextContent();
serviceResourceInstance.setState(stateInstance);
}
}
}
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);
}