Examples of LoadBalancingRule


Examples of com.cloud.network.lb.LoadBalancingRule

            if (_networkMgr.isProviderSupportServiceInNetwork(guestNetworkId, Service.Lb, provider)) {
                // Re-apply load balancing rules
                for (LoadBalancerVO lb : lbs) {
                    List<LbDestination> dstList = _lbMgr.getExistingDestinations(lb.getId());
                    List<LbStickinessPolicy> policyList = _lbMgr.getStickinessPolicies(lb.getId());
                    LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList, policyList);
                    lbRules.add(loadBalancing);
                }
            }
  
            s_logger.debug("Found " + lbRules.size() + " load balancing rule(s) to apply as a part of domR " + router + " start.");
View Full Code Here

Examples of com.cloud.network.lb.LoadBalancingRule

                    List<LoadBalancerVO> lbs = _loadBalancerDao.listByNetworkId(network.getId());
                    List<LoadBalancingRule> lbRules = new ArrayList<LoadBalancingRule>();
                    for (LoadBalancerVO lb : lbs) {
                        List<LbDestination> dstList = _lbMgr.getExistingDestinations(lb.getId());
                        List<LbStickinessPolicy> policyList = _lbMgr.getStickinessPolicies(lb.getId());
                        LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList,policyList);
                        lbRules.add(loadBalancing);
                    }
                    return sendLBRules(router, lbRules, network.getId());
                } else if (rules.get(0).getPurpose() == Purpose.PortForwarding) {
                    return sendPortForwardingRules(router, (List<PortForwardingRule>) rules, network.getId());
View Full Code Here

Examples of com.cloud.network.lb.LoadBalancingRule

            throw new ResourceUnavailableException(errMsg, this.getClass(), 0);
        }

        List<LoadBalancerTO> loadBalancersToApply = new ArrayList<LoadBalancerTO>();
        for (int i = 0; i < loadBalancingRules.size(); i++) {
            LoadBalancingRule rule = loadBalancingRules.get(i);
            boolean revoked = (rule.getState().equals(FirewallRule.State.Revoke));
            String protocol = rule.getProtocol();
            String algorithm = rule.getAlgorithm();
            String lbUuid = rule.getUuid();
            String srcIp = rule.getSourceIp().addr();
            int srcPort = rule.getSourcePortStart();
            List<LbDestination> destinations = rule.getDestinations();

            if ((destinations != null && !destinations.isEmpty()) || rule.isAutoScaleConfig()) {
                LoadBalancerTO loadBalancer =
                    new LoadBalancerTO(lbUuid, srcIp, srcPort, protocol, algorithm, revoked, false, false, destinations, rule.getStickinessPolicies(),
                        rule.getHealthCheckPolicies(), rule.getLbSslCert(), rule.getLbProtocol());
                if (rule.isAutoScaleConfig()) {
                    loadBalancer.setAutoScaleVmGroup(rule.getAutoScaleVmGroup());
                }
                loadBalancersToApply.add(loadBalancer);
            }
        }
View Full Code Here

