Examples of RoleSizeListResponse


Examples of com.microsoft.windowsazure.management.models.RoleSizeListResponse

                }
                throw ex;
            }
           
            // Create Result
            RoleSizeListResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new RoleSizeListResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element roleSizesSequenceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "RoleSizes");
            if (roleSizesSequenceElement != null) {
                for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(roleSizesSequenceElement, "http://schemas.microsoft.com/windowsazure", "RoleSize").size(); i1 = i1 + 1) {
                    org.w3c.dom.Element roleSizesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(roleSizesSequenceElement, "http://schemas.microsoft.com/windowsazure", "RoleSize").get(i1));
                    RoleSizeListResponse.RoleSize roleSizeInstance = new RoleSizeListResponse.RoleSize();
                    result.getRoleSizes().add(roleSizeInstance);
                   
                    Element nameElement = XmlUtility.getElementByTagNameNS(roleSizesElement, "http://schemas.microsoft.com/windowsazure", "Name");
                    if (nameElement != null) {
                        String nameInstance;
                        nameInstance = nameElement.getTextContent();
                        roleSizeInstance.setName(nameInstance);
                    }
                   
                    Element labelElement = XmlUtility.getElementByTagNameNS(roleSizesElement, "http://schemas.microsoft.com/windowsazure", "Label");
                    if (labelElement != null) {
                        String labelInstance;
                        labelInstance = labelElement.getTextContent();
                        roleSizeInstance.setLabel(labelInstance);
                    }
                   
                    Element coresElement = XmlUtility.getElementByTagNameNS(roleSizesElement, "http://schemas.microsoft.com/windowsazure", "Cores");
                    if (coresElement != null) {
                        int coresInstance;
                        coresInstance = DatatypeConverter.parseInt(coresElement.getTextContent());
                        roleSizeInstance.setCores(coresInstance);
                    }
                   
                    Element memoryInMbElement = XmlUtility.getElementByTagNameNS(roleSizesElement, "http://schemas.microsoft.com/windowsazure", "MemoryInMb");
                    if (memoryInMbElement != null) {
                        int memoryInMbInstance;
                        memoryInMbInstance = DatatypeConverter.parseInt(memoryInMbElement.getTextContent());
                        roleSizeInstance.setMemoryInMb(memoryInMbInstance);
                    }
                   
                    Element supportedByWebWorkerRolesElement = XmlUtility.getElementByTagNameNS(roleSizesElement, "http://schemas.microsoft.com/windowsazure", "SupportedByWebWorkerRoles");
                    if (supportedByWebWorkerRolesElement != null) {
                        boolean supportedByWebWorkerRolesInstance;
                        supportedByWebWorkerRolesInstance = DatatypeConverter.parseBoolean(supportedByWebWorkerRolesElement.getTextContent().toLowerCase());
                        roleSizeInstance.setSupportedByWebWorkerRoles(supportedByWebWorkerRolesInstance);
                    }
                   
                    Element supportedByVirtualMachinesElement = XmlUtility.getElementByTagNameNS(roleSizesElement, "http://schemas.microsoft.com/windowsazure", "SupportedByVirtualMachines");
                    if (supportedByVirtualMachinesElement != null) {
                        boolean supportedByVirtualMachinesInstance;
                        supportedByVirtualMachinesInstance = DatatypeConverter.parseBoolean(supportedByVirtualMachinesElement.getTextContent().toLowerCase());
                        roleSizeInstance.setSupportedByVirtualMachines(supportedByVirtualMachinesInstance);
                    }
                   
                    Element maxDataDiskCountElement = XmlUtility.getElementByTagNameNS(roleSizesElement, "http://schemas.microsoft.com/windowsazure", "MaxDataDiskCount");
                    if (maxDataDiskCountElement != null) {
                        int maxDataDiskCountInstance;
                        maxDataDiskCountInstance = DatatypeConverter.parseInt(maxDataDiskCountElement.getTextContent());
                        roleSizeInstance.setMaxDataDiskCount(maxDataDiskCountInstance);
                    }
                   
                    Element webWorkerResourceDiskSizeInMbElement = XmlUtility.getElementByTagNameNS(roleSizesElement, "http://schemas.microsoft.com/windowsazure", "WebWorkerResourceDiskSizeInMb");
                    if (webWorkerResourceDiskSizeInMbElement != null) {
                        int webWorkerResourceDiskSizeInMbInstance;
                        webWorkerResourceDiskSizeInMbInstance = DatatypeConverter.parseInt(webWorkerResourceDiskSizeInMbElement.getTextContent());
                        roleSizeInstance.setWebWorkerResourceDiskSizeInMb(webWorkerResourceDiskSizeInMbInstance);
                    }
                   
                    Element virtualMachineResourceDiskSizeInMbElement = XmlUtility.getElementByTagNameNS(roleSizesElement, "http://schemas.microsoft.com/windowsazure", "VirtualMachineResourceDiskSizeInMb");
                    if (virtualMachineResourceDiskSizeInMbElement != null) {
                        int virtualMachineResourceDiskSizeInMbInstance;
                        virtualMachineResourceDiskSizeInMbInstance = DatatypeConverter.parseInt(virtualMachineResourceDiskSizeInMbElement.getTextContent());
                        roleSizeInstance.setVirtualMachineResourceDiskSizeInMb(virtualMachineResourceDiskSizeInMbInstance);
                    }
                }
            }
           
            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

Examples of com.microsoft.windowsazure.management.models.RoleSizeListResponse

        createService();
    }

    @Test
    public void listRoleSizeSuccess() throws Exception {
        RoleSizeListResponse roleSizeListResponse = managementClient.getRoleSizesOperations().list();

        Assert.assertEquals(200, roleSizeListResponse.getStatusCode());
        Assert.assertNotNull(roleSizeListResponse.getRequestId());
        Assert.assertTrue(roleSizeListResponse.getRoleSizes().size() > 0);
    }
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.