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
private final SystemInformationService sysInfoService;
// Mandatory dependency.
private final RoleService roleService;
public void doAct() {
IpAddress masterIp = roleService.getMaster(dpid).ip();
if(masterIp.equals(sysInfoService.
getSystem().getAddress())){
log.debug(“this controller is the master to {}”,
dpid);
// now that we know this controller has master privilages
// we could for example initiate write operations on the
// datapath – like sending flow-mods
}
}
}
- To determine the role that a controller is playing with respect to a given datapath
import com.hp.of.lib.msg.ControllerRole;
import com.hp.sdn.adm.role.RoleService;
import com.hp.sdn.region.ControllerNode;
import com.hp.sdn.region.ControllerNodeModel;
…
public class SampleService {
// Mandatory dependency.
private final RoleService roleService;
public void doAct() {
...
ControllerNode controller = new ControllerNodeModel(“10.1.1.1”);
ControllerRole role = roleService.getCurrentRole(controller,deviceIp);
switch(role){
case MASTER:
// the given controller has master privilages
// we can trigger write-operations from that controller
...
Break;
Case SLAVE:
// we have only read privileges
...
break;
default:
// indicates the controller and device are not associated
220