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
return node;
}
}
Posting Alerts
In order to illustrate how alerts may be posted using the AlertService published by the controller,
SwitchManager of the sample application will post an alert if a device is read with an. See Alert
Logging on page 20 to get more information.
At this point SwitchManager already depends on the AlertService, so it is ready to use this service.
The following listing illustrates an extract of a modified SwitchManager that posts an alert when a
device is retrieved.
SwitchManager.java Posting Alerts:
package com.hp.hm.impl;
import com.hp.sdn.adm.alert.AlertService;
import com.hp.sdn.adm.alert.AlertTopic;
...
public class SwitchManager implements SwitchService {
...
private AlertService alertService;
private AlertTopic alertTopic;
...
public void setAlertService(AlertService alertService) {
this.alertService = alertService;
alertTopic = alertService.registerTopic("of_controller_hm",
"health-monitor", "Alerts from the health monitor application");
}
...
@Override
public Switch get(Id<Switch, UUID> id)) {
. . .
if (alertService != null) {
String source = "OpenFlow Switch: " +
id.getValue();
String data = "Switch Retrieved!!”;
alertService.post(Severity.WARNING, alertTopic,
source, data);
}
}
...
}
212