OSB_LIB::TzConfig Class Reference

Inheritance diagram for OSB_LIB::TzConfig:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Tariff zone configuration.

The TzConfig class is a configuration class for tariff zones. Each configuration of a tariff zone is make up of an origin, a destination (both as connection point oid) and a valid period of the tariff zone configuration. The origin and destination can be duplicate in a tariff zone but the valid period must not overlap.

Remarks:
Copy constructor, assignment and destructor by compiler.

Definition at line 173 of file tcdist.h.

Database operations:

Public Types

Public Member Functions

Read access:

Private Member Functions

Status changes operations:

Private Attributes

Friends


Member Typedef Documentation

typedef Id<TzConfig> OSB_LIB::TzConfig::Oid

Unique object id.

Definition at line 180 of file tcdist.h.


Constructor & Destructor Documentation

OSB_LIB::TzConfig::TzConfig ( const Oid oid = Oid()  ) 

Default constructor with optional object id.

OSB_LIB::TzConfig::TzConfig ( const Id< TariffZone > &  tzId,
const Id< ConnectionPt > &  origin,
const Id< ConnectionPt > &  dest 
)

Construct from tariff zone, origin and destination.


Member Function Documentation

const Id<ConnectionPt>& OSB_LIB::TzConfig::dest (  )  const [inline]

Get rated destination.

Definition at line 203 of file tcdist.h.

References dest_.

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

Set status of configuration to standby mode.

To set the status from editable to standby. The following rules must be satisfied.

  1. Connection point for origin and destination must exist.
  2. Start date must not be null.
  3. The start date must be earlier than end date.
  4. The valid period of the origin-destination pair must not overlap with the time period of other identical origin-destination pair already in standby mode.

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

Implements OSB_LIB::ToCfgBase.

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

Insert a tariff zone configuration into database.

Parameters:
session Database session to use.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Duplicate name.
  • Tariff zone not set.
  • Origin connection point not set.
  • Destination connection point not set.

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

Get unique id of tariff zone and time period.

const Id<ConnectionPt>& OSB_LIB::TzConfig::origin (  )  const [inline]

Get rated origin.

Definition at line 198 of file tcdist.h.

References origin_.

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

Read a tariff zone configuration from database.

The object id is used to gather other info from database and then populate the object's service tuple list.

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

bool OSB_LIB::TzConfig::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. The status must be in standby.
  2. From date must be later than current date.
  3. To date must be later than from date or null.

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

Implements OSB_LIB::ToCfgBase.

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

Remove a tariff zone configuration 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 to use.
Returns:
true if success else false.
Exceptions:
OsbException for the following errors:
  • Object does not exist.

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

Set status of configuration to standby mode.

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

  1. The status must be released.
  2. The configuration after the grace period must have already expired.

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

Implements OSB_LIB::ToCfgBase.

const Id<TariffZone>& OSB_LIB::TzConfig::tzOid (  )  const

Get tariff zone id.

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

Set status from standby to editable.

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

  1. The status must be standby.
  2. The tariff zone configuration must not be used in any of the tariff zone configuration in freezed state.

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

Implements OSB_LIB::ToCfgBase.

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

Update a tariff zone configuration in the database.

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

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


Friends And Related Function Documentation

friend struct OSB_DB::TzConfigGw [friend]

Database gateway need to populate private data members.

Definition at line 175 of file tcdist.h.

friend class TariffCatalogue [friend]

Tariff catalogue need to invoke private member functions.

Definition at line 177 of file tcdist.h.


Member Data Documentation

Id<ConnectionPt> OSB_LIB::TzConfig::dest_ [private]

Connection point of the destination.

Definition at line 351 of file tcdist.h.

Referenced by dest().

long OSB_LIB::TzConfig::objVs_ [private]

Object version.

Definition at line 345 of file tcdist.h.

Oid OSB_LIB::TzConfig::oid_ [private]

Object id of tariff zone configuration.

Definition at line 343 of file tcdist.h.

Id<ConnectionPt> OSB_LIB::TzConfig::origin_ [private]

Connection point of the origin.

Definition at line 349 of file tcdist.h.

Referenced by origin().

Id<TariffZone> OSB_LIB::TzConfig::tzId_ [private]

Tariff zone.

Definition at line 347 of file tcdist.h.


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