net.floodlightcontroller.storage
Class AbstractStorageSource

java.lang.Object
  extended by net.floodlightcontroller.storage.AbstractStorageSource
All Implemented Interfaces:
IFloodlightModule, IFloodlightService, IStorageSourceService
Direct Known Subclasses:
NoSqlStorageSource

public abstract class AbstractStorageSource
extends java.lang.Object
implements IStorageSourceService, IFloodlightModule


Field Summary
protected  java.util.Set<java.lang.String> allTableNames
           
protected  ICounterStoreService counterStore
           
protected static java.lang.String DB_ERROR_EXPLANATION
           
protected static java.util.concurrent.ExecutorService defaultExecutorService
           
protected  IStorageExceptionHandler exceptionHandler
           
protected  java.util.concurrent.ExecutorService executorService
           
protected static org.slf4j.Logger logger
           
protected  IRestApiService restApi
           
protected static java.lang.String STORAGE_DELETE_COUNTER_NAME
           
protected static java.lang.String STORAGE_QUERY_COUNTER_NAME
           
protected static java.lang.String STORAGE_UPDATE_COUNTER_NAME
           
 
Constructor Summary
AbstractStorageSource()
           
 
Method Summary
 void addListener(java.lang.String tableName, IStorageSourceListener listener)
          Add a listener to the specified table.
abstract  IQuery createQuery(java.lang.String tableName, java.lang.String[] columnNames, IPredicate predicate, RowOrdering ordering)
          Create a query object representing the given query parameters.
 void createTable(java.lang.String tableName, java.util.Set<java.lang.String> indexedColumns)
          Create a new table if one does not already exist with the given name.
 void deleteMatchingRows(java.lang.String tableName, IPredicate predicate)
          Delete the rows that match the predicate
 java.util.concurrent.Future<?> deleteMatchingRowsAsync(java.lang.String tableName, IPredicate predicate)
          Asynchronous version of deleteRows
 void deleteRow(java.lang.String tableName, java.lang.Object rowKey)
          Delete the row with the given primary key.
 java.util.concurrent.Future<?> deleteRowAsync(java.lang.String tableName, java.lang.Object rowKey)
          Asynchronous version of deleteRow
protected abstract  void deleteRowImpl(java.lang.String tableName, java.lang.Object rowKey)
           
 void deleteRows(java.lang.String tableName, java.util.Set<java.lang.Object> rowKeys)
          Delete the rows with the given keys.
 java.util.concurrent.Future<?> deleteRowsAsync(java.lang.String tableName, java.util.Set<java.lang.Object> rowKeys)
          Asynchronous version of deleteRows
protected abstract  void deleteRowsImpl(java.lang.String tableName, java.util.Set<java.lang.Object> rowKeys)
           
 IResultSet executeQuery(IQuery query)
          Execute a query created with createQuery.
 IResultSet executeQuery(java.lang.String tableName, java.lang.String[] columnNames, IPredicate predicate, RowOrdering ordering)
          Execute a query created with the given query parameters.
 java.lang.Object[] executeQuery(java.lang.String tableName, java.lang.String[] columnNames, IPredicate predicate, RowOrdering ordering, IRowMapper rowMapper)
          Execute a query and call the row mapper to map the results to Java objects.
 java.util.concurrent.Future<IResultSet> executeQueryAsync(IQuery query)
          Asynchronous variant of executeQuery.
 java.util.concurrent.Future<IResultSet> executeQueryAsync(java.lang.String tableName, java.lang.String[] columnNames, IPredicate predicate, RowOrdering ordering)
          Asynchronous variant of executeQuery.
 java.util.concurrent.Future<java.lang.Object[]> executeQueryAsync(java.lang.String tableName, java.lang.String[] columnNames, IPredicate predicate, RowOrdering ordering, IRowMapper rowMapper)
          Asynchronous variant of executeQuery
