Package com.microsoft.windowsazure.management.sql.models

Examples of com.microsoft.windowsazure.management.sql.models.ServiceObjective$DimensionSettingResponse


        String serverName = createServer();
        createDatabase(serverName);

        // act
        ServiceObjectiveListResponse serviceObjectivesListResponse = serviceObjectivesOperations.list(serverName);
        ServiceObjective serviceObjective = serviceObjectivesListResponse.getServiceObjectives().get(0);
        ServiceObjectiveGetResponse serviceObjectiveGetResponse = serviceObjectivesOperations.get(serverName, serviceObjective.getId());
        ServiceObjective actualServiceObjective = serviceObjectiveGetResponse.getServiceObjective();

        // assert
        assertEquals(serviceObjective.getId(), actualServiceObjective.getId());
        assertEquals(serviceObjective.getName(), actualServiceObjective.getName());
        assertEquals(serviceObjective.getName(), actualServiceObjective.getName());
    }
View Full Code Here


            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element serviceResourceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "ServiceResource");
            if (serviceResourceElement != null) {
                ServiceObjective serviceResourceInstance = new ServiceObjective();
                result.setServiceObjective(serviceResourceInstance);
               
                Element idElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Id");
                if (idElement != null) {
                    String idInstance;
                    idInstance = idElement.getTextContent();
                    serviceResourceInstance.setId(idInstance);
                }
               
                Element isDefaultElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "IsDefault");
                if (isDefaultElement != null) {
                    boolean isDefaultInstance;
                    isDefaultInstance = DatatypeConverter.parseBoolean(isDefaultElement.getTextContent().toLowerCase());
                    serviceResourceInstance.setIsDefault(isDefaultInstance);
                }
               
                Element isSystemElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "IsSystem");
                if (isSystemElement != null) {
                    boolean isSystemInstance;
                    isSystemInstance = DatatypeConverter.parseBoolean(isSystemElement.getTextContent().toLowerCase());
                    serviceResourceInstance.setIsSystem(isSystemInstance);
                }
               
                Element descriptionElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Description");
                if (descriptionElement != null) {
                    String descriptionInstance;
                    descriptionInstance = descriptionElement.getTextContent();
                    serviceResourceInstance.setDescription(descriptionInstance);
                }
               
                Element enabledElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Enabled");
                if (enabledElement != null) {
                    boolean enabledInstance;
                    enabledInstance = DatatypeConverter.parseBoolean(enabledElement.getTextContent().toLowerCase());
                    serviceResourceInstance.setEnabled(enabledInstance);
                }
               
                Element dimensionSettingsSequenceElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "DimensionSettings");
                if (dimensionSettingsSequenceElement != null) {
                    for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dimensionSettingsSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").size(); i1 = i1 + 1) {
                        org.w3c.dom.Element dimensionSettingsElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dimensionSettingsSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").get(i1));
                        ServiceObjective.DimensionSettingResponse serviceResourceInstance2 = new ServiceObjective.DimensionSettingResponse();
                        serviceResourceInstance.getDimensionSettings().add(serviceResourceInstance2);
                       
                        Element idElement2 = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Id");
                        if (idElement2 != null) {
                            String idInstance2;
                            idInstance2 = idElement2.getTextContent();
                            serviceResourceInstance2.setId(idInstance2);
                        }
                       
                        Element descriptionElement2 = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Description");
                        if (descriptionElement2 != null) {
                            String descriptionInstance2;
                            descriptionInstance2 = descriptionElement2.getTextContent();
                            serviceResourceInstance2.setDescription(descriptionInstance2);
                        }
                       
                        Element ordinalElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Ordinal");
                        if (ordinalElement != null) {
                            byte ordinalInstance;
                            ordinalInstance = DatatypeConverter.parseByte(ordinalElement.getTextContent());
                            serviceResourceInstance2.setOrdinal(ordinalInstance);
                        }
                       
                        Element isDefaultElement2 = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "IsDefault");
                        if (isDefaultElement2 != null) {
                            boolean isDefaultInstance2;
                            isDefaultInstance2 = DatatypeConverter.parseBoolean(isDefaultElement2.getTextContent().toLowerCase());
                            serviceResourceInstance2.setIsDefault(isDefaultInstance2);
                        }
                       
                        Element nameElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Name");
                        if (nameElement != null) {
                            String nameInstance;
                            nameInstance = nameElement.getTextContent();
                            serviceResourceInstance2.setName(nameInstance);
                        }
                       
                        Element typeElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Type");
                        if (typeElement != null) {
                            String typeInstance;
                            typeInstance = typeElement.getTextContent();
                            serviceResourceInstance2.setType(typeInstance);
                        }
                       
                        Element stateElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "State");
                        if (stateElement != null) {
                            String stateInstance;
                            stateInstance = stateElement.getTextContent();
                            serviceResourceInstance2.setState(stateInstance);
                        }
                    }
                }
               
                Element nameElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Name");
                if (nameElement2 != null) {
                    String nameInstance2;
                    nameInstance2 = nameElement2.getTextContent();
                    serviceResourceInstance.setName(nameInstance2);
                }
               
                Element typeElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Type");
                if (typeElement2 != null) {
                    String typeInstance2;
                    typeInstance2 = typeElement2.getTextContent();
                    serviceResourceInstance.setType(typeInstance2);
                }
               
                Element stateElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "State");
                if (stateElement2 != null) {
                    String stateInstance2;
                    stateInstance2 = stateElement2.getTextContent();
                    serviceResourceInstance.setState(stateInstance2);
                }
            }
           
            result.setStatusCode(statusCode);
            if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
