// TODO(sateesh): Extract and compare vendor specific configuration specification as well.
// DistributedVirtualSwitchKeyedOpaqueBlob[] vendorSpecificConfig = spec.getVendorSpecificConfig();
assert(currentTrafficShapingPolicy != null);
LongPolicy averageBandwidth = currentTrafficShapingPolicy.getAverageBandwidth();
LongPolicy burstSize = currentTrafficShapingPolicy.getBurstSize();
LongPolicy peakBandwidth = currentTrafficShapingPolicy.getPeakBandwidth();
BoolPolicy isEnabled = currentTrafficShapingPolicy.getEnabled();
if(!isEnabled.getValue())
return false;
if(averageBandwidth != null && !averageBandwidth.equals(shapingPolicy.getAverageBandwidth())) {
if(s_logger.isInfoEnabled()) {
s_logger.info("Average bandwidth setting in shaping policy doesn't match with existing setting.");
}
return false;
} else if(burstSize != null && !burstSize.equals(shapingPolicy.getBurstSize())) {
if(s_logger.isInfoEnabled()) {
s_logger.info("Burst size setting in shaping policy doesn't match with existing setting.");
}
return false;
} else if(peakBandwidth != null && !peakBandwidth.equals(shapingPolicy.getPeakBandwidth())) {
if(s_logger.isInfoEnabled()) {
s_logger.info("Peak bandwidth setting in shaping policy doesn't match with existing setting.");
}
return false;
}