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

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


        // act
        FirewallRuleCreateParameters firewallRuleCreateParameters = new FirewallRuleCreateParameters();
        firewallRuleCreateParameters.setName(expectedRuleName);
        firewallRuleCreateParameters.setStartIPAddress(expectedStartIpAddress);
        firewallRuleCreateParameters.setEndIPAddress(expectedEndIpAddress);
        FirewallRuleCreateResponse firewallRuleCreateResponse = firewallRuleOperations.create(expectedServerName, firewallRuleCreateParameters);
        FirewallRule firewallRule = firewallRuleCreateResponse.getFirewallRule();
        String firewallRuleName = firewallRule.getName();
        firewallRuleToBeRemoved.put(firewallRuleName, expectedServerName);

        // assert
        assertEquals(expectedRuleName, firewallRule.getName());
View Full Code Here


        // act
        FirewallRuleCreateParameters firewallRuleCreateParameters = new FirewallRuleCreateParameters();
        firewallRuleCreateParameters.setName(expectedRuleName);
        firewallRuleCreateParameters.setStartIPAddress(expectedStartIpAddress);
        firewallRuleCreateParameters.setEndIPAddress(expectedEndIpAddress);
        FirewallRuleCreateResponse firewallRuleCreateResponse = firewallRuleOperations.create(expectedServerName, firewallRuleCreateParameters);
        FirewallRule expectedFirewallRule = firewallRuleCreateResponse.getFirewallRule();
        firewallRuleOperations.delete(expectedServerName, expectedRuleName);
       
        // assert
        FirewallRuleListResponse firewallRuleListResponse = firewallRuleOperations.list(expectedServerName);
        ArrayList<FirewallRule> firewallRuleList = firewallRuleListResponse.getFirewallRules();
View Full Code Here

        // act
        FirewallRuleCreateParameters firewallRuleCreateParameters = new FirewallRuleCreateParameters();
        firewallRuleCreateParameters.setName(expectedRuleName);
        firewallRuleCreateParameters.setStartIPAddress(expectedStartIpAddress);
        firewallRuleCreateParameters.setEndIPAddress(expectedEndIpAddress);
        FirewallRuleCreateResponse firewallRuleCreateResponse = firewallRuleOperations.create(expectedServerName, firewallRuleCreateParameters);
        FirewallRule firewallRule = firewallRuleCreateResponse.getFirewallRule();
        String firewallRuleName = firewallRule.getName();
        firewallRuleToBeRemoved.put(firewallRuleName, expectedServerName);
        FirewallRuleUpdateParameters firewallRuleUpdateParameters = new FirewallRuleUpdateParameters();
        firewallRuleUpdateParameters.setEndIPAddress(updatedEndIpAddress);
        firewallRuleUpdateParameters.setName(expectedRuleName);
View Full Code Here

                }
                throw ex;
            }
           
            // Create Result
            FirewallRuleCreateResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new FirewallRuleCreateResponse();
            DocumentBuilderFactory documentBuilderFactory2 = DocumentBuilderFactory.newInstance();
            documentBuilderFactory2.setNamespaceAware(true);
            DocumentBuilder documentBuilder2 = documentBuilderFactory2.newDocumentBuilder();
            Document responseDoc = documentBuilder2.parse(new BOMInputStream(responseContent));
           
            Element serviceResourceElement2 = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "ServiceResource");
            if (serviceResourceElement2 != null) {
                FirewallRule serviceResourceInstance = new FirewallRule();
                result.setFirewallRule(serviceResourceInstance);
               
                Element startIPAddressElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "StartIPAddress");
                if (startIPAddressElement2 != null) {
                    InetAddress startIPAddressInstance;
                    startIPAddressInstance = InetAddress.getByName(startIPAddressElement2.getTextContent());
                    serviceResourceInstance.setStartIPAddress(startIPAddressInstance);
                }
               
                Element endIPAddressElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "EndIPAddress");
                if (endIPAddressElement2 != null) {
                    InetAddress endIPAddressInstance;
                    endIPAddressInstance = InetAddress.getByName(endIPAddressElement2.getTextContent());
                    serviceResourceInstance.setEndIPAddress(endIPAddressInstance);
                }
               
                Element nameElement2 = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "Name");
                if (nameElement2 != null) {
                    String nameInstance;
                    nameInstance = nameElement2.getTextContent();
                    serviceResourceInstance.setName(nameInstance);
                }
               
                Element typeElement = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "http://schemas.microsoft.com/windowsazure", "Type");
                if (typeElement != null) {
                    String typeInstance;
                    typeInstance = typeElement.getTextContent();
                    serviceResourceInstance.setType(typeInstance);
                }
               
                Element stateElement = XmlUtility.getElementByTagNameNS(serviceResourceElement2, "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.FirewallRuleCreateResponse

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.