View Full Code Here

           
            Element serviceResourcesSequenceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "ServiceResources");
            if (serviceResourcesSequenceElement != null) {
                for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(serviceResourcesSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").size(); i1 = i1 + 1) {
                    org.w3c.dom.Element serviceResourcesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(serviceResourcesSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").get(i1));
                    ServiceObjective serviceResourceInstance = new ServiceObjective();
                    result.getServiceObjectives().add(serviceResourceInstance);
                   
                    Element idElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Id");
                    if (idElement != null) {
                        String idInstance;
                        idInstance = idElement.getTextContent();
                        serviceResourceInstance.setId(idInstance);
                    }
                   
                    Element isDefaultElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "IsDefault");
                    if (isDefaultElement != null) {
                        boolean isDefaultInstance;
                        isDefaultInstance = DatatypeConverter.parseBoolean(isDefaultElement.getTextContent().toLowerCase());
                        serviceResourceInstance.setIsDefault(isDefaultInstance);
                    }
                   
                    Element isSystemElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "IsSystem");
                    if (isSystemElement != null) {
                        boolean isSystemInstance;
                        isSystemInstance = DatatypeConverter.parseBoolean(isSystemElement.getTextContent().toLowerCase());
                        serviceResourceInstance.setIsSystem(isSystemInstance);
                    }
                   
                    Element descriptionElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Description");
                    if (descriptionElement != null) {
                        String descriptionInstance;
                        descriptionInstance = descriptionElement.getTextContent();
                        serviceResourceInstance.setDescription(descriptionInstance);
                    }
                   
                    Element enabledElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Enabled");
                    if (enabledElement != null) {
                        boolean enabledInstance;
                        enabledInstance = DatatypeConverter.parseBoolean(enabledElement.getTextContent().toLowerCase());
                        serviceResourceInstance.setEnabled(enabledInstance);
                    }
                   
                    Element dimensionSettingsSequenceElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "DimensionSettings");
                    if (dimensionSettingsSequenceElement != null) {
                        for (int i2 = 0; i2 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dimensionSettingsSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").size(); i2 = i2 + 1) {
                            org.w3c.dom.Element dimensionSettingsElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(dimensionSettingsSequenceElement, "http://schemas.microsoft.com/windowsazure", "ServiceResource").get(i2));
                            ServiceObjective.DimensionSettingResponse serviceResourceInstance2 = new ServiceObjective.DimensionSettingResponse();
                            serviceResourceInstance.getDimensionSettings().add(serviceResourceInstance2);
                           
                            Element idElement2 = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Id");
                            if (idElement2 != null) {
                                String idInstance2;
                                idInstance2 = idElement2.getTextContent();
                                serviceResourceInstance2.setId(idInstance2);
                            }
                           
                            Element descriptionElement2 = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Description");
                            if (descriptionElement2 != null) {
                                String descriptionInstance2;
                                descriptionInstance2 = descriptionElement2.getTextContent();
                                serviceResourceInstance2.setDescription(descriptionInstance2);
                            }
                           
                            Element ordinalElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Ordinal");
                            if (ordinalElement != null) {
                                byte ordinalInstance;
                                ordinalInstance = DatatypeConverter.parseByte(ordinalElement.getTextContent());
                                serviceResourceInstance2.setOrdinal(ordinalInstance);
                            }
                           
                            Element isDefaultElement2 = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "IsDefault");
                            if (isDefaultElement2 != null) {
                                boolean isDefaultInstance2;
                                isDefaultInstance2 = DatatypeConverter.parseBoolean(isDefaultElement2.getTextContent().toLowerCase());
                                serviceResourceInstance2.setIsDefault(isDefaultInstance2);
                            }
                           
                            Element nameElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Name");
                            if (nameElement != null) {
                                String nameInstance;
                                nameInstance = nameElement.getTextContent();
                                serviceResourceInstance2.setName(nameInstance);
                            }
                           
                            Element typeElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "Type");
                            if (typeElement != null) {
                                String typeInstance;
                                typeInstance = typeElement.getTextContent();
                                serviceResourceInstance2.setType(typeInstance);
                            }
                           
                            Element stateElement = XmlUtility.getElementByTagNameNS(dimensionSettingsElement, "http://schemas.microsoft.com/windowsazure", "State");
                            if (stateElement != null) {
                                String stateInstance;
                                stateInstance = stateElement.getTextContent();
                                serviceResourceInstance2.setState(stateInstance);
                            }
                        }
                    }
                   
                    Element nameElement2 = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Name");
                    if (nameElement2 != null) {
                        String nameInstance2;
                        nameInstance2 = nameElement2.getTextContent();
                        serviceResourceInstance.setName(nameInstance2);
                    }
                   
                    Element typeElement2 = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Type");
                    if (typeElement2 != null) {
                        String typeInstance2;
                        typeInstance2 = typeElement2.getTextContent();
                        serviceResourceInstance.setType(typeInstance2);
                    }
                   
                    Element stateElement2 = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "State");
                    if (stateElement2 != null) {
                        String stateInstance2;
                        stateInstance2 = stateElement2.getTextContent();
                        serviceResourceInstance.setState(stateInstance2);
                    }
                }
            }
           
            result.setStatusCode(statusCode);
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.management.sql.models.ServiceObjective$DimensionSettingResponse

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.