本文整理汇总了Java中org.opendaylight.controller.sal.core.PeerBandwidth类的典型用法代码示例。如果您正苦于以下问题:Java PeerBandwidth类的具体用法?Java PeerBandwidth怎么用?Java PeerBandwidth使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PeerBandwidth类属于org.opendaylight.controller.sal.core包,在下文中一共展示了PeerBandwidth类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OFPortToProps
import org.opendaylight.controller.sal.core.PeerBandwidth; //导入依赖的package包/类
public static Set<Property> OFPortToProps(OFPhysicalPort port) {
Set<Property> props = new HashSet<Property>();
Bandwidth bw = InventoryServiceHelper.OFPortToBandWidth(port
.getCurrentFeatures());
if (bw != null) {
props.add(bw);
}
Bandwidth abw = InventoryServiceHelper.OFPortToBandWidth(port.getAdvertisedFeatures());
if (abw != null) {
AdvertisedBandwidth a = new AdvertisedBandwidth(abw.getValue());
if (a != null) {
props.add(a);
}
}
Bandwidth sbw = InventoryServiceHelper.OFPortToBandWidth(port.getSupportedFeatures());
if (sbw != null) {
SupportedBandwidth s = new SupportedBandwidth(sbw.getValue());
if (s != null) {
props.add(s);
}
}
Bandwidth pbw = InventoryServiceHelper.OFPortToBandWidth(port.getPeerFeatures());
if (pbw != null) {
PeerBandwidth p = new PeerBandwidth(pbw.getValue());
if (p != null) {
props.add(p);
}
}
props.add(new Name(port.getName()));
props.add(InventoryServiceHelper.OFPortToConfig(port.getConfig()));
props.add(InventoryServiceHelper.OFPortToState(port.getState()));
return props;
}