Examples of LDUpdate


Examples of net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate

                   explanation = "An unknown error occured while dispatching "
                                 + "link update notifications",
                   recommendation = LogMessageDoc.GENERIC_ACTION)
    private void doUpdatesThread() throws InterruptedException {
        do {
            LDUpdate update = updates.take();
            List<LDUpdate> updateList = new ArrayList<LDUpdate>();
            updateList.add(update);

            // Add all the pending updates to the list.
            while (updates.peek() != null) {
                updateList.add(updates.remove());
            }

            if (linkDiscoveryAware != null) {
                if (log.isTraceEnabled()) {
                    log.trace("Dispatching link discovery update {} {} {} {} {} for {}",
                              new Object[] {
                                            update.getOperation(),
                                            HexString.toHexString(update.getSrc()),
                                            update.getSrcPort(),
                                            HexString.toHexString(update.getDst()),
                                            update.getDstPort(),
                                            linkDiscoveryAware });
                }
                try {
                    for (ILinkDiscoveryListener lda : linkDiscoveryAware) { // order
                        // maintained
View Full Code Here

Examples of net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate

        if (portUp)
            operation = UpdateOperation.PORT_UP;
        else
            operation = UpdateOperation.PORT_DOWN;

        updates.add(new LDUpdate(sw, port, operation));
    }
View Full Code Here

Examples of net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate

            // they weren't set to null in the previous block of code.
            writeLinkToStorage(lt, newInfo);

            if (linkChanged) {
                // find out if the link was added or removed here.
                updates.add(new LDUpdate(lt.getSrc(), lt.getSrcPort(),
                                         lt.getDst(), lt.getDstPort(),
                                         getLinkType(lt, newInfo),
                                         updateOperation));
            }
        } finally {
View Full Code Here

Examples of net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate

                                                             this.portLinks.remove(dstNpt);
                }

                LinkInfo info = this.links.remove(lt);
                LinkType linkType = getLinkType(lt, info);
                linkUpdateList.add(new LDUpdate(lt.getSrc(),
                                                lt.getSrcPort(),
                                                lt.getDst(),
                                                lt.getDstPort(),
                                                linkType,
                                                UpdateOperation.LINK_REMOVED));
View Full Code Here

Examples of net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate

                // 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));
                }
            }
View Full Code Here

Examples of net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate

    // IOFSwitchListener
    //******************
    private void handlePortDown(long switchId, short portNumber) {
            NodePortTuple npt = new NodePortTuple(switchId, portNumber);
            deleteLinksOnPort(npt, "Port Status Changed");
            LDUpdate update = new LDUpdate(switchId, portNumber,
                    UpdateOperation.PORT_DOWN);
            updates.add(update);
    }
View Full Code Here

Examples of net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate

                    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();
        }
View Full Code Here

Examples of net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate

        if (sw.getEnabledPortNumbers() != null) {
            for (Short p : sw.getEnabledPortNumbers()) {
                processNewPort(sw.getId(), p);
            }
        }
        LDUpdate update = new LDUpdate(sw.getId(), null,
                                       UpdateOperation.SWITCH_UPDATED);
        updates.add(update);
    }
View Full Code Here

Examples of net.floodlightcontroller.linkdiscovery.ILinkDiscovery.LDUpdate

                sw.removeAttribute(IOFSwitch.SWITCH_IS_CORE_SWITCH);
                if (log.isTraceEnabled()) {
                    log.trace("SWITCH_IS_CORE_SWITCH set to False for {}",
                              sw);
                }
                updates.add(new LDUpdate(sw.getId(),
                                         SwitchType.BASIC_SWITCH,
                                         UpdateOperation.SWITCH_UPDATED));
            } else {
                sw.setAttribute(IOFSwitch.SWITCH_IS_CORE_SWITCH,
                                new Boolean(true));
                if (log.isTraceEnabled()) {
                    log.trace("SWITCH_IS_CORE_SWITCH set to True for {}", sw);
                }
                updates.add(new LDUpdate(sw.getId(), SwitchType.CORE_SWITCH,
                                         UpdateOperation.SWITCH_UPDATED));
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.