Cloudstack-2997 unable to update concurrent_conncetions feild in network_offerin.

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
Bharat Kumar 2013-07-29 15:27:11 +05:30 committed by Abhinandan Prateek
parent 9939d09455
commit c7a1dbb176
4 changed files with 16 additions and 7 deletions

View File

@ -91,6 +91,8 @@ public class NetworkOfferingResponse extends BaseResponse {
@SerializedName(ApiConstants.EGRESS_DEFAULT_POLICY) @Param(description="true if network offering supports persistent networks, false otherwise")
private Boolean egressDefaultPolicy;
@SerializedName(ApiConstants.MAX_CONNECTIONS) @Param(description = "maximum number of concurrents connections to be handled by lb")
private Integer concurrentConnections;
public void setId(String id) {
this.id = id;
@ -173,4 +175,8 @@ public class NetworkOfferingResponse extends BaseResponse {
this.egressDefaultPolicy = egressDefaultPolicy;
}
public void setConcurrentConnections(Integer concurrentConnections) {
this.concurrentConnections = concurrentConnections;
}
}

View File

@ -134,7 +134,8 @@ public class NetworkOfferingVO implements NetworkOffering {
boolean egressdefaultpolicy;
@Column(name = "concurrent_connections")
Integer concurrent_connections;
Integer concurrentConnections;
@Override
public String getDisplayText() {
@ -430,11 +431,11 @@ public class NetworkOfferingVO implements NetworkOffering {
}
public Integer getConcurrentConnections() {
return this.concurrent_connections;
return this.concurrentConnections;
}
public void setConcurrentConnections(Integer concurrent_connections) {
this.concurrent_connections = concurrent_connections;
this.concurrentConnections = concurrent_connections;
}
public void setPublicLb(boolean publicLb) {

View File

@ -2016,6 +2016,7 @@ public class ApiResponseHelper implements ResponseGenerator {
response.setIsPersistent(offering.getIsPersistent());
response.setNetworkRate(ApiDBUtils.getNetworkRate(offering.getId()));
response.setEgressDefaultPolicy(offering.getEgressDefaultPolicy());
response.setConcurrentConnections(offering.getConcurrentConnections());
Long so = null;
if (offering.getServiceOfferingId() != null) {
so = offering.getServiceOfferingId();

View File

@ -3917,7 +3917,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
}
validateLoadBalancerServiceCapabilities(lbServiceCapabilityMap);
if (lbServiceCapabilityMap != null && !lbServiceCapabilityMap.isEmpty()) {
if (!serviceProviderMap.containsKey(Service.Lb) && lbServiceCapabilityMap != null && !lbServiceCapabilityMap.isEmpty()) {
maxconn = cmd.getMaxconnections();
if (maxconn == null) {
maxconn=Integer.parseInt(_configDao.getValue(Config.NetworkLBHaproxyMaxConn.key()));
@ -4711,9 +4711,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
offering.setAvailability(availability);
}
}
if (maxconn != null) {
offering.setConcurrentConnections(maxconn);
if (_ntwkOffServiceMapDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.Lb)){
if (maxconn != null) {
offering.setConcurrentConnections(maxconn);
}
}
if (_networkOfferingDao.update(id, offering)) {