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;
}
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;
}
Aggregations