net.floodlightcontroller.debugevent
Class NullDebugEvent

java.lang.Object
  extended by net.floodlightcontroller.debugevent.NullDebugEvent
All Implemented Interfaces:
IFloodlightModule, IFloodlightService, IDebugEventService

public class NullDebugEvent
extends java.lang.Object
implements IFloodlightModule, IDebugEventService


Nested Class Summary
 class NullDebugEvent.NullEventImpl<T>
           
 
Nested classes/interfaces inherited from interface net.floodlightcontroller.debugevent.IDebugEventService
IDebugEventService.DebugEventInfo, IDebugEventService.EventColumn, IDebugEventService.EventFieldType, IDebugEventService.EventType, IDebugEventService.MaxEventsRegistered
 
Field Summary
 
Fields inherited from interface net.floodlightcontroller.debugevent.IDebugEventService
EV_MDATA_ERROR, EV_MDATA_WARN, MAX_EVENTS
 
Constructor Summary
NullDebugEvent()
           
 
Method Summary
 boolean containsModuleEventName(java.lang.String moduleName, java.lang.String eventName)
          Determine if eventName is a registered event for a given moduleName
 boolean containsModuleName(java.lang.String moduleName)
          Determine if any events have been registered for module of name moduleName
 void flushEvents()
          Update the global event stores with values from the thread local stores.
 java.util.List<IDebugEventService.DebugEventInfo> getAllEventHistory()
          Get event history for all events.
 java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
          Get a list of Modules that this module depends on.
 java.util.List<IDebugEventService.DebugEventInfo> getModuleEventHistory(java.lang.String param)
          Get event history for all events registered for a given moduleName
 java.util.List<java.lang.String> getModuleEventList(java.lang.String moduleName)
          Returns a list of all events registered for a specific moduleName or a empty list
 java.util.List<java.lang.String> getModuleList()
          Retrieve a list of moduleNames registered for debug events or an empty list if no events have been registered in the system
 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.
 IDebugEventService.DebugEventInfo getSingleEventHistory(java.lang.String moduleName, java.lang.String eventName, int last)
          Get event history for a single event
 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.
<T> IEventUpdater<T>
registerEvent(java.lang.String moduleName, java.lang.String eventName, java.lang.String eventDescription, IDebugEventService.EventType eventType, java.lang.Class<T> eventClass, int bufferCapacity, java.lang.String... metaData)
          Register an event for debugging.
 void resetAllEvents()
          Wipe out all event history for all registered events
 void resetAllModuleEvents(java.lang.String moduleName)
          Wipe out all event history for all events registered for a specific module
 void resetSingleEvent(java.lang.String moduleName, java.lang.String eventName)
          Wipe out event history for a single event
 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
 

Constructor Detail

NullDebugEvent

public NullDebugEvent()
Method Detail

flushEvents

public void flushEvents()
Description copied from interface: IDebugEventService
Update the global event stores with values from the thread local stores. This method is not typically intended for use by any module. It's typical usage is from floodlight core for events that happen in the packet processing pipeline. For other rare events, flushEvents should be called.

Specified by:
flushEvents in interface IDebugEventService

getModuleServices

public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleServices()
Description copied from interface: IFloodlightModule
Return the list of interfaces that this module implements. All interfaces must inherit IFloodlightService

Specified by:
getModuleServices in interface IFloodlightModule
Returns:

getServiceImpls

public java.util.Map<java.lang.Class<? extends IFloodlightService>,IFloodlightService> getServiceImpls()
Description copied from interface: IFloodlightModule
Instantiate (as needed) and return objects that implement each of the services exported by this module. The map returned maps the implemented service to the object. The object could be the same object or different objects for different exported services.

Specified by:
getServiceImpls in interface IFloodlightModule
Returns:
The map from service interface class to service implementation

getModuleDependencies

public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
Description copied from interface: IFloodlightModule
Get a list of Modules that this module depends on. The module system will ensure that each these dependencies is resolved before the subsequent calls to init().

Specified by:
getModuleDependencies in interface IFloodlightModule
Returns:
The Collection of IFloodlightServices that this module depends on.

init

public void init(FloodlightModuleContext context)
          throws FloodlightModuleException
Description copied from interface: IFloodlightModule
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.

Specified by:
init in interface IFloodlightModule
Throws:
FloodlightModuleException

startUp

public void startUp(FloodlightModuleContext context)
             throws FloodlightModuleException
