Package com.microsoft.windowsazure.management.models

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


   
    @Test
    public void getManagementCertificateSuccess() throws Exception {
     
        // arrange
         ManagementCertificateListResponse managementCertificateListResponse = managementClient.getManagementCertificatesOperations().list();
         ArrayList<ManagementCertificateListResponse.SubscriptionCertificate> managementCertificatelist = managementCertificateListResponse.getSubscriptionCertificates();
     
         if (managementCertificatelist.size() > 0) {
           String thumbprint = managementCertificatelist.get(0).getThumbprint();

           ManagementCertificateGetResponse managementCertificateResponse = managementClient.getManagementCertificatesOperations().get(thumbprint);
View Full Code Here


    }
   
    @Test
    public void listManagementCertificateSuccess() throws Exception {
        // Arrange 
       ManagementCertificateListResponse managementCertificateListResponse = managementClient.getManagementCertificatesOperations().list();
       ArrayList<ManagementCertificateListResponse.SubscriptionCertificate> managementCertificatelist = managementCertificateListResponse.getSubscriptionCertificates();
        
       Assert.assertNotNull(managementCertificatelist);;       
    }
View Full Code Here

                }
                throw ex;
            }
           
            // Create Result
            ManagementCertificateListResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new ManagementCertificateListResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element subscriptionCertificatesSequenceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "SubscriptionCertificates");
            if (subscriptionCertificatesSequenceElement != null) {
                for (int i1 = 0; i1 < com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(subscriptionCertificatesSequenceElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionCertificate").size(); i1 = i1 + 1) {
                    org.w3c.dom.Element subscriptionCertificatesElement = ((org.w3c.dom.Element) com.microsoft.windowsazure.core.utils.XmlUtility.getElementsByTagNameNS(subscriptionCertificatesSequenceElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionCertificate").get(i1));
                    ManagementCertificateListResponse.SubscriptionCertificate subscriptionCertificateInstance = new ManagementCertificateListResponse.SubscriptionCertificate();
                    result.getSubscriptionCertificates().add(subscriptionCertificateInstance);
                   
                    Element subscriptionCertificatePublicKeyElement = XmlUtility.getElementByTagNameNS(subscriptionCertificatesElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionCertificatePublicKey");
                    if (subscriptionCertificatePublicKeyElement != null) {
                        byte[] subscriptionCertificatePublicKeyInstance;
                        subscriptionCertificatePublicKeyInstance = subscriptionCertificatePublicKeyElement.getTextContent() != null ? Base64.decode(subscriptionCertificatePublicKeyElement.getTextContent()) : null;
                        subscriptionCertificateInstance.setPublicKey(subscriptionCertificatePublicKeyInstance);
                    }
                   
                    Element subscriptionCertificateThumbprintElement = XmlUtility.getElementByTagNameNS(subscriptionCertificatesElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionCertificateThumbprint");
                    if (subscriptionCertificateThumbprintElement != null) {
                        String subscriptionCertificateThumbprintInstance;
                        subscriptionCertificateThumbprintInstance = subscriptionCertificateThumbprintElement.getTextContent();
                        subscriptionCertificateInstance.setThumbprint(subscriptionCertificateThumbprintInstance);
                    }
                   
                    Element subscriptionCertificateDataElement = XmlUtility.getElementByTagNameNS(subscriptionCertificatesElement, "http://schemas.microsoft.com/windowsazure", "SubscriptionCertificateData");
                    if (subscriptionCertificateDataElement != null) {
                        byte[] subscriptionCertificateDataInstance;
                        subscriptionCertificateDataInstance = subscriptionCertificateDataElement.getTextContent() != null ? Base64.decode(subscriptionCertificateDataElement.getTextContent()) : null;
                        subscriptionCertificateInstance.setData(subscriptionCertificateDataInstance);
                    }
                   
                    Element createdElement = XmlUtility.getElementByTagNameNS(subscriptionCertificatesElement, "http://schemas.microsoft.com/windowsazure", "Created");
                    if (createdElement != null) {
                        Calendar createdInstance;
                        createdInstance = DatatypeConverter.parseDateTime(createdElement.getTextContent());
                        subscriptionCertificateInstance.setCreated(createdInstance);
                    }
                }
            }
           
            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.models.ManagementCertificateListResponse

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.