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

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


                }
                throw ex;
            }
           
            // Create Result
            ServiceBusNamespacesResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new ServiceBusNamespacesResponse();
            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));
                        ServiceBusNamespace entryInstance = new ServiceBusNamespace();
                        result.getNamespaces().add(entryInstance);
                       
                        Element contentElement = XmlUtility.getElementByTagNameNS(entriesElement, "http://www.w3.org/2005/Atom", "content");
                        if (contentElement != null) {
                            Element namespaceDescriptionElement = XmlUtility.getElementByTagNameNS(contentElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "NamespaceDescription");
                            if (namespaceDescriptionElement != null) {
                                Element nameElement = XmlUtility.getElementByTagNameNS(namespaceDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "Name");
                                if (nameElement != null) {
                                    String nameInstance;
                                    nameInstance = nameElement.getTextContent();
                                    entryInstance.setName(nameInstance);
                                }
                               
                                Element regionElement = XmlUtility.getElementByTagNameNS(namespaceDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "Region");
                                if (regionElement != null) {
                                    String regionInstance;
                                    regionInstance = regionElement.getTextContent();
                                    entryInstance.setRegion(regionInstance);
                                }
                               
                                Element statusElement = XmlUtility.getElementByTagNameNS(namespaceDescriptionElement, "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(namespaceDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "CreatedAt");
                                if (createdAtElement != null) {
                                    Calendar createdAtInstance;
                                    createdAtInstance = DatatypeConverter.parseDateTime(createdAtElement.getTextContent());
                                    entryInstance.setCreatedAt(createdAtInstance);
                                }
                               
                                Element acsManagementEndpointElement = XmlUtility.getElementByTagNameNS(namespaceDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "AcsManagementEndpoint");
                                if (acsManagementEndpointElement != null) {
                                    URI acsManagementEndpointInstance;
                                    acsManagementEndpointInstance = new URI(acsManagementEndpointElement.getTextContent());
                                    entryInstance.setAcsManagementEndpoint(acsManagementEndpointInstance);
                                }
                               
                                Element serviceBusEndpointElement = XmlUtility.getElementByTagNameNS(namespaceDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "ServiceBusEndpoint");
                                if (serviceBusEndpointElement != null) {
                                    URI serviceBusEndpointInstance;
                                    serviceBusEndpointInstance = new URI(serviceBusEndpointElement.getTextContent());
                                    entryInstance.setServiceBusEndpoint(serviceBusEndpointInstance);
                                }
                               
                                Element subscriptionIdElement = XmlUtility.getElementByTagNameNS(namespaceDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "SubscriptionId");
                                if (subscriptionIdElement != null) {
                                    String subscriptionIdInstance;
                                    subscriptionIdInstance = subscriptionIdElement.getTextContent();
                                    entryInstance.setSubscriptionId(subscriptionIdInstance);
                                }
                               
                                Element enabledElement = XmlUtility.getElementByTagNameNS(namespaceDescriptionElement, "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect", "Enabled");
                                if (enabledElement != null) {
                                    boolean enabledInstance;
                                    enabledInstance = DatatypeConverter.parseBoolean(enabledElement.getTextContent().toLowerCase());
                                    entryInstance.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);
            }
View Full Code Here

TOP

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

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.