public final class OFMDefaultEntityClassifier extends OFModule implements IEntityClassifierService
| Modifier and Type | Class and Description |
|---|---|
private static class |
OFMDefaultEntityClassifier.DefaultEntityClass
A default fixed entity class
|
| Modifier and Type | Field and Description |
|---|---|
private static OFMDefaultEntityClassifier.DefaultEntityClass |
entityClass |
private static java.util.EnumSet<IDeviceService.DeviceField> |
keyFields |
controller| Constructor and Description |
|---|
OFMDefaultEntityClassifier() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IEntityClassListener listener)
Adds a listener to listen for IEntityClassifierServices notifications
|
IEntityClass |
classifyEntity(Entity entity)
This choose a proper IEntityClass object to which the entity belongs.
|
void |
deviceUpdate(IDevice oldDevice,
java.util.Collection<? extends IDevice> newDevices)
Once reclassification is complete for a device, this method will be
called.
|
java.util.EnumSet<IDeviceService.DeviceField> |
getKeyFields()
Returns the primary key-fields to classify entities.
|
OFModel[] |
getModels()
returns the array of all
OFModel objects associated with this module. |
protected boolean |
handleDisconnect(Connection conn)
Process the disconnection event from a switch.
|
protected boolean |
handleHandshakedEvent(Connection conn,
MessageContext context)
An abstract method that all subclasses should implement.
|
protected boolean |
handleMessage(Connection conn,
MessageContext context,
org.openflow.protocol.OFMessage msg,
java.util.List<org.openflow.protocol.OFMessage> outgoing)
Handle incoming messages that pass the test of filters.
|
protected void |
initialize()
method that initializes this module.
|
IEntityClass |
reclassifyEntity(IDevice curDevice,
Entity entity)
Reclassifies the given entity into a class.
|
getController, getModule, init, processDisconnect, processHandshakeFinished, processMessage, registerFilter, registerModuleprivate static java.util.EnumSet<IDeviceService.DeviceField> keyFields
private static OFMDefaultEntityClassifier.DefaultEntityClass entityClass
public IEntityClass classifyEntity(Entity entity)
classifyEntity in interface IEntityClassifierServiceentity - entity to classifyIEntityClassifierService.getKeyFields()public IEntityClass reclassifyEntity(IDevice curDevice, Entity entity)
IEntityClassifierServiceNote that you must take steps to ensure you always return classes in some consistent ordering.
reclassifyEntity in interface IEntityClassifierServicecurDevice - the device currently associated with the entityentity - the entity to reclassifypublic void deviceUpdate(IDevice oldDevice, java.util.Collection<? extends IDevice> newDevices)
IEntityClassifierServicedeviceUpdate in interface IEntityClassifierServiceoldDevice - the original device objectnewDevices - all the new devices derived from the entities of the old device.
If null, the old device was unchanged.public java.util.EnumSet<IDeviceService.DeviceField> getKeyFields()
getKeyFields in interface IEntityClassifierServiceIEntityClass.getKeyFields(),
IEntityClassifierService.classifyEntity(Entity entity)public void addListener(IEntityClassListener listener)
IEntityClassifierServiceaddListener in interface IEntityClassifierServicelistener - The listener that wants the notificationsprotected void initialize()
OFModuleOFMLinkDiscovery.initialize().initialize in class OFModuleprotected boolean handleHandshakedEvent(Connection conn, MessageContext context)
OFModuleOFModule.processHandshakeFinished(Connection, MessageContext).
Normally, most of modules have very simple implementation for this method,
only returning true.handleHandshakedEvent in class OFModuleconn - connection that the event has occurredcontext - message context for the handshaking messagesprotected boolean handleMessage(Connection conn, MessageContext context, org.openflow.protocol.OFMessage msg, java.util.List<org.openflow.protocol.OFMessage> outgoing)
OFModuleOFModule.processMessage(Connection, MessageContext, OFMessage, List).handleMessage in class OFModuleconn - connection that the message has arrivedcontext - message context for the messagemsg - the actual message objectoutgoing - responses for the message arrived, which is filled by the handleMessage implementationprotected boolean handleDisconnect(Connection conn)
OFModuleOFModule.processDisconnect(Connection).
All subclasses of OFModule should implement this method.handleDisconnect in class OFModuleconn - connection that the event has occurred