public class BasicFactory extends Object implements OFMessageFactory, OFActionFactory, OFStatisticsFactory, OFVendorDataFactory
Modifier and Type | Field and Description |
---|---|
protected static BasicFactory |
instance |
Modifier | Constructor and Description |
---|---|
protected |
BasicFactory() |
Modifier and Type | Method and Description |
---|---|
static String |
dumpBuffer(org.jboss.netty.buffer.ChannelBuffer data) |
OFAction |
getAction(OFActionType t)
Retrieves an OFAction instance corresponding to the specified
OFActionType
|
OFActionFactory |
getActionFactory()
Retrieves an OFActionFactory
|
static BasicFactory |
getInstance() |
OFMessage |
getMessage(OFType t)
create and return a new instance of a message for OFType t.
|
OFStatistics |
getStatistics(OFType t,
OFStatisticsType st)
Retrieves an OFStatistics instance corresponding to the specified
OFStatisticsType
|
OFVendorData |
getVendorData(OFVendorId vendorId,
OFVendorDataType vendorDataType)
Retrieves an OFVendorData instance corresponding to the specified
OFVendorId and OFVendorDataType.
|
List<OFAction> |
parseActions(org.jboss.netty.buffer.ChannelBuffer data,
int length)
Attempts to parse and return all OFActions contained in the given
ByteBuffer, beginning at the ByteBuffer's position, and ending at
position+length.
|
List<OFAction> |
parseActions(org.jboss.netty.buffer.ChannelBuffer data,
int length,
int limit)
Attempts to parse and return all OFActions contained in the given
ByteBuffer, beginning at the ByteBuffer's position, and ending at
position+length.
|
List<OFMessage> |
parseMessage(org.jboss.netty.buffer.ChannelBuffer data)
Attempts to parse and return a OFMessages contained in the given
ChannelBuffer, beginning at the ChannelBuffer's position, and ending at
the after the first parsed message
|
OFMessage |
parseMessageOne(org.jboss.netty.buffer.ChannelBuffer data) |
List<OFStatistics> |
parseStatistics(OFType t,
OFStatisticsType st,
org.jboss.netty.buffer.ChannelBuffer data,
int length)
Attempts to parse and return all OFStatistics contained in the given
ByteBuffer, beginning at the ByteBuffer's position, and ending at
position+length.
|
List<OFStatistics> |
parseStatistics(OFType t,
OFStatisticsType st,
org.jboss.netty.buffer.ChannelBuffer data,
int length,
int limit)
Attempts to parse and return all OFStatistics contained in the given
ByteBuffer, beginning at the ByteBuffer's position, and ending at
position+length.
|
OFVendorData |
parseVendorData(int vendor,
org.jboss.netty.buffer.ChannelBuffer data,
int length)
Attempts to parse and return the OFVendorData contained in the given
ChannelBuffer, beginning right after the vendor id.
|
protected static BasicFactory instance
public static BasicFactory getInstance()
public OFMessage getMessage(OFType t)
getMessage
in interface OFMessageFactory
t
- the type of the OFMessage to be retrievedpublic List<OFMessage> parseMessage(org.jboss.netty.buffer.ChannelBuffer data) throws MessageParseException
OFMessageFactory
parseMessage
in interface OFMessageFactory
data
- the ChannelBuffer to parse for an OpenFlow messageMessageParseException
public OFMessage parseMessageOne(org.jboss.netty.buffer.ChannelBuffer data) throws MessageParseException
MessageParseException
public OFAction getAction(OFActionType t)
OFActionFactory
getAction
in interface OFActionFactory
t
- the type of the OFAction to be retrievedpublic List<OFAction> parseActions(org.jboss.netty.buffer.ChannelBuffer data, int length)
OFActionFactory
parseActions
in interface OFActionFactory
data
- the ChannelBuffer to parse for OpenFlow actionslength
- the number of Bytes to examine for OpenFlow actionspublic List<OFAction> parseActions(org.jboss.netty.buffer.ChannelBuffer data, int length, int limit)
OFActionFactory
parseActions
in interface OFActionFactory
data
- the ChannelBuffer to parse for OpenFlow actionslength
- the number of Bytes to examine for OpenFlow actionslimit
- the maximum number of messages to return, 0 means no limitpublic OFActionFactory getActionFactory()
OFMessageFactory
getActionFactory
in interface OFMessageFactory
public OFStatistics getStatistics(OFType t, OFStatisticsType st)
OFStatisticsFactory
getStatistics
in interface OFStatisticsFactory
t
- the type of the containing OFMessage, only accepts statistics
request or replyst
- the type of the OFStatistics to be retrievedpublic List<OFStatistics> parseStatistics(OFType t, OFStatisticsType st, org.jboss.netty.buffer.ChannelBuffer data, int length)
OFStatisticsFactory
parseStatistics
in interface OFStatisticsFactory
t
- the type of the containing OFMessage, only accepts statistics
request or replyst
- the type of the OFStatistics to be retrieveddata
- the ChannelBuffer to parse for OpenFlow Statisticslength
- the number of Bytes to examine for OpenFlow Statisticspublic List<OFStatistics> parseStatistics(OFType t, OFStatisticsType st, org.jboss.netty.buffer.ChannelBuffer data, int length, int limit)
OFStatisticsFactory
parseStatistics
in interface OFStatisticsFactory
t
- OFMessage type: should be one of stats_request or stats_replyst
- statistics type of this message, e.g., DESC, TABLEdata
- buffer to read fromlength
- length of statisticslimit
- number of statistics to grab; 0 == allpublic OFVendorData getVendorData(OFVendorId vendorId, OFVendorDataType vendorDataType)
OFVendorDataFactory
getVendorData
in interface OFVendorDataFactory
vendorId
- the vendorId of the containing OFVendor messagevendorDataType
- the type of the OFVendorData to be retrievedpublic OFVendorData parseVendorData(int vendor, org.jboss.netty.buffer.ChannelBuffer data, int length)
parseVendorData
in interface OFVendorDataFactory
vendor
- the vendor id that was parsed from the OFVendor message.data
- the ChannelBuffer from which to parse the vendor datalength
- the length to the end of the enclosing message.public static String dumpBuffer(org.jboss.netty.buffer.ChannelBuffer data)
Copyright © 2015. All rights reserved.