Reference Guide
Table Of Contents
- 1 Introduction
- 2 Establishing Your Test and Development Environments
- 3 Developing Applications
- Introduction
- Authentication
- REST API
- Audit Logging
- Alert Logging
- Configuration
- High Availability
- OpenFlow
- Metrics Framework
- GUI
- SKI Framework - Overview
- SKI Framework - Navigation Tree
- SKI Framework - Hash Navigation
- SKI Framework - View Life-Cycle
- SKI Framework - Live Reference Application
- UI Extension
- Introduction
- Controller Teaming
- Distributed Coordination Service
- Persistence
- Backup and Restore
- Device Driver Framework
- 4 Application Security
- 5 Including Debian Packages with Applications
- 6 Sample Application
- Application Description
- Creating Application Development Workspace
- Application Generator (Automatic Workspace Creation)
- Creating Eclipse Projects
- Updating Project Dependencies
- Building the Application
- Installing the Application
- Application Code
- 7 Testing Applications
- 8 Built-In Applications
- Appendix A
- Appendix B
- Bibliography
EqualityCondition.Mode mode = filter.getMacAddressCondition()
.getMode();
for (Switch device : switches) {
if (device.getMacAddress().equals(filterMacAddress)) {
if (mode == EqualityCondition.Mode.UNEQUAL) {
toDelete.add(device);
}
} else {
if (mode == EqualityCondition.Mode.EQUAL) {
toDelete.add(device);
}
}
}
switches.removeAll(toDelete);
}
// -----
return switches;
}
...
private Switch getByMacAddress(MacAddress macAddress) {
SwitchFilter filter = new SwitchFilter();
filter.setMacAddressCondition(
new EqualityCondition<MacAddress>(macAddress,
EqualityCondition.Mode.EQUAL));
List<Switch> switches = find(filter, null);
if (!switches.isEmpty()) {
return switches.get(0);
}
return null;
}
void startHandlingControllerEvents(ControllerService controllerService) {
controllerService.addDataPathListener(dataPathListener);
Set<DataPathInfo> dataPaths = controllerService.getAllDataPathInfo();
Set<MacAddress> connectedSwitches = new HashSet<MacAddress>();
for (DataPathInfo dataPathInfo : dataPaths) {
connectedSwitches.add(dataPathInfo.dpid().getMacAddress());
}
for (Switch device : find(null, null)) {
if (connectedSwitches.contains(device.getMacAddress())) {
device.setActiveState(ActiveState.ON);
223