private boolean canHandleLbRules(final List<LoadBalancingRule> rules) { final Map<Capability, String> lbCaps = getCapabilities().get(Service.Lb); if (!lbCaps.isEmpty()) { final String schemeCaps = lbCaps.get(Capability.LbSchemes); if (schemeCaps != null) { for (final LoadBalancingRule rule : rules) { if (!schemeCaps.contains(rule.getScheme().toString())) { s_logger.debug("Scheme " + rules.get(0).getScheme() + " is not supported by the provider " + getName()); return false; } } } } return true; }
private boolean canHandleLbRules(List<LoadBalancingRule> rules) { Map<Capability, String> lbCaps = getCapabilities().get(Service.Lb); if (!lbCaps.isEmpty()) { String schemeCaps = lbCaps.get(Capability.LbSchemes); if (schemeCaps != null) { for (LoadBalancingRule rule : rules) { if (!schemeCaps.contains(rule.getScheme().toString())) { s_logger.debug("Scheme " + rules.get(0).getScheme() + " is not supported by the provider " + getName()); return false; } } } } return true; }
private boolean canHandleLbRules(final List<LoadBalancingRule> rules) { final Map<Capability, String> lbCaps = getCapabilities().get(Service.Lb); if (!lbCaps.isEmpty()) { final String schemeCaps = lbCaps.get(Capability.LbSchemes); if (schemeCaps != null) { for (final LoadBalancingRule rule : rules) { if (!schemeCaps.contains(rule.getScheme().toString())) { s_logger.debug("Scheme " + rules.get(0).getScheme() + " is not supported by the provider " + getName()); return false; } } } } return true; }
@Override public boolean validateLBRule(Network network, LoadBalancingRule rule) { List<LoadBalancingRule> rules = new ArrayList<LoadBalancingRule>(); rules.add(rule); if (canHandle(network, rule.getScheme())) { List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.INTERNAL_LB_VM); if (routers == null || routers.isEmpty()) { return true; } return _networkHelper.validateHAProxyLBRule(rule); } return true; }
private boolean canHandle(Network network, List<LoadBalancingRule> rules) { if (network.getGuestType() != Network.GuestType.Shared || network.getTrafficType() != TrafficType.Guest) { s_logger.debug("Not handling network with type " + network.getGuestType() + " and traffic type " + network.getTrafficType()); return false; } Map<Capability, String> lbCaps = this.getCapabilities().get(Service.Lb); if (!lbCaps.isEmpty()) { String schemeCaps = lbCaps.get(Capability.LbSchemes); if (schemeCaps != null) { for (LoadBalancingRule rule : rules) { if (!schemeCaps.contains(rule.getScheme().toString())) { s_logger.debug("Scheme " + rules.get(0).getScheme() + " is not supported by the provider " + this.getName()); return false; } } } } return true; }