Examples of VirtualMachineOSImageListResponse


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

                }
                throw ex;
            }
           
            // Create Result
            VirtualMachineOSImageListResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new VirtualMachineOSImageListResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element imagesSequenceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "Images");
            if (imagesSequenceElement != null) {
                for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(imagesSequenceElement, "http://schemas.microsoft.com/windowsazure", "OSImage").size(); i1 = i1 + 1) {
                    org.w3c.dom.Element imagesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(imagesSequenceElement, "http://schemas.microsoft.com/windowsazure", "OSImage").get(i1));
                    VirtualMachineOSImageListResponse.VirtualMachineOSImage oSImageInstance = new VirtualMachineOSImageListResponse.VirtualMachineOSImage();
                    result.getImages().add(oSImageInstance);
                   
                    Element affinityGroupElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "AffinityGroup");
                    if (affinityGroupElement != null) {
                        String affinityGroupInstance;
                        affinityGroupInstance = affinityGroupElement.getTextContent();
                        oSImageInstance.setAffinityGroup(affinityGroupInstance);
                    }
                   
                    Element categoryElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "Category");
                    if (categoryElement != null) {
                        String categoryInstance;
                        categoryInstance = categoryElement.getTextContent();
                        oSImageInstance.setCategory(categoryInstance);
                    }
                   
                    Element labelElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "Label");
                    if (labelElement != null) {
                        String labelInstance;
                        labelInstance = labelElement.getTextContent();
                        oSImageInstance.setLabel(labelInstance);
                    }
                   
                    Element locationElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "Location");
                    if (locationElement != null) {
                        String locationInstance;
                        locationInstance = locationElement.getTextContent();
                        oSImageInstance.setLocation(locationInstance);
                    }
                   
                    Element logicalSizeInGBElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "LogicalSizeInGB");
                    if (logicalSizeInGBElement != null) {
                        double logicalSizeInGBInstance;
                        logicalSizeInGBInstance = DatatypeConverter.parseDouble(logicalSizeInGBElement.getTextContent());
                        oSImageInstance.setLogicalSizeInGB(logicalSizeInGBInstance);
                    }
                   
                    Element mediaLinkElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "MediaLink");
                    if (mediaLinkElement != null) {
                        URI mediaLinkInstance;
                        mediaLinkInstance = new URI(mediaLinkElement.getTextContent());
                        oSImageInstance.setMediaLinkUri(mediaLinkInstance);
                    }
                   
                    Element nameElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "Name");
                    if (nameElement != null) {
                        String nameInstance;
                        nameInstance = nameElement.getTextContent();
                        oSImageInstance.setName(nameInstance);
                    }
                   
                    Element osElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "OS");
                    if (osElement != null) {
                        String osInstance;
                        osInstance = osElement.getTextContent();
                        oSImageInstance.setOperatingSystemType(osInstance);
                    }
                   
                    Element eulaElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "Eula");
                    if (eulaElement != null) {
                        String eulaInstance;
                        eulaInstance = eulaElement.getTextContent();
                        oSImageInstance.setEula(eulaInstance);
                    }
                   
                    Element descriptionElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "Description");
                    if (descriptionElement != null) {
                        String descriptionInstance;
                        descriptionInstance = descriptionElement.getTextContent();
                        oSImageInstance.setDescription(descriptionInstance);
                    }
                   
                    Element imageFamilyElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "ImageFamily");
                    if (imageFamilyElement != null) {
                        String imageFamilyInstance;
                        imageFamilyInstance = imageFamilyElement.getTextContent();
                        oSImageInstance.setImageFamily(imageFamilyInstance);
                    }
                   
                    Element publishedDateElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "PublishedDate");
                    if (publishedDateElement != null) {
                        Calendar publishedDateInstance;
                        publishedDateInstance = DatatypeConverter.parseDateTime(publishedDateElement.getTextContent());
                        oSImageInstance.setPublishedDate(publishedDateInstance);
                    }
                   
                    Element isPremiumElement = XmlUtility.getElementByTagNameNS(imagesElement, "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());
                        oSImageInstance.setIsPremium(isPremiumInstance);
                    }
                   
                    Element privacyUriElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "PrivacyUri");
                    if (privacyUriElement != null) {
                        URI privacyUriInstance;
                        privacyUriInstance = new URI(privacyUriElement.getTextContent());
                        oSImageInstance.setPrivacyUri(privacyUriInstance);
                    }
                   
                    Element recommendedVMSizeElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "RecommendedVMSize");
                    if (recommendedVMSizeElement != null) {
                        String recommendedVMSizeInstance;
                        recommendedVMSizeInstance = recommendedVMSizeElement.getTextContent();
                        oSImageInstance.setRecommendedVMSize(recommendedVMSizeInstance);
                    }
                   
                    Element publisherNameElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "PublisherName");
                    if (publisherNameElement != null) {
                        String publisherNameInstance;
                        publisherNameInstance = publisherNameElement.getTextContent();
                        oSImageInstance.setPublisherName(publisherNameInstance);
                    }
                   
                    Element pricingDetailLinkElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "PricingDetailLink");
                    if (pricingDetailLinkElement != null) {
                        URI pricingDetailLinkInstance;
                        pricingDetailLinkInstance = new URI(pricingDetailLinkElement.getTextContent());
                        oSImageInstance.setPricingDetailUri(pricingDetailLinkInstance);
                    }
                   
                    Element smallIconUriElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "SmallIconUri");
                    if (smallIconUriElement != null) {
                        URI smallIconUriInstance;
                        smallIconUriInstance = new URI(smallIconUriElement.getTextContent());
                        oSImageInstance.setSmallIconUri(smallIconUriInstance);
                    }
                   
                    Element languageElement = XmlUtility.getElementByTagNameNS(imagesElement, "http://schemas.microsoft.com/windowsazure", "Language");
                    if (languageElement != null) {
                        String languageInstance;
                        languageInstance = languageElement.getTextContent();
                        oSImageInstance.setLanguage(languageInstance);
                    }
                }
            }
           
            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
Copyright © 2018 www.massapi.com. 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.