Search in sources :

Example 6 with LbHealthCheckPolicy

use of com.cloud.legacymodel.network.LoadBalancingRule.LbHealthCheckPolicy in project cosmic by MissionCriticalCloud.

the class LoadBalancingRulesManagerImpl method getHealthCheckPolicies.

@Override
public List<LbHealthCheckPolicy> getHealthCheckPolicies(final long lbId) {
    final List<LbHealthCheckPolicy> healthCheckPolicies = new ArrayList<>();
    final List<LBHealthCheckPolicyVO> hcDbpolicies = _lb2healthcheckDao.listByLoadBalancerIdAndDisplayFlag(lbId, null);
    for (final LBHealthCheckPolicyVO policy : hcDbpolicies) {
        final String pingpath = policy.getpingpath();
        final LbHealthCheckPolicy hDbPolicy = new LbHealthCheckPolicy(pingpath, policy.getDescription(), policy.getResponseTime(), policy.getHealthcheckInterval(), policy.getHealthcheckThresshold(), policy.getUnhealthThresshold(), policy.isRevoke());
        healthCheckPolicies.add(hDbPolicy);
    }
    return healthCheckPolicies;
}
Also used : ArrayList(java.util.ArrayList) LbHealthCheckPolicy(com.cloud.legacymodel.network.LoadBalancingRule.LbHealthCheckPolicy) LBHealthCheckPolicyVO(com.cloud.network.LBHealthCheckPolicyVO)

Example 7 with LbHealthCheckPolicy

use of com.cloud.legacymodel.network.LoadBalancingRule.LbHealthCheckPolicy in project cosmic by MissionCriticalCloud.

the class LoadBalancingRulesManagerImpl method getLoadBalancerRuleToApply.

private LoadBalancingRule getLoadBalancerRuleToApply(final LoadBalancerVO lb) {
    final List<LbStickinessPolicy> policyList = getStickinessPolicies(lb.getId());
    final Ip sourceIp = getSourceIp(lb);
    final LbSslCert sslCert = getLbSslCert(lb.getId());
    final LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, null, policyList, null, sourceIp, sslCert, lb.getLbProtocol());
    final List<LbDestination> dstList = getExistingDestinations(lb.getId());
    loadBalancing.setDestinations(dstList);
    final List<LbHealthCheckPolicy> hcPolicyList = getHealthCheckPolicies(lb.getId());
    loadBalancing.setHealthCheckPolicies(hcPolicyList);
    return loadBalancing;
}
Also used : LbSslCert(com.cloud.legacymodel.network.LoadBalancingRule.LbSslCert) LoadBalancingRule(com.cloud.legacymodel.network.LoadBalancingRule) Ip(com.cloud.legacymodel.network.Ip) PublicIp(com.cloud.network.addr.PublicIp) LbHealthCheckPolicy(com.cloud.legacymodel.network.LoadBalancingRule.LbHealthCheckPolicy) LbStickinessPolicy(com.cloud.legacymodel.network.LoadBalancingRule.LbStickinessPolicy) LbDestination(com.cloud.legacymodel.network.LoadBalancingRule.LbDestination)

Aggregations

LbHealthCheckPolicy (com.cloud.legacymodel.network.LoadBalancingRule.LbHealthCheckPolicy)7 Ip (com.cloud.legacymodel.network.Ip)5 LoadBalancingRule (com.cloud.legacymodel.network.LoadBalancingRule)5 LbDestination (com.cloud.legacymodel.network.LoadBalancingRule.LbDestination)5 LoadBalancerVO (com.cloud.network.dao.LoadBalancerVO)5 LbSslCert (com.cloud.legacymodel.network.LoadBalancingRule.LbSslCert)4 LbStickinessPolicy (com.cloud.legacymodel.network.LoadBalancingRule.LbStickinessPolicy)4 ArrayList (java.util.ArrayList)4 PublicIp (com.cloud.network.addr.PublicIp)3 LBHealthCheckPolicyVO (com.cloud.network.LBHealthCheckPolicyVO)2 NetworkModel (com.cloud.network.NetworkModel)2 LoadBalancerDao (com.cloud.network.dao.LoadBalancerDao)2 LoadBalancingRulesManager (com.cloud.network.lb.LoadBalancingRulesManager)2 DB (com.cloud.utils.db.DB)2 CallContext (com.cloud.context.CallContext)1 ActionEvent (com.cloud.event.ActionEvent)1 InvalidParameterValueException (com.cloud.legacymodel.exceptions.InvalidParameterValueException)1 FirewallRule (com.cloud.legacymodel.network.FirewallRule)1 Network (com.cloud.legacymodel.network.Network)1 Nic (com.cloud.legacymodel.network.Nic)1