Reference Guide

Table Of Contents
Figure 17 Message Factory Class Diagram
The other factories that a developer might use are:
MatchFactorycreates matches, used in FlowMods
FieldFactorycreates match fields, used in Matches
InstructionFactorycreates instructions for FlowMods
ActionFactorycreates actions for instructions, (1.0 flowmods), and group buckets
PortFactorycreates port descriptions
Note that there arereserved” 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
QueueFactorycreates queue descriptions
MeterBandFactorycreates meter bands, used in MeterMod messages
BucketFactorycreates buckets, used in GroupMod messages
TableFeatureFactorycreates 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);
31