Examples of ConfigureStaticNatRulesOnLogicalRouterCommand


Examples of com.cloud.agent.api.ConfigureStaticNatRulesOnLogicalRouterCommand

         * Outside IP: 11.11.11.11
         * Inside IP:  10.10.10.10
         */

        // Mock the command
        ConfigureStaticNatRulesOnLogicalRouterCommand cmd = mock(ConfigureStaticNatRulesOnLogicalRouterCommand.class);
        StaticNatRuleTO rule = new StaticNatRuleTO(1,"11.11.11.11", null, null, "10.10.10.10", null, null, null, false, false);
        List<StaticNatRuleTO> rules = new ArrayList<StaticNatRuleTO>();
        rules.add(rule);
        when(cmd.getRules()).thenReturn(rules);
        when(cmd.getLogicalRouterUuid()).thenReturn("aaaaa");

        // Mock the api find call
        @SuppressWarnings("unchecked")
        NiciraNvpList<NatRule> storedRules = mock(NiciraNvpList.class);
        when(_nvpApi.findNatRulesByLogicalRouterUuid("aaaaa")).thenReturn(storedRules);
View Full Code Here

Examples of com.cloud.agent.api.ConfigureStaticNatRulesOnLogicalRouterCommand

         * Outside IP: 11.11.11.11
         * Inside IP:  10.10.10.10
         */

        // Mock the command
        ConfigureStaticNatRulesOnLogicalRouterCommand cmd = mock(ConfigureStaticNatRulesOnLogicalRouterCommand.class);
        StaticNatRuleTO rule = new StaticNatRuleTO(1,"11.11.11.11", null, null, "10.10.10.10", null, null, null, false, false);
        List<StaticNatRuleTO> rules = new ArrayList<StaticNatRuleTO>();
        rules.add(rule);
        when(cmd.getRules()).thenReturn(rules);
        when(cmd.getLogicalRouterUuid()).thenReturn("aaaaa");

        // Mock the api create calls
        NatRule[] rulepair = _resource.generateStaticNatRulePair("10.10.10.10", "11.11.11.11");
        rulepair[0].setUuid(UUID.randomUUID());
        rulepair[1].setUuid(UUID.randomUUID());
View Full Code Here

Examples of com.cloud.agent.api.ConfigureStaticNatRulesOnLogicalRouterCommand

         * Outside IP: 11.11.11.11
         * Inside IP:  10.10.10.10
         */

        // Mock the command
        ConfigureStaticNatRulesOnLogicalRouterCommand cmd = mock(ConfigureStaticNatRulesOnLogicalRouterCommand.class);
        StaticNatRuleTO rule = new StaticNatRuleTO(1,"11.11.11.11", null, null, "10.10.10.10", null, null, null, true, false);
        List<StaticNatRuleTO> rules = new ArrayList<StaticNatRuleTO>();
        rules.add(rule);
        when(cmd.getRules()).thenReturn(rules);
        when(cmd.getLogicalRouterUuid()).thenReturn("aaaaa");

        // Mock the api create calls
        NatRule[] rulepair = _resource.generateStaticNatRulePair("10.10.10.10", "11.11.11.11");
        final UUID rule0Uuid = UUID.randomUUID();
        final UUID rule1Uuid = UUID.randomUUID();
View Full Code Here

Examples of com.cloud.agent.api.ConfigureStaticNatRulesOnLogicalRouterCommand

         * Outside IP: 11.11.11.11
         * Inside IP:  10.10.10.10
         */

        // Mock the command
        ConfigureStaticNatRulesOnLogicalRouterCommand cmd = mock(ConfigureStaticNatRulesOnLogicalRouterCommand.class);
        StaticNatRuleTO rule = new StaticNatRuleTO(1,"11.11.11.11", null, null, "10.10.10.10", null, null, null, false, false);
        List<StaticNatRuleTO> rules = new ArrayList<StaticNatRuleTO>();
        rules.add(rule);
        when(cmd.getRules()).thenReturn(rules);
        when(cmd.getLogicalRouterUuid()).thenReturn("aaaaa");

        // Mock the api create calls
        NatRule[] rulepair = _resource.generateStaticNatRulePair("10.10.10.10", "11.11.11.11");
        rulepair[0].setUuid(UUID.randomUUID());
        rulepair[1].setUuid(UUID.randomUUID());
View Full Code Here

Examples of com.cloud.agent.api.ConfigureStaticNatRulesOnLogicalRouterCommand

                    rule.getDestIpAddress(), 0, 65535,
                    "any", rule.isForRevoke(), false);
            staticNatRules.add(ruleTO);
        }

        ConfigureStaticNatRulesOnLogicalRouterCommand cmd =
                new ConfigureStaticNatRulesOnLogicalRouterCommand(routermapping.getLogicalRouterUuid(), staticNatRules);
        ConfigureStaticNatRulesOnLogicalRouterAnswer answer = (ConfigureStaticNatRulesOnLogicalRouterAnswer)_agentMgr.easySend(niciraNvpHost.getId(), cmd);

        return answer.getResult();
    }
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.