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
JSON Module Dependencies:
<dependency>
<groupId>com.hp.util</groupId>
<artifactId>hp-util-codec</artifactId>
<version>${hp-util.version}</version>
</dependency>
<dependency>
<groupId>com.hp.sdn</groupId>
<artifactId>sdn-adm-api</artifactId>
<version>${sdn.version}</version>
</dependency>
The HP VAN SDN Controller SDK uses the Jackson API [38] as the underlying API to handle JSON
conversion.
In order to make the SwitchJsonCodec, and any other codec in the application, available so it can
be reused, create a JSON factory that is registered to the central JSON repository which is
exposed as a regular service called JsonService. The following listing shows the implementation of
this JSON factory:
HmJsonFactory.java:
package com.hp.hm.rs.json;
import com.hp.util.json.AbstractJsonFactory;
import com.hp.util.json.JsonFactory;
...
@Component
@Service
@Property(name = "app", value = "flare")
public class HmJsonFactory extends AbstractJsonFactory {
public HmJsonFactory() {
// Register all application’s JSON codecs
addCodecs(Switch.class, new SwitchJsonCodec());
}
@Deactivate
protected void deactivate() {
clearCodecs();
}
}
HmJsonFactory holds all the JSON codecs; it is an OSGi service so it is registered to the central
JSON repository when it is activated and unregistered from the JSON repository when it is
deactivated. The registration happens automatically because the HP VAN SDN Controller
Framework observes all activated JSON Factories (JsonFactory) services annotated with the
following property: “name=flare”.
186