Package com.microsoft.windowsazure.management.websites.models

Examples of com.microsoft.windowsazure.management.websites.models.WebSpacesListWebSitesResponse


        WebSiteListParameters  webSiteListParameters = new  WebSiteListParameters();
        ArrayList<String> propertiesToInclude = new ArrayList<String>();
        webSiteListParameters.setPropertiesToInclude(propertiesToInclude);

        // Act
        WebSpacesListWebSitesResponse webSpacesListWebSitesResponse = webSiteManagementClient.getWebSpacesOperations().listWebSites(webSpaceName, webSiteListParameters);

        // Assert
        Assert.assertEquals(200, webSpacesListWebSitesResponse.getStatusCode());
        Assert.assertNotNull(webSpacesListWebSitesResponse.getRequestId());
       
        ArrayList<WebSite> webSiteslist = webSpacesListWebSitesResponse.getWebSites();
        for (WebSite  webSite : webSiteslist) {
             //Assert
             Assert.assertEquals(WebSpaceAvailabilityState.Normal, webSite.getAvailabilityState());
             Assert.assertNotNull(webSite.getName());
        }
View Full Code Here


                }
                throw ex;
            }
           
            // Create Result
            WebSpacesListWebSitesResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new WebSpacesListWebSitesResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element sitesSequenceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "Sites");
            if (sitesSequenceElement != null) {
                for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(sitesSequenceElement, "http://schemas.microsoft.com/windowsazure", "Site").size(); i1 = i1 + 1) {
                    org.w3c.dom.Element sitesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(sitesSequenceElement, "http://schemas.microsoft.com/windowsazure", "Site").get(i1));
                    WebSite siteInstance = new WebSite();
                    result.getWebSites().add(siteInstance);
                   
                    Element adminEnabledElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "AdminEnabled");
                    if (adminEnabledElement != null) {
                        boolean adminEnabledInstance;
                        adminEnabledInstance = DatatypeConverter.parseBoolean(adminEnabledElement.getTextContent().toLowerCase());
                        siteInstance.setAdminEnabled(adminEnabledInstance);
                    }
                   
                    Element availabilityStateElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "AvailabilityState");
                    if (availabilityStateElement != null) {
                        WebSpaceAvailabilityState availabilityStateInstance;
                        availabilityStateInstance = WebSpaceAvailabilityState.valueOf(availabilityStateElement.getTextContent());
                        siteInstance.setAvailabilityState(availabilityStateInstance);
                    }
                   
                    Element computeModeElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "ComputeMode");
                    if (computeModeElement != null) {
                        WebSiteComputeMode computeModeInstance;
                        computeModeInstance = WebSiteComputeMode.valueOf(computeModeElement.getTextContent());
                        siteInstance.setComputeMode(computeModeInstance);
                    }
                   
                    Element enabledElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "Enabled");
                    if (enabledElement != null) {
                        boolean enabledInstance;
                        enabledInstance = DatatypeConverter.parseBoolean(enabledElement.getTextContent().toLowerCase());
                        siteInstance.setEnabled(enabledInstance);
                    }
                   
                    Element enabledHostNamesSequenceElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "EnabledHostNames");
                    if (enabledHostNamesSequenceElement != null) {
                        for (int i2 = 0; i2 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(enabledHostNamesSequenceElement, "http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").size(); i2 = i2 + 1) {
                            org.w3c.dom.Element enabledHostNamesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(enabledHostNamesSequenceElement, "http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").get(i2));
                            siteInstance.getEnabledHostNames().add(enabledHostNamesElement.getTextContent());
                        }
                    }
                   
                    Element hostNameSslStatesSequenceElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "HostNameSslStates");
                    if (hostNameSslStatesSequenceElement != null) {
                        for (int i3 = 0; i3 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(hostNameSslStatesSequenceElement, "http://schemas.microsoft.com/windowsazure", "HostNameSslState").size(); i3 = i3 + 1) {
                            org.w3c.dom.Element hostNameSslStatesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(hostNameSslStatesSequenceElement, "http://schemas.microsoft.com/windowsazure", "HostNameSslState").get(i3));
                            WebSite.WebSiteHostNameSslState hostNameSslStateInstance = new WebSite.WebSiteHostNameSslState();
                            siteInstance.getHostNameSslStates().add(hostNameSslStateInstance);
                           
                            Element nameElement = XmlUtility.getElementByTagNameNS(hostNameSslStatesElement, "http://schemas.microsoft.com/windowsazure", "Name");
                            if (nameElement != null) {
                                String nameInstance;
                                nameInstance = nameElement.getTextContent();
                                hostNameSslStateInstance.setName(nameInstance);
                            }
                           
                            Element sslStateElement = XmlUtility.getElementByTagNameNS(hostNameSslStatesElement, "http://schemas.microsoft.com/windowsazure", "SslState");
                            if (sslStateElement != null) {
                                WebSiteSslState sslStateInstance;
                                sslStateInstance = WebSiteSslState.valueOf(sslStateElement.getTextContent());
                                hostNameSslStateInstance.setSslState(sslStateInstance);
                            }
                           
                            Element thumbprintElement = XmlUtility.getElementByTagNameNS(hostNameSslStatesElement, "http://schemas.microsoft.com/windowsazure", "Thumbprint");
                            if (thumbprintElement != null) {
                                boolean isNil = false;
                                Attr nilAttribute = thumbprintElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                if (nilAttribute != null) {
                                    isNil = "true".equals(nilAttribute.getValue());
                                }
                                if (isNil == false) {
                                    String thumbprintInstance;
                                    thumbprintInstance = thumbprintElement.getTextContent();
                                    hostNameSslStateInstance.setThumbprint(thumbprintInstance);
                                }
                            }
                           
                            Element virtualIPElement = XmlUtility.getElementByTagNameNS(hostNameSslStatesElement, "http://schemas.microsoft.com/windowsazure", "VirtualIP");
                            if (virtualIPElement != null) {
                                boolean isNil2 = false;
                                Attr nilAttribute2 = virtualIPElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                if (nilAttribute2 != null) {
                                    isNil2 = "true".equals(nilAttribute2.getValue());
                                }
                                if (isNil2 == false) {
                                    InetAddress virtualIPInstance;
                                    virtualIPInstance = InetAddress.getByName(virtualIPElement.getTextContent());
                                    hostNameSslStateInstance.setVirtualIP(virtualIPInstance);
                                }
                            }
                        }
                    }
                   
                    Element hostNamesSequenceElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "HostNames");
                    if (hostNamesSequenceElement != null) {
                        for (int i4 = 0; i4 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(hostNamesSequenceElement, "http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").size(); i4 = i4 + 1) {
                            org.w3c.dom.Element hostNamesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(hostNamesSequenceElement, "http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").get(i4));
                            siteInstance.getHostNames().add(hostNamesElement.getTextContent());
                        }
                    }
                   
                    Element lastModifiedTimeUtcElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "LastModifiedTimeUtc");
                    if (lastModifiedTimeUtcElement != null) {
                        Calendar lastModifiedTimeUtcInstance;
                        lastModifiedTimeUtcInstance = DatatypeConverter.parseDateTime(lastModifiedTimeUtcElement.getTextContent());
                        siteInstance.setLastModifiedTimeUtc(lastModifiedTimeUtcInstance);
                    }
                   
                    Element nameElement2 = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "Name");
                    if (nameElement2 != null) {
                        String nameInstance2;
                        nameInstance2 = nameElement2.getTextContent();
                        siteInstance.setName(nameInstance2);
                    }
                   
                    Element ownerElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "Owner");
                    if (ownerElement != null) {
                        boolean isNil3 = false;
                        Attr nilAttribute3 = ownerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                        if (nilAttribute3 != null) {
                            isNil3 = "true".equals(nilAttribute3.getValue());
                        }
                        if (isNil3 == false) {
                            String ownerInstance;
                            ownerInstance = ownerElement.getTextContent();
                            siteInstance.setOwner(ownerInstance);
                        }
                    }
                   
                    Element repositorySiteNameElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "RepositorySiteName");
                    if (repositorySiteNameElement != null) {
                        String repositorySiteNameInstance;
                        repositorySiteNameInstance = repositorySiteNameElement.getTextContent();
                        siteInstance.setRepositorySiteName(repositorySiteNameInstance);
                    }
                   
                    Element runtimeAvailabilityStateElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "RuntimeAvailabilityState");
                    if (runtimeAvailabilityStateElement != null) {
                        WebSiteRuntimeAvailabilityState runtimeAvailabilityStateInstance;
                        runtimeAvailabilityStateInstance = WebSiteRuntimeAvailabilityState.valueOf(runtimeAvailabilityStateElement.getTextContent());
                        siteInstance.setRuntimeAvailabilityState(runtimeAvailabilityStateInstance);
                    }
                   
                    Element sSLCertificatesSequenceElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "SSLCertificates");
                    if (sSLCertificatesSequenceElement != null) {
                        boolean isNil4 = false;
                        Attr nilAttribute4 = sSLCertificatesSequenceElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                        if (nilAttribute4 != null) {
                            isNil4 = "true".equals(nilAttribute4.getValue());
                        }
                        if (isNil4 == false) {
                            for (int i5 = 0; i5 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(sSLCertificatesSequenceElement, "http://schemas.microsoft.com/windowsazure", "Certificate").size(); i5 = i5 + 1) {
                                org.w3c.dom.Element sSLCertificatesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(sSLCertificatesSequenceElement, "http://schemas.microsoft.com/windowsazure", "Certificate").get(i5));
                                WebSite.WebSiteSslCertificate certificateInstance = new WebSite.WebSiteSslCertificate();
                                siteInstance.getSslCertificates().add(certificateInstance);
                               
                                Element expirationDateElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "ExpirationDate");
                                if (expirationDateElement != null && (expirationDateElement.getTextContent() == null || expirationDateElement.getTextContent().isEmpty() == true) == false) {
                                    boolean isNil5 = false;
                                    Attr nilAttribute5 = expirationDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute5 != null) {
                                        isNil5 = "true".equals(nilAttribute5.getValue());
                                    }
                                    if (isNil5 == false) {
                                        Calendar expirationDateInstance;
                                        expirationDateInstance = DatatypeConverter.parseDateTime(expirationDateElement.getTextContent());
                                        certificateInstance.setExpirationDate(expirationDateInstance);
                                    }
                                }
                               
                                Element friendlyNameElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "FriendlyName");
                                if (friendlyNameElement != null) {
                                    boolean isNil6 = false;
                                    Attr nilAttribute6 = friendlyNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute6 != null) {
                                        isNil6 = "true".equals(nilAttribute6.getValue());
                                    }
                                    if (isNil6 == false) {
                                        String friendlyNameInstance;
                                        friendlyNameInstance = friendlyNameElement.getTextContent();
                                        certificateInstance.setFriendlyName(friendlyNameInstance);
                                    }
                                }
                               
                                Element hostNamesSequenceElement2 = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "HostNames");
                                if (hostNamesSequenceElement2 != null) {
                                    boolean isNil7 = false;
                                    Attr nilAttribute7 = hostNamesSequenceElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute7 != null) {
                                        isNil7 = "true".equals(nilAttribute7.getValue());
                                    }
                                    if (isNil7 == false) {
                                        for (int i6 = 0; i6 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(hostNamesSequenceElement2, "http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").size(); i6 = i6 + 1) {
                                            org.w3c.dom.Element hostNamesElement2 = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(hostNamesSequenceElement2, "http://schemas.microsoft.com/2003/10/Serialization/Arrays", "string").get(i6));
                                            certificateInstance.getHostNames().add(hostNamesElement2.getTextContent());
                                        }
                                    } else {
                                        certificateInstance.setHostNames(null);
                                    }
                                }
                               
                                Element issueDateElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "IssueDate");
                                if (issueDateElement != null && (issueDateElement.getTextContent() == null || issueDateElement.getTextContent().isEmpty() == true) == false) {
                                    boolean isNil8 = false;
                                    Attr nilAttribute8 = issueDateElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute8 != null) {
                                        isNil8 = "true".equals(nilAttribute8.getValue());
                                    }
                                    if (isNil8 == false) {
                                        Calendar issueDateInstance;
                                        issueDateInstance = DatatypeConverter.parseDateTime(issueDateElement.getTextContent());
                                        certificateInstance.setIssueDate(issueDateInstance);
                                    }
                                }
                               
                                Element issuerElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "Issuer");
                                if (issuerElement != null) {
                                    boolean isNil9 = false;
                                    Attr nilAttribute9 = issuerElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute9 != null) {
                                        isNil9 = "true".equals(nilAttribute9.getValue());
                                    }
                                    if (isNil9 == false) {
                                        String issuerInstance;
                                        issuerInstance = issuerElement.getTextContent();
                                        certificateInstance.setIssuer(issuerInstance);
                                    }
                                }
                               
                                Element passwordElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "Password");
                                if (passwordElement != null) {
                                    boolean isNil10 = false;
                                    Attr nilAttribute10 = passwordElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute10 != null) {
                                        isNil10 = "true".equals(nilAttribute10.getValue());
                                    }
                                    if (isNil10 == false) {
                                        String passwordInstance;
                                        passwordInstance = passwordElement.getTextContent();
                                        certificateInstance.setPassword(passwordInstance);
                                    }
                                }
                               
                                Element pfxBlobElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "PfxBlob");
                                if (pfxBlobElement != null) {
                                    boolean isNil11 = false;
                                    Attr nilAttribute11 = pfxBlobElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute11 != null) {
                                        isNil11 = "true".equals(nilAttribute11.getValue());
                                    }
                                    if (isNil11 == false) {
                                        byte[] pfxBlobInstance;
                                        pfxBlobInstance = pfxBlobElement.getTextContent() != null ? Base64.decode(pfxBlobElement.getTextContent()) : null;
                                        certificateInstance.setPfxBlob(pfxBlobInstance);
                                    }
                                }
                               
                                Element selfLinkElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "SelfLink");
                                if (selfLinkElement != null) {
                                    boolean isNil12 = false;
                                    Attr nilAttribute12 = selfLinkElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute12 != null) {
                                        isNil12 = "true".equals(nilAttribute12.getValue());
                                    }
                                    if (isNil12 == false) {
                                        URI selfLinkInstance;
                                        selfLinkInstance = new URI(selfLinkElement.getTextContent());
                                        certificateInstance.setSelfLinkUri(selfLinkInstance);
                                    }
                                }
                               
                                Element siteNameElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "SiteName");
                                if (siteNameElement != null) {
                                    boolean isNil13 = false;
                                    Attr nilAttribute13 = siteNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute13 != null) {
                                        isNil13 = "true".equals(nilAttribute13.getValue());
                                    }
                                    if (isNil13 == false) {
                                        String siteNameInstance;
                                        siteNameInstance = siteNameElement.getTextContent();
                                        certificateInstance.setSiteName(siteNameInstance);
                                    }
                                }
                               
                                Element subjectNameElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "SubjectName");
                                if (subjectNameElement != null) {
                                    boolean isNil14 = false;
                                    Attr nilAttribute14 = subjectNameElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute14 != null) {
                                        isNil14 = "true".equals(nilAttribute14.getValue());
                                    }
                                    if (isNil14 == false) {
                                        String subjectNameInstance;
                                        subjectNameInstance = subjectNameElement.getTextContent();
                                        certificateInstance.setSubjectName(subjectNameInstance);
                                    }
                                }
                               
                                Element thumbprintElement2 = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "Thumbprint");
                                if (thumbprintElement2 != null) {
                                    boolean isNil15 = false;
                                    Attr nilAttribute15 = thumbprintElement2.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute15 != null) {
                                        isNil15 = "true".equals(nilAttribute15.getValue());
                                    }
                                    if (isNil15 == false) {
                                        String thumbprintInstance2;
                                        thumbprintInstance2 = thumbprintElement2.getTextContent();
                                        certificateInstance.setThumbprint(thumbprintInstance2);
                                    }
                                }
                               
                                Element toDeleteElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "ToDelete");
                                if (toDeleteElement != null && (toDeleteElement.getTextContent() == null || toDeleteElement.getTextContent().isEmpty() == true) == false) {
                                    boolean isNil16 = false;
                                    Attr nilAttribute16 = toDeleteElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute16 != null) {
                                        isNil16 = "true".equals(nilAttribute16.getValue());
                                    }
                                    if (isNil16 == false) {
                                        boolean toDeleteInstance;
                                        toDeleteInstance = DatatypeConverter.parseBoolean(toDeleteElement.getTextContent().toLowerCase());
                                        certificateInstance.setIsToBeDeleted(toDeleteInstance);
                                    }
                                }
                               
                                Element validElement = XmlUtility.getElementByTagNameNS(sSLCertificatesElement, "http://schemas.microsoft.com/windowsazure", "Valid");
                                if (validElement != null && (validElement.getTextContent() == null || validElement.getTextContent().isEmpty() == true) == false) {
                                    boolean isNil17 = false;
                                    Attr nilAttribute17 = validElement.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "nil");
                                    if (nilAttribute17 != null) {
                                        isNil17 = "true".equals(nilAttribute17.getValue());
                                    }
                                    if (isNil17 == false) {
                                        boolean validInstance;
                                        validInstance = DatatypeConverter.parseBoolean(validElement.getTextContent().toLowerCase());
                                        certificateInstance.setIsValid(validInstance);
                                    }
                                }
                            }
                        } else {
                            siteInstance.setSslCertificates(null);
                        }
                    }
                   
                    Element selfLinkElement2 = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "SelfLink");
                    if (selfLinkElement2 != null) {
                        URI selfLinkInstance2;
                        selfLinkInstance2 = new URI(selfLinkElement2.getTextContent());
                        siteInstance.setUri(selfLinkInstance2);
                    }
                   
                    Element serverFarmElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "ServerFarm");
                    if (serverFarmElement != null) {
                        String serverFarmInstance;
                        serverFarmInstance = serverFarmElement.getTextContent();
                        siteInstance.setServerFarm(serverFarmInstance);
                    }
                   
                    Element siteModeElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "SiteMode");
                    if (siteModeElement != null) {
                        WebSiteMode siteModeInstance;
                        siteModeInstance = WebSiteMode.valueOf(siteModeElement.getTextContent());
                        siteInstance.setSiteMode(siteModeInstance);
                    }
                   
                    Element sitePropertiesElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "SiteProperties");
                    if (sitePropertiesElement != null) {
                        WebSite.WebSiteProperties sitePropertiesInstance = new WebSite.WebSiteProperties();
                        siteInstance.setSiteProperties(sitePropertiesInstance);
                       
                        Element appSettingsSequenceElement = XmlUtility.getElementByTagNameNS(sitePropertiesElement, "http://schemas.microsoft.com/windowsazure", "AppSettings");
                        if (appSettingsSequenceElement != null) {
                            for (int i7 = 0; i7 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(appSettingsSequenceElement, "http://schemas.microsoft.com/windowsazure", "NameValuePair").size(); i7 = i7 + 1) {
                                org.w3c.dom.Element appSettingsElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(appSettingsSequenceElement, "http://schemas.microsoft.com/windowsazure", "NameValuePair").get(i7));
                                String appSettingsKey = XmlUtility.getElementByTagNameNS(appSettingsElement, "http://schemas.microsoft.com/windowsazure", "Name").getTextContent();
                                String appSettingsValue = XmlUtility.getElementByTagNameNS(appSettingsElement, "http://schemas.microsoft.com/windowsazure", "Value").getTextContent();
                                sitePropertiesInstance.getAppSettings().put(appSettingsKey, appSettingsValue);
                            }
                        }
                       
                        Element metadataSequenceElement = XmlUtility.getElementByTagNameNS(sitePropertiesElement, "http://schemas.microsoft.com/windowsazure", "Metadata");
                        if (metadataSequenceElement != null) {
                            for (int i8 = 0; i8 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(metadataSequenceElement, "http://schemas.microsoft.com/windowsazure", "NameValuePair").size(); i8 = i8 + 1) {
                                org.w3c.dom.Element metadataElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(metadataSequenceElement, "http://schemas.microsoft.com/windowsazure", "NameValuePair").get(i8));
                                String metadataKey = XmlUtility.getElementByTagNameNS(metadataElement, "http://schemas.microsoft.com/windowsazure", "Name").getTextContent();
                                String metadataValue = XmlUtility.getElementByTagNameNS(metadataElement, "http://schemas.microsoft.com/windowsazure", "Value").getTextContent();
                                sitePropertiesInstance.getMetadata().put(metadataKey, metadataValue);
                            }
                        }
                       
                        Element propertiesSequenceElement = XmlUtility.getElementByTagNameNS(sitePropertiesElement, "http://schemas.microsoft.com/windowsazure", "Properties");
                        if (propertiesSequenceElement != null) {
                            for (int i9 = 0; i9 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(propertiesSequenceElement, "http://schemas.microsoft.com/windowsazure", "NameValuePair").size(); i9 = i9 + 1) {
                                org.w3c.dom.Element propertiesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(propertiesSequenceElement, "http://schemas.microsoft.com/windowsazure", "NameValuePair").get(i9));
                                String propertiesKey = XmlUtility.getElementByTagNameNS(propertiesElement, "http://schemas.microsoft.com/windowsazure", "Name").getTextContent();
                                String propertiesValue = XmlUtility.getElementByTagNameNS(propertiesElement, "http://schemas.microsoft.com/windowsazure", "Value").getTextContent();
                                sitePropertiesInstance.getProperties().put(propertiesKey, propertiesValue);
                            }
                        }
                    }
                   
                    Element stateElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "State");
                    if (stateElement != null) {
                        String stateInstance;
                        stateInstance = stateElement.getTextContent();
                        siteInstance.setState(stateInstance);
                    }
                   
                    Element usageStateElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "UsageState");
                    if (usageStateElement != null) {
                        WebSiteUsageState usageStateInstance;
                        usageStateInstance = WebSiteUsageState.valueOf(usageStateElement.getTextContent());
                        siteInstance.setUsageState(usageStateInstance);
                    }
                   
                    Element webSpaceElement = XmlUtility.getElementByTagNameNS(sitesElement, "http://schemas.microsoft.com/windowsazure", "WebSpace");
                    if (webSpaceElement != null) {
                        String webSpaceInstance;
                        webSpaceInstance = webSpaceElement.getTextContent();
                        siteInstance.setWebSpace(webSpaceInstance);
                    }
                }
            }
           
            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.websites.models.WebSpacesListWebSitesResponse

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.