OSB_LIB::TfVersion Class Reference

Inheritance diagram for OSB_LIB::TfVersion:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Tariff version object that holds a collection of rating functions.

This class keeps a collection of rating functions that is applicable to the this tariff.

Definition at line 333 of file tariff.h.

Public Types

Public Member Functions

Private Member Functions

Modifying database operations:

Private Attributes

Friends


Member Typedef Documentation

typedef std::set< Id<RatingFn> > OSB_LIB::TfVersion::AssignedRf

STL container to store the assigned rating functions.

Definition at line 349 of file tariff.h.

typedef Id2<TfVersion> OSB_LIB::TfVersion::Oid

Type-safe, unique id of a tariff version.

Definition at line 347 of file tariff.h.


Constructor & Destructor Documentation

OSB_LIB::TfVersion::TfVersion ( const Oid oid = Oid()  )  [explicit]

Default constructor with optional object id.

OSB_LIB::TfVersion::TfVersion ( const Tariff::Oid tfOid  )  [explicit]

Constructor for a new tariff version.


Member Function Documentation

bool OSB_LIB::TfVersion::addRatingFn ( const RatingFn::Oid rfId  ) 

Add new rating functions into this tariff version.

This function will add in new rating function to this tariff version. Database will not be modified until update() function is called.

Parameters:
rfId Rating function to add.
Exceptions:
OsbException for the following errors:
  • Object is not editable.
Returns:
true if the rating function was not already assigned, else false.

bool OSB_LIB::TfVersion::checkObjVs ( const OSB_DB::Session session,
OsbErrors errors 
) [private]

Compare the object version with the database.

Parameters:
session Database session to use.
errors Gets error message if the object version does not match the database.
Returns:
true if the object version is the same as in the database, else false.

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

Set the tariff version from editable to standby.

To check a tariff version object, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container for errors.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

bool OSB_LIB::TfVersion::gracePeriodExpired (  )  const [private]

This function will determine whether the grace period this tariff version has expired.

Returns:
True if grace period has expired, else false.

bool OSB_LIB::TfVersion::hasReplacement ( OSB_LIB::DateTime nextVs  )  const [private]

This function will determine whether there is a tariff version object that can replace the object passed in.

Parameters:
nextVs If not 0: Gets the release timestamp of the next version.
Returns:
true if there is a replacement, else false.

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

This function allow tariff version to insert itself into database.

The object's id is not set before the function call. If the function completed successfully, the object will have it's id set, else the id will still be the same (not set).

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

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

Get the object id.

bool OSB_LIB::TfVersion::patch ( const OSB_DB::Session session,
OsbErrors errors,
TfVersion replacing 
)

Patch current tariff version with an existing tariff version.

This function changes the status of the tariff version that is to replace current tariff version from standby to released. Status of current tariff version is then changed to standby. The names of the boths tariff versions are then switched and the current and replacing version number is then logged.

Parameters:
session Database session.
replacing Tariff version replacing current version.
errors Container for errors.
Returns:
True if operation is successful.

void OSB_LIB::TfVersion::rate ( SumCdr sumCdr  )  const

Rate a summary cdr.

Parameters:
sumCdr Summary Cdr to be rated.

void OSB_LIB::TfVersion::rate ( UsedService us  )  const

Rate a used service.

Parameters:
us The used service to be rated.

void OSB_LIB::TfVersion::rate ( UsedService us,
const Money money,
Decimal volume 
) const

Find the volume for a given used service and money.

Parameters:
us The used service to be rated.
money Available money.
volume Total duration available.

const AssignedRf& OSB_LIB::TfVersion::ratingFns (  )  const

Get a list of rating functions bind to this tariff version.

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

This function allow tariff version to read itself from database.

Object id must be set before the function call. The id is used to retrieve other details from database and populate the object.

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

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

Set the tariff version from standby to released.

If the released date is not later than current date, send the tariff version for re-rating.

To release a tariff version object, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container for errors.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

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

This function allow tariff version to remove itself from database.

Object id must be set before the function call. The id will be unset if the function completed successfully, else no changes to the object.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object is not editable.
  • Object to be removed not found.

bool OSB_LIB::TfVersion::removeRatingFn ( const RatingFn::Oid rfId  ) 

Remove rating functions from this tariff version.

This function will remove a rating function from this tariff version. Database will not be modified until update() function is called.

Parameters:
rfId Rating function to remove.
Exceptions:
OsbException for the following errors:
  • Object is not editable.
Returns:
true if the rating function was assigned, else false.

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

Set the tariff version from released to standby.

To revoke a tariff version object, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container for errors.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

Tariff::Oid OSB_LIB::TfVersion::tfId (  )  const

Get the tariff id.

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

Set the tariff version from standby to editable.

To unfreeze a tariff version object, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container for errors.
Returns:
true if success else false.

Implements OSB_LIB::ToCfgBase.

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

This function allow tariff version to update itself into database.

This function will update an existing tairff version object in the database. If the function completed successfully, the object's objVs will increment by 1.

Parameters:
session Database session.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object does not exist.

long OSB_LIB::TfVersion::vsId (  )  const


Friends And Related Function Documentation

friend struct OSB_DB::TfVersionGw [friend]

The database gateway needs to populate data members after construction.

Definition at line 338 of file tariff.h.

friend class TariffCatalogue [friend]

The tariff catalogue is the only object that is allow to invoke the database functions of this class.

Definition at line 344 of file tariff.h.


Member Data Documentation

Oid OSB_LIB::TfVersion::oid_ [private]

Object's unique id.

Definition at line 626 of file tariff.h.

AssignedRf OSB_LIB::TfVersion::ratingFns_ [private]

List of rating functino bind to this tariff version.

Definition at line 628 of file tariff.h.


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