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


Java LinkInfo.setMulticastValidTime方法代码示例

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


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

示例1: updateLink

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
protected boolean updateLink(Link lt, LinkInfo oldInfo, LinkInfo newInfo) {
	boolean linkChanged = false;
	// Since the link info is already there, we need to
	// update the right fields.
	if (newInfo.getUnicastValidTime() == null) {
		// This is due to a multicast LLDP, so copy the old unicast
		// value.
		if (oldInfo.getUnicastValidTime() != null) {
			newInfo.setUnicastValidTime(oldInfo.getUnicastValidTime());
		}
	} else if (newInfo.getMulticastValidTime() == null) {
		// This is due to a unicast LLDP, so copy the old multicast
		// value.
		if (oldInfo.getMulticastValidTime() != null) {
			newInfo.setMulticastValidTime(oldInfo.getMulticastValidTime());
		}
	}

	Date oldTime = oldInfo.getUnicastValidTime();
	Date newTime = newInfo.getUnicastValidTime();
	// the link has changed its state between openflow and
	// non-openflow
	// if the unicastValidTimes are null or not null
	if (oldTime != null & newTime == null) {
		linkChanged = true;
	} else if (oldTime == null & newTime != null) {
		linkChanged = true;
	}

	return linkChanged;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:32,代码来源:LinkDiscoveryManager.java

示例2: updateLink

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
protected boolean updateLink(Link lt, LinkInfo oldInfo, LinkInfo newInfo) {
    boolean linkChanged = false;
    // Since the link info is already there, we need to
    // update the right fields.
    if (newInfo.getUnicastValidTime() == null) {
        // This is due to a multicast LLDP, so copy the old unicast
        // value.
        if (oldInfo.getUnicastValidTime() != null) {
            newInfo.setUnicastValidTime(oldInfo.getUnicastValidTime());
        }
    } else if (newInfo.getMulticastValidTime() == null) {
        // This is due to a unicast LLDP, so copy the old multicast
        // value.
        if (oldInfo.getMulticastValidTime() != null) {
            newInfo.setMulticastValidTime(oldInfo.getMulticastValidTime());
        }
    }

    Long oldTime = oldInfo.getUnicastValidTime();
    Long newTime = newInfo.getUnicastValidTime();
    // the link has changed its state between openflow and
    // non-openflow
    // if the unicastValidTimes are null or not null
    if (oldTime != null & newTime == null) {
        linkChanged = true;
    } else if (oldTime == null & newTime != null) {
        linkChanged = true;
    }

    return linkChanged;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:32,代码来源:LinkDiscoveryManager.java

示例3: timeoutLinks

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
/**
 * Iterates through the list of links and deletes if the last discovery
 * message reception time exceeds timeout values.
 */
protected void timeoutLinks() {
	List<Link> eraseList = new ArrayList<Link>();
	Long curTime = System.currentTimeMillis();
	boolean linkChanged = false;

	// reentrant required here because deleteLink also write locks
	lock.writeLock().lock();
	try {
		Iterator<Entry<Link, LinkInfo>> it = this.links.entrySet()
				.iterator();
		while (it.hasNext()) {
			Entry<Link, LinkInfo> entry = it.next();
			Link lt = entry.getKey();
			LinkInfo info = entry.getValue();

			// Timeout the unicast and multicast LLDP valid times
			// independently.
			if ((info.getUnicastValidTime() != null)
					&& (info.getUnicastValidTime().getTime()
							+ (this.LINK_TIMEOUT * 1000) < curTime)) {
				info.setUnicastValidTime(null);
				linkChanged = true;
			}
			if ((info.getMulticastValidTime() != null)
					&& (info.getMulticastValidTime().getTime()
							+ (this.LINK_TIMEOUT * 1000) < curTime)) {
				info.setMulticastValidTime(null);
				linkChanged = true;
			}
			// Add to the erase list only if the unicast
			// time is null.
			if (info.getUnicastValidTime() == null
					&& info.getMulticastValidTime() == null) {
				eraseList.add(entry.getKey());
			} else if (linkChanged) {
				updates.add(new LDUpdate(lt.getSrc(), lt.getSrcPort(),
						lt.getDst(), lt.getDstPort(),
						getLinkType(lt, info),
						UpdateOperation.LINK_UPDATED));
			}
		}

		// if any link was deleted or any link was changed.
		if ((eraseList.size() > 0) || linkChanged) {
			deleteLinks(eraseList, "LLDP timeout");
		}
	} finally {
		lock.writeLock().unlock();
	}
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:55,代码来源:LinkDiscoveryManager.java

示例4: timeoutLinks

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
/**
 * Iterates through the list of links and deletes if the last discovery
 * message reception time exceeds timeout values.
 */
protected void timeoutLinks() {
    List<Link> eraseList = new ArrayList<Link>();
    Long curTime = System.currentTimeMillis();
    boolean linkChanged = false;

    // reentrant required here because deleteLink also write locks
    lock.writeLock().lock();
    try {
        Iterator<Entry<Link, LinkInfo>> it = this.links.entrySet()
                                                       .iterator();
        while (it.hasNext()) {
            Entry<Link, LinkInfo> entry = it.next();
            Link lt = entry.getKey();
            LinkInfo info = entry.getValue();

            // Timeout the unicast and multicast LLDP valid times
            // independently.
            if ((info.getUnicastValidTime() != null)
                && (info.getUnicastValidTime()
                    + (this.LINK_TIMEOUT * 1000) < curTime)) {
                info.setUnicastValidTime(null);
                linkChanged = true;
            }
            if ((info.getMulticastValidTime() != null)
                && (info.getMulticastValidTime()
                    + (this.LINK_TIMEOUT * 1000) < curTime)) {
                info.setMulticastValidTime(null);
                linkChanged = true;
            }
            // Add to the erase list only if the unicast
            // time is null.
            if (info.getUnicastValidTime() == null
                && info.getMulticastValidTime() == null) {
                eraseList.add(entry.getKey());
            } else if (linkChanged) {
                updates.add(new LDUpdate(lt.getSrc(), lt.getSrcPort(),
                                         lt.getDst(), lt.getDstPort(),
                                         getLinkType(lt, info),
                                         UpdateOperation.LINK_UPDATED));
            }
        }

        // if any link was deleted or any link was changed.
        if ((eraseList.size() > 0) || linkChanged) {
            deleteLinks(eraseList, "LLDP timeout");
        }
    } finally {
        lock.writeLock().unlock();
    }
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:55,代码来源:LinkDiscoveryManager.java

示例5: timeoutLinks

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
/** 
 * Iterates through the list of links and deletes if the
 * last discovery message reception time exceeds timeout values.
 */
protected void timeoutLinks() {
    List<Link> eraseList = new ArrayList<Link>();
    Long curTime = System.currentTimeMillis();
    boolean linkChanged = false;

    // reentrant required here because deleteLink also write locks
    lock.writeLock().lock();
    try {
        Iterator<Entry<Link, LinkInfo>> it =
                this.links.entrySet().iterator();
        while (it.hasNext()) {
            Entry<Link, LinkInfo> entry = it.next();
            Link lt = entry.getKey();
            LinkInfo info = entry.getValue();

            // Timeout the unicast and multicast LLDP valid times
            // independently.
            if ((info.getUnicastValidTime() != null) && 
                    (info.getUnicastValidTime() + (this.LINK_TIMEOUT * 1000) < curTime)){
                info.setUnicastValidTime(null);

                if (info.getMulticastValidTime() != null)
                    addLinkToBroadcastDomain(lt);
                // Note that even if mTime becomes null later on,
                // the link would be deleted, which would trigger updateClusters().
                linkChanged = true;
            }
            if ((info.getMulticastValidTime()!= null) && 
                    (info.getMulticastValidTime()+ (this.LINK_TIMEOUT * 1000) < curTime)) {
                info.setMulticastValidTime(null);
                // if uTime is not null, then link will remain as openflow
                // link. If uTime is null, it will be deleted.  So, we
                // don't care about linkChanged flag here.
                removeLinkFromBroadcastDomain(lt);
                linkChanged = true;
            }
            // Add to the erase list only if the unicast
            // time is null.
            if (info.getUnicastValidTime() == null && 
                    info.getMulticastValidTime() == null){
                eraseList.add(entry.getKey());
            } else if (linkChanged) {
                UpdateOperation operation;
                operation = getUpdateOperation(info.getSrcPortState(),
                                               info.getDstPortState());
                updates.add(new LDUpdate(lt.getSrc(), lt.getSrcPort(),
                                         lt.getDst(), lt.getDstPort(),
                                         getLinkType(lt, info),
                                         operation));
            }
        }

        // if any link was deleted or any link was changed.
        if ((eraseList.size() > 0) || linkChanged) {
            deleteLinks(eraseList, "LLDP timeout");
        }
    } finally {
        lock.writeLock().unlock();
    }
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:65,代码来源:LinkDiscoveryManager.java

示例6: timeoutLinks

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
/**
 * Iterates through the list of links and deletes if the last discovery
 * message reception time exceeds timeout values.
 */
protected void timeoutLinks() {
    List<Link> eraseList = new ArrayList<Link>();
    Long curTime = System.currentTimeMillis();
    boolean linkChanged = false;

    // reentrant required here because deleteLink also write locks
    lock.writeLock().lock();
    try {
        Iterator<Entry<Link, LinkInfo>> it = this.links.entrySet()
                                                       .iterator();
        while (it.hasNext()) {
            Entry<Link, LinkInfo> entry = it.next();
            Link lt = entry.getKey();
            LinkInfo info = entry.getValue();

            // Timeout the unicast and multicast LLDP valid times
            // independently.
            if ((info.getUnicastValidTime() != null)
                && (info.getUnicastValidTime()
                    + (this.LINK_TIMEOUT * 1000) < curTime)) {
                info.setUnicastValidTime(null);
                linkChanged = true;
                log.error("Link {} timeout, receivedtime = {}, nowtime = {}", 
                		new Object[] {
                 		lt, 
                 		info.getUnicastValidTime().toString(), 
                 		curTime.toString()
                		});
               
            }
            if ((info.getMulticastValidTime() != null)
                && (info.getMulticastValidTime()
                    + (this.LINK_TIMEOUT * 1000) < curTime)) {
                info.setMulticastValidTime(null);
                linkChanged = true;
            }
            // Add to the erase list only if the unicast
            // time is null.
            if (info.getUnicastValidTime() == null
                && info.getMulticastValidTime() == null) {
                eraseList.add(entry.getKey());
            } else if (linkChanged) {
            	log.info("timeoutlinks {}", lt);
                updates.add(new LDUpdate(lt.getSrc(), lt.getSrcPort(),
                                         lt.getDst(), lt.getDstPort(),
                                         getLinkType(lt, info),
                                         UpdateOperation.LINK_UPDATED));
            }
        }

        // if any link was deleted or any link was changed.
        if ((eraseList.size() > 0) || linkChanged) {
            deleteLinks(eraseList, "LLDP timeout");
        }
    } finally {
        lock.writeLock().unlock();
    }
}
 
开发者ID:daniel666,项目名称:multicastSDN,代码行数:63,代码来源:LinkDiscoveryManager.java

示例7: timeoutLinks

import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
/**
 * Iterates through the list of links and deletes if the last discovery
 * message reception time exceeds timeout values.
 */
protected void timeoutLinks() {
    List<Link> eraseList = new ArrayList<Link>();
    Long curTime = System.currentTimeMillis();
    boolean linkChanged = false;

    // reentrant required here because deleteLink also write locks
    lock.writeLock().lock();
    try {
        Iterator<Entry<Link, LinkInfo>> it = this.links.entrySet()
                                                       .iterator();
        while (it.hasNext()) {
            Entry<Link, LinkInfo> entry = it.next();
            Link lt = entry.getKey();
            LinkInfo info = entry.getValue();

            // Timeout the unicast and multicast LLDP valid times
            // independently.
            if ((info.getUnicastValidTime() != null)
                && (info.getUnicastValidTime()
                    + (this.LINK_TIMEOUT * 1000) < curTime)) {
                info.setUnicastValidTime(null);

                if (info.getMulticastValidTime() != null)
                                                         addLinkToBroadcastDomain(lt);
                // Note that even if mTime becomes null later on,
                // the link would be deleted, which would trigger
                // updateClusters().
                linkChanged = true;
            }
            if ((info.getMulticastValidTime() != null)
                && (info.getMulticastValidTime()
                    + (this.LINK_TIMEOUT * 1000) < curTime)) {
                info.setMulticastValidTime(null);
                // if uTime is not null, then link will remain as openflow
                // link. If uTime is null, it will be deleted. So, we
                // don't care about linkChanged flag here.
                removeLinkFromBroadcastDomain(lt);
                linkChanged = true;
            }
            // Add to the erase list only if the unicast
            // time is null.
            if (info.getUnicastValidTime() == null
                && info.getMulticastValidTime() == null) {
                eraseList.add(entry.getKey());
            } else if (linkChanged) {
                UpdateOperation operation;
                operation = getUpdateOperation(info.getSrcPortState(),
                                               info.getDstPortState());
                updates.add(new LDUpdate(lt.getSrc(), lt.getSrcPort(),
                                         lt.getDst(), lt.getDstPort(),
                                         getLinkType(lt, info),
                                         operation));
            }
        }

        // if any link was deleted or any link was changed.
        if ((eraseList.size() > 0) || linkChanged) {
            deleteLinks(eraseList, "LLDP timeout");
        }
    } finally {
        lock.writeLock().unlock();
    }
}
 
开发者ID:dana-i2cat,项目名称:floodlight-nfv,代码行数:68,代码来源:LinkDiscoveryManager.java


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