Package com.microsoft.windowsazure.management.servicebus.models

Examples of com.microsoft.windowsazure.management.servicebus.models.ServiceBusQueuesResponse


                }
                throw ex;
            }
           
            // Create Result
            ServiceBusQueuesResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new ServiceBusQueuesResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element feedElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://www.w3.org/2005/Atom", "feed");
            if (feedElement != null) {
                if (feedElement != null) {
                    for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(feedElement, "http://www.w3.org/2005/Atom", "entry").size(); i1 = i1 + 1) {
                        org.w3c.dom.Element entriesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(feedElement, "http://www.w3.org/2005/Atom", "entry").get(i1));
                        ServiceBusQueue entryInstance = new ServiceBusQueue();
                        result.getQueues().add(entryInstance);
                       
                        Element titleElement = XmlUtility.getElementByTagNameNS(entriesElement, "http://www.w3.org/2005/Atom", "title");
                        if (titleElement != null) {
                            String titleInstance;
                            titleInstance = titleElement.getTextContent();
                            entryInstance.setName(titleInstance);
                        }
                       
                        Element contentElement = XmlUtility.getElementByTagNameNS(entriesElement, "http://www.w3.org/2005/Atom", "content");
                        if (contentElement != null) {
                            Element queueDescriptionElement = XmlUtility.getElementByTagNameNS(contentElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "QueueDescription");
                            if (queueDescriptionElement != null) {
                                Element lockDurationElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "LockDuration");
                                if (lockDurationElement != null) {
                                    String lockDurationInstance;
                                    lockDurationInstance = lockDurationElement.getTextContent();
                                    entryInstance.setLockDuration(lockDurationInstance);
                                }
                               
                                Element maxSizeInMegabytesElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "MaxSizeInMegabytes");
                                if (maxSizeInMegabytesElement != null) {
                                    int maxSizeInMegabytesInstance;
                                    maxSizeInMegabytesInstance = DatatypeConverter.parseInt(maxSizeInMegabytesElement.getTextContent());
                                    entryInstance.setMaxSizeInMegabytes(maxSizeInMegabytesInstance);
                                }
                               
                                Element requiresDuplicateDetectionElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "RequiresDuplicateDetection");
                                if (requiresDuplicateDetectionElement != null) {
                                    boolean requiresDuplicateDetectionInstance;
                                    requiresDuplicateDetectionInstance = DatatypeConverter.parseBoolean(requiresDuplicateDetectionElement.getTextContent().toLowerCase());
                                    entryInstance.setRequiresDuplicateDetection(requiresDuplicateDetectionInstance);
                                }
                               
                                Element requiresSessionElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "RequiresSession");
                                if (requiresSessionElement != null) {
                                    boolean requiresSessionInstance;
                                    requiresSessionInstance = DatatypeConverter.parseBoolean(requiresSessionElement.getTextContent().toLowerCase());
                                    entryInstance.setRequiresSession(requiresSessionInstance);
                                }
                               
                                Element defaultMessageTimeToLiveElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "DefaultMessageTimeToLive");
                                if (defaultMessageTimeToLiveElement != null) {
                                    String defaultMessageTimeToLiveInstance;
                                    defaultMessageTimeToLiveInstance = defaultMessageTimeToLiveElement.getTextContent();
                                    entryInstance.setDefaultMessageTimeToLive(defaultMessageTimeToLiveInstance);
                                }
                               
                                Element deadLetteringOnMessageExpirationElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "DeadLetteringOnMessageExpiration");
                                if (deadLetteringOnMessageExpirationElement != null) {
                                    boolean deadLetteringOnMessageExpirationInstance;
                                    deadLetteringOnMessageExpirationInstance = DatatypeConverter.parseBoolean(deadLetteringOnMessageExpirationElement.getTextContent().toLowerCase());
                                    entryInstance.setDeadLetteringOnMessageExpiration(deadLetteringOnMessageExpirationInstance);
                                }
                               
                                Element duplicateDetectionHistoryTimeWindowElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "DuplicateDetectionHistoryTimeWindow");
                                if (duplicateDetectionHistoryTimeWindowElement != null) {
                                    String duplicateDetectionHistoryTimeWindowInstance;
                                    duplicateDetectionHistoryTimeWindowInstance = duplicateDetectionHistoryTimeWindowElement.getTextContent();
                                    entryInstance.setDuplicateDetectionHistoryTimeWindow(duplicateDetectionHistoryTimeWindowInstance);
                                }
                               
                                Element maxDeliveryCountElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "MaxDeliveryCount");
                                if (maxDeliveryCountElement != null) {
                                    int maxDeliveryCountInstance;
                                    maxDeliveryCountInstance = DatatypeConverter.parseInt(maxDeliveryCountElement.getTextContent());
                                    entryInstance.setMaxDeliveryCount(maxDeliveryCountInstance);
                                }
                               
                                Element enableBatchedOperationsElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "EnableBatchedOperations");
                                if (enableBatchedOperationsElement != null) {
                                    boolean enableBatchedOperationsInstance;
                                    enableBatchedOperationsInstance = DatatypeConverter.parseBoolean(enableBatchedOperationsElement.getTextContent().toLowerCase());
                                    entryInstance.setEnableBatchedOperations(enableBatchedOperationsInstance);
                                }
                               
                                Element sizeInBytesElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "SizeInBytes");
                                if (sizeInBytesElement != null) {
                                    int sizeInBytesInstance;
                                    sizeInBytesInstance = DatatypeConverter.parseInt(sizeInBytesElement.getTextContent());
                                    entryInstance.setSizeInBytes(sizeInBytesInstance);
                                }
                               
                                Element messageCountElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "MessageCount");
                                if (messageCountElement != null) {
                                    int messageCountInstance;
                                    messageCountInstance = DatatypeConverter.parseInt(messageCountElement.getTextContent());
                                    entryInstance.setMessageCount(messageCountInstance);
                                }
                               
                                Element isAnonymousAccessibleElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "IsAnonymousAccessible");
                                if (isAnonymousAccessibleElement != null) {
                                    boolean isAnonymousAccessibleInstance;
                                    isAnonymousAccessibleInstance = DatatypeConverter.parseBoolean(isAnonymousAccessibleElement.getTextContent().toLowerCase());
                                    entryInstance.setIsAnonymousAccessible(isAnonymousAccessibleInstance);
                                }
                               
                                Element authorizationRulesSequenceElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AuthorizationRules");
                                if (authorizationRulesSequenceElement != null) {
                                    for (int i2 = 0; i2 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(authorizationRulesSequenceElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AuthorizationRule").size(); i2 = i2 + 1) {
                                        org.w3c.dom.Element authorizationRulesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(authorizationRulesSequenceElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AuthorizationRule").get(i2));
                                        ServiceBusSharedAccessAuthorizationRule authorizationRuleInstance = new ServiceBusSharedAccessAuthorizationRule();
                                        entryInstance.getAuthorizationRules().add(authorizationRuleInstance);
                                       
                                        Element claimTypeElement = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ClaimType");
                                        if (claimTypeElement != null) {
                                            String claimTypeInstance;
                                            claimTypeInstance = claimTypeElement.getTextContent();
                                            authorizationRuleInstance.setClaimType(claimTypeInstance);
                                        }
                                       
                                        Element claimValueElement = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ClaimValue");
                                        if (claimValueElement != null) {
                                            String claimValueInstance;
                                            claimValueInstance = claimValueElement.getTextContent();
                                            authorizationRuleInstance.setClaimValue(claimValueInstance);
                                        }
                                       
                                        Element rightsSequenceElement = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "Rights");
                                        if (rightsSequenceElement != null) {
                                            for (int i3 = 0; i3 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(rightsSequenceElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AccessRights").size(); i3 = i3 + 1) {
                                                org.w3c.dom.Element rightsElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(rightsSequenceElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AccessRights").get(i3));
                                                authorizationRuleInstance.getRights().add(AccessRight.valueOf(rightsElement.getTextContent()));
                                            }
                                        }
                                       
                                        Element createdTimeElement = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "CreatedTime");
                                        if (createdTimeElement != null) {
                                            Calendar createdTimeInstance;
                                            createdTimeInstance = DatatypeConverter.parseDateTime(createdTimeElement.getTextContent());
                                            authorizationRuleInstance.setCreatedTime(createdTimeInstance);
                                        }
                                       
                                        Element keyNameElement = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "KeyName");
                                        if (keyNameElement != null) {
                                            String keyNameInstance;
                                            keyNameInstance = keyNameElement.getTextContent();
                                            authorizationRuleInstance.setKeyName(keyNameInstance);
                                        }
                                       
                                        Element modifiedTimeElement = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ModifiedTime");
                                        if (modifiedTimeElement != null) {
                                            Calendar modifiedTimeInstance;
                                            modifiedTimeInstance = DatatypeConverter.parseDateTime(modifiedTimeElement.getTextContent());
                                            authorizationRuleInstance.setModifiedTime(modifiedTimeInstance);
                                        }
                                       
                                        Element primaryKeyElement = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "PrimaryKey");
                                        if (primaryKeyElement != null) {
                                            String primaryKeyInstance;
                                            primaryKeyInstance = primaryKeyElement.getTextContent();
                                            authorizationRuleInstance.setPrimaryKey(primaryKeyInstance);
                                        }
                                       
                                        Element secondaryKeyElement = XmlUtility.getElementByTagNameNS(authorizationRulesElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "SecondaryKey");
                                        if (secondaryKeyElement != null) {
                                            String secondaryKeyInstance;
                                            secondaryKeyInstance = secondaryKeyElement.getTextContent();
                                            authorizationRuleInstance.setSecondaryKey(secondaryKeyInstance);
                                        }
                                    }
                                }
                               
                                Element statusElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "Status");
                                if (statusElement != null) {
                                    String statusInstance;
                                    statusInstance = statusElement.getTextContent();
                                    entryInstance.setStatus(statusInstance);
                                }
                               
                                Element createdAtElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "CreatedAt");
                                if (createdAtElement != null) {
                                    Calendar createdAtInstance;
                                    createdAtInstance = DatatypeConverter.parseDateTime(createdAtElement.getTextContent());
                                    entryInstance.setCreatedAt(createdAtInstance);
                                }
                               
                                Element updatedAtElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "UpdatedAt");
                                if (updatedAtElement != null) {
                                    Calendar updatedAtInstance;
                                    updatedAtInstance = DatatypeConverter.parseDateTime(updatedAtElement.getTextContent());
                                    entryInstance.setUpdatedAt(updatedAtInstance);
                                }
                               
                                Element accessedAtElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AccessedAt");
                                if (accessedAtElement != null) {
                                    Calendar accessedAtInstance;
                                    accessedAtInstance = DatatypeConverter.parseDateTime(accessedAtElement.getTextContent());
                                    entryInstance.setAccessedAt(accessedAtInstance);
                                }
                               
                                Element supportOrderingElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "SupportOrdering");
                                if (supportOrderingElement != null) {
                                    boolean supportOrderingInstance;
                                    supportOrderingInstance = DatatypeConverter.parseBoolean(supportOrderingElement.getTextContent().toLowerCase());
                                    entryInstance.setSupportOrdering(supportOrderingInstance);
                                }
                               
                                Element countDetailsElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "CountDetails");
                                if (countDetailsElement != null) {
                                    CountDetails countDetailsInstance = new CountDetails();
                                    entryInstance.setCountDetails(countDetailsInstance);
                                   
                                    Element activeMessageCountElement = XmlUtility.getElementByTagNameNS(countDetailsElement, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "ActiveMessageCount");
                                    if (activeMessageCountElement != null) {
                                        int activeMessageCountInstance;
                                        activeMessageCountInstance = DatatypeConverter.parseInt(activeMessageCountElement.getTextContent());
                                        countDetailsInstance.setActiveMessageCount(activeMessageCountInstance);
                                    }
                                   
                                    Element deadLetterMessageCountElement = XmlUtility.getElementByTagNameNS(countDetailsElement, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "DeadLetterMessageCount");
                                    if (deadLetterMessageCountElement != null) {
                                        int deadLetterMessageCountInstance;
                                        deadLetterMessageCountInstance = DatatypeConverter.parseInt(deadLetterMessageCountElement.getTextContent());
                                        countDetailsInstance.setDeadLetterMessageCount(deadLetterMessageCountInstance);
                                    }
                                   
                                    Element scheduledMessageCountElement = XmlUtility.getElementByTagNameNS(countDetailsElement, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "ScheduledMessageCount");
                                    if (scheduledMessageCountElement != null) {
                                        int scheduledMessageCountInstance;
                                        scheduledMessageCountInstance = DatatypeConverter.parseInt(scheduledMessageCountElement.getTextContent());
                                        countDetailsInstance.setScheduledMessageCount(scheduledMessageCountInstance);
                                    }
                                   
                                    Element transferDeadLetterMessageCountElement = XmlUtility.getElementByTagNameNS(countDetailsElement, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "TransferDeadLetterMessageCount");
                                    if (transferDeadLetterMessageCountElement != null) {
                                        int transferDeadLetterMessageCountInstance;
                                        transferDeadLetterMessageCountInstance = DatatypeConverter.parseInt(transferDeadLetterMessageCountElement.getTextContent());
                                        countDetailsInstance.setTransferDeadLetterMessageCount(transferDeadLetterMessageCountInstance);
                                    }
                                   
                                    Element transferMessageCountElement = XmlUtility.getElementByTagNameNS(countDetailsElement, "http://schemas.microsoft.com/netservices/2011/06/servicebus", "TransferMessageCount");
                                    if (transferMessageCountElement != null) {
                                        int transferMessageCountInstance;
                                        transferMessageCountInstance = DatatypeConverter.parseInt(transferMessageCountElement.getTextContent());
                                        countDetailsInstance.setTransferMessageCount(transferMessageCountInstance);
                                    }
                                }
                               
                                Element autoDeleteOnIdleElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AutoDeleteOnIdle");
                                if (autoDeleteOnIdleElement != null) {
                                    String autoDeleteOnIdleInstance;
                                    autoDeleteOnIdleInstance = autoDeleteOnIdleElement.getTextContent();
                                    entryInstance.setAutoDeleteOnIdle(autoDeleteOnIdleInstance);
                                }
                               
                                Element entityAvailabilityStatusElement = XmlUtility.getElementByTagNameNS(queueDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "EntityAvailabilityStatus");
                                if (entityAvailabilityStatusElement != null) {
                                    String entityAvailabilityStatusInstance;
                                    entityAvailabilityStatusInstance = entityAvailabilityStatusElement.getTextContent();
                                    entryInstance.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);
            }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.management.servicebus.models.ServiceBusQueuesResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.