OSB_LIB::TsVersion Class Reference

Inheritance diagram for OSB_LIB::TsVersion:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Tariff system versions.

This class has information about the configuration of each version of the tariff system. The configuration includes the service class system that it can support, the tariff classification system of each service class, tariff period system of each tariff class and the tariff of each tariff class, tariff period tuple.

Definition at line 272 of file tariffsystem.h.

Database operations

Public Types

Public Member Functions

Get configuration
Get configuration details
Get supported tariff objects
Set configuration

Static Public Member Functions

Private Member Functions

Status changes

Private Attributes

Friends


Member Typedef Documentation

typedef Id2<TsVersion> OSB_LIB::TsVersion::Oid

Type-safe object id. Consist of unique id and version of tariff system.

Definition at line 301 of file tariffsystem.h.

typedef Id<ScSystem> OSB_LIB::TsVersion::ScsOid

Type-safe id of service class system. Consist of unique id and version number of service class system.

Definition at line 306 of file tariffsystem.h.


Member Enumeration Documentation

enum OSB_LIB::TsVersion::RatingType

Type of rating this tariff system supports.

Enumerator:
flatRating  Flat Rating: Support rating performed on one Cdr at a time.
sumRating  Summary Rating: Support rating performed on one Cdr at a time and rating performed on one SumCdr at a time.
unknownRating  Unknown rating type.

Definition at line 281 of file tariffsystem.h.


Constructor & Destructor Documentation

OSB_LIB::TsVersion::TsVersion ( const Oid oid = Oid(),
RatingType  type = flatRating 
) [explicit]

Default constructor with optional object id and rating type.

OSB_LIB::TsVersion::TsVersion ( const TariffSystem::Oid tsId,
RatingType  type = flatRating 
) [explicit]

Construct from TS object id and optional rating type.


Member Function Documentation

void OSB_LIB::TsVersion::copyCfg ( const TsVersion src  ) 

Get configuration from another TS version.

The class can determine which of the data members can be copied. Other than the name, status and released date, the rest of the data members will be the same as the source version.

Parameters:
src Tariff system version to copy from.

bool OSB_LIB::TsVersion::freeze ( const OSB_DB::Session session,
OsbErrors errors 
) [private, virtual]

Set status of the version to standby mode.

To set the status to standby mode, the following rules must be satisfied:

  1. Tariff system must have exactly one service class system defined.
  2. All service class system version must be freezed.
  3. All tariff classification system version must be freezed.
  4. All tariff period system version must be freezed.
  5. The service class in the tariff system configuration must exist in the service class system version.
  6. The tariff class in the tariff system configuration must exist in the tariff classification system version.
  7. The tariff period in the tariff system configuration must exist in the tariff period system version.
  8. All service classes must have a tariff classification system version defined.
  9. All tariff classes must have a tariff period system version defined.
  10. Each tariff class and tariff period tuple must have a tariff assigned. The above checking are done at the gateway.

Parameters:
session Database session.
errors List of errors that occur during checks.
Exceptions:
OsbException if encountered problems in database.
Returns:
True if check is successful.

Implements OSB_LIB::ToCfgBase.

const Tariff::Oid& OSB_LIB::TsVersion::getFlatTariff ( const TariffClass::Oid tcId,
const TariffPeriod::Oid tpId 
) const

Get the flat rating tariff based on tariff period and tariff class.

Parameters:
tcId Tariff class id.
tpId Tariff period id.
Returns:
The flat tariff valid for tcId and tpId.

const Tariff::Oid& OSB_LIB::TsVersion::getMassTariff ( const TariffClass::Oid tcId,
const TariffPeriod::Oid tpId 
) const

Get the mass rating tariff based on tariff period and tariff class.

Parameters:
tcId Tariff class id.
tpId Tariff period id.
Returns:
The mass tariff valid for tcId and tpId.

void OSB_LIB::TsVersion::getSupportedScOid ( std::set< ServiceClass::Oid > &  scOids  )  const

Get all service classes supported by the tariff system.

Each tariff system supports one service class system. All service classes supported are the one included in the service class system configured.

Parameters:
scOids Container for the service classes supported.

