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

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


        createDatabase(serverName);

        // act
        DatabaseOperationListResponse databaseOperationOperationsListResponse = databaseOperationOperations.listByServer(serverName);
        DatabaseOperation databaseOperation = databaseOperationOperationsListResponse.getDatabaseOperations().get(0);
        DatabaseOperationGetResponse databaseOperationGetResponse = databaseOperationOperations.get(serverName, databaseOperation.getId());
        DatabaseOperation actualDatabaseOperation = databaseOperationGetResponse.getDatabaseOperation();

        // assert
        assertEquals(databaseOperation.getDatabaseName(), actualDatabaseOperation.getDatabaseName());
        assertEquals(databaseOperation.getId(), actualDatabaseOperation.getId());
    }
View Full Code Here


                }
                throw ex;
            }
           
            // Create Result
            DatabaseOperationGetResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new DatabaseOperationGetResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            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) {
                DatabaseOperation serviceResourceInstance = new DatabaseOperation();
                result.setDatabaseOperation(serviceResourceInstance);
               
                Element idElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Id");
                if (idElement != null) {
                    String idInstance;
                    idInstance = idElement.getTextContent();
                    serviceResourceInstance.setId(idInstance);
                }
               
                Element stateIdElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "StateId");
                if (stateIdElement != null) {
                    int stateIdInstance;
                    stateIdInstance = DatatypeConverter.parseInt(stateIdElement.getTextContent());
                    serviceResourceInstance.setStateId(stateIdInstance);
                }
               
                Element sessionActivityIdElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "SessionActivityId");
                if (sessionActivityIdElement != null) {
                    String sessionActivityIdInstance;
                    sessionActivityIdInstance = sessionActivityIdElement.getTextContent();
                    serviceResourceInstance.setSessionActivityId(sessionActivityIdInstance);
                }
               
                Element databaseNameElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "DatabaseName");
                if (databaseNameElement != null) {
                    String databaseNameInstance;
                    databaseNameInstance = databaseNameElement.getTextContent();
                    serviceResourceInstance.setDatabaseName(databaseNameInstance);
                }
               
                Element percentCompleteElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "PercentComplete");
                if (percentCompleteElement != null) {
                    int percentCompleteInstance;
                    percentCompleteInstance = DatatypeConverter.parseInt(percentCompleteElement.getTextContent());
                    serviceResourceInstance.setPercentComplete(percentCompleteInstance);
                }
               
                Element errorCodeElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "ErrorCode");
                if (errorCodeElement != null) {
                    int errorCodeInstance;
                    errorCodeInstance = DatatypeConverter.parseInt(errorCodeElement.getTextContent());
                    serviceResourceInstance.setErrorCode(errorCodeInstance);
                }
               
                Element errorElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Error");
                if (errorElement != null) {
                    String errorInstance;
                    errorInstance = errorElement.getTextContent();
                    serviceResourceInstance.setError(errorInstance);
                }
               
                Element errorSeverityElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "ErrorSeverity");
                if (errorSeverityElement != null) {
                    int errorSeverityInstance;
                    errorSeverityInstance = DatatypeConverter.parseInt(errorSeverityElement.getTextContent());
                    serviceResourceInstance.setErrorSeverity(errorSeverityInstance);
                }
               
                Element errorStateElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "ErrorState");
                if (errorStateElement != null) {
                    int errorStateInstance;
                    errorStateInstance = DatatypeConverter.parseInt(errorStateElement.getTextContent());
                    serviceResourceInstance.setErrorState(errorStateInstance);
                }
               
                Element startTimeElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "StartTime");
                if (startTimeElement != null) {
                    Calendar startTimeInstance;
                    startTimeInstance = DatatypeConverter.parseDateTime(startTimeElement.getTextContent());
                    serviceResourceInstance.setStartTime(startTimeInstance);
                }
               
                Element lastModifyTimeElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "LastModifyTime");
                if (lastModifyTimeElement != null) {
                    Calendar lastModifyTimeInstance;
                    lastModifyTimeInstance = DatatypeConverter.parseDateTime(lastModifyTimeElement.getTextContent());
                    serviceResourceInstance.setLastModifyTime(lastModifyTimeInstance);
                }
               
                Element nameElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Name");
                if (nameElement != null) {
                    String nameInstance;
                    nameInstance = nameElement.getTextContent();
                    serviceResourceInstance.setName(nameInstance);
                }
               
                Element typeElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "Type");
                if (typeElement != null) {
                    String typeInstance;
                    typeInstance = typeElement.getTextContent();
                    serviceResourceInstance.setType(typeInstance);
                }
               
                Element stateElement = XmlUtility.getElementByTagNameNS(serviceResourceElement, "http://schemas.microsoft.com/windowsazure", "State");
                if (stateElement != null) {
                    String stateInstance;
                    stateInstance = stateElement.getTextContent();
                    serviceResourceInstance.setState(stateInstance);
                }
            }
           
            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.DatabaseOperationGetResponse

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.