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

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


        String serverName = createServer();
        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


            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) {
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));
                    DatabaseOperation serviceResourceInstance = new DatabaseOperation();
                    result.getDatabaseOperations().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 stateIdElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "StateId");
                    if (stateIdElement != null) {
                        int stateIdInstance;
                        stateIdInstance = DatatypeConverter.parseInt(stateIdElement.getTextContent());
                        serviceResourceInstance.setStateId(stateIdInstance);
                    }
                   
                    Element sessionActivityIdElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "SessionActivityId");
                    if (sessionActivityIdElement != null) {
                        String sessionActivityIdInstance;
                        sessionActivityIdInstance = sessionActivityIdElement.getTextContent();
                        serviceResourceInstance.setSessionActivityId(sessionActivityIdInstance);
                    }
                   
                    Element databaseNameElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "DatabaseName");
                    if (databaseNameElement != null) {
                        String databaseNameInstance;
                        databaseNameInstance = databaseNameElement.getTextContent();
                        serviceResourceInstance.setDatabaseName(databaseNameInstance);
                    }
                   
                    Element percentCompleteElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "PercentComplete");
                    if (percentCompleteElement != null) {
                        int percentCompleteInstance;
                        percentCompleteInstance = DatatypeConverter.parseInt(percentCompleteElement.getTextContent());
                        serviceResourceInstance.setPercentComplete(percentCompleteInstance);
                    }
                   
                    Element errorCodeElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "ErrorCode");
                    if (errorCodeElement != null) {
                        int errorCodeInstance;
                        errorCodeInstance = DatatypeConverter.parseInt(errorCodeElement.getTextContent());
                        serviceResourceInstance.setErrorCode(errorCodeInstance);
                    }
                   
                    Element errorElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Error");
                    if (errorElement != null) {
                        String errorInstance;
                        errorInstance = errorElement.getTextContent();
                        serviceResourceInstance.setError(errorInstance);
                    }
                   
                    Element errorSeverityElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "ErrorSeverity");
                    if (errorSeverityElement != null) {
                        int errorSeverityInstance;
                        errorSeverityInstance = DatatypeConverter.parseInt(errorSeverityElement.getTextContent());
                        serviceResourceInstance.setErrorSeverity(errorSeverityInstance);
                    }
                   
                    Element errorStateElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "ErrorState");
                    if (errorStateElement != null) {
                        int errorStateInstance;
                        errorStateInstance = DatatypeConverter.parseInt(errorStateElement.getTextContent());
                        serviceResourceInstance.setErrorState(errorStateInstance);
                    }
                   
                    Element startTimeElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "StartTime");
                    if (startTimeElement != null) {
                        Calendar startTimeInstance;
                        startTimeInstance = DatatypeConverter.parseDateTime(startTimeElement.getTextContent());
                        serviceResourceInstance.setStartTime(startTimeInstance);
                    }
                   
                    Element lastModifyTimeElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "LastModifyTime");
                    if (lastModifyTimeElement != null) {
                        Calendar lastModifyTimeInstance;
                        lastModifyTimeInstance = DatatypeConverter.parseDateTime(lastModifyTimeElement.getTextContent());
                        serviceResourceInstance.setLastModifyTime(lastModifyTimeInstance);
                    }
                   
                    Element nameElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Name");
                    if (nameElement != null) {
                        String nameInstance;
                        nameInstance = nameElement.getTextContent();
                        serviceResourceInstance.setName(nameInstance);
                    }
                   
                    Element typeElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Type");
                    if (typeElement != null) {
                        String typeInstance;
                        typeInstance = typeElement.getTextContent();
                        serviceResourceInstance.setType(typeInstance);
                    }
                   
                    Element stateElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "State");
                    if (stateElement != null) {
                        String stateInstance;
                        stateInstance = stateElement.getTextContent();
                        serviceResourceInstance.setState(stateInstance);
                    }
                }
            }
           
            result.setStatusCode(statusCode);
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));
                    DatabaseOperation serviceResourceInstance = new DatabaseOperation();
                    result.getDatabaseOperations().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 stateIdElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "StateId");
                    if (stateIdElement != null) {
                        int stateIdInstance;
                        stateIdInstance = DatatypeConverter.parseInt(stateIdElement.getTextContent());
                        serviceResourceInstance.setStateId(stateIdInstance);
                    }
                   
                    Element sessionActivityIdElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "SessionActivityId");
                    if (sessionActivityIdElement != null) {
                        String sessionActivityIdInstance;
                        sessionActivityIdInstance = sessionActivityIdElement.getTextContent();
                        serviceResourceInstance.setSessionActivityId(sessionActivityIdInstance);
                    }
                   
                    Element databaseNameElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "DatabaseName");
                    if (databaseNameElement != null) {
                        String databaseNameInstance;
                        databaseNameInstance = databaseNameElement.getTextContent();
                        serviceResourceInstance.setDatabaseName(databaseNameInstance);
                    }
                   
                    Element percentCompleteElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "PercentComplete");
                    if (percentCompleteElement != null) {
                        int percentCompleteInstance;
                        percentCompleteInstance = DatatypeConverter.parseInt(percentCompleteElement.getTextContent());
                        serviceResourceInstance.setPercentComplete(percentCompleteInstance);
                    }
                   
                    Element errorCodeElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "ErrorCode");
                    if (errorCodeElement != null) {
                        int errorCodeInstance;
                        errorCodeInstance = DatatypeConverter.parseInt(errorCodeElement.getTextContent());
                        serviceResourceInstance.setErrorCode(errorCodeInstance);
                    }
                   
                    Element errorElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Error");
                    if (errorElement != null) {
                        String errorInstance;
                        errorInstance = errorElement.getTextContent();
                        serviceResourceInstance.setError(errorInstance);
                    }
                   
                    Element errorSeverityElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "ErrorSeverity");
                    if (errorSeverityElement != null) {
                        int errorSeverityInstance;
                        errorSeverityInstance = DatatypeConverter.parseInt(errorSeverityElement.getTextContent());
                        serviceResourceInstance.setErrorSeverity(errorSeverityInstance);
                    }
                   
                    Element errorStateElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "ErrorState");
                    if (errorStateElement != null) {
                        int errorStateInstance;
                        errorStateInstance = DatatypeConverter.parseInt(errorStateElement.getTextContent());
                        serviceResourceInstance.setErrorState(errorStateInstance);
                    }
                   
                    Element startTimeElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "StartTime");
                    if (startTimeElement != null) {
                        Calendar startTimeInstance;
                        startTimeInstance = DatatypeConverter.parseDateTime(startTimeElement.getTextContent());
                        serviceResourceInstance.setStartTime(startTimeInstance);
                    }
                   
                    Element lastModifyTimeElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "LastModifyTime");
                    if (lastModifyTimeElement != null) {
                        Calendar lastModifyTimeInstance;
                        lastModifyTimeInstance = DatatypeConverter.parseDateTime(lastModifyTimeElement.getTextContent());
                        serviceResourceInstance.setLastModifyTime(lastModifyTimeInstance);
                    }
                   
                    Element nameElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Name");
                    if (nameElement != null) {
                        String nameInstance;
                        nameInstance = nameElement.getTextContent();
                        serviceResourceInstance.setName(nameInstance);
                    }
                   
                    Element typeElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "Type");
                    if (typeElement != null) {
                        String typeInstance;
                        typeInstance = typeElement.getTextContent();
                        serviceResourceInstance.setType(typeInstance);
                    }
                   
                    Element stateElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "State");
                    if (stateElement != null) {
                        String stateInstance;
                        stateInstance = stateElement.getTextContent();
                        serviceResourceInstance.setState(stateInstance);
                    }
                }
            }
           
            result.setStatusCode(statusCode);
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.management.sql.models.DatabaseOperation

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.