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

Examples of com.microsoft.windowsazure.management.sql.models.ServerListResponse


                Thread.sleep(100);
            }
        }

        serverToBeRemoved.clear();
        ServerListResponse listserverresult = serverOperations.list();
        for (Server  servers: listserverresult) {
            try {
                serverOperations.delete(servers.getName());
            }
            catch (Exception e) {
View Full Code Here


        String serverName = serverCreateResponse.getServerName();
        serverToBeRemoved.add(serverName);
       
        //assert
       
        ServerListResponse serverListResponse = serverOperations.list();
        Iterator<Server> serverList = serverListResponse.iterator();
        Server createdServer = null;
        while (serverList.hasNext()) {
            Server nextServer = serverList.next();
            if (nextServer.getName().equals(serverName)) {
                createdServer = nextServer;
View Full Code Here

        ServerCreateResponse serverCreateResponse = serverOperations.create(serverCreateParameters);
        String serverName = serverCreateResponse.getServerName();
        serverOperations.delete(serverName);

        // assert
        ServerListResponse serverListResponse = serverOperations.list();
        Iterator<Server> serverList = serverListResponse.iterator();
        Server createdServer = null;
        while (serverList.hasNext()) {
            Server nextServer = serverList.next();
            if (nextServer.getName().equals(serverName)) {
                createdServer = nextServer;
View Full Code Here

                }
                throw ex;
            }
           
            // Create Result
            ServerListResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new ServerListResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element serversSequenceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/sqlazure/2010/12/", "Servers");
            if (serversSequenceElement != null) {
                for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(serversSequenceElement, "http://schemas.microsoft.com/sqlazure/2010/12/", "Server").size(); i1 = i1 + 1) {
                    org.w3c.dom.Element serversElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(serversSequenceElement, "http://schemas.microsoft.com/sqlazure/2010/12/", "Server").get(i1));
                    Server serverInstance = new Server();
                    result.getServers().add(serverInstance);
                   
                    Element nameElement = XmlUtility.getElementByTagNameNS(serversElement, "http://schemas.microsoft.com/sqlazure/2010/12/", "Name");
                    if (nameElement != null) {
                        String nameInstance;
                        nameInstance = nameElement.getTextContent();
                        serverInstance.setName(nameInstance);
                    }
                   
                    Element administratorLoginElement = XmlUtility.getElementByTagNameNS(serversElement, "http://schemas.microsoft.com/sqlazure/2010/12/", "AdministratorLogin");
                    if (administratorLoginElement != null) {
                        String administratorLoginInstance;
                        administratorLoginInstance = administratorLoginElement.getTextContent();
                        serverInstance.setAdministratorUserName(administratorLoginInstance);
                    }
                   
                    Element locationElement = XmlUtility.getElementByTagNameNS(serversElement, "http://schemas.microsoft.com/sqlazure/2010/12/", "Location");
                    if (locationElement != null) {
                        String locationInstance;
                        locationInstance = locationElement.getTextContent();
                        serverInstance.setLocation(locationInstance);
                    }
                   
                    Element fullyQualifiedDomainNameElement = XmlUtility.getElementByTagNameNS(serversElement, "http://schemas.microsoft.com/sqlazure/2010/12/", "FullyQualifiedDomainName");
                    if (fullyQualifiedDomainNameElement != null) {
                        String fullyQualifiedDomainNameInstance;
                        fullyQualifiedDomainNameInstance = fullyQualifiedDomainNameElement.getTextContent();
                        serverInstance.setFullyQualifiedDomainName(fullyQualifiedDomainNameInstance);
                    }
                   
                    Element stateElement = XmlUtility.getElementByTagNameNS(serversElement, "http://schemas.microsoft.com/sqlazure/2010/12/", "State");
                    if (stateElement != null) {
                        String stateInstance;
                        stateInstance = stateElement.getTextContent();
                        serverInstance.setState(stateInstance);
                    }
                   
                    Element versionElement = XmlUtility.getElementByTagNameNS(serversElement, "http://schemas.microsoft.com/sqlazure/2010/12/", "Version");
                    if (versionElement != null) {
                        String versionInstance;
                        versionInstance = versionElement.getTextContent();
                        serverInstance.setVersion(versionInstance);
                    }
                }
            }
           
            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.sql.models.ServerListResponse

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.