Package com.microsoft.windowsazure.management.websites.models

Examples of com.microsoft.windowsazure.management.websites.models.ServerFarmCreateResponse


        createParameters.setNumberOfWorkers(numberOfWorkersValue);
        createParameters.setStatus(ServerFarmStatus.Pending);       
        createParameters.setWorkerSize(ServerFarmWorkerSize.Small);      
       
        // Act
        ServerFarmCreateResponse serverFarmCreateResponse = webSiteManagementClient.getServerFarmsOperations().create(webSpaceName, createParameters);
       
        // Assert
        Assert.assertEquals(200,  serverFarmCreateResponse.getStatusCode());
        Assert.assertNotNull(serverFarmCreateResponse.getRequestId());
        Assert.assertEquals(currentNumberOfWorkersValue, serverFarmCreateResponse.getCurrentNumberOfWorkers());
        Assert.assertEquals(ServerFarmWorkerSize.Small, serverFarmCreateResponse.getCurrentWorkerSize());
    }
View Full Code Here


                }
                throw ex;
            }
           
            // Create Result
            ServerFarmCreateResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new ServerFarmCreateResponse();
            DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance();
            documentBuilderFactory2.setNamespaceAware(true);
            DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder();
            Document responseDoc = documentBuilder2.parse(new BOMInputStream(responseContent));
           
            Element serverFarmElement2 = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "ServerFarm");
            if (serverFarmElement2 != null) {
                Element currentNumberOfWorkersElement2 = XmlUtility.getElementByTagNameNS(serverFarmElement2, "http://schemas.microsoft.com/windowsazure", "CurrentNumberOfWorkers");
                if (currentNumberOfWorkersElement2 != null) {
                    int currentNumberOfWorkersInstance;
                    currentNumberOfWorkersInstance = DatatypeConverter.parseInt(currentNumberOfWorkersElement2.getTextContent());
                    result.setCurrentNumberOfWorkers(currentNumberOfWorkersInstance);
                }
               
                Element currentWorkerSizeElement2 = XmlUtility.getElementByTagNameNS(serverFarmElement2, "http://schemas.microsoft.com/windowsazure", "CurrentWorkerSize");
                if (currentWorkerSizeElement2 != null) {
                    ServerFarmWorkerSize currentWorkerSizeInstance;
                    currentWorkerSizeInstance = ServerFarmWorkerSize.valueOf(currentWorkerSizeElement2.getTextContent());
                    result.setCurrentWorkerSize(currentWorkerSizeInstance);
                }
               
                Element nameElement2 = XmlUtility.getElementByTagNameNS(serverFarmElement2, "http://schemas.microsoft.com/windowsazure", "Name");
                if (nameElement2 != null) {
                    String nameInstance;
                    nameInstance = nameElement2.getTextContent();
                    result.setName(nameInstance);
                }
               
                Element numberOfWorkersElement2 = XmlUtility.getElementByTagNameNS(serverFarmElement2, "http://schemas.microsoft.com/windowsazure", "NumberOfWorkers");
                if (numberOfWorkersElement2 != null) {
                    int numberOfWorkersInstance;
                    numberOfWorkersInstance = DatatypeConverter.parseInt(numberOfWorkersElement2.getTextContent());
                    result.setNumberOfWorkers(numberOfWorkersInstance);
                }
               
                Element workerSizeElement2 = XmlUtility.getElementByTagNameNS(serverFarmElement2, "http://schemas.microsoft.com/windowsazure", "WorkerSize");
                if (workerSizeElement2 != null) {
                    ServerFarmWorkerSize workerSizeInstance;
                    workerSizeInstance = ServerFarmWorkerSize.valueOf(workerSizeElement2.getTextContent());
                    result.setWorkerSize(workerSizeInstance);
                }
               
                Element statusElement2 = XmlUtility.getElementByTagNameNS(serverFarmElement2, "http://schemas.microsoft.com/windowsazure", "Status");
                if (statusElement2 != null) {
                    ServerFarmStatus statusInstance;
                    statusInstance = ServerFarmStatus.valueOf(statusElement2.getTextContent());
                    result.setStatus(statusInstance);
                }
            }
           
            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.websites.models.ServerFarmCreateResponse

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.