Java 类com.vmware.vim25.DVPortgroupConfigInfo 实例源码

项目:contrail-vcenter-plugin    文件:VCenterDB.java   
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;
    }
项目:cloudstack    文件:HypervisorHostHelper.java   
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;
}
项目:vijava    文件:DistributedVirtualPortgroup.java   
public DVPortgroupConfigInfo getConfig()
{
    return (DVPortgroupConfigInfo) getCurrentProperty("config");
}