本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFPortDescProp类的典型用法代码示例。如果您正苦于以下问题:Java OFPortDescProp类的具体用法?Java OFPortDescProp怎么用?Java OFPortDescProp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OFPortDescProp类属于org.projectfloodlight.openflow.protocol包,在下文中一共展示了OFPortDescProp类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTargetPowerRange
import org.projectfloodlight.openflow.protocol.OFPortDescProp; //导入依赖的package包/类
@Override
public Optional<Range<Long>> getTargetPowerRange(PortNumber port, T component) {
for (OFPortDesc pd : getPortDescs()) {
if (pd.getPortNo().getPortNumber() == port.toLong()) {
for (OFPortDescProp prop : pd.getProperties()) {
if (prop instanceof OFPortDescPropOptical) {
OFPortDescPropOptical oprop = (OFPortDescPropOptical) prop;
long txMin = oprop.getTxPwrMin();
long txMax = oprop.getTxPwrMax();
return Optional.of(Range.closed(txMin, txMax));
}
}
}
}
return Optional.empty();
}
示例2: getPorts
import org.projectfloodlight.openflow.protocol.OFPortDescProp; //导入依赖的package包/类
@Override
public List<PortNumber> getPorts(T component) {
List<PortNumber> ports = new ArrayList<>();
for (OFPortDesc pd : getPortDescs()) {
for (OFPortDescProp prop : pd.getProperties()) {
// Note: Power monitor detection can actually be more complex
// than this. It is possible that the power is not
// configurable, but it is readable. In this case, the best
// bet is probably to check rx/tx power info valid in the
// port stats reply, unfortunately.
if (prop instanceof OFPortDescPropOptical) {
ports.add(PortNumber.portNumber(pd.getPortNo().getPortNumber()));
break;
}
}
}
return ports;
}
示例3: testGenerationIdSet
import org.projectfloodlight.openflow.protocol.OFPortDescProp; //导入依赖的package包/类
@Test
public void testGenerationIdSet() {
OFFactory factory = OFFactories.getFactory(OFVersion.OF_14);
OFPortDesc desc = factory.buildPortDesc()
.setProperties(ImmutableList.<OFPortDescProp>of(
factory.portDescPropBsnGenerationId(U64.of(1234))))
.build();
assertThat(desc.getBsnGenerationId(), equalTo(U64.of(1234)));
}