SDN Controller Programming Guide
27
Figure 17 Message Factory Class Diagram
The other factories that a developer might use are:
MatchFactory—creates matches, used in FlowMods
FieldFactory—creates match fields, used in Matches
InstructionFactory—creates instructions for FlowMods
ActionFactory—creates actions for instructions, (1.0 flowmods), and group buckets
PortFactory—creates port descriptions
Note that there are “reserved” values (special port numbers) defined on the Port class
(MAX, IN_PORT, TABLE, NORMAL, FLOOD, ALL, CONTROLLER, LOCAL, ANY)—see
com.hp.of.lib.msg.Port Javadocs
QueueFactory—creates queue descriptions
MeterBandFactory—creates meter bands, used in MeterMod messages
BucketFactory—creates buckets, used in GroupMod messages
TableFeatureFactory—creates table feature descriptions
Note that application developers should not ever need to invoke “parse” or “encode” methods on
any of the factories; those methods are reserved for use by the Core Controller.
An example: creating a FlowMod message
The following listing shows an example of how to create a flowmod message:
Flowmod Message Example:
public class SampleFlowModMessageCreation {
private static final ProtocolVersion PV = ProtocolVersion.V_1_3;
private static final long COOKIE = 0x00002468;
private static final TableId TABLE_ID = TableId.valueOf(200);