Examples of MediaServicesAccountListResponse


Examples of com.microsoft.windowsazure.management.mediaservices.models.MediaServicesAccountListResponse

                }
                throw ex;
            }
           
            // Create Result
            MediaServicesAccountListResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new MediaServicesAccountListResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            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));
                    MediaServicesAccountListResponse.MediaServiceAccount serviceResourceInstance = new MediaServicesAccountListResponse.MediaServiceAccount();
                    result.getAccounts().add(serviceResourceInstance);
                   
                    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);
                    }
                   
                    Element selfLinkElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "SelfLink");
                    if (selfLinkElement != null) {
                        URI selfLinkInstance;
                        selfLinkInstance = new URI(selfLinkElement.getTextContent());
                        serviceResourceInstance.setUri(selfLinkInstance);
                    }
                   
                    Element parentLinkElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "ParentLink");
                    if (parentLinkElement != null) {
                        URI parentLinkInstance;
                        parentLinkInstance = new URI(parentLinkElement.getTextContent());
                        serviceResourceInstance.setParentUri(parentLinkInstance);
                    }
                   
                    Element accountIdElement = XmlUtility.getElementByTagNameNS(serviceResourcesElement, "http://schemas.microsoft.com/windowsazure", "AccountId");
                    if (accountIdElement != null) {
                        String accountIdInstance;
                        accountIdInstance = accountIdElement.getTextContent();
                        serviceResourceInstance.setAccountId(accountIdInstance);
                    }
                }
            }
           
            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.mediaservices.models.MediaServicesAccountListResponse

            }
        }
    }
   
    public static void cleanMediaServicesAccount() {
        MediaServicesAccountListResponse mediaServicesAccountListResponse = null;
        try {
          mediaServicesAccountListResponse  = mediaServicesManagementClient.getAccountsOperations().list();
        } catch (IOException e) {
        } catch (ServiceException e) {
        } catch (ParserConfigurationException e) {
        } catch (SAXException e) {
        } catch (URISyntaxException e) {
        }

        if (mediaServicesAccountListResponse != null){
            ArrayList<MediaServiceAccount> mediaServicesAccountlist = mediaServicesAccountListResponse.getAccounts();
            for (MediaServiceAccount mediaServiceAccount : mediaServicesAccountlist) {
                if (mediaServiceAccount.getName().startsWith(testMediaServicesAccountPrefix)) {
                    try {
                        mediaServicesManagementClient.getAccountsOperations().delete(mediaServiceAccount.getName());
                    } catch (IOException e) {
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.