Java 类net.floodlightcontroller.core.IHAListener 实例源码

项目:fresco_floodlight    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:fresco_floodlight    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:iTAP-controller    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:iTAP-controller    文件:Controller.java   
/**
 * Initialize internal data structures
 */
public void init(Map<String, String> configParams) throws FloodlightModuleException {

    this.moduleLoaderState = ModuleLoaderState.INIT;

    // These data structures are initialized here because other
    // module's startUp() might be called before ours        
    this.messageListeners = new ConcurrentHashMap<OFType, ListenerDispatcher<OFType, IOFMessageListener>>();
    this.haListeners = new ListenerDispatcher<HAListenerTypeMarker, IHAListener>();
    this.controllerNodeIPsCache = new HashMap<String, String>();
    this.updates = new LinkedBlockingQueue<IUpdate>();
    this.providerMap = new HashMap<String, List<IInfoProvider>>();

    setConfigParams(configParams);

    HARole initialRole = getInitialRole(configParams);
    this.notifiedRole = initialRole;
    this.shutdownService = new ShutdownServiceImpl();

    this.roleManager = new RoleManager(this, this.shutdownService,
                                       this.notifiedRole,
                                       INITIAL_ROLE_CHANGE_DESCRIPTION);
    this.timer = new HashedWheelTimer();

    // Switch Service Startup
    this.switchService.registerLogicalOFMessageCategory(LogicalOFMessageCategory.MAIN);
    this.switchService.addOFSwitchListener(new NotificationSwitchListener());

    this.counters = new ControllerCounters(debugCounterService);
 }
项目:iTAP-controller    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:SDN-Multicast    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:SDN-Multicast    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:arscheduler    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:arscheduler    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:QoS-floodlight    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isDebugEnabled()) {
        log.debug("Dispatching HA Role update newRole = {}",
                  newRole);
    }
    for (IHAListener listener : haListeners.getOrderedListeners()) {
        if (log.isTraceEnabled()) {
            log.trace("Calling HAListener {} with transitionToMaster",
                      listener.getName());
        }
        listener.transitionToMaster();
    }
    if (newRole != Role.SLAVE) {
        Controller.this.notifiedRole = newRole;
    }
}
项目:QoS-floodlight    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:floodlight1.2-delay    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:floodlight1.2-delay    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:floodlight-hardware    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:floodlight-hardware    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:ACAMPController    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:ACAMPController    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:fast-failover-demo    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:fast-failover-demo    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:floodlightLB    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:floodlightLB    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:floodlight_with_topoguard    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isDebugEnabled()) {
        log.debug("Dispatching HA Role update newRole = {}",
                  newRole);
    }
    for (IHAListener listener : haListeners.getOrderedListeners()) {
        if (log.isTraceEnabled()) {
            log.trace("Calling HAListener {} with transitionToMaster",
                      listener.getName());
        }
        listener.transitionToMaster();
    }
    if (newRole != Role.SLAVE) {
        Controller.this.notifiedRole = newRole;
    }
}
项目:floodlight_with_topoguard    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:floodlight    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:floodlight    文件:ControllerTest.java   
/** Test other setRole cases: re-setting role to the current role,
 * setting role to equal, etc.
 */
