本文整理汇总了Java中net.floodlightcontroller.util.EventHistory.EvAction类的典型用法代码示例。如果您正苦于以下问题:Java EvAction类的具体用法?Java EvAction怎么用?Java EvAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EvAction类属于net.floodlightcontroller.util.EventHistory包,在下文中一共展示了EvAction类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removedSwitch
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
/**
* When a switch disconnects we remove any links from our map and notify.
* @param The id of the switch
*/
@Override
public void removedSwitch(IOFSwitch iofSwitch) {
// Update event history
long sw = iofSwitch.getId();
evHistTopoSwitch(iofSwitch, EvAction.SWITCH_DISCONNECTED, "None");
List<Link> eraseList = new ArrayList<Link>();
lock.writeLock().lock();
try {
if (switchLinks.containsKey(sw)) {
if (log.isTraceEnabled()) {
log.trace("Handle switchRemoved. Switch {}; removing links {}",
HexString.toHexString(sw), switchLinks.get(sw));
}
// add all tuples with an endpoint on this switch to erase list
eraseList.addAll(switchLinks.get(sw));
deleteLinks(eraseList, "Switch Removed");
// Send a switch removed update
LDUpdate update = new LDUpdate(sw, null, UpdateOperation.SWITCH_REMOVED);
updates.add(update);
}
} finally {
lock.writeLock().unlock();
}
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:30,代码来源:LinkDiscoveryManager.java
示例2: evHistTopoSwitch
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
private void evHistTopoSwitch(IOFSwitch sw, EvAction actn, String reason) {
if (evTopoSwitch == null) {
evTopoSwitch = new EventHistoryTopologySwitch();
}
evTopoSwitch.dpid = sw.getId();
if ((sw.getChannel() != null) &&
(SocketAddress.class.isInstance(
sw.getChannel().getRemoteAddress()))) {
evTopoSwitch.ipv4Addr =
IPv4.toIPv4Address(((InetSocketAddress)(sw.getChannel().
getRemoteAddress())).getAddress().getAddress());
evTopoSwitch.l4Port =
((InetSocketAddress)(sw.getChannel().
getRemoteAddress())).getPort();
} else {
evTopoSwitch.ipv4Addr = 0;
evTopoSwitch.l4Port = 0;
}
evTopoSwitch.reason = reason;
evTopoSwitch = evHistTopologySwitch.put(evTopoSwitch, actn);
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:22,代码来源:LinkDiscoveryManager.java
示例3: evHistTopoSwitch
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
/**
* Switch Added/Deleted Events
*/
private void evHistTopoSwitch(IOFSwitch sw, EvAction actn, String reason) {
if (evTopoSwitch == null) {
evTopoSwitch = new EventHistoryTopologySwitch();
}
evTopoSwitch.dpid = sw.getId();
if ((SocketAddress.class.isInstance(sw.getInetAddress()))) {
evTopoSwitch.ipv4Addr = IPv4.toIPv4Address(((InetSocketAddress) (sw.getInetAddress())).getAddress()
.getAddress());
evTopoSwitch.l4Port = ((InetSocketAddress) (sw.getInetAddress())).getPort();
} else {
evTopoSwitch.ipv4Addr = 0;
evTopoSwitch.l4Port = 0;
}
evTopoSwitch.reason = reason;
evTopoSwitch = evHistTopologySwitch.put(evTopoSwitch, actn);
}
示例4: evHistTopoSwitch
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
private void
evHistTopoSwitch(IOFSwitch sw, EvAction actn, String reason) {
if (evTopoSwitch == null) {
evTopoSwitch = new EventHistoryTopologySwitch();
}
evTopoSwitch.dpid = sw.getId();
if ((SocketAddress.class.isInstance(sw.getInetAddress()))) {
evTopoSwitch.ipv4Addr = IPv4.toIPv4Address(((InetSocketAddress) (sw.getInetAddress())).getAddress()
.getAddress());
evTopoSwitch.l4Port = ((InetSocketAddress) (sw.getInetAddress())).getPort();
} else {
evTopoSwitch.ipv4Addr = 0;
evTopoSwitch.l4Port = 0;
}
evTopoSwitch.reason = reason;
evTopoSwitch = evHistTopologySwitch.put(evTopoSwitch, actn);
}
示例5: addedSwitch
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
/**
* We send out LLDP messages when a switch is added to discover the topology
* @param sw The IOFSwitch that connected to the controller
*/
@Override
public void addedSwitch(IOFSwitch sw) {
if (sw.getEnabledPorts() != null) {
for (Short p : sw.getEnabledPortNumbers()) {
processNewPort(sw.getId(), p);
}
}
// Update event history
evHistTopoSwitch(sw, EvAction.SWITCH_CONNECTED, "None");
LDUpdate update = new LDUpdate(sw.getId(), null,
UpdateOperation.SWITCH_UPDATED);
updates.add(update);
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:19,代码来源:LinkDiscoveryManager.java
示例6: evHistTopoLink
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
private void evHistTopoLink(long srcDpid, long dstDpid, short srcPort,
short dstPort, int srcPortState, int dstPortState,
ILinkDiscovery.LinkType linkType,
EvAction actn, String reason) {
if (evTopoLink == null) {
evTopoLink = new EventHistoryTopologyLink();
}
evTopoLink.srcSwDpid = srcDpid;
evTopoLink.dstSwDpid = dstDpid;
evTopoLink.srcSwport = srcPort & 0xffff;
evTopoLink.dstSwport = dstPort & 0xffff;
evTopoLink.srcPortState = srcPortState;
evTopoLink.dstPortState = dstPortState;
evTopoLink.reason = reason;
switch (linkType) {
case DIRECT_LINK:
evTopoLink.linkType = "DIRECT_LINK";
break;
case MULTIHOP_LINK:
evTopoLink.linkType = "MULTIHOP_LINK";
break;
case TUNNEL:
evTopoLink.linkType = "TUNNEL";
break;
case INVALID_LINK:
default:
evTopoLink.linkType = "Unknown";
break;
}
evTopoLink = evHistTopologyLink.put(evTopoLink, actn);
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:32,代码来源:LinkDiscoveryManager.java
示例7: evHistTopoCluster
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
public void evHistTopoCluster(long dpid, long clusterIdOld,
long clusterIdNew, EvAction action, String reason) {
if (evTopoCluster == null) {
evTopoCluster = new EventHistoryTopologyCluster();
}
evTopoCluster.dpid = dpid;
evTopoCluster.clusterIdOld = clusterIdOld;
evTopoCluster.clusterIdNew = clusterIdNew;
evTopoCluster.reason = reason;
evTopoCluster = evHistTopologyCluster.put(evTopoCluster, action);
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:12,代码来源:LinkDiscoveryManager.java
示例8: addedSwitch
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
/**
* We send out LLDP messages when a switch is added to discover the topology
*
* @param sw
* The IOFSwitch that connected to the controller
*/
@Override
public void addedSwitch(IOFSwitch sw) {
if (sw.getEnabledPortNumbers() != null) {
for (Short p : sw.getEnabledPortNumbers()) {
processNewPort(sw.getId(), p);
}
}
// Update event history
evHistTopoSwitch(sw, EvAction.SWITCH_CONNECTED, "None");
LDUpdate update = new LDUpdate(sw.getId(), null,
UpdateOperation.SWITCH_UPDATED);
updates.add(update);
}
示例9: removedSwitch
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
/**
* When a switch disconnects we remove any links from our map and notify.
*
* @param The
* id of the switch
*/
@Override
public void removedSwitch(IOFSwitch iofSwitch) {
// Update event history
long sw = iofSwitch.getId();
evHistTopoSwitch(iofSwitch, EvAction.SWITCH_DISCONNECTED, "None");
List<Link> eraseList = new ArrayList<Link>();
lock.writeLock().lock();
try {
if (switchLinks.containsKey(sw)) {
if (log.isTraceEnabled()) {
log.trace("Handle switchRemoved. Switch {}; removing links {}",
HexString.toHexString(sw), switchLinks.get(sw));
}
List<LDUpdate> updateList = new ArrayList<LDUpdate>();
updateList.add(new LDUpdate(sw, null,
UpdateOperation.SWITCH_REMOVED));
// add all tuples with an endpoint on this switch to erase list
eraseList.addAll(switchLinks.get(sw));
// Sending the updateList, will ensure the updates in this
// list will be added at the end of all the link updates.
// Thus, it is not necessary to explicitly add these updates
// to the queue.
deleteLinks(eraseList, "Switch Removed", updateList);
} else {
// Switch does not have any links.
updates.add(new LDUpdate(sw, null,
UpdateOperation.SWITCH_REMOVED));
}
} finally {
lock.writeLock().unlock();
}
}
示例10: evHistTopoLink
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
private void evHistTopoLink(long srcDpid, long dstDpid, short srcPort,
short dstPort, int srcPortState,
int dstPortState,
ILinkDiscovery.LinkType linkType,
EvAction actn, String reason) {
if (evTopoLink == null) {
evTopoLink = new EventHistoryTopologyLink();
}
evTopoLink.srcSwDpid = srcDpid;
evTopoLink.dstSwDpid = dstDpid;
evTopoLink.srcSwport = srcPort & 0xffff;
evTopoLink.dstSwport = dstPort & 0xffff;
evTopoLink.srcPortState = srcPortState;
evTopoLink.dstPortState = dstPortState;
evTopoLink.reason = reason;
switch (linkType) {
case DIRECT_LINK:
evTopoLink.linkType = "DIRECT_LINK";
break;
case MULTIHOP_LINK:
evTopoLink.linkType = "MULTIHOP_LINK";
break;
case TUNNEL:
evTopoLink.linkType = "TUNNEL";
break;
case INVALID_LINK:
default:
evTopoLink.linkType = "Unknown";
break;
}
evTopoLink = evHistTopologyLink.put(evTopoLink, actn);
}
示例11: evHistTopoCluster
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
public void evHistTopoCluster(long dpid, long clusterIdOld,
long clusterIdNew, EvAction action,
String reason) {
if (evTopoCluster == null) {
evTopoCluster = new EventHistoryTopologyCluster();
}
evTopoCluster.dpid = dpid;
evTopoCluster.clusterIdOld = clusterIdOld;
evTopoCluster.clusterIdNew = clusterIdNew;
evTopoCluster.reason = reason;
evTopoCluster = evHistTopologyCluster.put(evTopoCluster, action);
}
示例12: addedSwitch
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
/**
* We send out LLDP messages when a switch is added to discover the topology
*
* @param sw
* The IOFSwitch that connected to the controller
*/
@Override
public void addedSwitch(IOFSwitch sw) {
if (sw.getEnabledPortNumbers() != null) {
for (Short p : sw.getEnabledPortNumbers()) {
processNewPort(sw.getId(), p);
}
}
// Update event history
evHistTopoSwitch(sw, EvAction.SWITCH_CONNECTED, "None");
LDUpdate update = new LDUpdate(sw.getId(), null,
UpdateOperation.SWITCH_UPDATED);
updates.add(update);
}
示例13: removedSwitch
import net.floodlightcontroller.util.EventHistory.EvAction; //导入依赖的package包/类
/**
* When a switch disconnects we remove any links from our map and notify.
*
* @param The
* id of the switch
*/
@Override
public void removedSwitch(IOFSwitch iofSwitch) {
// Update event history
long sw = iofSwitch.getId();
evHistTopoSwitch(iofSwitch, EvAction.SWITCH_DISCONNECTED, "None");
List<Link> eraseList = new ArrayList<Link>();
lock.writeLock().lock();
try {
if (switchLinks.containsKey(sw)) {
if (log.isTraceEnabled()) {
log.trace("Handle switchRemoved. Switch {}; removing links {}",
HexString.toHexString(sw), switchLinks.get(sw));
}
List<LDUpdate> updateList = new ArrayList<LDUpdate>();
updateList.add(new LDUpdate(sw, null,
UpdateOperation.SWITCH_REMOVED));
// add all tuples with an endpoint on this switch to erase list
eraseList.addAll(switchLinks.get(sw));
// Sending the updateList, will ensure the updates in this
// list will be added at the end of all the link updates.
// Thus, it is not necessary to explicitly add these updates
// to the queue.
deleteLinks(eraseList, "Switch Removed", updateList);
} else {
// Switch does not have any links.
updates.add(new LDUpdate(sw, null,
UpdateOperation.SWITCH_REMOVED));
}
} finally {
lock.writeLock().unlock();
}
}