void OSB_LIB::TsVersion::getSupportedTcOid ( std::set< TariffClass::Oid > &  tcOids  )  const

Get all tariff classes supported by the tariff system.

All tariff classes supported are the ones supported by the tariff classification system configured.

Parameters:
tcOids Container for the tariff classes supported.

void OSB_LIB::TsVersion::getSupportedTcTpOid ( std::set< TcTp > &  tcTpOids  )  const

Get all tariff class, tariff period pairs supported by the tariff system.

Parameters:
tcTpOids Container for the tariff classes supported.

void OSB_LIB::TsVersion::getSupportedTpOid ( std::set< TariffPeriod::Oid > &  tpOids  )  const

Get all tariff period supported by the tariff system.

All tariff period supported are the ones supported by the tariff period systems configured.

Parameters:
tpOids Container for the tariff period supported.

const TcSystem::Oid& OSB_LIB::TsVersion::getTcSystem ( const ServiceClass::Oid scId  )  const

Get the tariff classification based on service class.

Parameters:
scId Service class id.
Returns:
The tariff classification system for scId.

const TpSystem::Oid& OSB_LIB::TsVersion::getTpSystem ( const TariffClass::Oid tcId  )  const

Get the tariff period system based on tariff class.

Parameters:
tcId Tariff class id.
Returns:
The tariff period system for tcId.

bool OSB_LIB::TsVersion::insert ( const OSB_DB::Session session  )  [private]

Insert a tariff system version into database.

A new object is inserted. All attribute of the object has been set except object id. The object id will only be set by the function if the insertion is successful.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Duplicate name.
  • Name too long.

static RatingType OSB_LIB::TsVersion::longToRt ( const long  type  )  [static]

Change the long integer into tariff system rating type representation.

const Oid& OSB_LIB::TsVersion::oid (  )  const

Get object id of TsVersion.

RatingType OSB_LIB::TsVersion::ratingType (  )  const

Get the type of rating supported.

bool OSB_LIB::TsVersion::read ( const OSB_DB::Session session  ) 

Read a tariff system version from database.

The object id is used to gather other info from database and then populate the object's data members.

Parameters:
session Database session.
Returns:
true if success else false.

bool OSB_LIB::TsVersion::release ( const OSB_DB::Session session,
OsbErrors errors 
) [private, virtual]

Set status of configuration to released mode.

To change status to released mode, the following must be fulfilled:

  1. A released version of the service class system must exist.
  2. For all tariff classification system a version must be released.
  3. For all tariff period system a version must be released.
  4. The release date must be later than current date, i.e., earliest tomorrow.
  5. Status of tariff system must be standby. The above checking are done at the gateway.

Parameters:
session Database session.
errors List of errors that occur during checks.
Exceptions:
OsbException if encountered problems in database.
Returns:
true if rules are satisfied.

Implements OSB_LIB::ToCfgBase.

bool OSB_LIB::TsVersion::remove ( const OSB_DB::Session session  )  [private]

Remove a tariff system version from database.

After the function call, oid of this object will be unset to indicate that there is no such entry anymore in the database.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object does not exist.
  • Object outdated. Object version differs.
  • Object not in status editable.

void OSB_LIB::TsVersion::repopulateScTcsConfig (  )  [private]

Repopulate the SC-TCS configuration.

void OSB_LIB::TsVersion::repopulateTcTpFlatTariff (  )  [private]

Repopulate the TC-TP-simTF configuration.

void OSB_LIB::TsVersion::repopulateTcTpMassTariff (  )  [private]

Repopulate the TC-TP-massTF configuration.

void OSB_LIB::TsVersion::repopulateTcTpsConfig (  )  [private]

Repopulate the TC-TPS configuration.

bool OSB_LIB::TsVersion::revoke ( const OSB_DB::Session session,
OsbErrors errors 
) [private, virtual]

Set status from released to standby mode.

To change status from released to standby mode, the following must be satisifed:

  1. The status must be released.
  2. There must exist another released version of the tariff system.
  3. Current date at which the version of the tariff system is revoked, must be more than grace period + released date of the latest released version. The above checking are done at the gateway.

Parameters:
session Database session.
errors List of errors that occur during checks.
Exceptions:
OsbException if encountered problems in database.
Returns:
true if rules are satisfied.

Implements OSB_LIB::ToCfgBase.

static long OSB_LIB::TsVersion::rtToLong ( const RatingType  type  )  [static]

Change the tariff system rating type into long integer representation.

const ScsOid& OSB_LIB::TsVersion::scsId (  )  const

Get version id of service class system.

const ScTcsCfg& OSB_LIB::TsVersion::scTcsCfg (  )  const

Get serivce class, tariff classification system configuration.

void OSB_LIB::TsVersion::setFlatTariff ( const TcTpTariff flatTf  ) 

Set the flat tariff for tariff classes and periods.

Parameters:
flatTf Container with tariff classes, tariff periods to change
(it needn't contain all pairs <tariff class, tariff period>).
Exceptions:
OsbException if the status is not editable.
Sets the flat tariff for each entry in flatTf, the configuration of other pairs <tariff class, tariff period> is left unchanged.
If a pair <tariff class, tariff period> in flatTf does not exist in the configuration, the entry is silently discarded.

void OSB_LIB::TsVersion::setMassTariff ( const TcTpTariff massTf  ) 

Set the mass tariff for tariff classes and periods.

Parameters:
massTf Container with tariff classes, tariff periods to change
(it needn't contain all pairs <tariff class, tariff period>).
Exceptions:
OsbException if the status is not editable.
Sets the mass tariff for each entry in flatTf, the configuration of other pairs <tariff class, tariff period> is left unchanged.
If a pair <tariff class, tariff period> in massTf does not exist in the configuration, the entry is silently discarded.

void OSB_LIB::TsVersion::setRatingType ( const RatingType  rt  ) 

Set the rating type.

Parameters:
rt The rating type of the TS version.
Exceptions:
OsbException if status is not editable
Note:
tcTpMassTariff_ is not cleared if the type changes from bundled to flat rating, the clean-up is done just before inserting or updating in the database.
This specification allows changing the rating type back and forth without the need to read the mass tariffs from the database when changing to bundled rating.

void OSB_LIB::TsVersion::setScsId ( const ScsOid scsId  ) 

Set service class system.

Does not update in the database. Call TariffCatalogue::updTsVersion() to save the newly assigned service class system.

Parameters:
scsId New service class system version.
Exceptions:
OsbException if status is not editable.

void OSB_LIB::TsVersion::setScTcsCfg ( const ServiceClass::Oid scId,
const TcSystem::Oid tcsId 
)

Set a service class, tariff classification system configuration to map.

Deprecated:
Use setScTcsCfg(const ScTcsCfg&) instead.
This function will either insert a new entry into the configuration or replace the old configuration with the new one. The replacement is based on the service class id of the configuration.

Parameters:
scId Object id of service class.
tcsId Object id of TC system for scId.

void OSB_LIB::TsVersion::setScTcsCfg ( const ScTcsCfg scTcsCfg  ) 

Set the TC system for service classes.

Parameters:
scTcsCfg Container with service classes to change
(it needn't contain all service classes).
Exceptions:
OsbException if the status is not editable.
Sets the TC system for each entry in scTcsCfg, the configuration of other services classes is left unchanged.
If a service class in scTcsCfg does not exist in the configuration, the entry is silently discarded.

void OSB_LIB::TsVersion::setTcTpFlatTariff ( const TcTp tcTp,
const Tariff::Oid tariffOid 
)

Set a flat tariff of a tariff class, tariff period tuple to map.

Deprecated:
Use setFlatTariff(const TcTpTariff&) instead.
This function will either insert a new entry into the configuration or replace the old configuration with the new one. The replacement is based on the tariff class, tariff period pair of the configuration.

Parameters:
tcTp Tariff class, tariff period pair.
tariffOid Unique id of tariff.

void OSB_LIB::TsVersion::setTcTpMassTariff ( const TcTp tcTp,
const Tariff::Oid tariffOid 
)

Set a mass tariff of a tariff class, tariff period tuple to map.

Deprecated:
Use setMassTariff(const TcTpTariff&) instead.
This function will either insert a new entry into the configuration or replace the old configuration with the new one. The replacement is based on the tariff class, tariff period pair of the configuration.

Parameters:
tcTp Tariff class, tariff period pair.
tariffOid Unique id of tariff.

void OSB_LIB::TsVersion::setTcTpsCfg ( const TariffClass::Oid tcOid,
const TpSystem::Oid tpsOid 
)

Set tariff class, tariff period system configuration to map.

Deprecated:
Use setTcTpsCfg(const TcTpsCfg&) instead.
This function will either insert a new entry into the configuration or replace the old configuration with the new one. The replacement is based on the tariff class id of the configuration.

Parameters:
tcOid Id of tariff class.
tpsOid Id and version of tariff period system.

void OSB_LIB::TsVersion::setTcTpsCfg ( const TcTpsCfg tcTpsCfg  ) 

Set the TP system for tariff classes.

Parameters:
tcTpsCfg Container with tariff classes to change
(it needn't contain all tariff classes).
Exceptions:
OsbException if the status is not editable.
Sets the TP system for each entry in tcTpsCfg, the configuration of other tariff classes is left unchanged.
If a tariff class in tcTpsCfg does not exist in the configuration, the entry is silently discarded.

const TcTpTariff& OSB_LIB::TsVersion::tcTpFlatTariff (  )  const

Get flat tariff of tariff class, tariff period tuple.

const TcTpTariff& OSB_LIB::TsVersion::tcTpMassTariff (  )  const

Get mass tariff of tariff class, tariff period tuple.

const TcTpsCfg& OSB_LIB::TsVersion::tcTpsCfg (  )  const

Get tariff class, tariff period system configuration.

TariffSystem::Oid OSB_LIB::TsVersion::tsId (  )  const

Get id of tariff system.

bool OSB_LIB::TsVersion::unfreeze ( const OSB_DB::Session session,
OsbErrors errors 
) [private, virtual]

Set status to from standby to editable.

To change status from standby to editable mode, the following must be satisifed:

  1. The status must be standby.

Parameters:
session Database session.
errors List of errors that occur during checks.
Exceptions:
OsbException if encountered problems in database.
Returns:
True if the above rule is satisfied.

Implements OSB_LIB::ToCfgBase.

bool OSB_LIB::TsVersion::update ( const OSB_DB::Session session  )  [private]

Update a tariff system version in the database.

Old entry in the database identified by the object id will be replaced with the new data from this object.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object does not exist.
  • Object outdated. Object version differs.
  • Name too long.
  • Duplicate name.


Friends And Related Function Documentation

friend struct OSB_DB::TsVersionGw [friend]

Gateway need to populate private data memebers.

Definition at line 276 of file tariffsystem.h.

friend class TariffCatalogue [friend]

Allow tariff catalogue to call private member functions.

Definition at line 278 of file tariffsystem.h.


Member Data Documentation

Oid OSB_LIB::TsVersion::oid_ [private]

Unique id and version of tariff system.

Definition at line 799 of file tariffsystem.h.

RatingType OSB_LIB::TsVersion::ratingType_ [private]

Type of rating supported.

Definition at line 803 of file tariffsystem.h.

ScsOid OSB_LIB::TsVersion::scsOid_ [private]

Unique id and version of service class system.

Definition at line 801 of file tariffsystem.h.

ScTcsCfg OSB_LIB::TsVersion::scTcsCfg_ [private]

Service class, tariff classification system configuration.

Definition at line 805 of file tariffsystem.h.

TcTpTariff OSB_LIB::TsVersion::tcTpFlatTariff_ [private]

Flat Tariff of tariff class, tariff period tuple.

Definition at line 809 of file tariffsystem.h.

TcTpTariff OSB_LIB::TsVersion::tcTpMassTariff_ [private]

Mass Tariff of tariff class, tariff period tuple.

Definition at line 811 of file tariffsystem.h.

TcTpsCfg OSB_LIB::TsVersion::tcTpsCfg_ [private]

Tariff class, tariff period system configuration.

Definition at line 807 of file tariffsystem.h.


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