@Test
public void testSetRoleOthercases() throws Exception {
    doSetUp(HARole.STANDBY);

    // Create and add the HA listener
    IHAListener listener = createMock(IHAListener.class);
    expect(listener.getName()).andReturn("foo").anyTimes();
    setupListenerOrdering(listener);
    replay(listener);
    controller.addHAListener(listener);

    // Set role to slave again. Nothing should happen
    controller.setRole(HARole.STANDBY, "FooBar");
    controller.processUpdateQueueForTesting();
    verify(listener);

    reset(listener);
    expect(listener.getName()).andReturn("foo").anyTimes();
    listener.transitionToActive();
    expectLastCall().once();
    replay(listener);
}
项目:FloodligtModule    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isDebugEnabled()) {
        log.debug("Dispatching HA Role update newRole = {}",
                  newRole);
    }
    for (IHAListener listener : haListeners.getOrderedListeners()) {
        if (log.isTraceEnabled()) {
            log.trace("Calling HAListener {} with transitionToMaster",
                      listener.getName());
        }
        listener.transitionToMaster();
    }
    if (newRole != Role.SLAVE) {
        Controller.this.notifiedRole = newRole;
    }
}
项目:FloodligtModule    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:smartenit    文件:Controller.java   
public void dispatch() {
    // Make sure that old and new roles are different.
    if (oldRole == newRole) {
        if (log.isTraceEnabled()) {
            log.trace("HA role update ignored as the old and " +
                      "new roles are the same. newRole = {}" +
                      "oldRole = {}", newRole, oldRole);
        }
        return;
    }
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Role update newRole = {}, oldRole = {}",
                  newRole, oldRole);
    }
    if (haListeners != null) {
        for (IHAListener listener : haListeners) {
                listener.roleChanged(oldRole, newRole);
        }
    }
}
项目:smartenit    文件:Controller.java   
/**
 * Initialize internal data structures
 */
public void init(Map<String, String> configParams) {
    // These data structures are initialized here because other
    // module's startUp() might be called before ours
    this.messageListeners =
            new ConcurrentHashMap<OFType, 
                                  ListenerDispatcher<OFType, 
                                                     IOFMessageListener>>();
    this.switchListeners = new CopyOnWriteArraySet<IOFSwitchListener>();
    this.haListeners = new CopyOnWriteArraySet<IHAListener>();
    this.activeSwitches = new ConcurrentHashMap<Long, IOFSwitch>();
    this.connectedSwitches = new HashSet<OFSwitchImpl>();
    this.controllerNodeIPsCache = new HashMap<String, String>();
    this.updates = new LinkedBlockingQueue<IUpdate>();
    this.factory = new BasicFactory();
    this.providerMap = new HashMap<String, List<IInfoProvider>>();
    setConfigParams(configParams);
    this.role = getInitialRole(configParams);
    this.roleChanger = new RoleChanger();
    initVendorMessages();
    this.systemStartTime = System.currentTimeMillis();
}
项目:multicastSDN    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isDebugEnabled()) {
        log.debug("Dispatching HA Role update newRole = {}",
                  newRole);
    }
    for (IHAListener listener : haListeners.getOrderedListeners()) {
        if (log.isTraceEnabled()) {
            log.trace("Calling HAListener {} with transitionToMaster",
                      listener.getName());
        }
        listener.transitionToMaster();
    }
    if (newRole != Role.SLAVE) {
        Controller.this.notifiedRole = newRole;
    }
}
项目:multicastSDN    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:Engine    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners.getOrderedListeners()) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:floodlight-qosmanager    文件:Controller.java   
public void dispatch() {
    // Make sure that old and new roles are different.
    if (oldRole == newRole) {
        if (log.isTraceEnabled()) {
            log.trace("HA role update ignored as the old and " +
                      "new roles are the same. newRole = {}" +
                      "oldRole = {}", newRole, oldRole);
        }
        return;
    }
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Role update newRole = {}, oldRole = {}",
                  newRole, oldRole);
    }
    if (haListeners != null) {
        for (IHAListener listener : haListeners) {
                listener.roleChanged(oldRole, newRole);
        }
    }
}
项目:floodlight-qosmanager    文件:Controller.java   
/**
 * Initialize internal data structures
 */
