tariff-gw.h

Go to the documentation of this file.
00001 // OSB library ************************************************ -*- C++ -*-
00006 /*
00007   AUTHOR(S): Tang Boon Leong (tbl)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.28 $
00012 
00013   License
00014    OSB rating and billing library for communication networks
00015    Copyright (C) 2004, 2005, 2006  OSB systems
00016 
00017    This file may be distributed and/or modify under the terms of the
00018    GNU General Public License (GPL) as published by the Free Software
00019    Foundation which is provided in the file LICENSE.GPL included in the
00020    packaging of this file.
00021 
00022    The file is distributed in the hope that it will be useful, but WITHOUT
00023    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00024    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00025    for more details.
00026 
00027    Holders of a OSB Commercial License may use this file under the terms
00028    and conditions of this commercial license.
00029  */
00030 #ifndef _TARIFFGW_H_
00031 #define _TARIFFGW_H_
00032 
00033 // ************************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + local headers
00038 #include "tariff.h"
00039 
00040 // ************************************************************************
00041 // class declarations
00042 namespace OSB_DB {
00043     class Session;
00044 }
00045 
00046 // ************************************************************************
00047 // namespace extensions
00048 namespace OSB_DB {
00049 
00050 // *********************************************************************
00051 // class definitions
00052 
00053     // ********************************************************************
00054     // class RateCodeGw
00061     class RateCodeGw {
00063         friend class OSB_LIB::RateCodes;
00064     private:
00074         void read(
00075             const Session&                  session,
00076                   OSB_LIB::RateCodes::Cont& dest
00077         );
00078 
00087         void insert(
00088             const Session&           session,
00089                   OSB_LIB::RateCode* rc
00090         );
00091 
00104         void update(
00105             const Session&           session,
00106                   OSB_LIB::RateCode* rc
00107         );
00108 
00120         void remove(
00121             const Session&           session,
00122                   OSB_LIB::RateCode* rc
00123         );
00124 
00138         void lock(
00139             const Session&           session,
00140                   OSB_LIB::RateCode* rc
00141         );
00142 
00150         void checkUniqueness(
00151             const Session&           session,
00152             const OSB_LIB::RateCode& rc
00153         );
00154     };                                  // class RateCodeGw
00155 
00156     // ********************************************************************
00157     // struct TariffGw
00161     struct TariffGw {
00165         friend class OSB_LIB::Tariff;
00166 
00180         bool fetch(
00181             const Session&         session,
00182                   OSB_LIB::Tariff& tf
00183         );
00184 
00197         long fetch(
00198             const Session&          session,
00199                   OSB_LIB::Tariffs& tfs
00200         );
00201 
00202     private:
00219         bool insTariff(
00220             const Session&         session,
00221                   OSB_LIB::Tariff& tf
00222         );
00223 
00242         bool delTariff(
00243             const Session&         session,
00244                   OSB_LIB::Tariff& tf
00245         );
00246 
00265         bool updTariff(
00266             const Session&         session,
00267                   OSB_LIB::Tariff& tf
00268         );
00269 
00284         OSB_LIB::ObjectStatus checkObjVs(
00285             const Session&         session,
00286             const OSB_LIB::Tariff& tf
00287         );
00288     };                                  // struct TariffGw
00289 
00290     // ********************************************************************
00291     // struct TfVersionGw
00295     struct TfVersionGw {
00299         friend class OSB_LIB::TfVersion;
00300 
00314         bool fetch(
00315             const Session&            session,
00316                   OSB_LIB::TfVersion& tfv
00317         );
00318 
00332         long fetch(
00333             const Session&             session,
00334                   OSB_LIB::TfVersions& tfvs
00335         );
00336 
00337     private:
00354         bool insTfVersion(
00355             const Session&            session,
00356                   OSB_LIB::TfVersion& tfv
00357         );
00358 
00379         bool delTfVersion(
00380             const Session&            session,
00381                   OSB_LIB::TfVersion& tfv
00382         );
00383 
00403         bool updTfVersion(
00404             const Session&            session,
00405                   OSB_LIB::TfVersion& tfv
00406         );
00407 
00422         OSB_LIB::ObjectStatus checkObjVs(
00423             const Session&            session,
00424             const OSB_LIB::TfVersion& tfv
00425         );
00426 
00438         bool allRatingFnsChecked(
00439             const Session&                 session,
00440             const OSB_LIB::TfVersion::Oid& oid
00441         );
00442 
00454         bool allRatingFnsReleased(
00455             const Session&                 session,
00456             const OSB_LIB::TfVersion::Oid& oid
00457         );
00458 
00472         bool isReleasedInFuture(
00473             const Session&                 session,
00474             const OSB_LIB::TfVersion::Oid& oid
00475         );
00476 
00490         bool uniqueReleaseTs(
00491             const Session&              session,
00492             const OSB_LIB::Tariff::Oid& oid,
00493             const OSB_LIB::DateTime&    ts
00494         ) const;
00495 
00509         bool isTariffUsedByReleasedTsVersion(
00510             const Session&              session,
00511             const OSB_LIB::Tariff::Oid& oid
00512         );
00513 
00527         bool isTariffUsedByFreezedTsVersion(
00528             const Session&              session,
00529             const OSB_LIB::Tariff::Oid& oid
00530         );
00531 
00543         OSB_LIB::DateTime findReplacementReleasedTfVersion(
00544             const Session&                 session,
00545             const OSB_LIB::TfVersion::Oid& oid
00546         );
00547 
00559         bool hasOtherReleasedTfVersion(
00560             const Session&                 session,
00561             const OSB_LIB::TfVersion::Oid& oid
00562         );
00563 
00574         bool findReplacementFreezedTfVersion(
00575             const Session&                 session,
00576             const OSB_LIB::TfVersion::Oid& oid
00577         );
00578 
00595         bool setStatus(
00596             const Session&            session,
00597                   OSB_LIB::TfVersion& tfVs,
00598                   OSB_LIB::CfgStatus  status
00599         );
00600 
00601 
00614         bool existReleasedTfVs(
00615             const Session&                 session,
00616             const OSB_LIB::Date&           backDate,
00617             const OSB_LIB::TfVersion::Oid& oid
00618         );
00619 
00632         bool patch(
00633             const Session&            session,
00634                   OSB_LIB::TfVersion& tfVs,
00635                   OSB_LIB::TfVersion& newTfVs
00636         );
00637     };                                  // struct TfVersionGw
00638 }                                       // namespace OSB_DB
00639 #endif                                  // #ifndef _TARIFFGW_H_

Generated on Sat Sep 2 14:06:35 2006 for OSB Library by  doxygen 1.4.7