public final class DBManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DB_CONFIG
Database collection name for OVX configuration.
|
static String |
DB_USER
Database collection name for OVX users.
|
static String |
DB_VNET
Database collection name for virtual networks.
|
Modifier and Type | Method and Description |
---|---|
void |
addLink(DPIDandPortPair dpp)
Adds physical link to the OVXNetworkManagers that are waiting for this
link.
|
void |
addPort(DPIDandPort port)
Adds physical port to the OVXNetworkManagers that are waiting for this
port.
|
void |
addSwitch(Long dpid)
Adds physical switch to the OVXNetworkManagers that are waiting for this
switch.
|
void |
close()
Closes connection to database backend.
|
void |
createDoc(Persistable obj)
Creates document in db from persistable object obj.
|
void |
delLink(DPIDandPortPair dpp)
Deletes physical link from the OVXNetworkManagers that are waiting for
this switch.
|
void |
delPort(DPIDandPort port)
Deletes physical port from the OVXNetworkManagers that are waiting for
this switch.
|
void |
delSwitch(Long dpid)
Deletes physical switch from the OVXNetworkManagers that are waiting for
this switch.
|
static DBManager |
getInstance()
Gets the database manager instance, and creates one
if it doesn't exist.
|
void |
init(String host,
Integer port,
boolean clear)
Initializes database backend by creating
config, user and vnet collections.
|
void |
remove(Persistable obj)
Removes persistable object obj.
|
void |
removeDoc(Persistable obj)
Removes document from db.
|
void |
removeLinkPath(int tenantId,
int linkId)
Removes stored path of vlink for specified tenant.
|
void |
removeSwitchPath(int tenantId,
long switchId)
Removes all routes of switch for given tenant.
|
void |
save(Persistable obj)
Saves persistable object obj.
|
public static final String DB_CONFIG
public static final String DB_USER
public static final String DB_VNET
public static DBManager getInstance()
public void init(String host, Integer port, boolean clear)
host
- the database hostport
- the database portclear
- flag to clear the databasepublic void close()
public void createDoc(Persistable obj)
obj
- the object to createpublic void removeDoc(Persistable obj)
obj
- the object to removepublic void save(Persistable obj)
obj
- the object to persistpublic void remove(Persistable obj)
obj
- the object to removepublic void removeSwitchPath(int tenantId, long switchId)
tenantId
- the tenant IDswitchId
- the dpidpublic void removeLinkPath(int tenantId, int linkId)
tenantId
- the tenant IDlinkId
- the link IDpublic void addSwitch(Long dpid)
dpid
- the swith dpidpublic void delSwitch(Long dpid)
dpid
- the switch dpidpublic void addLink(DPIDandPortPair dpp)
dpp
- physical link given as a dpid and port pairpublic void delLink(DPIDandPortPair dpp)
dpp
- the physical link given as a dpid and port pairpublic void addPort(DPIDandPort port)
port
- the port given as a dpid and port pairpublic void delPort(DPIDandPort port)
port
- the port given as a dpid and port pairCopyright © 2015. All rights reserved.