OSB_DB::CgiGw Struct Reference

List of all members.

Detailed Description

Database interface of Cgi.

Definition at line 58 of file cgi-gw.h.

Public Member Functions

Private Member Functions

Friends


Member Function Documentation

bool OSB_DB::CgiGw::bothDateInFuture ( const Session session,
const OSB_LIB::Cgi::Oid oid 
) [private]

Ensure both start and end dates are in future.

This function checks whether both released start date and released end date of a CGI are in the future. For end date, it can be null.

Parameters:
session Database session.
oid Object id of the CGI to be checked.
Returns:
true if both start and end dates are in the future, or the end date is null, else false.
Exceptions:
OsbException for all database errors.

OSB_LIB::ObjectStatus OSB_DB::CgiGw::checkObjVs ( const Session session,
const OSB_LIB::Cgi cgi 
) [private]

Check the current object version.

Parameters:
session Database session.
cgi CGI object that the object version is to be checked.
Returns:
Result of the object version verification. Possible values are:
  • objUnchanged
  • objModified
  • objDeleted
Exceptions:
OsbException for any database errors.

bool OSB_DB::CgiGw::delCgi ( const Session session,
OSB_LIB::Cgi cgi 
) [private]

Delete a CGI.

This function will delete a CGI entry from the database base on the passed in CGI object. This function will find the database entry with the same object id and object version when performing the deletion. After a successful deletion in the database, this function will unset the object id of the passed in CGI object.

Parameters:
session Database session.
cgi CGI object to be deleted.
Returns:
true if deletion is successful else false.
Exceptions:
OsbException for the following errors:
  • Object out-dated. Object version differs.
  • Object not found.
  • Other database errors.

bool OSB_DB::CgiGw::fetch ( const Session session,
OSB_LIB::Cgi cgi 
)

Populate a CGI object with data.

This function accept an empty CGI with only its object id set. It will populate all other attribute of the object.

Parameters:
session Database session.
cgi CGI object to be populated.
Returns:
true if the object is found else false.
Exceptions:
OsbException for any database errors.

long OSB_DB::CgiGw::fetch ( const Session session,
OSB_LIB::Cgis cgis 
)

Get a list of all available CGIs.

This function retrieve all available CGIs from database.

Parameters:
session Database session.
cgis Container to store all the CGIs retrieved.
Returns:
Number of CGIs retrieved.
Exceptions:
OsbException for any database errors.

OSB_LIB::CfgStatus OSB_DB::CgiGw::getStatus ( const Session session,
const OSB_LIB::Cgi::Oid oid 
) [private]

Get the status of a CGI in database.

Parameters:
session Database session.
oid Object id of the CGI to be checked.
Returns:
Status of the tariff period version found. Possible values are:
  • cfgEditable
  • cfgStandby
  • cfgTesting
  • cfgReleased
Exceptions:
OsbException for the following errors:
  • Database error.

bool OSB_DB::CgiGw::gracePeriodExpired ( const Session session,
const OSB_LIB::Cgi::Oid oid 
) [private]

Ensure the grace period for a CGI has expired.

This function will ensure the grace period for a CGI has expired.

Parameters:
session Database session.
oid Object id of the CGI to be checked.
Returns:
true if grace period expired else false.
Exceptions:
OsbException for any database errors.

bool OSB_DB::CgiGw::hasOverlapCgi ( const Session session,
const OSB_LIB::Cgi::Oid oid 
) [private]

Ensure no two CGIs that is released at the same time.

This function checks all release CGIs to ensure that no two CGI (with same value) is in status released at any time.o

Parameters:
session Database session.
oid Object id of the CGI to be checked.
Returns:
true if overlap release time between CGIs exist else false.
Exceptions:
OsbException for any database errors.

bool OSB_DB::CgiGw::hasReleasedCp ( const Session session,
const OSB_LIB::Cgi::Oid oid 
) [private]

Ensure there is a released connection point assigned.

This function check whether the CGI has a released connection point assigned. The connection point must have been released when releasing a CGI. This function will also ensures that the release period of a CGI is within the release period of the connection point configured.

Parameters:
session Database session.
oid Object id of the CGI to be checked.
Returns:
true if a released connection point is assigned else false.
Exceptions:
OsbException for any database errors.

bool OSB_DB::CgiGw::insCgi ( const Session session,
OSB_LIB::Cgi cgi 
) [private]

Add a new CGI.

Before the function call, the CGI object must have all its mandatory attributes assigned (exception oid and object version). After the function call, the object will get its object id and object version.

Parameters:
session Database session.
cgi New CGI object to be added.
Returns:
true if creation is successful else false.
Exceptions:
OsbException for the following errors:
  • Name too long.
  • Duplicate name.
  • Other database errors.

bool OSB_DB::CgiGw::noDateConflict ( const Session session,
const OSB_LIB::Cgi::Oid oid 
) [private]

Ensure no conflict for the start and end date.

This function will ensure that end date (if set), is later than the start date.

Parameters:
session Database session.
oid Object id of the CGI to be checked.
Returns:
true if no conflict else false.
Exceptions:
OsbException for any database errors.

void OSB_DB::CgiGw::setStatus ( const Session session,
const OSB_LIB::Cgi::Oid oid,
const OSB_LIB::CfgStatus status 
) [private]

Change the status of a CGI.

This function changes the status of a CGI with the given object id to the status given in the argument.

Parameters:
session Database session.
oid Tariff period version object id.
status Status to change to. Possible values are:
  • cfgEditable
  • cfgStandby
  • cfgTesting
  • cfgReleased
Exceptions:
OsbException for any database errors.

bool OSB_DB::CgiGw::updCgi ( const Session session,
OSB_LIB::Cgi cgi 
) [private]

Update a CGI.

The function will modify a database entry base on the passed in CGI object. It will find the database entry that shares the same object id and object version with the pass in CGI, than update the found entry with the data contained in the passed in CGI object.

Parameters:
session Database session.
cgi Updated CGI that will be used to update the database entry.
Returns:
true if update is successful else false.
Exceptions:
OsbException for the following errors:
  • Name too long.
  • Duplicate name.
  • Object out-dated. Object version differs.
  • Object not found.
  • Other database errors.


Friends And Related Function Documentation

friend class OSB_LIB::Cgi [friend]

Cgi needs to call the private member functions.

Definition at line 60 of file cgi-gw.h.


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