本文整理汇总了Java中net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate类的典型用法代码示例。如果您正苦于以下问题:Java LDUpdate类的具体用法?Java LDUpdate怎么用?Java LDUpdate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LDUpdate类属于net.floodlightcontroller.linkdiscovery.ILinkDiscovery包,在下文中一共展示了LDUpdate类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: topologyChanged
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
/**
* Topology listener method.
*/
@Override
public void topologyChanged(List<LDUpdate> updateList) {
Iterator<Device> diter = deviceMap.values().iterator();
if (updateList != null) {
if (logger.isTraceEnabled()) {
for(LDUpdate update: updateList) {
logger.trace("Topo update: {}", update);
}
}
}
while (diter.hasNext()) {
Device d = diter.next();
if (d.updateAttachmentPoint()) {
if (logger.isDebugEnabled()) {
logger.debug("Attachment point changed for device: {}", d);
}
sendDeviceMovedNotification(d);
}
}
// Since topologyChanged() does not occur in the packet-in pipeline,
// debugEvents need to be flushed explicitly
debugEventService.flushEvents();
}
示例2: generateSwitchPortStatusUpdate
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
private void generateSwitchPortStatusUpdate(DatapathId sw, OFPort port) {
UpdateOperation operation;
IOFSwitch iofSwitch = switchService.getSwitch(sw);
if (iofSwitch == null) return;
OFPortDesc ofp = iofSwitch.getPort(port);
if (ofp == null) return;
Set<OFPortState> srcPortState = ofp.getState();
boolean portUp = !srcPortState.contains(OFPortState.STP_BLOCK);
if (portUp) {
operation = UpdateOperation.PORT_UP;
} else {
operation = UpdateOperation.PORT_DOWN;
}
updates.add(new LDUpdate(sw, port, operation));
}
示例3: topologyChanged
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
/**
* Topology listener method.
*/
@Override
public void topologyChanged(List<LDUpdate> updateList) {
Iterator<Device> diter = deviceMap.values().iterator();
if (updateList != null) {
if (logger.isTraceEnabled()) {
for(LDUpdate update: updateList) {
logger.trace("Topo update: {}", update);
}
}
}
while (diter.hasNext()) {
Device d = diter.next();
if (d.updateAttachmentPoint()) {
if (logger.isDebugEnabled()) {
logger.debug("Attachment point changed for device: {}", d);
}
sendDeviceMovedNotification(d);
}
}
// Since topologyChanged() does not occur in the packet-in pipeline,
// debugEvents need to be flushed explicitly
debugEventService.flushEvents();
}
示例4: generateSwitchPortStatusUpdate
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
private void generateSwitchPortStatusUpdate(DatapathId sw, OFPort port) {
UpdateOperation operation;
IOFSwitch iofSwitch = switchService.getSwitch(sw);
if (iofSwitch == null) return;
OFPortDesc ofp = iofSwitch.getPort(port);
if (ofp == null) return;
Set<OFPortState> srcPortState = ofp.getState();
boolean portUp = !srcPortState.contains(OFPortState.STP_BLOCK);
if (portUp) {
operation = UpdateOperation.PORT_UP;
} else {
operation = UpdateOperation.PORT_DOWN;
}
updates.add(new LDUpdate(sw, port, operation));
}
示例5: topologyChanged
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
/**
* Topology listener method.
*/
@Override
public void topologyChanged(List<LDUpdate> updateList) {
Iterator<Device> diter = deviceMap.values().iterator();
if (updateList != null) {
if (logger.isTraceEnabled()) {
for(LDUpdate update: updateList) {
logger.trace("Topo update: {}", update);
}
}
}
while (diter.hasNext()) {
Device d = diter.next();
if (d.updateAttachmentPoint()) {
if (logger.isDebugEnabled()) {
logger.debug("Attachment point changed for device: {}", d);
}
sendDeviceMovedNotification(d);
}
}
// Since topologyChanged() does not occur in the packet-in pipeline,
// debugEvents need to be flushed explicitly
debugEvents.flushEvents();
}
示例6: generateSwitchPortStatusUpdate
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
private void generateSwitchPortStatusUpdate(long sw, short port) {
UpdateOperation operation;
IOFSwitch iofSwitch = floodlightProvider.getSwitch(sw);
if (iofSwitch == null) return;
OFPhysicalPort ofp = iofSwitch.getPort(port).toOFPhysicalPort();
if (ofp == null) return;
int srcPortState = ofp.getState();
boolean portUp = ((srcPortState & OFPortState.OFPPS_STP_MASK.getValue())
!= OFPortState.OFPPS_STP_BLOCK.getValue());
if (portUp)
operation = UpdateOperation.PORT_UP;
else
operation = UpdateOperation.PORT_DOWN;
updates.add(new LDUpdate(sw, port, operation));
}
示例7: topologyChanged
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
/**
* Topology listener method.
*/
@Override
public void topologyChanged() {
Iterator<Device> diter = deviceMap.values().iterator();
List<LDUpdate> updateList = topology.getLastLinkUpdates();
if (updateList != null) {
if (logger.isTraceEnabled()) {
for(LDUpdate update: updateList) {
logger.trace("Topo update: {}", update);
}
}
}
while (diter.hasNext()) {
Device d = diter.next();
if (d.updateAttachmentPoint()) {
if (logger.isDebugEnabled()) {
logger.debug("Attachment point changed for device: {}", d);
}
sendDeviceMovedNotification(d);
}
}
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:26,代码来源:DeviceManagerImpl.java
示例8: generateSwitchPortStatusUpdate
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
private void generateSwitchPortStatusUpdate(long sw, short port) {
UpdateOperation operation;
IOFSwitch iofSwitch = floodlightProvider.getSwitches().get(sw);
if (iofSwitch == null) return;
OFPhysicalPort ofp = iofSwitch.getPort(port);
if (ofp == null) return;
int srcPortState = ofp.getState();
boolean portUp = ((srcPortState &
OFPortState.OFPPS_STP_MASK.getValue()) !=
OFPortState.OFPPS_STP_BLOCK.getValue());
if (portUp) operation = UpdateOperation.PORT_UP;
else operation = UpdateOperation.PORT_DOWN;
updates.add(new LDUpdate(sw, port, operation));
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:20,代码来源:LinkDiscoveryManager.java
示例9: removedSwitch
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的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
示例10: topologyChanged
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
@Override
public void topologyChanged(List<LDUpdate> linkUpdates) {
// TODO Auto-generated method stub
if(!linkUpdates.isEmpty()){
Iterator<LDUpdate> update = linkUpdates.iterator();
while(update.hasNext()){
LDUpdate key = update.next();
UpdateOperation operation = key.getOperation();
if(operation == UpdateOperation.LINK_REMOVED && SpanTreeRecovery ==false){
SpanTreeRecovery =true;
//massivefailurerecoveryservice.startmassiverecovery();
}
//this.link_failure_handle(key);
}
}
}
示例11: generateSwitchPortStatusUpdate
import net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate; //导入依赖的package包/类
private void generateSwitchPortStatusUpdate(long sw, short port) {
UpdateOperation operation;
IOFSwitch iofSwitch = floodlightProvider.getSwitch(sw);
if (iofSwitch == null) return;
OFPhysicalPort ofp = iofSwitch.getPort(port).toOFPhysicalPort();
if (ofp == null) return;
int srcPortState = ofp.getState();
boolean portUp = ((srcPortState & OFPortState.OFPPS_STP_MASK.getValue())
!= OFPortState.OFPPS_STP_BLOCK.getValue());
if (portUp)
operation = UpdateOperation.PORT_UP;
else
operation = UpdateOperation.PORT_DOWN;
log.info("generateSwitchPortStatusUpdate");
updates.add(new LDUpdate(sw, port, operation));
}