本文整理汇总了Java中net.floodlightcontroller.linkdiscovery.LinkInfo.getUnicastValidTime方法的典型用法代码示例。如果您正苦于以下问题:Java LinkInfo.getUnicastValidTime方法的具体用法?Java LinkInfo.getUnicastValidTime怎么用?Java LinkInfo.getUnicastValidTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.floodlightcontroller.linkdiscovery.LinkInfo
的用法示例。
在下文中一共展示了LinkInfo.getUnicastValidTime方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLinkType
import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
@Override
public ILinkDiscovery.LinkType getLinkType(Link lt, LinkInfo info) {
if (info.getUnicastValidTime() != null) {
return ILinkDiscovery.LinkType.DIRECT_LINK;
} else if (info.getMulticastValidTime() != null) {
return ILinkDiscovery.LinkType.MULTIHOP_LINK;
}
return ILinkDiscovery.LinkType.INVALID_LINK;
}
示例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());
}
}
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;
}
示例3: getLinkType
import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
@Override
public ILinkDiscovery.LinkType getLinkType(Link lt, LinkInfo info) {
if (info.getUnicastValidTime() != null) {
return ILinkDiscovery.LinkType.DIRECT_LINK;
} else if (info.getMulticastValidTime() != null) {
return ILinkDiscovery.LinkType.MULTIHOP_LINK;
}
return ILinkDiscovery.LinkType.INVALID_LINK;
}
示例4: 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;
}
示例5: getLinkType
import net.floodlightcontroller.linkdiscovery.LinkInfo; //导入方法依赖的package包/类
public ILinkDiscovery.LinkType getLinkType(Link lt, LinkInfo info) {
if (info.getUnicastValidTime() != null) {
return ILinkDiscovery.LinkType.DIRECT_LINK;
} else if (info.getMulticastValidTime() != null) {
return ILinkDiscovery.LinkType.MULTIHOP_LINK;
}
return ILinkDiscovery.LinkType.INVALID_LINK;
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:9,代码来源: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().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();
}
}
示例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);
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();
}
}
示例8: 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
示例9: 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();
}
}
示例10: 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();
}
}