Reference Guide

Table Of Contents
Open the hm-root/pom.xml file and add the XML extract from the following list to the
<dependencies> node. After updating the POM file update the Eclipse project dependencies (see
Updating Project Dependencies on page 146).
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>
If the application offers, and this sample application does, a way to retrieve model objectsin this
example Open Flow switchesbased on some kind of filter, then it is a good practice to create a
POJO class [19] 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 ConditionUsed to represent the following conditions: Less than, less than or
equal to, equal, greater than or equal to and greater than.
Equality ConditionUsed to represent the following conditions: Equal and unequal.
Interval ConditionUsed to represent the following conditions: In and not in.
Set ConditionUsed to represent the following conditions: In and not in.
String ConditionUsed to represent the following conditions: Equal, unequal, starts with,
contains and ends with.
Based on these conditions we will create a filter for the Open Flow switch class as illustrated in the
following listing.
SwitchFilter.java:
package com.hp.hm.model;
153