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


Java LinkInfo.linkStpBlocked方法代码示例

本文整理汇总了Java中net.floodlightcontroller.linkdiscovery.LinkInfo.linkStpBlocked方法的典型用法代码示例。如果您正苦于以下问题:Java LinkInfo.linkStpBlocked方法的具体用法?Java LinkInfo.linkStpBlocked怎么用?Java LinkInfo.linkStpBlocked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.floodlightcontroller.linkdiscovery.LinkInfo的用法示例。


在下文中一共展示了LinkInfo.linkStpBlocked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeLinkToStorage

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
/**
 * Writes a LinkTuple and corresponding LinkInfo to storage
 * @param lt The LinkTuple to write
 * @param linkInfo The LinkInfo to write
 */
protected void writeLinkToStorage(Link lt, LinkInfo linkInfo) {
    LinkType type = getLinkType(lt, linkInfo);

    // Write only direct links.  Do not write links to external
    // L2 network.
    // if (type != LinkType.DIRECT_LINK && type != LinkType.TUNNEL) {
    //    return;
    // }

    Map<String, Object> rowValues = new HashMap<String, Object>();
    String id = getLinkId(lt);
    rowValues.put(LINK_ID, id);
    rowValues.put(LINK_VALID_TIME, linkInfo.getUnicastValidTime());
    String srcDpid = HexString.toHexString(lt.getSrc());
    rowValues.put(LINK_SRC_SWITCH, srcDpid);
    rowValues.put(LINK_SRC_PORT, lt.getSrcPort());

    if (type == LinkType.DIRECT_LINK)
        rowValues.put(LINK_TYPE, "internal");
    else if (type == LinkType.MULTIHOP_LINK) 
        rowValues.put(LINK_TYPE, "external");
    else if (type == LinkType.TUNNEL) 
        rowValues.put(LINK_TYPE, "tunnel"); 
    else rowValues.put(LINK_TYPE, "invalid");

    if (linkInfo.linkStpBlocked()) {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, srcPortState Blocked",
                      lt, linkInfo);
        }
        rowValues.put(LINK_SRC_PORT_STATE,
                      OFPhysicalPort.OFPortState.OFPPS_STP_BLOCK.getValue());
    } else {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, srcPortState {}",
                      new Object[]{ lt, linkInfo, linkInfo.getSrcPortState() });
        }
        rowValues.put(LINK_SRC_PORT_STATE, linkInfo.getSrcPortState());
    }
    String dstDpid = HexString.toHexString(lt.getDst());
    rowValues.put(LINK_DST_SWITCH, dstDpid);
    rowValues.put(LINK_DST_PORT, lt.getDstPort());
    if (linkInfo.linkStpBlocked()) {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, dstPortState Blocked",
                      lt, linkInfo);
        }
        rowValues.put(LINK_DST_PORT_STATE,
                      OFPhysicalPort.OFPortState.OFPPS_STP_BLOCK.getValue());
    } else {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, dstPortState {}",
                      new Object[]{ lt, linkInfo, linkInfo.getDstPortState() });
        }
        rowValues.put(LINK_DST_PORT_STATE, linkInfo.getDstPortState());
    }
    storageSource.updateRowAsync(LINK_TABLE_NAME, rowValues);
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:64,代码来源:LinkDiscoveryManager.java

示例2: writeLinkToStorage

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
/**
 * Writes a LinkTuple and corresponding LinkInfo to storage
 *
 * @param lt
 *            The LinkTuple to write
 * @param linkInfo
 *            The LinkInfo to write
 */
