Examples of IDevice


Examples of fr.soleil.salsa.entity.IDevice

    private void initSavedAxis(List<? extends IDevice> deviceList,
            Iterator<DisplayAxis> iteratorAxis, boolean sensor) {
        if (deviceList != null) {
            Iterator<? extends IDevice> iteratorDevice = deviceList.listIterator();
            IDevice device = null;
            DisplayAxis displayAxis = null;
            String attributeName = null;
            while (iteratorDevice.hasNext()) {
                device = iteratorDevice.next();
                if (iteratorAxis.hasNext()) {
                    displayAxis = iteratorAxis.next();
                    if (displayAxis == null) {
                        displayAxis = getDisplayAxis(Axis.NONE);
                    }
                }
                else {
                    displayAxis = getDisplayAxis(Axis.NONE);
                }
                attributeName = device.getName();
                if (sensor) {
                    attributeName = attributeName + "(sensor)";
                }
                attributeNameList.add(attributeName);
                // Add sensor for sensor attribute in case of sensor = actuator
View Full Code Here

Examples of fr.soleil.salsa.entity.IDevice

        if (deviceList == null) {
            return;
        }

        Iterator<?> iteratorDevice = deviceList.listIterator();
        IDevice device = null;
        DisplayAxis displayAxis = null;
        String attributeName = null;
        while (iteratorDevice.hasNext()) {
            device = (IDevice) iteratorDevice.next();
            if (iteratorAxis.hasNext()) {
                displayAxis = iteratorAxis.next();
                if (displayAxis == null) {
                    displayAxis = getDisplayAxis(Axis.NONE);
                }
            }
            else {
                displayAxis = getDisplayAxis(Axis.NONE);
            }
            attributeName = device.getName();
            attributeNameList.add(attributeName);
            // System.out.println("attributeName =" + attributeName + "->" + displayAxis);
            initDefaultAxis(attributeName, getAxis(displayAxis));
        }
    }
View Full Code Here

Examples of net.floodlightcontroller.devicemanager.IDevice

     */
    protected void pushBidirectionalVipRoutes(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx, IPClient client, LBMember member) {
       
        // borrowed code from Forwarding to retrieve src and dst device entities
        // Check if we have the location of the destination
        IDevice srcDevice = null;
        IDevice dstDevice = null;
       
        // retrieve all known devices
        Collection<? extends IDevice> allDevices = deviceManager
                .getAllDevices();
       
        for (IDevice d : allDevices) {
            for (int j = 0; j < d.getIPv4Addresses().length; j++) {
                    if (srcDevice == null && client.ipAddress == d.getIPv4Addresses()[j])
                        srcDevice = d;
                    if (dstDevice == null && member.address == d.getIPv4Addresses()[j]) {
                        dstDevice = d;
                        member.macString = dstDevice.getMACAddressString();
                    }
                    if (srcDevice != null && dstDevice != null)
                        break;
            }
        } 
       
        // srcDevice and/or dstDevice is null, no route can be pushed
        if (srcDevice == null || dstDevice == null) return;
       
        Long srcIsland = topology.getL2DomainId(sw.getId());

        if (srcIsland == null) {
            log.debug("No openflow island found for source {}/{}",
                      sw.getStringId(), pi.getInPort());
            return;
        }
       
        // Validate that we have a destination known on the same island
        // Validate that the source and destination are not on the same switchport
        boolean on_same_island = false;
        boolean on_same_if = false;
        for (SwitchPort dstDap : dstDevice.getAttachmentPoints()) {
            long dstSwDpid = dstDap.getSwitchDPID();
            Long dstIsland = topology.getL2DomainId(dstSwDpid);
            if ((dstIsland != null) && dstIsland.equals(srcIsland)) {
                on_same_island = true;
                if ((sw.getId() == dstSwDpid) &&
                        (pi.getInPort() == dstDap.getPort())) {
                    on_same_if = true;
                }
                break;
            }
        }
       
        if (!on_same_island) {
            // Flood since we don't know the dst device
            if (log.isTraceEnabled()) {
                log.trace("No first hop island found for destination " +
                        "device {}, Action = flooding", dstDevice);
            }
            return;
        }           
       
        if (on_same_if) {
            if (log.isTraceEnabled()) {
                log.trace("Both source and destination are on the same " +
                        "switch/port {}/{}, Action = NOP",
                        sw.toString(), pi.getInPort());
            }
            return;
        }
       
        // Install all the routes where both src and dst have attachment
        // points.  Since the lists are stored in sorted order we can
        // traverse the attachment points in O(m+n) time
        SwitchPort[] srcDaps = srcDevice.getAttachmentPoints();
        Arrays.sort(srcDaps, clusterIdComparator);
        SwitchPort[] dstDaps = dstDevice.getAttachmentPoints();
        Arrays.sort(dstDaps, clusterIdComparator);
       
        int iSrcDaps = 0, iDstDaps = 0;

        // following Forwarding's same routing routine, retrieve both in-bound and out-bound routes for
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.