public class OFMStorageManager extends OFModule implements IStorageService
| Modifier and Type | Field and Description |
|---|---|
private com.mongodb.DB |
db |
private com.mongodb.MongoClient |
mongoClient |
private org.codehaus.jackson.map.ObjectMapper |
om |
private Storage |
storage |
controller| Constructor and Description |
|---|
OFMStorageManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> query) |
boolean |
delete(java.lang.String dbName,
java.lang.String collection,
java.lang.String r) |
void |
dropDB(java.lang.String dbName) |
void |
dropIndex(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> key) |
void |
ensureIndex(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> key) |
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
getIndex(java.lang.String dbName,
java.lang.String collection) |
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.
|
boolean |
insert(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> query)
inserts a Map
|
boolean |
insert(java.lang.String dbName,
java.lang.String collection,
java.lang.String r)
inserts a JSON style String object into a persistent storage
return true when successful and false in other cases
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
retrieve(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> query) |
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
retrieveAll(java.lang.String dbName,
java.lang.String collection) |
java.util.List<java.lang.String> |
retrieveAsString(java.lang.String dbName,
java.lang.String collection,
java.lang.String query) |
java.util.List<java.lang.String> |
retrieveAsStringAll(java.lang.String dbName,
java.lang.String collection) |
java.util.List<java.lang.String> |
retrieveDBs() |
boolean |
update(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> key,
java.util.Map<java.lang.String,java.lang.Object> query) |
boolean |
update(java.lang.String dbName,
java.lang.String collection,
java.lang.String key,
java.lang.String query) |
boolean |
upsert(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> key,
java.util.Map<java.lang.String,java.lang.Object> query) |
boolean |
upsert(java.lang.String dbName,
java.lang.String collection,
java.lang.String key,
java.lang.String query) |
getController, getModule, init, processDisconnect, processHandshakeFinished, processMessage, registerFilter, registerModuleprivate com.mongodb.MongoClient mongoClient
private com.mongodb.DB db
private org.codehaus.jackson.map.ObjectMapper om
private Storage storage
protected void initialize()
OFModuleOFMLinkDiscovery.initialize().initialize in class OFModulepublic boolean insert(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> query)
throws StorageException
insert in interface IStorageServicedbName - name of the databasecollection - name of collection for the databasequery - MapStorageExceptionpublic boolean insert(java.lang.String dbName,
java.lang.String collection,
java.lang.String r)
throws StorageException
insert in interface IStorageServicedbName - name of the databasecollection - name of collection for the databasequery - JSON style String data to be insertedStorageExceptionpublic boolean delete(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> query)
throws StorageException
delete in interface IStorageServiceStorageExceptionpublic boolean delete(java.lang.String dbName,
java.lang.String collection,
java.lang.String r)
throws StorageException
delete in interface IStorageServiceStorageExceptionpublic boolean update(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> key,
java.util.Map<java.lang.String,java.lang.Object> query)
throws StorageException
update in interface IStorageServiceStorageExceptionpublic boolean update(java.lang.String dbName,
java.lang.String collection,
java.lang.String key,
java.lang.String query)
throws StorageException
update in interface IStorageServiceStorageExceptionpublic boolean upsert(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> key,
java.util.Map<java.lang.String,java.lang.Object> query)
throws StorageException
upsert in interface IStorageServiceStorageExceptionpublic boolean upsert(java.lang.String dbName,
java.lang.String collection,
java.lang.String key,
java.lang.String query)
throws StorageException
upsert in interface IStorageServiceStorageExceptionpublic java.util.List<java.lang.String> retrieveAsStringAll(java.lang.String dbName,
java.lang.String collection)
throws StorageException
retrieveAsStringAll in interface IStorageServiceStorageExceptionpublic java.util.List<java.lang.String> retrieveAsString(java.lang.String dbName,
java.lang.String collection,
java.lang.String query)
throws StorageException
retrieveAsString in interface IStorageServiceStorageExceptionpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> retrieve(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> query)
throws StorageException
retrieve in interface IStorageServiceStorageExceptionpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> retrieveAll(java.lang.String dbName,
java.lang.String collection)
throws StorageException
retrieveAll in interface IStorageServiceStorageExceptionpublic void ensureIndex(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> key)
throws StorageException
ensureIndex in interface IStorageServiceStorageExceptionpublic void dropIndex(java.lang.String dbName,
java.lang.String collection,
java.util.Map<java.lang.String,java.lang.Object> key)
throws StorageException
dropIndex in interface IStorageServiceStorageExceptionpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getIndex(java.lang.String dbName,
java.lang.String collection)
throws StorageException
getIndex in interface IStorageServiceStorageExceptionpublic java.util.List<java.lang.String> retrieveDBs()
throws StorageException
retrieveDBs in interface IStorageServiceStorageExceptionpublic void dropDB(java.lang.String dbName)
throws StorageException
dropDB in interface IStorageServiceStorageExceptionprotected boolean handleHandshakedEvent(Connection conn, MessageContext context)
OFModuleOFModule.processHandshakeFinished(Connection, MessageContext).
Normally, most of modules have very simple implementation for this method,
only returning true.handleHandshakedEvent in class OFModuleconn - 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)
OFModuleOFModule.processMessage(Connection, MessageContext, OFMessage, List).handleMessage in class OFModuleconn - 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)
OFModuleOFModule.processDisconnect(Connection).
All subclasses of OFModule should implement this method.handleDisconnect in class OFModuleconn - connection that the event has occurred