OSB_DB::TpsVersionGw Struct Reference

List of all members.

Detailed Description

Database interface TpsVersion.

Definition at line 687 of file tariffperiod-gw.h.

Public Member Functions

Private Member Functions

Friends


Member Function Documentation

bool OSB_DB::TpsVersionGw::allDayClassesFreezed ( const Session session,
const OSB_LIB::TpsVersion::Oid oid,
OSB_LIB::OsbErrors errors 
) [private]

Check whether all day classes configured are freezed.

Parameters:
session Database session to use.
oid Object id of TPS version to check.
errors Container for detected errors.
Returns:
true if no errors are found, else false.

bool OSB_DB::TpsVersionGw::allDayClassesReleased ( const Session session,
const OSB_LIB::TpsVersion::Oid oid,
OSB_LIB::OsbErrors errors 
) [private]

Check whether all day classes configured are released.

Parameters:
session Database session to use.
oid Object id of TPS version to check.
errors Container for detected errors.
Returns:
true if no errors are found, else false.

bool OSB_DB::TpsVersionGw::checkDcSwitchTimeUnique ( const Session session,
const OSB_LIB::TpsVersion::Oid oid,
OSB_LIB::OsbErrors errors 
) [private]

Check the uniqueness of "day class / switch time" pair.

This function will check whether all "day class /switch time" in a tariff period system version are unique.

Parameters:
session Database session to use.
oid Tariff period system version object id.
errors Container for the errors found.
Returns:
true if no errors are found, else false.

OSB_LIB::ObjectStatus OSB_DB::TpsVersionGw::checkObjVs ( const Session session,
const OSB_LIB::TpsVersion tpsv 
) [private]

Check the current object version.

Parameters:
session Database session.
tpsv Object where the object version is to be checked.
Returns:
Result of the object version verification.

bool OSB_DB::TpsVersionGw::checkSwitchTime ( const Session session,
const OSB_LIB::TpsVersion::Oid oid,
OSB_LIB::OsbErrors errors 
) [private]

Ensure the switch time is defined in the legal format "hh24:mm:ss".

Parameters:
session Database session to use.
oid Object id of TPS version to check.
errors Container for the errors found.
Returns:
true if no errors are found, else false.

bool OSB_DB::TpsVersionGw::delTpsVersion ( const Session session,
OSB_LIB::TpsVersion tpsv 
) [private]

Delete a tariff period system version.

This function deletes a tariff period system version from database base on the passed in object. After a successful function call, the passed in tariff period system version will have its object id unset.

Parameters:
session Database session.
tpsv Tariff period system version to be deleted.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object not found.
  • Object has been modified.
  • Other database errors.

bool OSB_DB::TpsVersionGw::eachDayCoveredOnce ( const Session session,
const OSB_LIB::TpsVersion::Oid oid 
) [private]

Ensure each day only exist in one day class.

This function ensures that every single day is only represented in one day class.

Parameters:
session Database session.
oid Tariff period system version object id.
Returns:
true if unique else false.

bool OSB_DB::TpsVersionGw::fetch ( const Session session,
OSB_LIB::TpsVersion tpsv 
)

Retrieve tariff period system configuration.

This function populates the tariff period system object passed in with its configuration.

Parameters:
session Database session.
tpsv Tariff period system to be populated.
Returns:
true if success else false.
Exceptions:
OsbException for any database errors.

long OSB_DB::TpsVersionGw::fetch ( const Session session,
OSB_LIB::TpsVersions tpsvs 
)

Retrieve all tariff period system versions.

Parameters:
session Database session.
tpsvs Container to store all tariff period system versions retrieved.
Returns:
Number of tariff period system versions retrieved.
Exceptions:
OsbException for any database errors.

bool OSB_DB::TpsVersionGw::findReplacementFreezedTpsVersion ( const Session session,
const OSB_LIB::TpsVersion::Oid oid 
) [private]

Find the replacement for a freezed tariff period system version.

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

bool OSB_DB::TpsVersionGw::hasOtherReleasedTpsVersion ( const Session session,
const OSB_LIB::TpsVersion::Oid oid 
) [private]

