Reference Guide

Table Of Contents
someIntVariable = ConfigUtils.readInt(config, CONFIG_KEY, null, 100);
}
...
}
As the configuration property value can one of several different kinds of Java object (Integer, Long,
String, etc.) a utility class is provided to read the appropriate Java object type from the configuration
map. The ConfigUtils.java class provides methods to read integers, longs, strings, Booleans and
ports from the configuration map of key -> value pairs. The caller must provide the following
information:
The configuration map
The key (string) for the desired property in the configuration map
A data Validator object (can be null)
A default value. The default value is returned if the provided key is not found in the
configuration map, if the key does not map to an Object of the desired type, or if a provided
data validator object rejects the value.
A Validator is a typed class which performs custom validation on a given configuration value. For
example, a data validator which only allows integer values between 10 and 20 is illustrated in the
following listing.
Configurable Property Validator Example:
...
import com.hp.sdn.misc.Validator;
public class MyValidator implements Validator<Integer> {
@Override
public boolean isValid(Integer value) {
return ((10 <= value) && (value <= 20));
}
}
To use this validator with the ConfigUtils class to obtain the configuration value from the
configuration map, just include it in the method call:
MyValidator myValidator = new MyValidator();
ConfigUtils.readInt(config, CONFIG_KEY, myValidator, 15);
High Availability
Role orchestration
Role Orchestration Service provides a federated mechanism to define the role of teamed controllers
with respect to the network elements in the controlled domain. The role that a controller assumes in
relation to a network element would determine whether it has abilities to write and modify the
configurations on the network element, or has only read-only access to it.
As a preparation to exercise the Role Orchestration Service (ROS) in the HP VAN SDN Controller,
there are two pre-requisite operations that needs to be carried out beforehand:
23