protected abstract  IResultSet executeQueryImpl(IQuery query)
           
 java.util.Set<java.lang.String> getAllTableNames()
           
 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.
 IResultSet getRow(java.lang.String tableName, java.lang.Object rowKey)
          Query for a row with the given ID (primary key).
 java.util.concurrent.Future<?> getRowAsync(java.lang.String tableName, java.lang.Object rowKey)
          Asynchronous version of getRow
protected abstract  IResultSet getRowImpl(java.lang.String tableName, java.lang.Object rowKey)
           
 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 insertRow(java.lang.String tableName, java.util.Map<java.lang.String,java.lang.Object> values)
          Insert a new row in the table with the given column data.
 java.util.concurrent.Future<?> insertRowAsync(java.lang.String tableName, java.util.Map<java.lang.String,java.lang.Object> values)
          Asynchronous variant of insertRow.
protected abstract  void insertRowImpl(java.lang.String tableName, java.util.Map<java.lang.String,java.lang.Object> values)
           
 void notifyListeners(java.util.List<StorageSourceNotification> notifications)
          This is logically a private method and should not be called by clients of this interface.
protected  void notifyListeners(StorageSourceNotification notification)
           
 void removeListener(java.lang.String tableName, IStorageSourceListener listener)
          Remove a listener from the specified table.
 java.util.concurrent.Future<?> saveAsync(IResultSet resultSet)
          Asynchronous version of save
 void setCounterStore(CounterStore counterStore)
           
 void setExceptionHandler(IStorageExceptionHandler exceptionHandler)
          Set exception handler to use for asynchronous operations.
 void setExecutorService(java.util.concurrent.ExecutorService executorService)
           
abstract  void setTablePrimaryKeyName(java.lang.String tableName, java.lang.String primaryKeyName)
          Set the column to be used as the primary key for a table.
 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.
protected  void updateCounters(java.lang.String baseName, java.lang.String tableName)
           
 void updateMatchingRows(java.lang.String tableName, IPredicate predicate, java.util.Map<java.lang.String,java.lang.Object> values)
          Update the rows in the given table.
 java.util.concurrent.Future<?> updateMatchingRowsAsync(java.lang.String tableName, IPredicate predicate, java.util.Map<java.lang.String,java.lang.Object> values)
          Asynchronous variant of updateMatchingRows
protected abstract  void updateMatchingRowsImpl(java.lang.String tableName, IPredicate predicate, java.util.Map<java.lang.String,java.lang.Object> values)
           
 void updateRow(java.lang.String tableName, java.util.Map<java.lang.String,java.lang.Object> values)
          Update or insert a row in the table with the given column data.
 void updateRow(java.lang.String tableName, java.lang.Object rowKey, java.util.Map<java.lang.String,java.lang.Object> values)
          Update or insert a row in the table with the given row key (primary key) and column names/values.
 java.util.concurrent.Future<?> updateRowAsync(java.lang.String tableName, java.util.Map<java.lang.String,java.lang.Object> values)
          Asynchronous version of updateRow
 java.util.concurrent.Future<?> updateRowAsync(java.lang.String tableName, java.lang.Object rowKey, java.util.Map<java.lang.String,java.lang.Object> values)
          Asynchronous variant of updateRow
protected abstract  void updateRowImpl(java.lang.String tableName, java.util.Map<java.lang.String,java.lang.Object> values)
           
protected abstract  void updateRowImpl(java.lang.String tableName, java.lang.Object rowKey, java.util.Map<java.lang.String,java.lang.Object> values)
           
 void updateRows(java.lang.String tableName, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows)
          Update or insert a list of rows in the table.
 java.util.concurrent.Future<?> updateRowsAsync(java.lang.String tableName, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows)
          Asynchronous variant of updateRows
