OSB_DB::TfVersionGw Struct Reference

List of all members.

Detailed Description

Database interface for tariff version.

Definition at line 295 of file tariff-gw.h.

Public Member Functions

Private Member Functions

Friends


Member Function Documentation

bool OSB_DB::TfVersionGw::allRatingFnsChecked ( const Session session,
const OSB_LIB::TfVersion::Oid oid 
) [private]

Check whether all the rating functions bound to the tariff version has been checked.

Parameters:
session Database session.
oid Object id of the tariff version to be checked.
Returns:
true if at least one rating function is bound to it, else false.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::allRatingFnsReleased ( const Session session,
const OSB_LIB::TfVersion::Oid oid 
) [private]

Check whether all the rating functions bound to the tariff version has been released.

Parameters:
session Database session.
oid Object id of the tariff version to be checked.
Returns:
true if at least one rating function is bound to it, else false.
Exceptions:
OsbException for the following errors:
  • Database error.

OSB_LIB::ObjectStatus OSB_DB::TfVersionGw::checkObjVs ( const Session session,
const OSB_LIB::TfVersion tfv 
) [private]

Check the current object version.

Parameters:
session Database session.
tfv Tariff version which object version is to be verified.
Returns:
Result of the object version verification. Possible values are:
  • objUnchanged
  • objModified
  • objDeleted
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::delTfVersion ( const Session session,
OSB_LIB::TfVersion tfv 
) [private]

Delete a tariff version from database.

The tariff version to be deleted must exist in the database. Besides that, the object version of the tariff version to be deleted must match the object version in the database. This is to ensure that the object to be deleted truly represents the entry in the databse. After the function call, the object's id will be unset but the object itself is not deleted automatically. Application is responsible to delete the tariff version object itself.

Parameters:
session Database session.
tfv Tariff object to be deleted.
Returns:
true if deletion is successful else false.
Exceptions:
OsbException for the following errors:
  • Object not found.
  • Object has been modified.
  • Database error.

bool OSB_DB::TfVersionGw::existReleasedTfVs ( const Session session,
const OSB_LIB::Date backDate,
const OSB_LIB::TfVersion::Oid oid 
) [private]

Check if a tariff version existing whose released date is between released date of current tariff version and the back-date.

Parameters:
session Database session,
backDate Date which the tariff version will be shifted back.
oid Object id of current tariff version.
Returns:
True if successful else false.
Exceptions:
OsbException if such a tariff version exist.

long OSB_DB::TfVersionGw::fetch ( const Session session,
OSB_LIB::TfVersions tfvs 
)

Get a list of all available tariff versions.

This function retrieve all the available tariff versions from database.

Parameters:
session Database session.
tfvs Container that stores all the retrieved object
Returns:
Number of tariff version object retrieved.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::fetch ( const Session session,
OSB_LIB::TfVersion tfv 
)

Populate a tariff version object with data.

This function accept an empty tariff version object with only its oid set. It will populate all other data members of the object.

Parameters:
session Database session.
tfv Tariff version object to be populated.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::findReplacementFreezedTfVersion ( const Session session,
const OSB_LIB::TfVersion::Oid oid 
) [private]

Find the replacement for a freezed tariff version.

Parameters:
session Database session.
oid Object id of the tariff version to be replaced.
Returns:
true if found a replacement else false;
Exceptions:
OsbException for the following errors:
  • Database error.

OSB_LIB::DateTime OSB_DB::TfVersionGw::findReplacementReleasedTfVersion ( const Session session,
const OSB_LIB::TfVersion::Oid oid 
) [private]

Find the replacement for a released tariff version.

Parameters:
session Database session.
oid Object id of the tariff version to be replaced.
Returns:
Expired date of the tariff version to be replaced, it is not set if no replacement exists.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::hasOtherReleasedTfVersion ( const Session session,
const OSB_LIB::TfVersion::Oid oid 
) [private]

Check is there any other released tariff version exists.

Parameters:
session Database session.
oid Object id of the tariff version to be checked.
Returns:
true if other released version found else false.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::insTfVersion ( const Session session,
OSB_LIB::TfVersion tfv 
) [private]

Add a new tariff version object.

Before the function call, the object must have all its member attributes assigned (except oid_.id2 and objVs_). After the function call, the object will have its oid_ and objVs_ set.

Parameters:
session Database session.
tfv New tariff version to be added into database.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Database error.
  • The name is too long.
  • Duplicate name.

bool OSB_DB::TfVersionGw::isReleasedInFuture ( const Session session,
const OSB_LIB::TfVersion::Oid oid 
) [private]

Ensure the release date is in the future.

This function checks whether the tariff version with the given object id has its release date in the future.

Parameters:
session Database session.
oid Object id of the tariff version to be checked.
Returns:
true if the release date is in the future else return false.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::isTariffUsedByFreezedTsVersion ( const Session session,
const OSB_LIB::Tariff::Oid oid 
) [private]

Check whether tariff version is in used.

This function checks whether any freezed tariff system version is using the tariff with the object id given.

Parameters:
session Database session.
oid Object id of the tariff to be checked.
Returns:
true if in used by released tariff system version else false.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::isTariffUsedByReleasedTsVersion ( const Session session,
const OSB_LIB::Tariff::Oid oid 
) [private]

Check whether tariff version is in used.

This function checks whether any released tariff system version is using the tariff with the object id given.

Parameters:
session Database session.
oid Object id of the tariff to be checked.
Returns:
true if in used by released tariff system version else false.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::patch ( const Session session,
OSB_LIB::TfVersion tfVs,
OSB_LIB::TfVersion newTfVs 
) [private]

Switch the names between two tariff versions.

This function switches the names between the substitute version and the version to be replaced.

Parameters:
session Database session.
tfVs Tariff version object to be replaced.
newTfVs Substitute tariff version.
Returns:
True if successful else false.
Exceptions:
OsbException if database operation fails.

bool OSB_DB::TfVersionGw::setStatus ( const Session session,
OSB_LIB::TfVersion tfVs,
OSB_LIB::CfgStatus  status 
) [private]

Change the status of tariff version.

This function will change the status of tariff version with the given object id based on the input status.

Parameters:
session Database session to use.
tfVs Tariff version for which to set the status.
status New status of the rating function.
If the function returns true its object version is increased and its status set to status.
Returns:
true if the status was updated in the database,
false if the object version is not consistent.

bool OSB_DB::TfVersionGw::uniqueReleaseTs ( const Session session,
const OSB_LIB::Tariff::Oid oid,
const OSB_LIB::DateTime ts 
) const [private]

Check whether the release date is unique.

This function will check whether the release date is unique among the different versions of the same tariff.

Parameters:
session Database session.
oid Object id of the tariff.
ts Release time stamp to check.
Returns:
true if unique else false.
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::TfVersionGw::updTfVersion ( const Session session,
OSB_LIB::TfVersion tfv 
) [private]

Update a tariff version object.

The function will modify the data of a tariff version in the database with the data contained within the input object. The tariff version object entry in the database will only be updated if the input object truly represent the current entry in the database (the object version is the same).

Parameters:
session Database session.
tfv Tariff version object to be updated.
Returns:
true if updated successfully else false.
Exceptions:
OsbException for the following errors:
  • Database error.
  • The name is too long.
  • Duplicate name.
  • Object not found.
  • Object has been modified.


Friends And Related Function Documentation

friend class OSB_LIB::TfVersion [friend]

Tariff version needs to call the private member functions.

Definition at line 299 of file tariff-gw.h.


The documentation for this struct was generated from the following file:
Generated on Sat Sep 2 14:09:03 2006 for OSB Library by  doxygen 1.4.7