}
throw ex;
}
// Create Result
ServiceBusQueueResponse result = null;
// Deserialize Response
InputStream responseContent = httpResponse.getEntity().getContent();
result = new ServiceBusQueueResponse();
DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance();
documentBuilderFactory2.setNamespaceAware(true);
DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder();
Document responseDoc = documentBuilder2.parse(new BOMInputStream(responseContent));
Element entryElement2 = XmlUtility.getElementByTagNameNS(responseDoc, "http://www.w3.org/2005/Atom", "entry");
if (entryElement2 != null) {
Element titleElement = XmlUtility.getElementByTagNameNS(entryElement2, "http://www.w3.org/2005/Atom", "title");
if (titleElement != null) {
}
Element contentElement2 = XmlUtility.getElementByTagNameNS(entryElement2, "http://www.w3.org/2005/Atom", "content");
if (contentElement2 != null) {
Element queueDescriptionElement2 = XmlUtility.getElementByTagNameNS(contentElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "QueueDescription");
if (queueDescriptionElement2 != null) {
ServiceBusQueue queueDescriptionInstance = new ServiceBusQueue();
result.setQueue(queueDescriptionInstance);
Element lockDurationElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "LockDuration");
if (lockDurationElement2 != null) {
String lockDurationInstance;
lockDurationInstance = lockDurationElement2.getTextContent();
queueDescriptionInstance.setLockDuration(lockDurationInstance);
}
Element maxSizeInMegabytesElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "MaxSizeInMegabytes");
if (maxSizeInMegabytesElement2 != null) {
int maxSizeInMegabytesInstance;
maxSizeInMegabytesInstance = DatatypeConverter.parseInt(maxSizeInMegabytesElement2.getTextContent());
queueDescriptionInstance.setMaxSizeInMegabytes(maxSizeInMegabytesInstance);
}
Element requiresDuplicateDetectionElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "RequiresDuplicateDetection");
if (requiresDuplicateDetectionElement2 != null) {
boolean requiresDuplicateDetectionInstance;
requiresDuplicateDetectionInstance = DatatypeConverter.parseBoolean(requiresDuplicateDetectionElement2.getTextContent().toLowerCase());
queueDescriptionInstance.setRequiresDuplicateDetection(requiresDuplicateDetectionInstance);
}
Element requiresSessionElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "RequiresSession");
if (requiresSessionElement2 != null) {
boolean requiresSessionInstance;
requiresSessionInstance = DatatypeConverter.parseBoolean(requiresSessionElement2.getTextContent().toLowerCase());
queueDescriptionInstance.setRequiresSession(requiresSessionInstance);
}
Element defaultMessageTimeToLiveElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "DefaultMessageTimeToLive");
if (defaultMessageTimeToLiveElement2 != null) {
String defaultMessageTimeToLiveInstance;
defaultMessageTimeToLiveInstance = defaultMessageTimeToLiveElement2.getTextContent();
queueDescriptionInstance.setDefaultMessageTimeToLive(defaultMessageTimeToLiveInstance);
}
Element deadLetteringOnMessageExpirationElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "DeadLetteringOnMessageExpiration");
if (deadLetteringOnMessageExpirationElement2 != null) {
boolean deadLetteringOnMessageExpirationInstance;
deadLetteringOnMessageExpirationInstance = DatatypeConverter.parseBoolean(deadLetteringOnMessageExpirationElement2.getTextContent().toLowerCase());
queueDescriptionInstance.setDeadLetteringOnMessageExpiration(deadLetteringOnMessageExpirationInstance);
}
Element duplicateDetectionHistoryTimeWindowElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "DuplicateDetectionHistoryTimeWindow");
if (duplicateDetectionHistoryTimeWindowElement2 != null) {
String duplicateDetectionHistoryTimeWindowInstance;
duplicateDetectionHistoryTimeWindowInstance = duplicateDetectionHistoryTimeWindowElement2.getTextContent();
queueDescriptionInstance.setDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindowInstance);
}
Element maxDeliveryCountElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "MaxDeliveryCount");
if (maxDeliveryCountElement != null) {
int maxDeliveryCountInstance;
maxDeliveryCountInstance = DatatypeConverter.parseInt(maxDeliveryCountElement.getTextContent());
queueDescriptionInstance.setMaxDeliveryCount(maxDeliveryCountInstance);
}
Element enableBatchedOperationsElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "EnableBatchedOperations");
if (enableBatchedOperationsElement2 != null) {
boolean enableBatchedOperationsInstance;
enableBatchedOperationsInstance = DatatypeConverter.parseBoolean(enableBatchedOperationsElement2.getTextContent().toLowerCase());
queueDescriptionInstance.setEnableBatchedOperations(enableBatchedOperationsInstance);
}
Element sizeInBytesElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "SizeInBytes");
if (sizeInBytesElement2 != null) {
int sizeInBytesInstance;
sizeInBytesInstance = DatatypeConverter.parseInt(sizeInBytesElement2.getTextContent());
queueDescriptionInstance.setSizeInBytes(sizeInBytesInstance);
}
Element messageCountElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "MessageCount");
if (messageCountElement2 != null) {
int messageCountInstance;
messageCountInstance = DatatypeConverter.parseInt(messageCountElement2.getTextContent());
queueDescriptionInstance.setMessageCount(messageCountInstance);
}
Element isAnonymousAccessibleElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "IsAnonymousAccessible");
if (isAnonymousAccessibleElement2 != null) {
boolean isAnonymousAccessibleInstance;
isAnonymousAccessibleInstance = DatatypeConverter.parseBoolean(isAnonymousAccessibleElement2.getTextContent().toLowerCase());
queueDescriptionInstance.setIsAnonymousAccessible(isAnonymousAccessibleInstance);
}
Element authorizationRulesSequenceElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AuthorizationRules");
if (authorizationRulesSequenceElement2 != null) {
for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(authorizationRulesSequenceElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AuthorizationRule").size(); i1 = i1 + 1) {
org.w3c.dom.Element authorizationRulesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(authorizationRulesSequenceElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AuthorizationRule").get(i1));
ServiceBusSharedAccessAuthorizationRule authorizationRuleInstance = new ServiceBusSharedAccessAuthorizationRule();
queueDescriptionInstance.getAuthorizationRules().add(authorizationRuleInstance);
Element claimTypeElement2 = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ClaimType");
if (claimTypeElement2 != null) {
String claimTypeInstance;
claimTypeInstance = claimTypeElement2.getTextContent();
authorizationRuleInstance.setClaimType(claimTypeInstance);
}
Element claimValueElement2 = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ClaimValue");
if (claimValueElement2 != null) {
String claimValueInstance;
claimValueInstance = claimValueElement2.getTextContent();
authorizationRuleInstance.setClaimValue(claimValueInstance);
}
Element rightsSequenceElement2 = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "Rights");
if (rightsSequenceElement2 != null) {
for (int i2 = 0; i2 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(rightsSequenceElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AccessRights").size(); i2 = i2 + 1) {
org.w3c.dom.Element rightsElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(rightsSequenceElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AccessRights").get(i2));
authorizationRuleInstance.getRights().add(AccessRight.valueOf(rightsElement.getTextContent()));
}
}
Element createdTimeElement2 = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "CreatedTime");
if (createdTimeElement2 != null) {
Calendar createdTimeInstance;
createdTimeInstance = DatatypeConverter.parseDateTime(createdTimeElement2.getTextContent());
authorizationRuleInstance.setCreatedTime(createdTimeInstance);
}
Element keyNameElement2 = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "KeyName");
if (keyNameElement2 != null) {
String keyNameInstance;
keyNameInstance = keyNameElement2.getTextContent();
authorizationRuleInstance.setKeyName(keyNameInstance);
}
Element modifiedTimeElement2 = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ModifiedTime");
if (modifiedTimeElement2 != null) {
Calendar modifiedTimeInstance;
modifiedTimeInstance = DatatypeConverter.parseDateTime(modifiedTimeElement2.getTextContent());
authorizationRuleInstance.setModifiedTime(modifiedTimeInstance);
}
Element primaryKeyElement2 = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "PrimaryKey");
if (primaryKeyElement2 != null) {
String primaryKeyInstance;
primaryKeyInstance = primaryKeyElement2.getTextContent();
authorizationRuleInstance.setPrimaryKey(primaryKeyInstance);
}
Element secondaryKeyElement2 = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "SecondaryKey");
if (secondaryKeyElement2 != null) {
String secondaryKeyInstance;
secondaryKeyInstance = secondaryKeyElement2.getTextContent();
authorizationRuleInstance.setSecondaryKey(secondaryKeyInstance);
}
}
}
Element statusElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "Status");
if (statusElement2 != null) {
String statusInstance;
statusInstance = statusElement2.getTextContent();
queueDescriptionInstance.setStatus(statusInstance);
}
Element createdAtElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "CreatedAt");
if (createdAtElement != null) {
Calendar createdAtInstance;
createdAtInstance = DatatypeConverter.parseDateTime(createdAtElement.getTextContent());
queueDescriptionInstance.setCreatedAt(createdAtInstance);
}
Element updatedAtElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "UpdatedAt");
if (updatedAtElement != null) {
Calendar updatedAtInstance;
updatedAtInstance = DatatypeConverter.parseDateTime(updatedAtElement.getTextContent());
queueDescriptionInstance.setUpdatedAt(updatedAtInstance);
}
Element accessedAtElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AccessedAt");
if (accessedAtElement != null) {
Calendar accessedAtInstance;
accessedAtInstance = DatatypeConverter.parseDateTime(accessedAtElement.getTextContent());
queueDescriptionInstance.setAccessedAt(accessedAtInstance);
}
Element supportOrderingElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "SupportOrdering");
if (supportOrderingElement2 != null) {
boolean supportOrderingInstance;
supportOrderingInstance = DatatypeConverter.parseBoolean(supportOrderingElement2.getTextContent().toLowerCase());
queueDescriptionInstance.setSupportOrdering(supportOrderingInstance);
}
Element countDetailsElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "CountDetails");
if (countDetailsElement2 != null) {
CountDetails countDetailsInstance = new CountDetails();
queueDescriptionInstance.setCountDetails(countDetailsInstance);
Element activeMessageCountElement2 = XmlUtility.getElementByTagNameNS(countDetailsElement2, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "ActiveMessageCount");
if (activeMessageCountElement2 != null) {
int activeMessageCountInstance;
activeMessageCountInstance = DatatypeConverter.parseInt(activeMessageCountElement2.getTextContent());
countDetailsInstance.setActiveMessageCount(activeMessageCountInstance);
}
Element deadLetterMessageCountElement2 = XmlUtility.getElementByTagNameNS(countDetailsElement2, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "DeadLetterMessageCount");
if (deadLetterMessageCountElement2 != null) {
int deadLetterMessageCountInstance;
deadLetterMessageCountInstance = DatatypeConverter.parseInt(deadLetterMessageCountElement2.getTextContent());
countDetailsInstance.setDeadLetterMessageCount(deadLetterMessageCountInstance);
}
Element scheduledMessageCountElement2 = XmlUtility.getElementByTagNameNS(countDetailsElement2, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "ScheduledMessageCount");
if (scheduledMessageCountElement2 != null) {
int scheduledMessageCountInstance;
scheduledMessageCountInstance = DatatypeConverter.parseInt(scheduledMessageCountElement2.getTextContent());
countDetailsInstance.setScheduledMessageCount(scheduledMessageCountInstance);
}
Element transferDeadLetterMessageCountElement2 = XmlUtility.getElementByTagNameNS(countDetailsElement2, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "TransferDeadLetterMessageCount");
if (transferDeadLetterMessageCountElement2 != null) {
int transferDeadLetterMessageCountInstance;
transferDeadLetterMessageCountInstance = DatatypeConverter.parseInt(transferDeadLetterMessageCountElement2.getTextContent());
countDetailsInstance.setTransferDeadLetterMessageCount(transferDeadLetterMessageCountInstance);
}
Element transferMessageCountElement2 = XmlUtility.getElementByTagNameNS(countDetailsElement2, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "TransferMessageCount");
if (transferMessageCountElement2 != null) {
int transferMessageCountInstance;
transferMessageCountInstance = DatatypeConverter.parseInt(transferMessageCountElement2.getTextContent());
countDetailsInstance.setTransferMessageCount(transferMessageCountInstance);
}
}
Element autoDeleteOnIdleElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AutoDeleteOnIdle");
if (autoDeleteOnIdleElement2 != null) {
String autoDeleteOnIdleInstance;
autoDeleteOnIdleInstance = autoDeleteOnIdleElement2.getTextContent();
queueDescriptionInstance.setAutoDeleteOnIdle(autoDeleteOnIdleInstance);
}
Element entityAvailabilityStatusElement2 = XmlUtility.getElementByTagNameNS(queueDescriptionElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "EntityAvailabilityStatus");
if (entityAvailabilityStatusElement2 != null) {
String entityAvailabilityStatusInstance;
entityAvailabilityStatusInstance = entityAvailabilityStatusElement2.getTextContent();
queueDescriptionInstance.setEntityAvailabilityStatus(entityAvailabilityStatusInstance);
}
}
}
}
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);
}