net.floodlightcontroller.counter
Class NullCounterStore

java.lang.Object
  extended by net.floodlightcontroller.counter.NullCounterStore
All Implemented Interfaces:
IFloodlightModule, IFloodlightService, ICounterStoreService

public class NullCounterStore
extends java.lang.Object
implements IFloodlightModule, ICounterStoreService

An ICounsterStoreService implementation that does nothing. This is used mainly for performance testing or if you don't want to use the counterstore.

Author:
alexreimers

Field Summary
 
Fields inherited from interface net.floodlightcontroller.counter.ICounterStoreService
BROADCAST, CONTROLLER_NAME, L3ET_IPV4, MULTICAST, TitleDelimitor, UNICAST
 
Constructor Summary
NullCounterStore()
           
 
Method Summary
 ICounter createCounter(java.lang.String key, CounterValue.CounterType type)
          Create a new ICounter and set the title.
 java.util.Map<java.lang.String,ICounter> getAll()
          Returns an immutable map of title:counter with all of the counters in the store.
 java.util.List<java.lang.String> getAllCategories(java.lang.String counterName, CounterStore.NetworkLayer layer)
          Retrieve a list of subCategories by counterName.
 ICounter getCounter(java.lang.String key)
          Retrieves a counter with the given title, or null if none can be found.
 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.
 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.
 void updateFlush()
          Flush Local Counter Updates
 void updatePacketInCountersLocal(IOFSwitch sw, OFMessage m, Ethernet eth)
          Update packetIn counters
 void updatePktOutFMCounterStoreLocal(IOFSwitch sw, OFMessage ofMsg)
          This method can only be used to update packetOut and flowmod counters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullCounterStore

public NullCounterStore()
Method Detail

updatePacketInCountersLocal

public void updatePacketInCountersLocal(IOFSwitch sw,
                                        OFMessage m,
                                        Ethernet eth)
Description copied from interface: ICounterStoreService
Update packetIn counters

Specified by:
updatePacketInCountersLocal in interface ICounterStoreService

updatePktOutFMCounterStoreLocal

public void updatePktOutFMCounterStoreLocal(IOFSwitch sw,
                                            OFMessage ofMsg)
Description copied from interface: ICounterStoreService
This method can only be used to update packetOut and flowmod counters

Specified by:
updatePktOutFMCounterStoreLocal in interface ICounterStoreService

updateFlush

public void updateFlush()
Description copied from interface: ICounterStoreService
Flush Local Counter Updates

Specified by:
updateFlush in interface ICounterStoreService

getAllCategories

public java.util.List<java.lang.String> getAllCategories(java.lang.String counterName,
                                                         CounterStore.NetworkLayer layer)
Description copied from interface: ICounterStoreService
Retrieve a list of subCategories by counterName. null if nothing.

Specified by:
getAllCategories in interface ICounterStoreService

createCounter

public ICounter createCounter(java.lang.String key,
                              CounterValue.CounterType type)
Description copied from interface: ICounterStoreService
Create a new ICounter and set the title. Note that the title must be unique, otherwise this will throw an IllegalArgumentException.

Specified by:
createCounter in interface ICounterStoreService
Returns:

getCounter

public ICounter getCounter(java.lang.String key)
Description copied from interface: ICounterStoreService
Retrieves a counter with the given title, or null if none can be found.

Specified by:
getCounter in interface ICounterStoreService

getAll

public java.util.Map<java.lang.String,ICounter> getAll()
Description copied from interface: ICounterStoreService
Returns an immutable map of title:counter with all of the counters in the store. (Note - this method may be slow - primarily for debugging/UI)

Specified by:
getAll in interface ICounterStoreService

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)
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