Examples of com.cloud.network.lb.LoadBalancingRule

            throw new ResourceUnavailableException(errMsg, this.getClass(), 0);
        }

        List<LoadBalancerTO> loadBalancersToApply = new ArrayList<LoadBalancerTO>();
        for (int i = 0; i < loadBalancingRules.size(); i++) {
            LoadBalancingRule rule = loadBalancingRules.get(i);
            boolean revoked = (rule.getState().equals(FirewallRule.State.Revoke));
            String protocol = rule.getProtocol();
            String algorithm = rule.getAlgorithm();
            String lbUuid = rule.getUuid();
            String srcIp = rule.getSourceIp().addr();
            int srcPort = rule.getSourcePortStart();
            List<LbDestination> destinations = rule.getDestinations();

            if ((destinations != null && !destinations.isEmpty()) || rule.isAutoScaleConfig()) {
                LoadBalancerTO loadBalancer =
                    new LoadBalancerTO(lbUuid, srcIp, srcPort, protocol, algorithm, revoked, false, false, destinations, null, rule.getHealthCheckPolicies(),
                        rule.getLbSslCert(), rule.getLbProtocol());
                loadBalancersToApply.add(loadBalancer);
            }
        }

        if (loadBalancersToApply.size() > 0) {
View Full Code Here

Examples of com.cloud.network.lb.LoadBalancingRule

    @Test
    public void verifyValidateLBRule() throws ResourceUnavailableException {
        ApplicationLoadBalancerRuleVO lb = new ApplicationLoadBalancerRuleVO(null, null, 22, 22, "roundrobin", 1L, 1L, 1L, new Ip("10.10.10.1"), 1L, Scheme.Internal);
        lb.setState(FirewallRule.State.Add);

        LoadBalancingRule rule = new LoadBalancingRule(lb, null, null, null, new Ip("10.10.10.1"));

        boolean result = _lbEl.validateLBRule(new NetworkVO(), rule);
        assertTrue("Wrong value is returned by validateLBRule method", result);
    }
View Full Code Here

Examples of com.cloud.network.lb.LoadBalancingRule

    @Test(expected = CloudRuntimeException.class)
    public void applyWithEmptyVmsSet() {
        boolean result = false;
        List<DomainRouterVO> vms = new ArrayList<DomainRouterVO>();
        List<LoadBalancingRule> rules = new ArrayList<LoadBalancingRule>();
        LoadBalancingRule rule = new LoadBalancingRule(null, null, null, null, null, null, null);

        rules.add(rule);
        try {
            result = _lbVmMgr.applyLoadBalancingRules(new NetworkVO(), rules, vms);
        } catch (ResourceUnavailableException e) {
View Full Code Here

Examples of com.cloud.network.lb.LoadBalancingRule

        List<DomainRouterVO> vms = new ArrayList<DomainRouterVO>();
        vm.setState(State.Starting);
        vms.add(vm);

        List<LoadBalancingRule> rules = new ArrayList<LoadBalancingRule>();
        LoadBalancingRule rule = new LoadBalancingRule(null, null, null, null, null, null, null);

        rules.add(rule);
        try {
            result = _lbVmMgr.applyLoadBalancingRules(new NetworkVO(), rules, vms);
        } finally {
View Full Code Here

Examples of com.cloud.network.lb.LoadBalancingRule

        List<DomainRouterVO> vms = new ArrayList<DomainRouterVO>();
        vm.setState(State.Stopped);
        vms.add(vm);

        List<LoadBalancingRule> rules = new ArrayList<LoadBalancingRule>();
        LoadBalancingRule rule = new LoadBalancingRule(null, null, null, null, null, null, null);

        rules.add(rule);
        try {
            result = _lbVmMgr.applyLoadBalancingRules(new NetworkVO(), rules, vms);
        } finally {
View Full Code Here

Examples of com.cloud.network.lb.LoadBalancingRule

        List<DomainRouterVO> vms = new ArrayList<DomainRouterVO>();
        vm.setState(State.Stopping);
        vms.add(vm);

        List<LoadBalancingRule> rules = new ArrayList<LoadBalancingRule>();
        LoadBalancingRule rule = new LoadBalancingRule(null, null, null, null, null, null, null);

        rules.add(rule);
        try {
            result = _lbVmMgr.applyLoadBalancingRules(new NetworkVO(), rules, vms);
        } finally {
View Full Code Here

Examples of com.cloud.network.lb.LoadBalancingRule

        List<LoadBalancingRule> rules = new ArrayList<LoadBalancingRule>();
        ApplicationLoadBalancerRuleVO lb = new ApplicationLoadBalancerRuleVO(null, null, 22, 22, "roundrobin", 1L, 1L, 1L, new Ip(requestedIp), 1L, Scheme.Internal);
        lb.setState(FirewallRule.State.Add);

        LoadBalancingRule rule = new LoadBalancingRule(lb, null, null, null, new Ip(requestedIp));

        rules.add(rule);

        ntwk.getId();
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.