Definition at line 1091 of file network.h.
OSB_LIB::NetworkManager::NetworkManager | ( | ) |
Default Constructor.
bool OSB_LIB::NetworkManager::addNetwork | ( | OSB_DB::Session & | session, | |
Network & | net | |||
) |
Creates a new network in the database.
This method will write lock the whole list of network.
Add a network entry to the database. Also add it to the network list. The object id and object version will be set if insertion success.
Session will be committed if successful.
session | The database session. | |
net | The new network (oid not set). |
OsbException |
|
bool OSB_LIB::NetworkManager::delNetwork | ( | OSB_DB::Session & | session, | |
const Network::Oid & | oid | |||
) |
Deletes a network from the database.
This method will write lock the whole list of network.
This will delete an entry from the database, also delete it from the network list. Session will be committed if successful.
session | The database session. | |
oid | Network to delete. |
OsbException |
|
const Network* OSB_LIB::NetworkManager::findNetwork | ( | const Network::Oid & | oid | ) | const |
Find the network based on the given oid.
oid | Object id of the network. |
const Network& OSB_LIB::NetworkManager::getNetwork | ( | const Network::Oid & | oid | ) | const |
Get the network based on the given oid.
oid | Object id of the network. |
ObjectNotFound |
const TimeZone& OSB_LIB::NetworkManager::getTimeZone | ( | const TimeZone::Oid & | oid | ) | const |
Return the timezone for the given object id.
This will compare the given timezone id with the ids in the timezone container. If the given id is matched then it will return the reference to the timezone object else throw the exception.
oid | Unique identifier of the timezone. |
ObjectNotFound |
const TimeZones& OSB_LIB::NetworkManager::getTimeZones | ( | ) | const |
const TrunkGroup& OSB_LIB::NetworkManager::getTrkGroup | ( | const Id< TrunkGroup > & | tgId | ) | const |
Find a trunk group by its id.
tgId | Id of the trunk group to find. |
ObjectNotFound |
Network* OSB_LIB::NetworkManager::network | ( | const Network::Oid & | oid | ) |
Get the writable network based on the given oid.
oid | Object id of network. |
const Networks& OSB_LIB::NetworkManager::networks | ( | ) | const [inline] |
NetworkRg OSB_LIB::NetworkManager::readLock | ( | const Network::Oid & | oid | ) |
Read-lock a network by its object id.
oid | Object id of the network. |
OsbException |
|
NetworksRg OSB_LIB::NetworkManager::readLockList | ( | ) |
Read-lock all networks.
OsbException |
|
long OSB_LIB::NetworkManager::readNetworks | ( | const OSB_DB::Session & | session | ) |
Get all networks.
Load all networks from database and store them to the list.
session | Database session to use. |
OsbException |
|
long OSB_LIB::NetworkManager::readTimeZones | ( | const OSB_DB::Session & | session | ) |
Read all timezone.
Load all the timezone from the database.
session | Database session to use. |
void OSB_LIB::NetworkManager::sortNetworkByName | ( | bool | desc = false |
) |
Sort networks by name.
desc | Flag to sort in descending (true) or ascending (false) order. |
bool OSB_LIB::NetworkManager::updNetwork | ( | OSB_DB::Session & | session, | |
Network & | net | |||
) |
Update a network to the database.
This method will write lock the network object.
Update network to the database. Also update it to the network list. The object version will be update if success.
Session will be committed if successful.
session | The database session. | |
net | Network to update. |
OsbException |
|
NetworkWg OSB_LIB::NetworkManager::writeLock | ( | const Network::Oid & | oid | ) |
Write-lock a network by its object id.
oid | Object id of the network. |
OsbException |
|
NetworksWg OSB_LIB::NetworkManager::writeLockList | ( | ) | [private] |
Write-lock the list of all networks.
RwMutex OSB_LIB::NetworkManager::mutex_ [private] |
Networks OSB_LIB::NetworkManager::networks_ [private] |
TimeZones OSB_LIB::NetworkManager::timezones_ [private] |