protected abstract  void updateRowsImpl(java.lang.String tableName, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.slf4j.Logger logger

defaultExecutorService

protected static java.util.concurrent.ExecutorService defaultExecutorService

STORAGE_QUERY_COUNTER_NAME

protected static final java.lang.String STORAGE_QUERY_COUNTER_NAME
See Also:
Constant Field Values

STORAGE_UPDATE_COUNTER_NAME

protected static final java.lang.String STORAGE_UPDATE_COUNTER_NAME
See Also:
Constant Field Values

STORAGE_DELETE_COUNTER_NAME

protected static final java.lang.String STORAGE_DELETE_COUNTER_NAME
See Also:
Constant Field Values

allTableNames

protected java.util.Set<java.lang.String> allTableNames

counterStore

protected ICounterStoreService counterStore

executorService

protected java.util.concurrent.ExecutorService executorService

exceptionHandler

protected IStorageExceptionHandler exceptionHandler

restApi

protected IRestApiService restApi

DB_ERROR_EXPLANATION

protected static final java.lang.String DB_ERROR_EXPLANATION
See Also:
Constant Field Values
Constructor Detail

AbstractStorageSource

public AbstractStorageSource()
Method Detail

setExecutorService

public void setExecutorService(java.util.concurrent.ExecutorService executorService)

setExceptionHandler

public void setExceptionHandler(IStorageExceptionHandler exceptionHandler)
Description copied from interface: IStorageSourceService
Set exception handler to use for asynchronous operations.

Specified by:
setExceptionHandler in interface IStorageSourceService

setTablePrimaryKeyName

public abstract void setTablePrimaryKeyName(java.lang.String tableName,
                                            java.lang.String primaryKeyName)
Description copied from interface: IStorageSourceService
Set the column to be used as the primary key for a table. This should be guaranteed to be unique for all of the rows in the table, although the storage API does not necessarily enforce this requirement. If no primary key name is specified for a table then the storage API assumes there is a column named "id" that is used as the primary key. In this case when a new row is inserted using the storage API and no id is specified explictly in the row data, the storage API automatically generates a unique ID (typically a UUID) for the id column. To work across all possible implementations of the storage API it is safest, though, to specify the primary key column explicitly. FIXME: It's sort of a kludge to have to specify the primary key column here. Ideally there would be some sort of metadata -- perhaps stored directly in the table, at least in the NoSQL case -- that the storage API could query to obtain the primary key info.

Specified by:
setTablePrimaryKeyName in interface IStorageSourceService
Parameters:
tableName - The name of the table for which we're setting the key
primaryKeyName - The name of column to be used as the primary key

createTable

public void createTable(java.lang.String tableName,
                        java.util.Set<java.lang.String> indexedColumns)
Description copied from interface: IStorageSourceService
Create a new table if one does not already exist with the given name.

Specified by:
createTable in interface IStorageSourceService
Parameters:
tableName - The name of the table to create.
indexedColumns - Which columns should be indexed

getAllTableNames

public java.util.Set<java.lang.String> getAllTableNames()
Specified by:
getAllTableNames in interface IStorageSourceService
Returns:
the set of all tables that have been created via createTable

setCounterStore

public void setCounterStore(CounterStore counterStore)

updateCounters

protected void updateCounters(java.lang.String baseName,
                              java.lang.String tableName)

createQuery

public abstract IQuery createQuery(java.lang.String tableName,
                                   java.lang.String[] columnNames,
                                   IPredicate predicate,
                                   RowOrdering ordering)
Description copied from interface: IStorageSourceService
Create a query object representing the given query parameters. The query object can be passed to executeQuery to actually perform the query and obtain a result set.

Specified by:
createQuery in interface IStorageSourceService
Parameters:
tableName - The name of the table to query.
columnNames - The list of columns to return in the result set.
predicate - The predicate that specifies which rows to return in the result set.
ordering - Specification of order that rows are returned from the result set returned from executing the query. If the ordering is null, then rows are returned in an implementation-specific order.
Returns:
Query object to be passed to executeQuery.

executeQuery

public IResultSet executeQuery(IQuery query)
Description copied from interface: IStorageSourceService
Execute a query created with createQuery.

Specified by:
executeQuery in interface IStorageSourceService
Parameters:
query - The query to execute
Returns:
The result set containing the rows/columns specified in the query.

executeQueryImpl

protected abstract IResultSet executeQueryImpl(IQuery query)

executeQuery

public IResultSet executeQuery(java.lang.String tableName,
                               java.lang.String[] columnNames,
                               IPredicate predicate,
                               RowOrdering ordering)
Description copied from interface: IStorageSourceService
Execute a query created with the given query parameters.

Specified by:
executeQuery in interface IStorageSourceService
Parameters:
tableName - The name of the table to query.
columnNames - The list of columns to return in the result set.
predicate - The predicate that specifies which rows to return in the result set.
ordering - Specification of order that rows are returned from the result set returned from executing the query. If the ordering is null, then rows are returned in an implementation-specific order.
Returns:
The result set containing the rows/columns specified in the query.

executeQuery

public java.lang.Object[] executeQuery(java.lang.String tableName,
                                       java.lang.String[] columnNames,
                                       IPredicate predicate,
                                       RowOrdering ordering,
                                       IRowMapper rowMapper)
Description copied from interface: IStorageSourceService
Execute a query and call the row mapper to map the results to Java objects.

Specified by:
executeQuery in interface IStorageSourceService
Parameters:
tableName - The name of the table to query.
columnNames - The list of columns to return in the result set.
predicate - The predicate that specifies which rows to return in the result set.
ordering - Specification of order that rows are returned from the result set returned from executing the query. If the ordering is null, then rows are returned in an implementation-specific order.
rowMapper - The client-supplied object that maps the data in a row in the result set to a client object.
Returns:
The result set containing the rows/columns specified in the query.

executeQueryAsync

public java.util.concurrent.Future<IResultSet> executeQueryAsync(IQuery query)
Description copied from interface: IStorageSourceService
Asynchronous variant of executeQuery.

Specified by:
executeQueryAsync in interface IStorageSourceService
Returns:

executeQueryAsync

public java.util.concurrent.Future<IResultSet> executeQueryAsync(java.lang.String tableName,
                                                                 java.lang.String[] columnNames,
                                                                 IPredicate predicate,
                                                                 RowOrdering ordering)
Description copied from interface: IStorageSourceService
Asynchronous variant of executeQuery.

Specified by:
executeQueryAsync in interface IStorageSourceService
Returns:

executeQueryAsync

public java.util.concurrent.Future<java.lang.Object[]> executeQueryAsync(java.lang.String tableName,
                                                                         java.lang.String[] columnNames,
                                                                         IPredicate predicate,
                                                                         RowOrdering ordering,
                                                                         IRowMapper rowMapper)
Description copied from interface: IStorageSourceService
Asynchronous variant of executeQuery

Specified by:
executeQueryAsync in interface IStorageSourceService
Returns:

insertRowAsync

public java.util.concurrent.Future<?> insertRowAsync(java.lang.String tableName,
                                                     java.util.Map<java.lang.String,java.lang.Object> values)
Description copied from interface: IStorageSourceService
Asynchronous variant of insertRow.

Specified by:
insertRowAsync in interface IStorageSourceService
Returns:

updateRowsAsync

public java.util.concurrent.Future<?> updateRowsAsync(java.lang.String tableName,
                                                      java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows)
Description copied from interface: IStorageSourceService
Asynchronous variant of updateRows

Specified by:
updateRowsAsync in interface IStorageSourceService

updateMatchingRowsAsync

public java.util.concurrent.Future<?> updateMatchingRowsAsync(java.lang.String tableName,
                                                              IPredicate predicate,
                                                              java.util.Map<java.lang.String,java.lang.Object> values)
Description copied from interface: IStorageSourceService
Asynchronous variant of updateMatchingRows

Specified by:
updateMatchingRowsAsync in interface IStorageSourceService
Returns:

updateRowAsync

public java.util.concurrent.Future<?> updateRowAsync(java.lang.String tableName,
                                                     java.lang.Object rowKey,
                                                     java.util.Map<java.lang.String,java.lang.Object> values)
Description copied from interface: IStorageSourceService
Asynchronous variant of updateRow

Specified by:
updateRowAsync in interface IStorageSourceService
Returns:

updateRowAsync

public java.util.concurrent.Future<?> updateRowAsync(java.lang.String tableName,
                                                     java.util.Map<java.lang.String,java.lang.Object> values)
Description copied from interface: IStorageSourceService
Asynchronous version of updateRow

Specified by:
updateRowAsync in interface IStorageSourceService
Returns:

deleteRowAsync

public java.util.concurrent.Future<?> deleteRowAsync(java.lang.String tableName,
                                                     java.lang.Object rowKey)
Description copied from interface: IStorageSourceService
Asynchronous version of deleteRow

Specified by:
deleteRowAsync in interface IStorageSourceService
Returns:

deleteRowsAsync

public java.util.concurrent.Future<?> deleteRowsAsync(java.lang.String tableName,
                                                      java.util.Set<java.lang.Object> rowKeys)
Description copied from interface: IStorageSourceService
Asynchronous version of deleteRows

Specified by:
deleteRowsAsync in interface IStorageSourceService
Returns:

deleteMatchingRowsAsync

public java.util.concurrent.Future<?> deleteMatchingRowsAsync(java.lang.String tableName,
                                                              IPredicate predicate)
Description copied from interface: IStorageSourceService
Asynchronous version of deleteRows

Specified by:
deleteMatchingRowsAsync in interface IStorageSourceService
Returns:

getRowAsync

public java.util.concurrent.Future<?> getRowAsync(java.lang.String tableName,
                                                  java.lang.Object rowKey)
Description copied from interface: IStorageSourceService
Asynchronous version of getRow

Specified by:
getRowAsync in interface IStorageSourceService
Returns:

saveAsync

public java.util.concurrent.Future<?> saveAsync(IResultSet resultSet)
Description copied from interface: IStorageSourceService
Asynchronous version of save

Specified by:
saveAsync in interface IStorageSourceService
Returns:

insertRow

public void insertRow(java.lang.String tableName,
                      java.util.Map<java.lang.String,java.lang.Object> values)
Description copied from interface: IStorageSourceService
Insert a new row in the table with the given column data. If the primary key is the default value of "id" and is not specified in the then a unique id will be automatically assigned to the row.

Specified by:
insertRow in interface IStorageSourceService
Parameters:
tableName - The name of the table to which to add the row
values - The map of column names/values to add to the table.

insertRowImpl

protected abstract void insertRowImpl(java.lang.String tableName,
                                      java.util.Map<java.lang.String,java.lang.Object> values)

updateRows

public void updateRows(java.lang.String tableName,
                       java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows)
Description copied from interface: IStorageSourceService
Update or insert a list of rows in the table. The primary key must be included in the map of values for each row.

Specified by:
updateRows in interface IStorageSourceService
Parameters:
tableName - The table to update or insert into

updateRowsImpl

protected abstract void updateRowsImpl(java.lang.String tableName,
                                       java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows)

updateMatchingRows

public void updateMatchingRows(java.lang.String tableName,
                               IPredicate predicate,
                               java.util.Map<java.lang.String,java.lang.Object> values)
Description copied from interface: IStorageSourceService
Update the rows in the given table. Any rows matching the predicate are updated with the column names/values specified in the values map. (The values map should not contain the special column "id".)

Specified by:
updateMatchingRows in interface IStorageSourceService
Parameters:
tableName - The table to update
predicate - The predicate to use to select which rows to update
values - The map of column names/values to update the rows.

updateMatchingRowsImpl

protected abstract void updateMatchingRowsImpl(java.lang.String tableName,
                                               IPredicate predicate,
                                               java.util.Map<java.lang.String,java.lang.Object> values)

updateRow

public void updateRow(java.lang.String tableName,
                      java.lang.Object rowKey,
                      java.util.Map<java.lang.String,java.lang.Object> values)
Description copied from interface: IStorageSourceService
Update or insert a row in the table with the given row key (primary key) and column names/values. (If the values map contains the special column "id", its value must match rowId.)

Specified by:
updateRow in interface IStorageSourceService
Parameters:
tableName - The table to update or insert into
rowKey - The ID (primary key) of the row to update
values - The map of column names/values to update the rows

updateRowImpl

protected abstract void updateRowImpl(java.lang.String tableName,
                                      java.lang.Object rowKey,
                                      java.util.Map<java.lang.String,java.lang.Object> values)

updateRow

public void updateRow(java.lang.String tableName,
                      java.util.Map<java.lang.String,java.lang.Object> values)
Description copied from interface: IStorageSourceService
Update or insert a row in the table with the given column data. The primary key must be included in the map of values.

Specified by:
updateRow in interface IStorageSourceService
Parameters:
tableName - The table to update or insert into
values - The map of column names/values to update the rows

updateRowImpl

protected abstract void updateRowImpl(java.lang.String tableName,
                                      java.util.Map<java.lang.String,java.lang.Object> values)

deleteRow

public void deleteRow(java.lang.String tableName,
                      java.lang.Object rowKey)
Description copied from interface: IStorageSourceService
Delete the row with the given primary key.

Specified by:
deleteRow in interface IStorageSourceService
Parameters:
tableName - The table from which to delete the row
rowKey - The primary key of the row to delete.

deleteRowImpl

protected abstract void deleteRowImpl(java.lang.String tableName,
                                      java.lang.Object rowKey)

deleteRows

public void deleteRows(java.lang.String tableName,
                       java.util.Set<java.lang.Object> rowKeys)
Description copied from interface: IStorageSourceService
Delete the rows with the given keys.

Specified by:
deleteRows in interface IStorageSourceService
Parameters:
tableName - The table from which to delete the rows
rowKeys - The set of primary keys of the rows to delete.

deleteRowsImpl

protected abstract void deleteRowsImpl(java.lang.String tableName,
                                       java.util.Set<java.lang.Object> rowKeys)

deleteMatchingRows

public void deleteMatchingRows(java.lang.String tableName,
                               IPredicate predicate)
Description copied from interface: IStorageSourceService
Delete the rows that match the predicate

Specified by:
deleteMatchingRows in interface IStorageSourceService

getRow

public IResultSet getRow(java.lang.String tableName,
                         java.lang.Object rowKey)
Description copied from interface: IStorageSourceService
Query for a row with the given ID (primary key).

Specified by:
getRow in interface IStorageSourceService
Parameters:
tableName - The name of the table to query
rowKey - The primary key of the row
Returns:
The result set containing the row with the given ID

getRowImpl

protected abstract IResultSet getRowImpl(java.lang.String tableName,
                                         java.lang.Object rowKey)

addListener

public void addListener(java.lang.String tableName,
                        IStorageSourceListener listener)
Description copied from interface: IStorageSourceService
Add a listener to the specified table. The listener is called when any modifications are made to the table. You can add the same listener instance to multiple tables, since the table name is included as a parameter in the listener methods.

Specified by:
addListener in interface IStorageSourceService
Parameters:
tableName - The name of the table to listen for modifications
listener - The listener instance to call

removeListener

public void removeListener(java.lang.String tableName,
                           IStorageSourceListener listener)
Description copied from interface: IStorageSourceService
Remove a listener from the specified table. The listener should have been previously added to the table with addListener.

Specified by:
removeListener in interface IStorageSourceService
Parameters:
tableName - The name of the table with the listener
listener - The previously installed listener instance

notifyListeners

protected void notifyListeners(StorageSourceNotification notification)

notifyListeners

public void notifyListeners(java.util.List<StorageSourceNotification> notifications)
Description copied from interface: IStorageSourceService
This is logically a private method and should not be called by clients of this interface.

Specified by:
notifyListeners in interface IStorageSourceService
Parameters:
notifications - the notifications to dispatch

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