protected void writeLinkToStorage(Link lt, LinkInfo linkInfo) {
    LinkType type = getLinkType(lt, linkInfo);

    // Write only direct links. Do not write links to external
    // L2 network.
    // if (type != LinkType.DIRECT_LINK && type != LinkType.TUNNEL) {
    // return;
    // }

    Map<String, Object> rowValues = new HashMap<String, Object>();
    String id = getLinkId(lt);
    rowValues.put(LINK_ID, id);
    rowValues.put(LINK_VALID_TIME, linkInfo.getUnicastValidTime());
    String srcDpid = HexString.toHexString(lt.getSrc());
    rowValues.put(LINK_SRC_SWITCH, srcDpid);
    rowValues.put(LINK_SRC_PORT, lt.getSrcPort());

    if (type == LinkType.DIRECT_LINK)
        rowValues.put(LINK_TYPE, "internal");
    else if (type == LinkType.MULTIHOP_LINK)
        rowValues.put(LINK_TYPE, "external");
    else if (type == LinkType.TUNNEL)
        rowValues.put(LINK_TYPE, "tunnel");
    else
        rowValues.put(LINK_TYPE, "invalid");

    if (linkInfo.linkStpBlocked()) {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, srcPortState Blocked",
                      lt, linkInfo);
        }
        rowValues.put(LINK_SRC_PORT_STATE,
                      OFPhysicalPort.OFPortState.OFPPS_STP_BLOCK.getValue());
    } else {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, srcPortState {}",
                      new Object[] { lt, linkInfo,
                                    linkInfo.getSrcPortState() });
        }
        rowValues.put(LINK_SRC_PORT_STATE, linkInfo.getSrcPortState());
    }
    String dstDpid = HexString.toHexString(lt.getDst());
    rowValues.put(LINK_DST_SWITCH, dstDpid);
    rowValues.put(LINK_DST_PORT, lt.getDstPort());
    if (linkInfo.linkStpBlocked()) {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, dstPortState Blocked",
                      lt, linkInfo);
        }
        rowValues.put(LINK_DST_PORT_STATE,
                      OFPhysicalPort.OFPortState.OFPPS_STP_BLOCK.getValue());
    } else {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, dstPortState {}",
                      new Object[] { lt, linkInfo,
                                    linkInfo.getDstPortState() });
        }
        rowValues.put(LINK_DST_PORT_STATE, linkInfo.getDstPortState());
    }
    storageSource.updateRowAsync(LINK_TABLE_NAME, rowValues);
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:70,代码来源:LinkDiscoveryManager.java

示例3: writeLinkToStorage

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
/**
 * Writes a LinkTuple and corresponding LinkInfo to storage
 * 
 * @param lt
 *            The LinkTuple to write
 * @param linkInfo
 *            The LinkInfo to write
 */
protected void writeLinkToStorage(Link lt, LinkInfo linkInfo) {
    LinkType type = getLinkType(lt, linkInfo);

    // Write only direct links. Do not write links to external
    // L2 network.
    // if (type != LinkType.DIRECT_LINK && type != LinkType.TUNNEL) {
    // return;
    // }

    Map<String, Object> rowValues = new HashMap<String, Object>();
    String id = getLinkId(lt);
    rowValues.put(LINK_ID, id);
    rowValues.put(LINK_VALID_TIME, linkInfo.getUnicastValidTime());
    String srcDpid = HexString.toHexString(lt.getSrc());
    rowValues.put(LINK_SRC_SWITCH, srcDpid);
    rowValues.put(LINK_SRC_PORT, lt.getSrcPort());

    if (type == LinkType.DIRECT_LINK)
        rowValues.put(LINK_TYPE, "internal");
    else if (type == LinkType.MULTIHOP_LINK)
        rowValues.put(LINK_TYPE, "external");
    else if (type == LinkType.TUNNEL)
        rowValues.put(LINK_TYPE, "tunnel");
    else
        rowValues.put(LINK_TYPE, "invalid");

    if (linkInfo.linkStpBlocked()) {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, srcPortState Blocked",
                      lt, linkInfo);
        }
        rowValues.put(LINK_SRC_PORT_STATE,
                      OFPhysicalPort.OFPortState.OFPPS_STP_BLOCK.getValue());
    } else {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, srcPortState {}",
                      new Object[] { lt, linkInfo,
                                    linkInfo.getSrcPortState() });
        }
        rowValues.put(LINK_SRC_PORT_STATE, linkInfo.getSrcPortState());
    }
    String dstDpid = HexString.toHexString(lt.getDst());
    rowValues.put(LINK_DST_SWITCH, dstDpid);
    rowValues.put(LINK_DST_PORT, lt.getDstPort());
    if (linkInfo.linkStpBlocked()) {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, dstPortState Blocked",
                      lt, linkInfo);
        }
        rowValues.put(LINK_DST_PORT_STATE,
                      OFPhysicalPort.OFPortState.OFPPS_STP_BLOCK.getValue());
    } else {
        if (log.isTraceEnabled()) {
            log.trace("writeLink, link {}, info {}, dstPortState {}",
                      new Object[] { lt, linkInfo,
                                    linkInfo.getDstPortState() });
        }
        rowValues.put(LINK_DST_PORT_STATE, linkInfo.getDstPortState());
    }
    storageSource.updateRowAsync(LINK_TABLE_NAME, rowValues);
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:70,代码来源:LinkDiscoveryManager.java


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