Check is there any other released tariff period system version exists.

Parameters:
session Database session.
oid Object id of the tariff period system version to be checked.
Returns:
true if other released version found else false.

bool OSB_DB::TpsVersionGw::identicalTariffPeriod ( const Session session,
const OSB_LIB::TpsVersion::Oid oid 
) [private]

Ensure all versions of tariff period system support the same set of tariff period.

This function will refer to the previous released versions of tariff period system to do the comparison. This function always return true if the object to be checked is the first version to be released.

Parameters:
session Database session.
oid Object id of the service class system version to be checked.
Returns:
true if identical else false.
Exceptions:
OsbException for any database errors.

bool OSB_DB::TpsVersionGw::insTpsVersion ( const Session session,
OSB_LIB::TpsVersion tpsv 
) [private]

Create a new tariff period system version.

This function will create a new entry in the database base on the tariff period system version object passed in. After a successful function call, the passed in object will have its object id set.

Parameters:
session Database session.
tpsv New tariff period system version.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Name too long.
  • Duplicate name.
  • Object not found.
  • Object has been modified.
  • Other database errors.

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

Ensure release date is in the future.

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

Parameters:
session Database session.
oid Object id of the tariff period system version to be checked.
Returns:
true if the release date is in the future else false.
Exceptions:
OsbException for any database errors.

bool OSB_DB::TpsVersionGw::isTpSystemUsedByFreezedTsVersion ( const Session session,
const OSB_LIB::TpSystem::Oid oid 
) [private]

Check whether tariff period system version is in used.

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

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

bool OSB_DB::TpsVersionGw::isTpSystemUsedByReleasedTsVersion ( const Session session,
const OSB_LIB::TpSystem::Oid oid 
) [private]

Check whether tariff period system version is in used.

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

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

OSB_LIB::DateTime OSB_DB::TpsVersionGw::nextReleasedVersion ( const Session session,
const OSB_LIB::TpsVersion::Oid oid 
) [private]

Find the replacement for a released tariff period system version.

Parameters:
session Database session.
oid Object id of the tariff period system version to be replaced.
Returns:
Expired date of the TPS version to be replaced.
It is not set if no replacement exists.

bool OSB_DB::TpsVersionGw::switchTimeZeroDefined ( const Session session,
const OSB_LIB::TpsVersion::Oid oid,
OSB_LIB::OsbErrors errors 
) [private]

For each dayclass, SW 00:00:00 must be defined.

Parameters:
session Database session.
oid Tariff period system version object id.
errors Container for errors encountered.
Returns:
true if no errors are found, else false.

bool OSB_DB::TpsVersionGw::uniqueReleaseTs ( const Session session,
const OSB_LIB::TpSystem::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 period system.

Parameters:
session Database session.
oid Object id of the tariff period system.
ts Release time stamp to check.
Returns:
true if unique else false.

void OSB_DB::TpsVersionGw::updStatus ( const Session session,
OSB_LIB::TpsVersion tpsVs 
) [private]

Change the status of a tariff period system version.

Parameters:
session Database session to use.
tpsVs TPS version to update, it must have the new status set.

bool OSB_DB::TpsVersionGw::updTpsVersion ( const Session session,
OSB_LIB::TpsVersion tpsv 
) [private]

Update a tariff period system version.

This function will update the database entry base on the tariff period system version object passed in.

Parameters:
session Database session.
tpsv Updated tariff period system version.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Name too long.
  • Duplicate name.
  • Object not found.
  • Object has been modified.
  • Other database errors.

bool OSB_DB::TpsVersionGw::wholeWeekCover ( const Session session,
const OSB_LIB::TpsVersion::Oid oid 
) [private]

Check that one whole week is covered.

Parameters:
session Database session.
oid Tariff period system version object id.
Returns:
true if whole week is covered else false.


Friends And Related Function Documentation

friend class OSB_LIB::TpsVersion [friend]

Tps version needs to call the private member functions.

Definition at line 689 of file tariffperiod-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