org.openflow.protocol.factory
Interface OFVendorDataFactory

All Known Implementing Classes:
FloodlightFactory

public interface OFVendorDataFactory

The interface to factories used for parsing/creating OFVendorData instances. All methods are expected to be thread-safe.

Author:
Rob Vaterlaus (rob.vaterlaus@bigswitch.com)

Method Summary
 OFVendorData getVendorData(OFVendorId vendorId, OFVendorDataType vendorDataType)
          Retrieves an OFVendorData instance corresponding to the specified OFVendorId and OFVendorDataType.
 OFVendorData parseVendorData(int vendorId, java.nio.ByteBuffer data, int length)
          Attempts to parse and return the OFVendorData contained in the given ByteBuffer, beginning right after the vendor id.
 

Method Detail

getVendorData

OFVendorData getVendorData(OFVendorId vendorId,
                           OFVendorDataType vendorDataType)
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.

Parameters:
vendorId - the vendorId of the containing OFVendor message
vendorDataType - the type of the OFVendorData to be retrieved
Returns:
an OFVendorData instance

parseVendorData

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

Parameters:
vendorId - the vendor id that was parsed from the OFVendor message.
data - the ByteBuffer from which to parse the vendor data
length - the length to the end of the enclosing message.
Returns:
an OFVendorData instance