本文整理汇总了Java中org.openflow.protocol.action.OFActionType.VENDOR属性的典型用法代码示例。如果您正苦于以下问题:Java OFActionType.VENDOR属性的具体用法?Java OFActionType.VENDOR怎么用?Java OFActionType.VENDOR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.openflow.protocol.action.OFActionType
的用法示例。
在下文中一共展示了OFActionType.VENDOR属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseActionOne
private OFAction parseActionOne(final OFActionType type,
final ChannelBuffer data) {
OFAction ofa;
data.markReaderIndex();
ofa = this.getAction(type);
ofa.readFrom(data);
if (type == OFActionType.VENDOR) {
final OFActionVendor vendorAction = (OFActionVendor) ofa;
final OFVendorActionFactory vendorActionFactory = this.vendorActionRegistry
.get(vendorAction.getVendor());
if (vendorActionFactory != null) {
// if we have a specific vendorActionFactory for this vendor id,
// delegate to it for vendor-specific reparsing of the message
data.resetReaderIndex();
final OFActionVendor newAction = vendorActionFactory
.readFrom(data);
if (newAction != null) {
ofa = newAction;
}
}
}
if (OFAction.class.equals(ofa.getClass())) {
// advance the position for un-implemented messages
data.readerIndex(data.readerIndex() + ofa.getLengthU()
- OFAction.MINIMUM_LENGTH);
}
return ofa;
}
示例2: parseActionOne
private OFAction parseActionOne(OFActionType type, ChannelBuffer data) {
OFAction ofa;
data.markReaderIndex();
ofa = getAction(type);
ofa.readFrom(data);
if(type == OFActionType.VENDOR) {
OFActionVendor vendorAction = (OFActionVendor) ofa;
OFVendorActionFactory vendorActionFactory = vendorActionRegistry.get(vendorAction.getVendor());
if(vendorActionFactory != null) {
// if we have a specific vendorActionFactory for this vendor id,
// delegate to it for vendor-specific reparsing of the message
data.resetReaderIndex();
OFActionVendor newAction = vendorActionFactory.readFrom(data);
if(newAction != null)
ofa = newAction;
}
}
if (OFAction.class.equals(ofa.getClass())) {
// advance the position for un-implemented messages
data.readerIndex(data.readerIndex()+(ofa.getLengthU() -
OFAction.MINIMUM_LENGTH));
}
return ofa;
}