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
SwitchManager.java (Sample Application Service Implementation):
package com.hp.hm.impl;
...
public class SwitchManager implements SwitchService {
@Override
public Switch create(String name) {
Switch s = new Switch(name);
if (isEmpty(s.name()) {
s.setname("Switch-" + s.getId().getValue().toString());
}
store.put(s.getId(), s);
return s;
}
@Override
public Collection<Switch> getAll() {
synchronized (store) {
return Collections.unmodifiableCollection(store.values());
}
}
@Override
public Switch get(Id<Switch, UUID> id) {
synchronized (store) {
Switch s = store.get(id);
if (s == null)
throw new NotFoundException("Switch with id " + id +
" not found");
return s;
}
}
@Override
public void delete(Id<Switch, UUID> id) {
synchronized (store) {
Switch s = store.remove(id);
if (s == null)
throw new NotFoundException("Switch with id " + id +
" not found");
}
}
}
158