public boolean getExternalIpamInfo(DVPortgroupConfigInfo configInfo, String vnName) throws Exception { DistributedVirtualSwitchKeyedOpaqueBlob[] opaqueBlobs = configInfo.getVendorSpecificConfig(); if ((opaqueBlobs == null) || (opaqueBlobs.length == 0)) { return false; } for (DistributedVirtualSwitchKeyedOpaqueBlob opaqueBlob : opaqueBlobs) { s_logger.debug("pg (" + vnName + ") " + "opaqueBlob: key (" + opaqueBlob.getKey() + " ) opaqueData (" + opaqueBlob.getOpaqueData() + ")"); if (opaqueBlob.getKey().equals("external_ipam")) { if (opaqueBlob.getOpaqueData().equals("true")) { return true; } else { return false; } } } return false; }
public static boolean isSpecMatch(DVPortgroupConfigInfo configInfo, Integer vid, DVSTrafficShapingPolicy shapingPolicy) { DVSTrafficShapingPolicy currentTrafficShapingPolicy; currentTrafficShapingPolicy = configInfo.getDefaultPortConfig().getInShapingPolicy(); assert (currentTrafficShapingPolicy != null); LongPolicy averageBandwidth = currentTrafficShapingPolicy.getAverageBandwidth(); LongPolicy burstSize = currentTrafficShapingPolicy.getBurstSize(); LongPolicy peakBandwidth = currentTrafficShapingPolicy.getPeakBandwidth(); BoolPolicy isEnabled = currentTrafficShapingPolicy.getEnabled(); if (!isEnabled.equals(shapingPolicy.getEnabled())) { 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; } return true; }
public DVPortgroupConfigInfo getConfig() { return (DVPortgroupConfigInfo) getCurrentProperty("config"); }