org.openflow.protocol.vendor
Class OFVendorId

java.lang.Object
  extended by org.openflow.protocol.vendor.OFVendorId
Direct Known Subclasses:
OFBasicVendorId

public abstract class OFVendorId
extends java.lang.Object

Base class for the vendor ID corresponding to vendor extensions from a given vendor. It is responsible for knowing how to parse out some sort of data type value from the vendor data in an OFVendor message so that we can dispatch to the different subclasses of OFVendorData corresponding to the different formats of data for the vendor extensions.

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

Field Summary
protected  int id
          The vendor id value, typically the OUI of the vendor prefixed with 0.
 
Constructor Summary
OFVendorId(int id)
          Create an OFVendorId with the give vendor id value
 
Method Summary
 int getId()
           
static OFVendorId lookupVendorId(int id)
          Lookup the OFVendorId instance corresponding to the given id value.
abstract  OFVendorDataType parseVendorDataType(java.nio.ByteBuffer data, int length)
          This function parses enough of the data from the channel buffer to be able to determine the appropriate OFVendorDataType for the data.
static void registerVendorId(OFVendorId vendorId)
          Register a new vendor id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected int id
The vendor id value, typically the OUI of the vendor prefixed with 0.

Constructor Detail

OFVendorId

public OFVendorId(int id)
Create an OFVendorId with the give vendor id value

Parameters:
id -
Method Detail

registerVendorId

public static void registerVendorId(OFVendorId vendorId)
Register a new vendor id.

Parameters:
vendorId - the vendor id to register

lookupVendorId

public static OFVendorId lookupVendorId(int id)
Lookup the OFVendorId instance corresponding to the given id value.

Parameters:
id - the integer vendor id value
Returns:
the corresponding OFVendorId that's been registered for the given value, or null if there id has not been registered.

getId

public int getId()
Returns:
the vendor id value

parseVendorDataType

public abstract OFVendorDataType parseVendorDataType(java.nio.ByteBuffer data,
                                                     int length)
This function parses enough of the data from the channel buffer to be able to determine the appropriate OFVendorDataType for the data.

Parameters:
data - the channel buffer containing the vendor data.
length - the length to the end of the enclosing message
Returns:
the OFVendorDataType that can be used to instantiate the appropriate subclass of OFVendorData.