SDN Controller Programming Guide
121
Open the hm-root/pom.xml file and add the XML extract from following list to the <dependencies>
node. After updating the POM file update the Eclipse project dependencies (see Updating Project
Dependencies on page 115).
HP SDN Controller Framework Common Dependencies:
<dependency>
<groupId>com.hp.util</groupId>
<artifactId>hp-util-misc</artifactId>
<version>${hp-util.version}</version>
</dependency>
<dependency>
<groupId>com.hp.util</groupId>
<artifactId>hp-util-api</artifactId>
<version>${hp-util.version}</version>
</dependency>
<dependency>
<groupId>com.hp.util</groupId>
<artifactId>hp-util-ip</artifactId>
<version>${hp-util.version}</version>
</dependency>
<dependency>
<groupId>com.hp.sdn</groupId>
<artifactId>sdn-common-model</artifactId>
<version>${sdn.version}</version>
</dependency>
Switch model object implements Transportable<Switch, Long> which means that the Switch’s
identity (or id) type is Long. Long has been chosen to simplify the implementation, however the
services published by the HP VAN SDN Controller normally use java.util.UUID.
If the application offers, and this sample application does, a way to retrieve model objects—In this
example Open Flow switches—based on some kind of filter, then it is a good practice to create a
POJO class [20] that represents the filter. Creating such a class will help decoupling the service
consumer from the way filtering is implemented in lower level layers (like the data store service or
database). The HP VAN SDN Controller Framework provides a set of classes that represent filter
conditions which can be used to compose a filter.
These classes include:
Comparable Condition—Used to represent the following conditions: Less than, less than or
equal to, equal, greater than or equal to and greater than.
Equality Condition—Used to represent the following conditions: Equal and unequal.
Interval Condition—Used to represent the following conditions: In and not in.
Set Condition—Used to represent the following conditions: In and not in.
String Condition—Used to represent the following conditions: Equal, unequal, starts with,
contains and ends with.