Description copied from interface: IFloodlightModule
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.

Specified by:
startUp in interface IFloodlightModule
Throws:
FloodlightModuleException

containsModuleEventName

public boolean containsModuleEventName(java.lang.String moduleName,
                                       java.lang.String eventName)
Description copied from interface: IDebugEventService
Determine if eventName is a registered event for a given moduleName

Specified by:
containsModuleEventName in interface IDebugEventService

containsModuleName

public boolean containsModuleName(java.lang.String moduleName)
Description copied from interface: IDebugEventService
Determine if any events have been registered for module of name moduleName

Specified by:
containsModuleName in interface IDebugEventService

getAllEventHistory

public java.util.List<IDebugEventService.DebugEventInfo> getAllEventHistory()
Description copied from interface: IDebugEventService
Get event history for all events. This call can be expensive as it formats the event histories for all events.

Specified by:
getAllEventHistory in interface IDebugEventService
Returns:
a list of all event histories or an empty list if no events have been registered

getModuleEventHistory

public java.util.List<IDebugEventService.DebugEventInfo> getModuleEventHistory(java.lang.String param)
Description copied from interface: IDebugEventService
Get event history for all events registered for a given moduleName

Specified by:
getModuleEventHistory in interface IDebugEventService
Returns:
a list of all event histories for all events registered for the the module or an empty list if there are no events for this module

getSingleEventHistory

public IDebugEventService.DebugEventInfo getSingleEventHistory(java.lang.String moduleName,
                                                               java.lang.String eventName,
                                                               int last)
Description copied from interface: IDebugEventService
Get event history for a single event

Specified by:
getSingleEventHistory in interface IDebugEventService
Parameters:
moduleName - registered module name
eventName - registered event name for moduleName
last - last X events
Returns:
DebugEventInfo for that event, or null if the moduleEventName does not correspond to a registered event.

resetAllEvents

public void resetAllEvents()
Description copied from interface: IDebugEventService
Wipe out all event history for all registered events

Specified by:
resetAllEvents in interface IDebugEventService

resetAllModuleEvents

public void resetAllModuleEvents(java.lang.String moduleName)
Description copied from interface: IDebugEventService
Wipe out all event history for all events registered for a specific module

Specified by:
resetAllModuleEvents in interface IDebugEventService
Parameters:
moduleName - registered module name

resetSingleEvent

public void resetSingleEvent(java.lang.String moduleName,
                             java.lang.String eventName)
Description copied from interface: IDebugEventService
Wipe out event history for a single event

Specified by:
resetSingleEvent in interface IDebugEventService
Parameters:
moduleName - registered module name
eventName - registered event name for moduleName

registerEvent

public <T> IEventUpdater<T> registerEvent(java.lang.String moduleName,
                                          java.lang.String eventName,
                                          java.lang.String eventDescription,
                                          IDebugEventService.EventType eventType,
                                          java.lang.Class<T> eventClass,
                                          int bufferCapacity,
                                          java.lang.String... metaData)
                               throws IDebugEventService.MaxEventsRegistered
Description copied from interface: IDebugEventService
Register an event for debugging.

Specified by:
registerEvent in interface IDebugEventService
Parameters:
moduleName - module registering event eg. linkdiscovery, virtualrouting.
eventName - name given to event.
eventDescription - A descriptive string describing the event.
eventType - EventType for this event. On-demand events have to be explicitly enabled using other methods in this API
eventClass - A user defined class that annotates the fields with @EventColumn. This class specifies the fields/columns for this event.
bufferCapacity - Number of events to store for this event in a circular buffer. Older events will be discarded once the buffer is full.
metaData - variable arguments that qualify an event eg. EV_MDATA_WARN, EV_MDATA_ERROR etc. See Debug Event Qualifiers
Returns:
IEventUpdater with update methods that can be used to update an event of the given eventClass
Throws:
IDebugEventService.MaxEventsRegistered

getModuleList

public java.util.List<java.lang.String> getModuleList()
Description copied from interface: IDebugEventService
Retrieve a list of moduleNames registered for debug events or an empty list if no events have been registered in the system

Specified by:
getModuleList in interface IDebugEventService

getModuleEventList

public java.util.List<java.lang.String> getModuleEventList(java.lang.String moduleName)
Description copied from interface: IDebugEventService
Returns a list of all events registered for a specific moduleName or a empty list

Specified by:
getModuleEventList in interface IDebugEventService