当前位置: 首页>>代码示例>>Java>>正文


Java OFActionType.VENDOR属性代码示例

本文整理汇总了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;
}
 
开发者ID:CoVisor,项目名称:CoVisor,代码行数:32,代码来源:BasicFactory.java

示例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;
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:28,代码来源:BasicFactory.java


注:本文中的org.openflow.protocol.action.OFActionType.VENDOR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。