|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.floodlightcontroller.devicemanager.internal.DefaultEntityClassifier
public class DefaultEntityClassifier
This is a default entity classifier that simply classifies all entities into a fixed entity class, with key fields of MAC and VLAN.
Nested Class Summary | |
---|---|
protected static class |
DefaultEntityClassifier.DefaultEntityClass
A default fixed entity class |
Field Summary | |
---|---|
protected static DefaultEntityClassifier.DefaultEntityClass |
entityClass
|
protected static java.util.EnumSet<IDeviceService.DeviceField> |
keyFields
|
Constructor Summary | |
---|---|
DefaultEntityClassifier()
|
Method Summary | |
---|---|
void |
addListener(IEntityClassListener listener)
Adds a listener to listen for IEntityClassifierServices notifications |
IEntityClass |
classifyEntity(Entity entity)
Classify the given entity into an IEntityClass. |
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()
Return the most general list of fields that should be used as key fields. |
java.util.Collection<java.lang.Class<? extends IFloodlightService>> |
getModuleDependencies()
Get a list of Modules that this module depends on. |
java.util.Collection<java.lang.Class<? extends IFloodlightService>> |
getModuleServices()
Return the list of interfaces that this module implements. |
java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> |
getServiceImpls()
Instantiate (as needed) and return objects that implement each of the services exported by this module. |
void |
init(FloodlightModuleContext context)
This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized. |
IEntityClass |
reclassifyEntity(IDevice curDevice,
Entity entity)
Reclassify the given entity into a class. |
void |
startUp(FloodlightModuleContext context)
This is a hook for each module to do its external initializations, e.g., register for callbacks or query for state in other modules It is expected that this function will not block and that modules that want non-event driven CPU will spawn their own threads. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.EnumSet<IDeviceService.DeviceField> keyFields
protected static DefaultEntityClassifier.DefaultEntityClass entityClass
Constructor Detail |
---|
public DefaultEntityClassifier()
Method Detail |
---|
public IEntityClass classifyEntity(Entity entity)
IEntityClassifierService
IEntityClassifierService.getKeyFields()
be sufficient for classifying entities. That is, if two entities are
identical except for a field that is not a key field, they must be
assigned the same class. Furthermore, entity classification must be
transitive: For all entities x, y, z, if x and y belong to a class c, and
y and z belong class c, then x and z must belong to class c.
classifyEntity
in interface IEntityClassifierService
entity
- the entity to classify
IEntityClassifierService.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 reclassify
public 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()
IEntityClassifierService
IEntityClass
returned by IEntityClassifierService.classifyEntity(net.floodlightcontroller.devicemanager.internal.Entity)
. The key fields
for an entity classifier must not change unless associated with a
flush of all entity state. The list of key fields must be the union
of all key fields that could be returned by
IEntityClass.getKeyFields()
.
getKeyFields
in interface IEntityClassifierService
IEntityClass#getKeyFields()}
,
IEntityClassifierService#classifyEntity}
public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
IFloodlightModule
getModuleServices
in interface IFloodlightModule
public java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
IFloodlightModule
getServiceImpls
in interface IFloodlightModule
public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
IFloodlightModule
getModuleDependencies
in interface IFloodlightModule
public void init(FloodlightModuleContext context) throws FloodlightModuleException
IFloodlightModule
init
in interface IFloodlightModule
FloodlightModuleException
public void startUp(FloodlightModuleContext context)
IFloodlightModule
startUp
in interface IFloodlightModule
public void addListener(IEntityClassListener listener)
IEntityClassifierService
addListener
in interface IEntityClassifierService
listener
- The listener that wants the notifications
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |