OSB_LIB::TrunkResource Class Reference

Inheritance diagram for OSB_LIB::TrunkResource:

Inheritance graph
[legend]
Collaboration diagram for OSB_LIB::TrunkResource:

Collaboration graph
[legend]
List of all members.

Detailed Description

Group trunk groups.

This is user created, non-prepaid resource.

Definition at line 68 of file trunkresource.h.

Public Types

Public Member Functions

Read access to data members:
Configuration:
Database transactions:

Static Public Member Functions

Private Member Functions

Private Attributes

Static Private Attributes

Friends

Classes


Member Typedef Documentation

typedef std::list<AssignedTrunk> OSB_LIB::TrunkResource::AssignedTrunks

STL-container used for assigned trunk groups.

Definition at line 87 of file trunkresource.h.


Constructor & Destructor Documentation

OSB_LIB::TrunkResource::TrunkResource ( const Oid id = Oid()  ) 

Constructor with optional object id.

OSB_LIB::TrunkResource::TrunkResource ( const Number rn,
const Id< Network > &  nw 
)

Constructor with resource number and optional network id.

Parameters:
rn The resource number.
nw The id of the network that owns the trunk resource.


Member Function Documentation

bool OSB_LIB::TrunkResource::addTrkGroup ( const OSB_DB::Session session,
const Date start,
const TrunkGroup tg 
)

bool OSB_LIB::TrunkResource::assign ( const AssignedTrunk assignedTg  )  [private]

Add a trunk group to the resource.

Parameters:
assignedTg Trunk group assignment to add.
Returns:
false if the added trunk group was already assigned, else true. In either case assignedTg is in the list of assigned trunk groups after the function returns.

const AssignedTrunks& OSB_LIB::TrunkResource::assignedTrks (  )  const

List with all the assigned trunk groups.

bool OSB_LIB::TrunkResource::canSetExtNw (  )  const

Check if the external network can be set or not.

The external network can be set if the resource has no trunk group assigned and the status of the trunk resource is not rsAssigned.

Returns:
true if can, else false.

const AssignedTrunks OSB_LIB::TrunkResource::curAssignedTrks (  )  const

List with current assigned trunk groups.

bool OSB_LIB::TrunkResource::deassign ( const Id< TrunkGroup > &  tgId  )  [private]

Remove a trunk group from the resource.

Parameters:
tgId Id of the removed trunk group.
Returns:
true if the removed trunk group was previously assigned, else false.

bool OSB_LIB::TrunkResource::delTrkGroup ( const OSB_DB::Session session,
const Id< TrunkGroup > &  tgId 
)

const std::string& OSB_LIB::TrunkResource::des (  )  const

Description.

const Id<Network>& OSB_LIB::TrunkResource::extNetwork (  )  const

The id of the external network.

const TrunkGroup& OSB_LIB::TrunkResource::getTrkGroup ( const Id< TrunkGroup > &  tgId  )  const

Get a trunk group by its id.

Parameters:
tgId Id of the trunk group to search.
Exceptions:
OsbException if the trunk group can not be found or if the trunk group is not assigned to the resource.
Returns:
Reference to the matching trunk group.
This is a utility function for on-line clients, the implementation wraps to TheNetworkManager.

bool OSB_LIB::TrunkResource::insert ( const OSB_DB::Session session  )  [virtual]

Insert the resource into the database.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.

Implements OSB_LIB::Resource.

bool OSB_LIB::TrunkResource::isCurAssigned ( const Id< TrunkGroup > &  tgId  )  const

Check whether the trunk group is currently assigned to this trunk resource.

Returns:
true if currently assigned, else false if currently not assigned.

bool OSB_LIB::TrunkResource::read ( const OSB_DB::Session session  )  [virtual]

Read the resource from the database.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.

Implements OSB_LIB::Resource.

bool OSB_LIB::TrunkResource::remove ( const OSB_DB::Session session  )  [virtual]

Delete the resource from the database.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.

Implements OSB_LIB::Resource.

void OSB_LIB::TrunkResource::setDes ( const std::string &  des  ) 

Set the description.

void OSB_LIB::TrunkResource::setExternalNetwork ( const Id< Network > &  ext  ) 

Set the partner network.

Parameters:
ext The id of the external network.
Exceptions:
OsbException in case of an error:

static void OSB_LIB::TrunkResource::sortTgsByName ( AssignedTrunks groups  )  [static]

Sort assigned trunk groups by name.

Parameters:
groups List of assigned trunk groups to sort.

static void OSB_LIB::TrunkResource::sortTgsByPriority ( AssignedTrunks groups  )  [static]

Ascending Sort assigned trunk groups by from date.

Parameters:
groups List of assigned trunk groups to sort.

Type OSB_LIB::TrunkResource::typeId (  )  const [virtual]

Type of the trunk resource: rtTrunkItem.

Implements OSB_LIB::Resource.

void OSB_LIB::TrunkResource::updData ( const OSB_DB::Session session  )  [virtual]

Update the resource in the database.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.
Exceptions:
OsbException from lock().
OsbException from incObjVs().

Implements OSB_LIB::Resource.


Friends And Related Function Documentation

friend class OSB_DB::TrunkResourceGw [friend]

The gateway must be able to set the data members.

Definition at line 70 of file trunkresource.h.


Member Data Documentation

AssignedTrunks OSB_LIB::TrunkResource::assignedTrunks_ [private]

History of assigned trunk groups.

Definition at line 251 of file trunkresource.h.

std::string OSB_LIB::TrunkResource::des_ [private]

Description of the trunk resource.

Definition at line 247 of file trunkresource.h.

Id<Network> OSB_LIB::TrunkResource::extNetworkId_ [private]

Id of the partner network.

Definition at line 249 of file trunkresource.h.

const Type OSB_LIB::TrunkResource::typeId_ = rtTrunkResource [static, private]

Identification of the resource type.

Definition at line 73 of file trunkresource.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:13:26 2006 for OSB Library by  doxygen 1.4.7