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, registerModule
private static java.util.EnumSet<IDeviceService.DeviceField> keyFields
private static OFMDefaultEntityClassifier.DefaultEntityClass entityClass
public IEntityClass classifyEntity(Entity entity)
classifyEntity
in interface IEntityClassifierService
entity
- entity to classifyIEntityClassifierService.getKeyFields()
public IEntityClass reclassifyEntity(IDevice curDevice, Entity entity)
IEntityClassifierService
Note that you must take steps to ensure you always return classes in some consistent ordering.
reclassifyEntity
in interface IEntityClassifierService
curDevice
- the device currently associated with the entityentity
- the entity to reclassifypublic void deviceUpdate(IDevice oldDevice, java.util.Collection<? extends IDevice> newDevices)
IEntityClassifierService
deviceUpdate
in interface IEntityClassifierService
oldDevice
- 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 IEntityClassifierService
IEntityClass.getKeyFields()
,
IEntityClassifierService.classifyEntity(Entity entity)
public void addListener(IEntityClassListener listener)
IEntityClassifierService
addListener
in interface IEntityClassifierService
listener
- The listener that wants the notificationsprotected void initialize()
OFModule
OFMLinkDiscovery.initialize()
.initialize
in class OFModule
protected boolean handleHandshakedEvent(Connection conn, MessageContext context)
OFModule
OFModule.processHandshakeFinished(Connection, MessageContext)
.
Normally, most of modules have very simple implementation for this method,
only returning true.handleHandshakedEvent
in class OFModule
conn
- 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)
OFModule
OFModule.processMessage(Connection, MessageContext, OFMessage, List)
.handleMessage
in class OFModule
conn
- 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)
OFModule
OFModule.processDisconnect(Connection)
.
All subclasses of OFModule should implement this method.handleDisconnect
in class OFModule
conn
- connection that the event has occurred