org.openflow.protocol.factory
Class FloodlightFactory

java.lang.Object
  extended by org.openflow.protocol.factory.BasicFactory
      extended by org.openflow.protocol.factory.FloodlightFactory
All Implemented Interfaces:
OFActionFactory, OFHelloElementFactory, OFInstructionFactory, OFMessageFactory, OFMeterBandFactory, OFQueuePropertyFactory, OFStatisticsFactory, OFTableFeaturesPropertyFactory, OFVendorDataFactory

public class FloodlightFactory
extends BasicFactory
implements OFVendorDataFactory

the extended floodlight factory that supports vendor factories.

Author:
Srini Seetharaman (srini.seetharaman@gmail.com)

Method Summary
static java.lang.String dumpBuffer(java.nio.ByteBuffer data)
           
static FloodlightFactory getInstance()
           
 OFVendorData getVendorData(OFVendorId vendorId, OFVendorDataType vendorDataType)
          Retrieves an OFVendorData instance corresponding to the specified OFVendorId and OFVendorDataType.
protected  void injectFactories(OFMessage ofm)
           
 java.util.List<OFAction> parseActions(java.nio.ByteBuffer 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.
 OFVendorData parseVendorData(int vendor, java.nio.ByteBuffer data, int length)
          Attempts to parse and return the OFVendorData contained in the given ChannelBuffer, beginning right after the vendor id.
 
Methods inherited from class org.openflow.protocol.factory.BasicFactory
getAction, getActionFactory, getHelloElement, getInstruction, getInstructionFactory, getMessage, getMeterBand, getQueueProperty, getStatistics, getTableFeaturesProperty, parseActions, parseHelloElements, parseHelloElements, parseInstructions, parseInstructions, parseMessages, parseMessages, parseMeterBands, parseMeterBands, parseQueueProperties, parseQueueProperties, parseStatistics, parseStatistics, parseTableFeaturesProperties, parseTableFeaturesProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static FloodlightFactory getInstance()

injectFactories

protected void injectFactories(OFMessage ofm)
Overrides:
injectFactories in class BasicFactory

parseActions

public java.util.List<OFAction> parseActions(java.nio.ByteBuffer data,
                                             int length,
                                             int limit)
Description copied from interface: OFActionFactory
Attempts to parse and return all OFActions contained in the given ByteBuffer, beginning at the ByteBuffer's position, and ending at position+length.

Specified by:
parseActions in interface OFActionFactory
Overrides:
parseActions in class BasicFactory
Parameters:
data - the ByteBuffer to parse for OpenFlow actions
length - the number of Bytes to examine for OpenFlow actions
limit - the maximum number of messages to return, 0 means no limit
Returns:
a list of OFAction instances

getVendorData

public OFVendorData getVendorData(OFVendorId vendorId,
                                  OFVendorDataType vendorDataType)
Description copied from interface: OFVendorDataFactory
Retrieves an OFVendorData instance corresponding to the specified OFVendorId and OFVendorDataType. There are 3 possible cases for how this will be called: 1) If the vendor id in the OFVendor message is an unknown value, then this method is called with both vendorId and vendorDataType set to null. In this case typically the factory method should return an instance of OFGenericVendorData that just contains the raw byte array of the vendor data. 2) If the vendor id is known but no vendor data type has been registered for the data in the message, then vendorId is set to the appropriate OFVendorId instance and OFVendorDataType is set to null. This would typically be handled the same way as #1 3) If both the vendor id and and vendor data type are known, then typically you'd just call the method in OFVendorDataType to instantiate the appropriate subclass of OFVendorData.

Specified by:
getVendorData in interface OFVendorDataFactory
Parameters:
vendorId - the vendorId of the containing OFVendor message
vendorDataType - the type of the OFVendorData to be retrieved
Returns:
an OFVendorData instance

parseVendorData

public OFVendorData parseVendorData(int vendor,
                                    java.nio.ByteBuffer data,
                                    int length)
Attempts to parse and return the OFVendorData contained in the given ChannelBuffer, beginning right after the vendor id.

Specified by:
parseVendorData in interface OFVendorDataFactory
Parameters:
vendor - the vendor id that was parsed from the OFVendor message.
data - the ChannelBuffer from which to parse the vendor data
length - the length to the end of the enclosing message.
Returns:
an OFVendorData instance

dumpBuffer

public static java.lang.String dumpBuffer(java.nio.ByteBuffer data)