3131import com .cloud .network .lb .LoadBalancingRule .LbCondition ;
3232import com .cloud .network .lb .LoadBalancingRule .LbDestination ;
3333import com .cloud .network .lb .LoadBalancingRule .LbHealthCheckPolicy ;
34- import com .cloud .network .lb .LoadBalancingRule .LbStickinessPolicy ;
3534import com .cloud .network .lb .LoadBalancingRule .LbSslCert ;
35+ import com .cloud .network .lb .LoadBalancingRule .LbStickinessPolicy ;
3636import com .cloud .utils .Pair ;
3737
3838public class LoadBalancerTO {
@@ -83,7 +83,8 @@ public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, Str
8383 }
8484
8585 public LoadBalancerTO (String id , String srcIp , int srcPort , String protocol , String algorithm , boolean revoked , boolean alreadyAdded , boolean inline ,
86- List <LbDestination > arg_destinations , List <LbStickinessPolicy > stickinessPolicies , List <LbHealthCheckPolicy > healthCheckPolicies , LbSslCert sslCert , String lbProtocol ) {
86+ List <LbDestination > arg_destinations , List <LbStickinessPolicy > stickinessPolicies , List <LbHealthCheckPolicy > healthCheckPolicies , LbSslCert sslCert ,
87+ String lbProtocol ) {
8788 this (id , srcIp , srcPort , protocol , algorithm , revoked , alreadyAdded , inline , arg_destinations );
8889 this .stickinessPolicies = null ;
8990 this .healthCheckPolicies = null ;
@@ -106,8 +107,9 @@ public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, Str
106107 this .healthCheckPolicies = new HealthCheckPolicyTO [MAX_HEALTHCHECK_POLICIES ];
107108 int index = 0 ;
108109 for (LbHealthCheckPolicy hcp : healthCheckPolicies ) {
109- this .healthCheckPolicies [0 ] = new HealthCheckPolicyTO (hcp .getpingpath (), hcp .getDescription (), hcp .getResponseTime (), hcp .getHealthcheckInterval (),
110- hcp .getHealthcheckThresshold (), hcp .getUnhealthThresshold (), hcp .isRevoked ());
110+ this .healthCheckPolicies [0 ] =
111+ new HealthCheckPolicyTO (hcp .getpingpath (), hcp .getDescription (), hcp .getResponseTime (), hcp .getHealthcheckInterval (), hcp .getHealthcheckThresshold (),
112+ hcp .getUnhealthThresshold (), hcp .isRevoked ());
111113 index ++;
112114 if (index == MAX_HEALTHCHECK_POLICIES )
113115 break ;
@@ -215,7 +217,8 @@ public static class HealthCheckPolicyTO {
215217 private int unhealthThresshold ;
216218 private boolean revoke = false ;
217219
218- public HealthCheckPolicyTO (String pingPath , String description , int responseTime , int healthcheckInterval , int healthcheckThresshold , int unhealthThresshold , boolean revoke ) {
220+ public HealthCheckPolicyTO (String pingPath , String description , int responseTime , int healthcheckInterval , int healthcheckThresshold , int unhealthThresshold ,
221+ boolean revoke ) {
219222
220223 this .description = description ;
221224 this .pingPath = pingPath ;
@@ -411,8 +414,9 @@ public static class AutoScaleVmProfileTO implements Serializable {
411414 private final String vmName ;
412415 private final String networkId ;
413416
414- public AutoScaleVmProfileTO (String zoneId , String domainId , String cloudStackApiUrl , String autoScaleUserApiKey , String autoScaleUserSecretKey , String serviceOfferingId ,
415- String templateId , String vmName , String networkId , String otherDeployParams , List <Pair <String , String >> counterParamList , Integer destroyVmGraceperiod ) {
417+ public AutoScaleVmProfileTO (String zoneId , String domainId , String cloudStackApiUrl , String autoScaleUserApiKey , String autoScaleUserSecretKey ,
418+ String serviceOfferingId , String templateId , String vmName , String networkId , String otherDeployParams , List <Pair <String , String >> counterParamList ,
419+ Integer destroyVmGraceperiod ) {
416420 this .zoneId = zoneId ;
417421 this .domainId = domainId ;
418422 this .serviceOfferingId = serviceOfferingId ;
@@ -487,8 +491,8 @@ public static class AutoScaleVmGroupTO implements Serializable {
487491 private final String state ;
488492 private final String currentState ;
489493
490- AutoScaleVmGroupTO (String uuid , int minMembers , int maxMembers , int memberPort , int interval , List <AutoScalePolicyTO > policies , AutoScaleVmProfileTO profile , String state ,
491- String currentState ) {
494+ AutoScaleVmGroupTO (String uuid , int minMembers , int maxMembers , int memberPort , int interval , List <AutoScalePolicyTO > policies , AutoScaleVmProfileTO profile ,
495+ String state , String currentState ) {
492496 this .uuid = uuid ;
493497 this .minMembers = minMembers ;
494498 this .maxMembers = maxMembers ;
@@ -551,20 +555,21 @@ public void setAutoScaleVmGroup(LbAutoScaleVmGroup lbAutoScaleVmGroup) {
551555 conditionTOs .add (conditionTO );
552556 }
553557 AutoScalePolicy autoScalePolicy = lbAutoScalePolicy .getPolicy ();
554- autoScalePolicyTOs .add (new AutoScalePolicyTO (autoScalePolicy .getId (), autoScalePolicy .getDuration (), autoScalePolicy .getQuietTime (), autoScalePolicy . getAction (),
555- conditionTOs , lbAutoScalePolicy .isRevoked ()));
558+ autoScalePolicyTOs .add (new AutoScalePolicyTO (autoScalePolicy .getId (), autoScalePolicy .getDuration (), autoScalePolicy .getQuietTime (),
559+ autoScalePolicy . getAction (), conditionTOs , lbAutoScalePolicy .isRevoked ()));
556560 }
557561 LbAutoScaleVmProfile lbAutoScaleVmProfile = lbAutoScaleVmGroup .getProfile ();
558562 AutoScaleVmProfile autoScaleVmProfile = lbAutoScaleVmProfile .getProfile ();
559563
560- AutoScaleVmProfileTO autoScaleVmProfileTO = new AutoScaleVmProfileTO (lbAutoScaleVmProfile .getZoneId (), lbAutoScaleVmProfile .getDomainId (), lbAutoScaleVmProfile .getCsUrl (),
561- lbAutoScaleVmProfile .getAutoScaleUserApiKey (), lbAutoScaleVmProfile .getAutoScaleUserSecretKey (), lbAutoScaleVmProfile .getServiceOfferingId (),
562- lbAutoScaleVmProfile .getTemplateId (), lbAutoScaleVmProfile .getVmName (), lbAutoScaleVmProfile .getNetworkId (), autoScaleVmProfile .getOtherDeployParams (),
563- autoScaleVmProfile .getCounterParams (), autoScaleVmProfile .getDestroyVmGraceperiod ());
564+ AutoScaleVmProfileTO autoScaleVmProfileTO =
565+ new AutoScaleVmProfileTO (lbAutoScaleVmProfile .getZoneId (), lbAutoScaleVmProfile .getDomainId (), lbAutoScaleVmProfile .getCsUrl (),
566+ lbAutoScaleVmProfile .getAutoScaleUserApiKey (), lbAutoScaleVmProfile .getAutoScaleUserSecretKey (), lbAutoScaleVmProfile .getServiceOfferingId (),
567+ lbAutoScaleVmProfile .getTemplateId (), lbAutoScaleVmProfile .getVmName (), lbAutoScaleVmProfile .getNetworkId (), autoScaleVmProfile .getOtherDeployParams (),
568+ autoScaleVmProfile .getCounterParams (), autoScaleVmProfile .getDestroyVmGraceperiod ());
564569
565570 AutoScaleVmGroup autoScaleVmGroup = lbAutoScaleVmGroup .getVmGroup ();
566- autoScaleVmGroupTO = new AutoScaleVmGroupTO ( autoScaleVmGroup . getUuid (), autoScaleVmGroup . getMinMembers (), autoScaleVmGroup . getMaxMembers (),
567- autoScaleVmGroup .getMemberPort (), autoScaleVmGroup .getInterval (), autoScalePolicyTOs , autoScaleVmProfileTO , autoScaleVmGroup .getState (),
568- lbAutoScaleVmGroup .getCurrentState ());
571+ autoScaleVmGroupTO =
572+ new AutoScaleVmGroupTO ( autoScaleVmGroup .getUuid (), autoScaleVmGroup .getMinMembers (), autoScaleVmGroup . getMaxMembers (), autoScaleVmGroup .getMemberPort (),
573+ autoScaleVmGroup . getInterval (), autoScalePolicyTOs , autoScaleVmProfileTO , autoScaleVmGroup . getState (), lbAutoScaleVmGroup .getCurrentState ());
569574 }
570575}
0 commit comments