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
•
MessageListener—To receive events about OpenFlow messages received by the controller
from connected datapaths.
•
SequencedPacketListener—To participate in the processing of Packet-In messages
•
FlowListener—To receive events about flow.
DataPathListener will be used to monitor connections and thus translate connected devices to
reachable devices. Even though just DataPathListener will be shown here, using the other listeners
is a matter of creating a variation of what is shown.
The following listings illustrate an extract of the implementation of SwitchManager and
SwitchComponent consuming the ControllerService to monitor datapath connections.
SwitchManager.java Subscribing a DataPathListener to the ControllerService:
package com.hp.hm.impl;
import com.hp.of.ctl.ControllerService;
import com.hp.of.ctl.DataPathEvent;
import com.hp.of.ctl.DataPathListener;
import com.hp.of.ctl.OpenflowEventType;
import com.hp.of.ctl.QueueEvent;
import com.hp.of.lib.dt.DataPathInfo;
...
public class SwitchManager implements SwitchService {
...
private DataPathListener dataPathListener;
public SwitchManager(SystemInformationService systemInformationService) {
...
dataPathListener = new DataPathListenerImpl();
}
...
@Override
public List<Switch> find(SwitchFilter filter,
SortSpecification<SwitchSortKey> sortSpecification) {
// In a real application a database may be used: filter would be
// mapped to predicates and sortSpecification to sorting clauses.
List<Switch> switches = new ArrayList<Switch>(devices.values());
// At this point just the MAC Address filter is used so a temporal
// implementation is also used (NOTE: This is not a proper way of
// implementing filtering).
// -----
if (filter != null && filter.getMacAddressCondition() != null) {
List<Switch> toDelete = new ArrayList<Switch>();
MacAddress filterMacAddress = filter.getMacAddressCondition()
.getValue();
222