本文整理汇总了Java中org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4类的典型用法代码示例。如果您正苦于以下问题:Java BgpFactoryVer4类的具体用法?Java BgpFactoryVer4怎么用?Java BgpFactoryVer4使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BgpFactoryVer4类属于org.onosproject.bgpio.protocol.ver4包,在下文中一共展示了BgpFactoryVer4类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFactory
import org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4; //导入依赖的package包/类
/**
* Returns the instance of BGP Version.
*
* @param version BGP version
* @return BGP version
*/
public static BgpFactory getFactory(BgpVersion version) {
switch (version) {
case BGP_4:
return BgpFactoryVer4.INSTANCE;
default:
throw new IllegalArgumentException("[BgpFactory:]Unknown version: " + version);
}
}
示例2: readFrom
import org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4; //导入依赖的package包/类
@Override
public BgpMessage readFrom(ChannelBuffer bb, BgpHeader bgpHeader)
throws BgpParseException {
BgpFactory factory;
if (!bb.readable()) {
log.error("Empty message received");
throw new BgpParseException("Empty message received");
}
// TODO: Currently only BGP version 4 is supported
factory = org.onosproject.bgpio.protocol.ver4.BgpFactoryVer4.INSTANCE;
return factory.getReader().readFrom(bb, bgpHeader);
}