Examples of SubscriptionListOperationsResponse


Examples of com.microsoft.windowsazure.management.models.SubscriptionListOperationsResponse

                }
                throw ex;
            }
           
            // Create Result
            SubscriptionListOperationsResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new SubscriptionListOperationsResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element subscriptionOperationCollectionElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "SubscriptionOperationCollection");
            if (subscriptionOperationCollectionElement != null) {
                Element continuationTokenElement = XmlUtility.getElementByTagNameNS(subscriptionOperationCollectionElement, "http://schemas.microsoft.com/windowsazure", "ContinuationToken");
                if (continuationTokenElement != null) {
                    String continuationTokenInstance;
                    continuationTokenInstance = continuationTokenElement.getTextContent();
                    result.setContinuationToken(continuationTokenInstance);
                }
               
                Element subscriptionOperationsSequenceElement = XmlUtility.getElementByTagNameNS(subscriptionOperationCollectionElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionOperations");
                if (subscriptionOperationsSequenceElement != null) {
                    for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(subscriptionOperationsSequenceElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionOperation").size(); i1 = i1 + 1) {
                        org.w3c.dom.Element subscriptionOperationsElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(subscriptionOperationsSequenceElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionOperation").get(i1));
                        SubscriptionListOperationsResponse.SubscriptionOperation subscriptionOperationInstance = new SubscriptionListOperationsResponse.SubscriptionOperation();
                        result.getSubscriptionOperations().add(subscriptionOperationInstance);
                       
                        Element operationIdElement = XmlUtility.getElementByTagNameNS(subscriptionOperationsElement, "http://schemas.microsoft.com/windowsazure", "OperationId");
                        if (operationIdElement != null) {
                            String operationIdInstance;
                            operationIdInstance = operationIdElement.getTextContent();
                            subscriptionOperationInstance.setOperationId(operationIdInstance);
                        }
                       
                        Element operationObjectIdElement = XmlUtility.getElementByTagNameNS(subscriptionOperationsElement, "http://schemas.microsoft.com/windowsazure", "OperationObjectId");
                        if (operationObjectIdElement != null) {
                            String operationObjectIdInstance;
                            operationObjectIdInstance = operationObjectIdElement.getTextContent();
                            subscriptionOperationInstance.setOperationObjectId(operationObjectIdInstance);
                        }
                       
                        Element operationNameElement = XmlUtility.getElementByTagNameNS(subscriptionOperationsElement, "http://schemas.microsoft.com/windowsazure", "OperationName");
                        if (operationNameElement != null) {
                            String operationNameInstance;
                            operationNameInstance = operationNameElement.getTextContent();
                            subscriptionOperationInstance.setOperationName(operationNameInstance);
                        }
                       
                        Element operationParametersSequenceElement = XmlUtility.getElementByTagNameNS(subscriptionOperationsElement, "http://schemas.microsoft.com/windowsazure", "OperationParameters");
                        if (operationParametersSequenceElement != null) {
                            for (int i2 = 0; i2 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(operationParametersSequenceElement, "http://schemas.microsoft.com/windowsazure", "OperationParameter").size(); i2 = i2 + 1) {
                                org.w3c.dom.Element operationParametersElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(operationParametersSequenceElement, "http://schemas.microsoft.com/windowsazure", "OperationParameter").get(i2));
                                String operationParametersKey = XmlUtility.getElementByTagNameNS(operationParametersElement, "http://schemas.datacontract.org/2004/07/Microsoft.WindowsAzure.ServiceManagement", "Name").getTextContent();
                                String operationParametersValue = XmlUtility.getElementByTagNameNS(operationParametersElement, "http://schemas.datacontract.org/2004/07/Microsoft.WindowsAzure.ServiceManagement", "Value").getTextContent();
                                subscriptionOperationInstance.getOperationParameters().put(operationParametersKey, operationParametersValue);
                            }
                        }
                       
                        Element operationCallerElement = XmlUtility.getElementByTagNameNS(subscriptionOperationsElement, "http://schemas.microsoft.com/windowsazure", "OperationCaller");
                        if (operationCallerElement != null) {
                            SubscriptionListOperationsResponse.OperationCallerDetails operationCallerInstance = new SubscriptionListOperationsResponse.OperationCallerDetails();
                            subscriptionOperationInstance.setOperationCaller(operationCallerInstance);
                           
                            Element usedServiceManagementApiElement = XmlUtility.getElementByTagNameNS(operationCallerElement, "http://schemas.microsoft.com/windowsazure", "UsedServiceManagementApi");
                            if (usedServiceManagementApiElement != null) {
                                boolean usedServiceManagementApiInstance;
                                usedServiceManagementApiInstance = DatatypeConverter.parseBoolean(usedServiceManagementApiElement.getTextContent().toLowerCase());
                                operationCallerInstance.setUsedServiceManagementApi(usedServiceManagementApiInstance);
                            }
                           
                            Element userEmailAddressElement = XmlUtility.getElementByTagNameNS(operationCallerElement, "http://schemas.microsoft.com/windowsazure", "UserEmailAddress");
                            if (userEmailAddressElement != null) {
                                String userEmailAddressInstance;
                                userEmailAddressInstance = userEmailAddressElement.getTextContent();
                                operationCallerInstance.setUserEmailAddress(userEmailAddressInstance);
                            }
                           
                            Element subscriptionCertificateThumbprintElement = XmlUtility.getElementByTagNameNS(operationCallerElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionCertificateThumbprint");
                            if (subscriptionCertificateThumbprintElement != null) {
                                String subscriptionCertificateThumbprintInstance;
                                subscriptionCertificateThumbprintInstance = subscriptionCertificateThumbprintElement.getTextContent();
                                operationCallerInstance.setSubscriptionCertificateThumbprint(subscriptionCertificateThumbprintInstance);
                            }
                           
                            Element clientIPElement = XmlUtility.getElementByTagNameNS(operationCallerElement, "http://schemas.microsoft.com/windowsazure", "ClientIP");
                            if (clientIPElement != null) {
                                InetAddress clientIPInstance;
                                clientIPInstance = InetAddress.getByName(clientIPElement.getTextContent());
                                operationCallerInstance.setClientIPAddress(clientIPInstance);
                            }
                        }
                       
                        Element operationStatusElement = XmlUtility.getElementByTagNameNS(subscriptionOperationsElement, "http://schemas.microsoft.com/windowsazure", "OperationStatus");
                        if (operationStatusElement != null) {
                            String operationStatusInstance;
                            operationStatusInstance = operationStatusElement.getTextContent();
                            subscriptionOperationInstance.setOperationStatus(operationStatusInstance);
                        }
                       
                        Element operationStartedTimeElement = XmlUtility.getElementByTagNameNS(subscriptionOperationsElement, "http://schemas.microsoft.com/windowsazure", "OperationStartedTime");
                        if (operationStartedTimeElement != null) {
                            Calendar operationStartedTimeInstance;
                            operationStartedTimeInstance = DatatypeConverter.parseDateTime(operationStartedTimeElement.getTextContent());
                            subscriptionOperationInstance.setOperationStartedTime(operationStartedTimeInstance);
                        }
                       
                        Element operationCompletedTimeElement = XmlUtility.getElementByTagNameNS(subscriptionOperationsElement, "http://schemas.microsoft.com/windowsazure", "OperationCompletedTime");
                        if (operationCompletedTimeElement != null) {
                            Calendar operationCompletedTimeInstance;
                            operationCompletedTimeInstance = DatatypeConverter.parseDateTime(operationCompletedTimeElement.getTextContent());
                            subscriptionOperationInstance.setOperationCompletedTime(operationCompletedTimeInstance);
                        }
                    }
                }
            }
           
            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

Examples of com.microsoft.windowsazure.management.models.SubscriptionListOperationsResponse

           Calendar endTime = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
           endTime.set(now.get(Calendar.YEAR), now.get(Calendar.MONTH) , now.get(Calendar.DATE - 1));
           parameters.setStartTime(startTime);
           parameters.setEndTime(endTime);
       
         SubscriptionListOperationsResponse subscriptionListOperationsResponse = managementClient.getSubscriptionsOperations().listOperations(parameters);
       
         Assert.assertEquals(200, subscriptionListOperationsResponse.getStatusCode());        
         Assert.assertNotNull(subscriptionListOperationsResponse.getRequestId());   
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.