public void init(Map<String, String> configParams) {
    // These data structures are initialized here because other
    // module's startUp() might be called before ours
    this.messageListeners =
            new ConcurrentHashMap<OFType, 
                                  ListenerDispatcher<OFType, 
                                                     IOFMessageListener>>();
    this.switchListeners = new CopyOnWriteArraySet<IOFSwitchListener>();
    this.haListeners = new CopyOnWriteArraySet<IHAListener>();
    this.activeSwitches = new ConcurrentHashMap<Long, IOFSwitch>();
    this.connectedSwitches = new HashSet<OFSwitchImpl>();
    this.controllerNodeIPsCache = new HashMap<String, String>();
    this.updates = new LinkedBlockingQueue<IUpdate>();
    this.factory = new BasicFactory();
    this.providerMap = new HashMap<String, List<IInfoProvider>>();
    setConfigParams(configParams);
    this.role = getInitialRole(configParams);
    this.roleChanger = new RoleChanger();
    initVendorMessages();
    this.systemStartTime = System.currentTimeMillis();
}
项目:floodlight-nfv    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:floodlight-oss    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:my-floodlight    文件:Controller.java   
public void dispatch() {
    // Make sure that old and new roles are different.
    if (oldRole == newRole) {
        if (log.isTraceEnabled()) {
            log.trace("HA role update ignored as the old and " +
                      "new roles are the same. newRole = {}" +
                      "oldRole = {}", newRole, oldRole);
        }
        return;
    }
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Role update newRole = {}, oldRole = {}",
                  newRole, oldRole);
    }
    if (haListeners != null) {
        for (IHAListener listener : haListeners) {
                listener.roleChanged(oldRole, newRole);
        }
    }
}
项目:my-floodlight    文件:Controller.java   
/**
 * Initialize internal data structures
 */
public void init(Map<String, String> configParams) {
    // These data structures are initialized here because other
    // module's startUp() might be called before ours
    this.messageListeners =
            new ConcurrentHashMap<OFType, 
                                  ListenerDispatcher<OFType, 
                                                     IOFMessageListener>>();
    this.switchListeners = new CopyOnWriteArraySet<IOFSwitchListener>();
    this.haListeners = new CopyOnWriteArraySet<IHAListener>();
    this.activeSwitches = new ConcurrentHashMap<Long, IOFSwitch>();
    this.connectedSwitches = new HashSet<OFSwitchImpl>();
    this.controllerNodeIPsCache = new HashMap<String, String>();
    this.updates = new LinkedBlockingQueue<IUpdate>();
    this.factory = new BasicFactory();
    this.providerMap = new HashMap<String, List<IInfoProvider>>();
    setConfigParams(configParams);
    this.role = getInitialRole(configParams);
    this.roleChanger = new RoleChanger();
    initVendorMessages();
    this.systemStartTime = System.currentTimeMillis();
}
项目:FL_HAND    文件:Controller.java   
@Override
public void dispatch() {
    if (log.isTraceEnabled()) {
        log.trace("Dispatching HA Controller Node IP update "
                + "curIPs = {}, addedIPs = {}, removedIPs = {}",
                new Object[] { curControllerNodeIPs, addedControllerNodeIPs,
                    removedControllerNodeIPs }
                );
    }
    if (haListeners != null) {
        for (IHAListener listener: haListeners) {
            listener.controllerNodeIPsChanged(curControllerNodeIPs,
                    addedControllerNodeIPs, removedControllerNodeIPs);
        }
    }
}
项目:FL_HAND    文件:Controller.java   
/**
 * Initialize internal data structures
 */
public void init(Map<String, String> configParams) {
    // These data structures are initialized here because other
    // module's startUp() might be called before ours
    this.messageListeners =
            new ConcurrentHashMap<OFType,
                                  ListenerDispatcher<OFType,
                                                     IOFMessageListener>>();
    this.switchListeners = new CopyOnWriteArraySet<IOFSwitchListener>();
    this.haListeners = new CopyOnWriteArraySet<IHAListener>();
    this.switchBindingMap =
            new ConcurrentHashMap<String, IOFSwitchDriver>();
    this.switchDescSortedList = new ArrayList<String>();
    this.activeSwitches = new ConcurrentHashMap<Long, IOFSwitch>();
    this.connectedSwitches = new HashSet<IOFSwitch>();
    this.controllerNodeIPsCache = new HashMap<String, String>();
    this.updates = new LinkedBlockingQueue<IUpdate>();
    this.factory = new BasicFactory();
    this.providerMap = new HashMap<String, List<IInfoProvider>>();
    setConfigParams(configParams);
    this.role = getInitialRole(configParams);
    this.notifiedRole = this.role;
    this.roleChanger = new RoleChanger(this);
    initVendorMessages();
    this.systemStartTime = System.currentTimeMillis();
}