本文整理汇总了Java中net.floodlightcontroller.core.IHAListener类的典型用法代码示例。如果您正苦于以下问题:Java IHAListener类的具体用法?Java IHAListener怎么用?Java IHAListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IHAListener类属于net.floodlightcontroller.core包,在下文中一共展示了IHAListener类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatch
import net.floodlightcontroller.core.IHAListener; //导入依赖的package包/类
@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);
}
}
}
示例2: testSetRoleOthercases
import net.floodlightcontroller.core.IHAListener; //导入依赖的package包/类
/** 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);
}
示例3: init
import net.floodlightcontroller.core.IHAListener; //导入依赖的package包/类
/**
* 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);
}
示例4: dispatch
import net.floodlightcontroller.core.IHAListener; //导入依赖的package包/类
@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;
}
}
示例5: dispatch
import net.floodlightcontroller.core.IHAListener; //导入依赖的package包/类
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);
}
}
}
示例6: init
import net.floodlightcontroller.core.IHAListener; //导入依赖的package包/类
/**
* 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();
}
示例7: dispatch
import net.floodlightcontroller.core.IHAListener; //导入依赖的package包/类
@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);
}
}
}
示例8: init
import net.floodlightcontroller.core.IHAListener; //导入依赖的package包/类
/**
* 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();
}