Adding protocol parameter to loadbalancer response

This commit is contained in:
Syed Ahmed 2013-11-19 22:10:22 +05:30 committed by Murali Reddy
parent 67b071beaa
commit 481af07fb1
5 changed files with 23 additions and 0 deletions

View File

@ -25,4 +25,5 @@ public interface LoadBalancer extends FirewallRule, LoadBalancerContainer {
int getDefaultPortEnd();
}

View File

@ -27,6 +27,8 @@ public interface LoadBalancerContainer {
String getDescription();
String getAlgorithm();
String getLbProtocol();
Scheme getScheme();

View File

@ -91,6 +91,11 @@ public class LoadBalancerResponse extends BaseResponse implements ControlledEnti
@Param(description = "the id of the zone the rule belongs to")
private String zoneId;
@SerializedName(ApiConstants.PROTOCOL)
@Param(description = "the protocol of the loadbalanacer rule")
private String lbProtocol;
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with load balancer", responseObject = ResourceTagResponse.class)
private List<ResourceTagResponse> tags;
@ -170,4 +175,7 @@ public class LoadBalancerResponse extends BaseResponse implements ControlledEnti
this.networkId = networkId;
}
public void setLbProtocol(String lbProtocol) {
this.lbProtocol = lbProtocol;
}
}

View File

@ -58,6 +58,10 @@ public class ApplicationLoadBalancerRuleVO extends FirewallRuleVO implements App
@Column(name="source_ip_address_network_id")
Long sourceIpNetworkId;
@Column(name="lb_protocol")
String lbProtocol;
@Column(name="source_ip_address")
@Enumerated(value=EnumType.STRING)
@ -111,6 +115,11 @@ public class ApplicationLoadBalancerRuleVO extends FirewallRuleVO implements App
return algorithm;
}
@Override
public String getLbProtocol() {
return lbProtocol;
}
@Override
public int getDefaultPortStart() {
return defaultPortStart;
@ -130,4 +139,6 @@ public class ApplicationLoadBalancerRuleVO extends FirewallRuleVO implements App
public int getInstancePort() {
return defaultPortStart;
}
}

View File

@ -748,6 +748,7 @@ public class ApiResponseHelper implements ResponseGenerator {
lbResponse.setPublicPort(Integer.toString(loadBalancer.getSourcePortStart()));
lbResponse.setPrivatePort(Integer.toString(loadBalancer.getDefaultPortStart()));
lbResponse.setAlgorithm(loadBalancer.getAlgorithm());
lbResponse.setLbProtocol(loadBalancer.getLbProtocol());
FirewallRule.State state = loadBalancer.getState();
String stateToSet = state.toString();
if (state.equals(FirewallRule.State.Revoke)) {