Package com.microsoft.windowsazure.management.compute.models

Examples of com.microsoft.windowsazure.management.compute.models.VirtualMachineVMImageListResponse


                }
                throw ex;
            }
           
            // Create Result
            VirtualMachineVMImageListResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new VirtualMachineVMImageListResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element vMImagesSequenceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "VMImages");
            if (vMImagesSequenceElement != null) {
                for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(vMImagesSequenceElement, "http://schemas.microsoft.com/windowsazure", "VMImage").size(); i1 = i1 + 1) {
                    org.w3c.dom.Element vMImagesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(vMImagesSequenceElement, "http://schemas.microsoft.com/windowsazure", "VMImage").get(i1));
                    VirtualMachineVMImageListResponse.VirtualMachineVMImage vMImageInstance = new VirtualMachineVMImageListResponse.VirtualMachineVMImage();
                    result.getVMImages().add(vMImageInstance);
                   
                    Element nameElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "Name");
                    if (nameElement != null) {
                        String nameInstance;
                        nameInstance = nameElement.getTextContent();
                        vMImageInstance.setName(nameInstance);
                    }
                   
                    Element labelElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "Label");
                    if (labelElement != null) {
                        String labelInstance;
                        labelInstance = labelElement.getTextContent();
                        vMImageInstance.setLabel(labelInstance);
                    }
                   
                    Element categoryElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "Category");
                    if (categoryElement != null) {
                        String categoryInstance;
                        categoryInstance = categoryElement.getTextContent();
                        vMImageInstance.setCategory(categoryInstance);
                    }
                   
                    Element descriptionElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "Description");
                    if (descriptionElement != null) {
                        String descriptionInstance;
                        descriptionInstance = descriptionElement.getTextContent();
                        vMImageInstance.setDescription(descriptionInstance);
                    }
                   
                    Element oSDiskConfigurationElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "OSDiskConfiguration");
                    if (oSDiskConfigurationElement != null) {
                        VirtualMachineVMImageListResponse.OSDiskConfiguration oSDiskConfigurationInstance = new VirtualMachineVMImageListResponse.OSDiskConfiguration();
                        vMImageInstance.setOSDiskConfiguration(oSDiskConfigurationInstance);
                       
                        Element nameElement2 = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "Name");
                        if (nameElement2 != null) {
                            String nameInstance2;
                            nameInstance2 = nameElement2.getTextContent();
                            oSDiskConfigurationInstance.setName(nameInstance2);
                        }
                       
                        Element hostCachingElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "HostCaching");
                        if (hostCachingElement != null) {
                            String hostCachingInstance;
                            hostCachingInstance = hostCachingElement.getTextContent();
                            oSDiskConfigurationInstance.setHostCaching(hostCachingInstance);
                        }
                       
                        Element oSStateElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "OSState");
                        if (oSStateElement != null) {
                            String oSStateInstance;
                            oSStateInstance = oSStateElement.getTextContent();
                            oSDiskConfigurationInstance.setOSState(oSStateInstance);
                        }
                       
                        Element osElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "OS");
                        if (osElement != null) {
                            String osInstance;
                            osInstance = osElement.getTextContent();
                            oSDiskConfigurationInstance.setOperatingSystem(osInstance);
                        }
                       
                        Element mediaLinkElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "MediaLink");
                        if (mediaLinkElement != null) {
                            URI mediaLinkInstance;
                            mediaLinkInstance = new URI(mediaLinkElement.getTextContent());
                            oSDiskConfigurationInstance.setMediaLink(mediaLinkInstance);
                        }
                       
                        Element logicalDiskSizeInGBElement = XmlUtility.getElementByTagNameNS(oSDiskConfigurationElement, "http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB");
                        if (logicalDiskSizeInGBElement != null) {
                            int logicalDiskSizeInGBInstance;
                            logicalDiskSizeInGBInstance = DatatypeConverter.parseInt(logicalDiskSizeInGBElement.getTextContent());
                            oSDiskConfigurationInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance);
                        }
                    }
                   
                    Element dataDiskConfigurationsSequenceElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "DataDiskConfigurations");
                    if (dataDiskConfigurationsSequenceElement != null) {
                        for (int i2 = 0; i2 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dataDiskConfigurationsSequenceElement, "http://schemas.microsoft.com/windowsazure", "DataDiskConfiguration").size(); i2 = i2 + 1) {
                            org.w3c.dom.Element dataDiskConfigurationsElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dataDiskConfigurationsSequenceElement, "http://schemas.microsoft.com/windowsazure", "DataDiskConfiguration").get(i2));
                            VirtualMachineVMImageListResponse.DataDiskConfiguration dataDiskConfigurationInstance = new VirtualMachineVMImageListResponse.DataDiskConfiguration();
                            vMImageInstance.getDataDiskConfigurations().add(dataDiskConfigurationInstance);
                           
                            Element nameElement3 = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "Name");
                            if (nameElement3 != null) {
                                String nameInstance3;
                                nameInstance3 = nameElement3.getTextContent();
                                dataDiskConfigurationInstance.setName(nameInstance3);
                            }
                           
                            Element hostCachingElement2 = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "HostCaching");
                            if (hostCachingElement2 != null) {
                                String hostCachingInstance2;
                                hostCachingInstance2 = hostCachingElement2.getTextContent();
                                dataDiskConfigurationInstance.setHostCaching(hostCachingInstance2);
                            }
                           
                            Element lunElement = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "Lun");
                            if (lunElement != null && (lunElement.getTextContent() == null || lunElement.getTextContent().isEmpty() == true) == false) {
                                int lunInstance;
                                lunInstance = DatatypeConverter.parseInt(lunElement.getTextContent());
                                dataDiskConfigurationInstance.setLogicalUnitNumber(lunInstance);
                            }
                           
                            Element mediaLinkElement2 = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "MediaLink");
                            if (mediaLinkElement2 != null) {
                                URI mediaLinkInstance2;
                                mediaLinkInstance2 = new URI(mediaLinkElement2.getTextContent());
                                dataDiskConfigurationInstance.setMediaLink(mediaLinkInstance2);
                            }
                           
                            Element logicalDiskSizeInGBElement2 = XmlUtility.getElementByTagNameNS(dataDiskConfigurationsElement, "http://schemas.microsoft.com/windowsazure", "LogicalDiskSizeInGB");
                            if (logicalDiskSizeInGBElement2 != null) {
                                int logicalDiskSizeInGBInstance2;
                                logicalDiskSizeInGBInstance2 = DatatypeConverter.parseInt(logicalDiskSizeInGBElement2.getTextContent());
                                dataDiskConfigurationInstance.setLogicalDiskSizeInGB(logicalDiskSizeInGBInstance2);
                            }
                        }
                    }
                   
                    Element serviceNameElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "ServiceName");
                    if (serviceNameElement != null) {
                        String serviceNameInstance;
                        serviceNameInstance = serviceNameElement.getTextContent();
                        vMImageInstance.setServiceName(serviceNameInstance);
                    }
                   
                    Element deploymentNameElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "DeploymentName");
                    if (deploymentNameElement != null) {
                        String deploymentNameInstance;
                        deploymentNameInstance = deploymentNameElement.getTextContent();
                        vMImageInstance.setDeploymentName(deploymentNameInstance);
                    }
                   
                    Element roleNameElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "RoleName");
                    if (roleNameElement != null) {
                        String roleNameInstance;
                        roleNameInstance = roleNameElement.getTextContent();
                        vMImageInstance.setRoleName(roleNameInstance);
                    }
                   
                    Element affinityGroupElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "AffinityGroup");
                    if (affinityGroupElement != null) {
                        String affinityGroupInstance;
                        affinityGroupInstance = affinityGroupElement.getTextContent();
                        vMImageInstance.setAffinityGroup(affinityGroupInstance);
                    }
                   
                    Element locationElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "Location");
                    if (locationElement != null) {
                        String locationInstance;
                        locationInstance = locationElement.getTextContent();
                        vMImageInstance.setLocation(locationInstance);
                    }
                   
                    Element createdTimeElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "CreatedTime");
                    if (createdTimeElement != null && (createdTimeElement.getTextContent() == null || createdTimeElement.getTextContent().isEmpty() == true) == false) {
                        Calendar createdTimeInstance;
                        createdTimeInstance = DatatypeConverter.parseDateTime(createdTimeElement.getTextContent());
                        vMImageInstance.setCreatedTime(createdTimeInstance);
                    }
                   
                    Element modifiedTimeElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "ModifiedTime");
                    if (modifiedTimeElement != null && (modifiedTimeElement.getTextContent() == null || modifiedTimeElement.getTextContent().isEmpty() == true) == false) {
                        Calendar modifiedTimeInstance;
                        modifiedTimeInstance = DatatypeConverter.parseDateTime(modifiedTimeElement.getTextContent());
                        vMImageInstance.setModifiedTime(modifiedTimeInstance);
                    }
                   
                    Element languageElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "Language");
                    if (languageElement != null) {
                        String languageInstance;
                        languageInstance = languageElement.getTextContent();
                        vMImageInstance.setLanguage(languageInstance);
                    }
                   
                    Element imageFamilyElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "ImageFamily");
                    if (imageFamilyElement != null) {
                        String imageFamilyInstance;
                        imageFamilyInstance = imageFamilyElement.getTextContent();
                        vMImageInstance.setImageFamily(imageFamilyInstance);
                    }
                   
                    Element recommendedVMSizeElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "RecommendedVMSize");
                    if (recommendedVMSizeElement != null) {
                        String recommendedVMSizeInstance;
                        recommendedVMSizeInstance = recommendedVMSizeElement.getTextContent();
                        vMImageInstance.setRecommendedVMSize(recommendedVMSizeInstance);
                    }
                   
                    Element isPremiumElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "IsPremium");
                    if (isPremiumElement != null && (isPremiumElement.getTextContent() == null || isPremiumElement.getTextContent().isEmpty() == true) == false) {
                        boolean isPremiumInstance;
                        isPremiumInstance = DatatypeConverter.parseBoolean(isPremiumElement.getTextContent().toLowerCase());
                        vMImageInstance.setIsPremium(isPremiumInstance);
                    }
                   
                    Element eulaElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "Eula");
                    if (eulaElement != null) {
                        String eulaInstance;
                        eulaInstance = eulaElement.getTextContent();
                        vMImageInstance.setEula(eulaInstance);
                    }
                   
                    Element iconUriElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "IconUri");
                    if (iconUriElement != null) {
                        URI iconUriInstance;
                        iconUriInstance = new URI(iconUriElement.getTextContent());
                        vMImageInstance.setIconUri(iconUriInstance);
                    }
                   
                    Element smallIconUriElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "SmallIconUri");
                    if (smallIconUriElement != null) {
                        URI smallIconUriInstance;
                        smallIconUriInstance = new URI(smallIconUriElement.getTextContent());
                        vMImageInstance.setSmallIconUri(smallIconUriInstance);
                    }
                   
                    Element privacyUriElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "PrivacyUri");
                    if (privacyUriElement != null) {
                        URI privacyUriInstance;
                        privacyUriInstance = new URI(privacyUriElement.getTextContent());
                        vMImageInstance.setPrivacyUri(privacyUriInstance);
                    }
                   
                    Element publisherNameElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "PublisherName");
                    if (publisherNameElement != null) {
                        String publisherNameInstance;
                        publisherNameInstance = publisherNameElement.getTextContent();
                        vMImageInstance.setPublisherName(publisherNameInstance);
                    }
                   
                    Element publishedDateElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "PublishedDate");
                    if (publishedDateElement != null && (publishedDateElement.getTextContent() == null || publishedDateElement.getTextContent().isEmpty() == true) == false) {
                        Calendar publishedDateInstance;
                        publishedDateInstance = DatatypeConverter.parseDateTime(publishedDateElement.getTextContent());
                        vMImageInstance.setPublishedDate(publishedDateInstance);
                    }
                   
                    Element showInGuiElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "ShowInGui");
                    if (showInGuiElement != null && (showInGuiElement.getTextContent() == null || showInGuiElement.getTextContent().isEmpty() == true) == false) {
                        boolean showInGuiInstance;
                        showInGuiInstance = DatatypeConverter.parseBoolean(showInGuiElement.getTextContent().toLowerCase());
                        vMImageInstance.setShowInGui(showInGuiInstance);
                    }
                   
                    Element pricingDetailLinkElement = XmlUtility.getElementByTagNameNS(vMImagesElement, "http://schemas.microsoft.com/windowsazure", "PricingDetailLink");
                    if (pricingDetailLinkElement != null) {
                        URI pricingDetailLinkInstance;
                        pricingDetailLinkInstance = new URI(pricingDetailLinkElement.getTextContent());
                        vMImageInstance.setPricingDetailLink(pricingDetailLinkInstance);
                    }
                }
            }
           
            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.compute.models.VirtualMachineVMImageListResponse

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.