}
throw ex;
}
// Create Result
ServiceBusAuthorizationRuleResponse result = null;
// Deserialize Response
InputStream responseContent = httpResponse.getEntity().getContent();
result = new ServiceBusAuthorizationRuleResponse();
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 contentElement2 = XmlUtility.getElementByTagNameNS(entryElement2, "http://www.w3.org/2005/Atom", "content");
if (contentElement2 != null) {
Element sharedAccessAuthorizationRuleElement2 = XmlUtility.getElementByTagNameNS(contentElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "SharedAccessAuthorizationRule");
if (sharedAccessAuthorizationRuleElement2 != null) {
ServiceBusSharedAccessAuthorizationRule sharedAccessAuthorizationRuleInstance = new ServiceBusSharedAccessAuthorizationRule();
result.setAuthorizationRule(sharedAccessAuthorizationRuleInstance);
Element claimTypeElement2 = XmlUtility.getElementByTagNameNS(sharedAccessAuthorizationRuleElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ClaimType");
if (claimTypeElement2 != null) {
String claimTypeInstance;
claimTypeInstance = claimTypeElement2.getTextContent();
sharedAccessAuthorizationRuleInstance.setClaimType(claimTypeInstance);
}
Element claimValueElement2 = XmlUtility.getElementByTagNameNS(sharedAccessAuthorizationRuleElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ClaimValue");
if (claimValueElement2 != null) {
String claimValueInstance;
claimValueInstance = claimValueElement2.getTextContent();
sharedAccessAuthorizationRuleInstance.setClaimValue(claimValueInstance);
}
Element rightsSequenceElement2 = XmlUtility.getElementByTagNameNS(sharedAccessAuthorizationRuleElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "Rights");
if (rightsSequenceElement2 != null) {
for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(rightsSequenceElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AccessRights").size(); i1 = i1 + 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(i1));
sharedAccessAuthorizationRuleInstance.getRights().add(AccessRight.valueOf(rightsElement.getTextContent()));
}
}
Element createdTimeElement2 = XmlUtility.getElementByTagNameNS(sharedAccessAuthorizationRuleElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "CreatedTime");
if (createdTimeElement2 != null) {
Calendar createdTimeInstance;
createdTimeInstance = DatatypeConverter.parseDateTime(createdTimeElement2.getTextContent());
sharedAccessAuthorizationRuleInstance.setCreatedTime(createdTimeInstance);
}
Element modifiedTimeElement2 = XmlUtility.getElementByTagNameNS(sharedAccessAuthorizationRuleElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ModifiedTime");
if (modifiedTimeElement2 != null) {
Calendar modifiedTimeInstance;
modifiedTimeInstance = DatatypeConverter.parseDateTime(modifiedTimeElement2.getTextContent());
sharedAccessAuthorizationRuleInstance.setModifiedTime(modifiedTimeInstance);
}
Element keyNameElement2 = XmlUtility.getElementByTagNameNS(sharedAccessAuthorizationRuleElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "KeyName");
if (keyNameElement2 != null) {
String keyNameInstance;
keyNameInstance = keyNameElement2.getTextContent();
sharedAccessAuthorizationRuleInstance.setKeyName(keyNameInstance);
}
Element primaryKeyElement2 = XmlUtility.getElementByTagNameNS(sharedAccessAuthorizationRuleElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "PrimaryKey");
if (primaryKeyElement2 != null) {
String primaryKeyInstance;
primaryKeyInstance = primaryKeyElement2.getTextContent();
sharedAccessAuthorizationRuleInstance.setPrimaryKey(primaryKeyInstance);
}
Element secondaryKeyElement = XmlUtility.getElementByTagNameNS(sharedAccessAuthorizationRuleElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "SecondaryKey");
if (secondaryKeyElement != null) {
String secondaryKeyInstance;
secondaryKeyInstance = secondaryKeyElement.getTextContent();
sharedAccessAuthorizationRuleInstance.setSecondaryKey(secondaryKeyInstance);
}
Element revisionElement2 = XmlUtility.getElementByTagNameNS(sharedAccessAuthorizationRuleElement2, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "Revision");
if (revisionElement2 != null) {
int revisionInstance;
revisionInstance = DatatypeConverter.parseInt(revisionElement2.getTextContent());
sharedAccessAuthorizationRuleInstance.setRevision(revisionInstance);
}
}
}
}
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);
}