00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef _TARIFFCATALOGUE_H_
00039 #define _TARIFFCATALOGUE_H_
00040
00041
00042
00043
00044
00045
00046 #include "osberror.h"
00047 #include "chrono.h"
00048 #include "tariffperiod-gw.h"
00049 #include "serviceclass.h"
00050 #include "tariffsystem.h"
00051 #include "tariff.h"
00052 #include "nwaddress.h"
00053 #include "cpmapper.h"
00054 #include "tcdist.h"
00055 #include "cgi.h"
00056 #include "e164.h"
00057 #include "e164map.h"
00058 #include "roundrule.h"
00059 #include "ratedservice.h"
00060
00061
00062 namespace OSB_DB {
00063 class Session;
00064 class TariffSystemGw;
00065 }
00066
00067 namespace OSB_LIB {
00068 class ConnectionPt;
00069 class CpTree;
00070 class SeTree;
00071 class TcatLockManager;
00072 class TcatReadMonitor;
00073 class UsageTypeList;
00074 }
00075
00076
00077
00078 namespace OSB_LIB {
00079
00080
00081
00082
00090 enum LockObjects {
00092 lckTs = 10,
00093
00095 lckSc = 20,
00096
00098 lckTcs = 30,
00099
00101 lckTp = 40,
00102
00104 lckTf = 50
00105 };
00106
00107
00108
00109
00110
00111
00126 class TariffCatalogue {
00132 friend class TcatLockManager;
00133
00134 public:
00136 TariffCatalogue();
00138 ~TariffCatalogue();
00139
00140 private:
00142
00143 TariffCatalogue(const TariffCatalogue& rhs);
00144 TariffCatalogue& operator=(const TariffCatalogue& rhs);
00146
00148 TcatLockManager* tcatlm_;
00149
00155 void readGracePeriod(const OSB_DB::Session& session);
00156
00162 void readUsageTypes(const OSB_DB::Session& session);
00163
00172 void readTariffSystem(const OSB_DB::Session& session);
00173
00182 void readServiceClass(const OSB_DB::Session& session);
00183
00192 void readTcSystem(const OSB_DB::Session& session);
00193
00202 void readTpSystem(const OSB_DB::Session& session);
00203
00212 void readTariff(const OSB_DB::Session& session);
00213
00215 void sortTsLists();
00216
00218 void sortScLists();
00219
00221 void sortTcsLists();
00222
00224 void sortTpsLists();
00225
00227 void sortTfLists();
00228
00229 public:
00238 void setLock(TcatLockManager& tcatlm)
00239 {
00240 tcatlm_ = &tcatlm;
00241 };
00242
00257 void read(
00258 OSB_DB::Session& session,
00259 bool noWait = false,
00260 TcatReadMonitor* monitor = 0
00261 );
00262
00264 std::ostream& tariffInfo(std::ostream&);
00265
00271 size_t info(std::string& st);
00272
00273
00274
00276 long gracePeriod() const { return gracePeriod_; }
00277
00279 const UsageTypeList& usageTypeList() const;
00280
00282
00283
00303 bool creSpecialDate(
00304 OSB_DB::Session& session,
00305 SpecialDate& sd,
00306 bool noWait
00307 );
00308
00334 void delSpecialDate(
00335 OSB_DB::Session& session,
00336 const SpecialDate::Oid& sdId,
00337 bool noWait
00338 );
00339
00354 OsbError updSpecialDate(
00355 OSB_DB::Session& session,
00356 SpecialDate& sd,
00357 bool noWait
00358 );
00359
00366 SpecialDate* specialDate(
00367 const SpecialDate::Oid& sdId
00368 );
00369
00376 const SpecialDate* findSpecialDate(
00377 const SpecialDate::Oid& sdId
00378 ) const;
00379
00390 const SpecialDate* searchActiveSpecialDate(
00391 const Date& date
00392 ) const;
00393
00402 const SpecialDate& getSpecialDate(
00403 const SpecialDate::Oid& sdId
00404 ) const;
00405
00407 const SpecialDates& specialDates() const { return specialDates_; }
00408
00419 bool changeSdStatus(
00420 OSB_DB::Session& session,
00421 const SpecialDate::Oid& sdId,
00422 CfgStatus reqStatus,
00423 OsbErrors& errors,
00424 const bool noWait
00425 );
00426
00427 private:
00438 bool changeSdStatus(
00439 OSB_DB::Session& session,
00440 SpecialDate& sd,
00441 CfgStatus reqStatus,
00442 OsbErrors& errors,
00443 bool noWait
00444 );
00445
00446 public:
00448 void sortSpecialDates();
00450
00451
00452
00454
00455
00461 DayClass* dayClass(const DayClass::Oid& oid);
00462
00472 const DayClass* findDayClass(const DayClass::Oid& dcId) const;
00473
00482 const DayClass& getDayClass(const DayClass::Oid& oid) const;
00483
00496 const DayClass* getDayClass(
00497 const DayClass::Oid& oid,
00498 const Weekday& weekday
00499 ) const;
00500
00519 DayClass::Oid creDayClass(
00520 OSB_DB::Session& session,
00521 DayClass& dc,
00522 bool noWait
00523 );
00524
00542 void delDayClass(
00543 OSB_DB::Session& session,
00544 DayClass::Oid& oid,
00545 bool noWait
00546 );
00547
00567 OsbError updDayClass(
00568 OSB_DB::Session& session,
00569 DayClass& dc,
00570 bool noWait
00571 );
00572
00574 const DayClasses& dayClasses() const { return dayClasses_; }
00575
00586 bool changeDcStatus(
00587 OSB_DB::Session& session,
00588 const DayClass::Oid& dcId,
00589 CfgStatus reqStatus,
00590 OsbErrors& errors,
00591 const bool noWait
00592 );
00593
00594 public:
00596 void sortDayClasses();
00598
00599
00600
00602
00603
00609 TariffPeriod* tariffPeriod(const TariffPeriod::Oid& oid);
00610
00620 const TariffPeriod* findTariffPeriod(
00621 const TariffPeriod::Oid& oid
00622 ) const;
00623
00632 const TariffPeriod& getTariffPeriod(
00633 const TariffPeriod::Oid& oid
00634 ) const;
00635
00654 TariffPeriod::Oid creTariffPeriod(
00655 OSB_DB::Session& session,
00656 TariffPeriod& tp,
00657 bool noWait
00658 );
00659
00679 OsbError updTariffPeriod(
00680 OSB_DB::Session& session,
00681 TariffPeriod& tp,
00682 bool noWait
00683 );
00684
00703 void delTariffPeriod(
00704 OSB_DB::Session& session,
00705 const TariffPeriod::Oid& oid,
00706 bool noWait
00707 );
00708
00721 const TariffPeriod::Oid& getTariffPeriod(
00722 const DayClass::Oid& dcId,
00723 const Time& time
00724 );
00725
00727 TariffPeriods& tariffPeriods() { return tariffPeriods_; }
00728
00730 void sortTariffPeriods();
00732
00733
00734
00736
00737
00738 const TpsVersions& tpsVersions() const { return tpsVersions_; }
00739
00753 const TpsVersion* searchTpsVersion(
00754 const TpSystem::Oid& oid,
00755 const DateTime& ts
00756 ) const;
00757
00765 const TpsVersion* findTpsVersion(
00766 const TpsVersion::Oid& oid
00767 ) const;
00768
00774 const TpsVersion& getTpsVersion(const TpsVersion::Oid& oid);
00775
00788 const TpsVersion& getReleasedTpsVersion(
00789 const TpSystem::Oid& tpsOid,
00790 const DateTime& startDateTime
00791 )const ;
00792
00801 TpsVersion* tpsVersion (const TpsVersion::Oid& oid);
00802
00821 TpsVersion::Oid creTpsVersion (
00822 OSB_DB::Session& session,
00823 TpsVersion& tpsVs,
00824 bool noWait
00825 );
00826
00842 void delTpsVersion (
00843 OSB_DB::Session& session,
00844 const TpsVersion::Oid& oid,
00845 bool noWait
00846 );
00847
00868 OsbError updTpsVersion (
00869 OSB_DB::Session& session,
00870 TpsVersion& tpsVs,
00871 bool noWait
00872 );
00873
00884 bool changeTpsVsStatus(
00885 OSB_DB::Session& session,
00886 const TpsVersion::Oid& tpsVsId,
00887 CfgStatus reqStatus,
00888 OsbErrors& errors,
00889 const bool noWait
00890 );
00891
00893 void sortTpsVersions();
00895
00896
00897
00899
00900
00901 TpSystems& tpSystems() { return tpSystems_; }
00902
00921 TpSystem::Oid creTpSystem(
00922 OSB_DB::Session& session,
00923 TpSystem& tps,
00924 bool noWait
00925 );
00926
00948 OsbError updTpSystem(
00949 OSB_DB::Session& session,
00950 TpSystem& tps,
00951 bool noWait
00952 );
00953
00962 TpSystem* tpSystem(const TpSystem::Oid& oid);
00963
00973 const TpSystem* findTpSystem(const TpSystem::Oid& oid) const;
00974
00983 const TpSystem& getTpSystem(const TpSystem::Oid& oid) const;
00984
01003 void delTpSystem(
01004 OSB_DB::Session& session,
01005 const TpSystem::Oid& oid,
01006 bool noWait
01007 );
01008
01010 void sortTpSystems();
01012
01013
01014
01016
01017 private:
01026 ConnectionPt* connectionPt(const Id<ConnectionPt>& oid);
01027
01028 public:
01038 const ConnectionPt* findConnectionPt(
01039 const Id<ConnectionPt>& oid
01040 ) const;
01041
01049 const ConnectionPt& getConnectionPt(
01050 const Id<ConnectionPt>& oid
01051 ) const;
01052
01072 Id<ConnectionPt> creConnectionPt(
01073 OSB_DB::Session& session,
01074 ConnectionPt& cp,
01075 bool noWait
01076 );
01077
01095 void delConnectionPt(
01096 OSB_DB::Session& session,
01097 Id<ConnectionPt>& oid,
01098 bool noWait
01099 );
01100
01120 OsbError updConnectionPt(
01121 OSB_DB::Session& session,
01122 ConnectionPt& cp,
01123 bool noWait
01124 );
01125
01127 const CpTree& cpTree() const;
01128
01130 const CpMapperList&
01131 cpMapperList() const { return cpMapperList_; }
01132
01143 bool changeCpStatus(
01144 OSB_DB::Session& session,
01145 const Id<ConnectionPt>& cpId,
01146 CfgStatus reqStatus,
01147 OsbErrors& errors,
01148 const bool noWait
01149 );
01151
01152
01153
01155
01156
01162 Cgi* cgi(const Cgi::Oid& oid);
01163
01173 const Cgi* findCgi(const Cgi::Oid& oid) const;
01174
01182 const Cgi& getCgi(const Cgi::Oid& oid) const;
01183
01204 Cgi::Oid creCgi(
01205 OSB_DB::Session& session,
01206 const Id<ConnectionPt>& cpId,
01207 const std::string& name,
01208 const std::string& val,
01209 bool noWait
01210 );
01211
01228 void delCgi(
01229 OSB_DB::Session& session,
01230 Cgi::Oid& oid,
01231 bool noWait
01232 );
01233
01253 OsbError updCgi(
01254 OSB_DB::Session& session,
01255 Cgi& cgi,
01256 bool noWait
01257 );
01258
01268 size_t checkCgi(
01269 OSB_DB::Session& session,
01270 const Cgi::Oid& oid,
01271 OsbErrors& errors,
01272 const bool noWait
01273 );
01274
01284 size_t unfreezeCgi(
01285 OSB_DB::Session& session,
01286 const Cgi::Oid& oid,
01287 OsbErrors& errors,
01288 const bool noWait
01289 );
01290
01300 size_t releaseCgi(
01301 OSB_DB::Session& session,
01302 const Cgi::Oid& oid,
01303 OsbErrors& errors,
01304 const bool noWait
01305 );
01306
01316 size_t revokeCgi(
01317 OSB_DB::Session& session,
01318 const Cgi::Oid& oid,
01319 OsbErrors& errors,
01320 const bool noWait
01321 );
01322
01334 bool cgiTzConfigEditable(const Cgi::Oid& oid);
01335
01337 const Cgis& cgis() const { return cgis_; }
01338
01340 void sortCgis();
01341
01359 const CgiMap& cgiMap() const;
01361
01362
01363
01365
01366
01372 E164* e164(const E164::Oid& oid);
01373
01384 const E164* findE164(const E164::Oid& oid) const;
01385
01393 const E164& getE164(const E164::Oid& oid) const;
01394
01414 E164::Oid creE164(
01415 OSB_DB::Session& session,
01416 E164& e164,
01417 bool noWait
01418 );
01419
01438 void delE164(
01439 OSB_DB::Session& session,
01440 E164::Oid& oid,
01441 bool noWait
01442 );
01443
01463 OsbError updE164(
01464 OSB_DB::Session& session,
01465 E164& e164,
01466 bool noWait
01467 );
01468
01479 bool changeE164Status(
01480 OSB_DB::Session& session,
01481 const E164::Oid& e164Id,
01482 CfgStatus reqStatus,
01483 OsbErrors& errors,
01484 const bool noWait
01485 );
01486
01498 bool e164TzConfigEditable(const E164::Oid& oid);
01499
01501 const E164s& e164s() const { return e164s_; }
01502
01504 void sortE164s();
01505
01523 const E164Map& e164Map() const;
01525
01526
01527
01529
01530
01536 TariffClass* tariffClass(const TariffClass::Oid& oid);
01537
01548 const TariffClass* findTariffClass(
01549 const TariffClass::Oid& oid
01550 ) const;
01551
01559 const TariffClass& getTariffClass(
01560 const TariffClass::Oid& oid
01561 ) const;
01562
01581 TariffClass::Oid creTariffClass(
01582 OSB_DB::Session& session,
01583 TariffClass& tc,
01584 bool noWait
01585 );
01586
01604 void delTariffClass(
01605 OSB_DB::Session& session,
01606 TariffClass::Oid& oid,
01607 bool noWait
01608 );
01609
01629 OsbError updTariffClass(
01630 OSB_DB::Session& session,
01631 TariffClass& tc,
01632 bool noWait
01633 );
01634
01636 const TariffClasses& tariffClasses() const
01637 {
01638 return tariffClasses_;
01639 }
01640
01642 void sortTariffClasses();
01644
01645
01646
01648
01649
01655 TariffZone* tariffZone(const TariffZone::Oid& oid);
01656
01667 const TariffZone* findTariffZone(
01668 const TariffZone::Oid& oid
01669 ) const;
01670
01678 const TariffZone& getTariffZone(
01679 const TariffZone::Oid& oid
01680 ) const;
01681
01702 TariffZone::Oid creTariffZone(
01703 OSB_DB::Session& session,
01704 TariffZone& tz,
01705 bool noWait
01706 );
01707
01731 void delTariffZone(
01732 OSB_DB::Session& session,
01733 TariffZone::Oid& oid,
01734 bool force,
01735 bool noWait
01736 );
01737
01758 OsbError updTariffZone(
01759 OSB_DB::Session& session,
01760 TariffZone& tz,
01761 bool noWait
01762 );
01763
01765 bool isTzInConfig(const TariffZone::Oid& oid);
01766
01768 const TariffZones& tariffZones() const
01769 {
01770 return tariffZones_;
01771 }
01772
01774 void sortTariffZones();
01776
01777
01778
01780
01781
01788 TcSystem* tcSystem(const TcSystem::Oid& oid);
01789
01800 const TcSystem* findTcSystem(const TcSystem::Oid& oid) const;
01801
01810 const TcSystem& getTcSystem(const TcSystem::Oid& oid) const;
01811
01831 TcSystem::Oid creTcSystem(
01832 OSB_DB::Session& session,
01833 TcSystem& tcs,
01834 bool noWait
01835 );
01836
01856 void delTcSystem(
01857 OSB_DB::Session& session,
01858 TcSystem::Oid& oid,
01859 bool noWait
01860 );
01861
01876 OsbError updTcSystem(
01877 OSB_DB::Session& session,
01878 TcSystem& tcs,
01879 bool noWait
01880 );
01881
01883 const TcSystems& tcSystems() const
01884 {
01885 return tcSystems_;
01886 }
01887
01889 void sortTcSystems();
01891
01892
01893
01895
01896
01902 const TzConfigs getTzConfigs(const TariffZone::Oid& oid) const;
01903
01913 TzConfig* tzConfig(const TzConfig::Oid& oid);
01914
01925 const TzConfig* findTzConfig(const TzConfig::Oid& oid) const;
01926
01935 const TzConfig& getTzConfig(const TzConfig::Oid& oid) const;
01936
01954 bool creTzConfig(
01955 OSB_DB::Session& session,
01956 TzConfig& tzCfg,
01957 bool noWait
01958 );
01959
01981 void delTzConfig(
01982 OSB_DB::Session& session,
01983 const TzConfig::Oid& oid,
01984 bool noWait
01985 );
01986
02006 OsbError updTzConfig(
02007 OSB_DB::Session& session,
02008 TzConfig& tzcfg,
02009 bool noWait
02010 );
02011
02013 const TzConfigs& tzConfigs() const
02014 {
02015 return tzConfigs_;
02016 }
02017
02030 bool changeTzCfgStatus(
02031 OSB_DB::Session& session,
02032 const TzConfig::Oid& tzConfigId,
02033 CfgStatus reqStatus,
02034 OsbErrors& errors,
02035 const bool noWait
02036 );
02037
02039 void sortTzCfgByStartDate();
02041
02042
02043
02045
02046
02052 TariffSystem* tariffSystem(const TariffSystem::Oid& oid);
02053
02063 const TariffSystem* findTariffSystem(
02064 const TariffSystem::Oid& oid
02065 ) const;
02066
02074 const TariffSystem& getTariffSystem(
02075 const TariffSystem::Oid& oid
02076 ) const;
02077
02096 TariffSystem::Oid creTariffSystem(
02097 OSB_DB::Session& session,
02098 TariffSystem& ts,
02099 bool noWait
02100 );
02101
02120 void delTariffSystem(
02121 OSB_DB::Session& session,
02122 TariffSystem::Oid& oid,
02123 bool noWait
02124 );
02125
02145 OsbError updTariffSystem(
02146 OSB_DB::Session& session,
02147 TariffSystem& ts,
02148 bool noWait
02149 );
02150
02152 const TariffSystems&
02153 tariffSystems() const { return tariffSystems_; }
02154
02156 void sortTariffSystems();
02158
02159
02160
02162
02163
02172 TsVersion* tsVersion(const TsVersion::Oid& oid);
02173
02184 const TsVersion* findTsVersion(const TsVersion::Oid& oid) const;
02185
02194 const TsVersion& getTsVersion(const TsVersion::Oid& oid) const;
02195
02206 const TsVersion& getReleasedTsVersion(
02207 const TariffSystem::Oid& tsId,
02208 const DateTime& startDt
02209 ) const;
02210
02233 TsVersion::Oid creTsVersion(
02234 OSB_DB::Session& session,
02235 TsVersion& tsVs,
02236 bool noWait
02237 );
02238
02257 void delTsVersion(
02258 OSB_DB::Session& session,
02259 const TsVersion::Oid oid,
02260 bool noWait
02261 );
02262
02279 OsbError updTsVersion(
02280 OSB_DB::Session& session,
02281 TsVersion& tsv,
02282 bool noWait
02283 );
02284
02286 const TsVersions& tsVersions() const
02287 {
02288 return tsVersions_;
02289 }
02290
02302 bool changeTsVsStatus(
02303 OSB_DB::Session& session,
02304 const TsVersion::Oid& tsVsId,
02305 CfgStatus reqStatus,
02306 OsbErrors& errors,
02307 const bool noWait
02308 );
02309
02311 void sortTsVersions();
02312
02314 void sortScOfTsVersion(
02315 const ServiceClass::Oid& oid
02316 );
02317
02319 void sortTcOfTsVersion(
02320 const TariffClass::Oid& oid
02321 );
02323
02324
02325
02327
02328 private:
02336 ServiceClass* serviceClass(const ServiceClass::Oid& oid);
02337
02338 public:
02346 const ServiceClass*
02347 findServiceClass(const ServiceClass::Oid& oid) const;
02348
02357 const ServiceClass&
02358 getServiceClass(const ServiceClass::Oid& oid) const;
02359
02374 ServiceClass::Oid creServiceClass(
02375 OSB_DB::Session& session,
02376 ServiceClass& sc,
02377 const bool noWait
02378 );
02379
02394 OsbError updServiceClass(
02395 OSB_DB::Session& session,
02396 ServiceClass& sc,
02397 const bool noWait);
02398
02411 void delServiceClass(
02412 OSB_DB::Session& session,
02413 const ServiceClass::Oid& oid,
02414 const bool noWait
02415 );
02416
02418 const ServiceClasses& serviceClasses()
02419 {
02420 return serviceClasses_;
02421 }
02422
02424 void sortServiceClasses();
02426
02427
02428
02430
02431 private:
02440 ScSystem* scSystem(const ScSystem::Oid& oid);
02441
02442 public:
02450 const ScSystem* findScSystem(const ScSystem::Oid& oid) const;
02451
02460 const ScSystem& getScSystem(const ScSystem::Oid& oid) const;
02461
02476 ScSystem::Oid creScSystem(
02477 OSB_DB::Session& session,
02478 ScSystem& scs,
02479 const bool noWait
02480 );
02481
02495 OsbError updScSystem(
02496 OSB_DB::Session& session,
02497 ScSystem& scs,
02498 const bool noWait
02499 );
02500
02515 void delScSystem(
02516 OSB_DB::Session& session,
02517 const ScSystem::Oid& oid,
02518 const bool noWait
02519 );
02520
02522 const ScSystems& scSystems() const { return scSystems_; }
02523
02525 void sortScSystems();
02527
02528
02529
02531
02532 private:
02541 ScsVersion* scsVersion(const ScsVersion::Oid& oid);
02542
02543 public:
02552 const ScsVersion* findScsVersion(const ScsVersion::Oid& oid) const;
02553
02563 const ScsVersion& getScsVersion(const ScsVersion::Oid& oid) const;
02564
02584 const ScsVersion& getReleasedScsVersion(
02585 const ScSystem::Oid& oid,
02586 const DateTime& startDateTime
02587 ) const ;
02588
02603 ScsVersion::Oid creScsVersion(
02604 OSB_DB::Session& session,
02605 ScsVersion& scsVs,
02606 bool noWait
02607 );
02608
02622 OsbError updScsVersion(
02623 OSB_DB::Session& session,
02624 ScsVersion& scsVs,
02625 const bool noWait
02626 );
02627
02642 void delScsVersion(
02643 OSB_DB::Session& session,
02644 const ScsVersion::Oid& oid,
02645 const bool noWait
02646 );
02647
02649 const ScsVersions& scsVersions() const { return scsVersions_; }
02650
02661 bool changeScsVsStatus(
02662 OSB_DB::Session& session,
02663 const ScsVersion::Oid& scsVs,
02664 CfgStatus reqStatus,
02665 OsbErrors& errors,
02666 const bool noWait
02667 );
02668
02670 void sortScsVersions();
02672
02673
02674
02676
02677 private:
02685 TcsVersion* tcsVersion(const TcsVersion::Oid& oid);
02686
02687 public:
02695 const TcsVersion* findTcsVersion(
02696 const TcsVersion::Oid& oid
02697 ) const;
02698
02708 const TcsVersion& getTcsVersion(
02709 const TcsVersion::Oid& oid
02710 ) const;
02711
02721 const TcsVersion* findReleasedTcsVersion(
02722 const TcSystem::Oid& tcsId,
02723 const DateTime& ts
02724 ) const;
02725
02734 const TcsVersion& getReleasedTcsVersion(
02735 const TcSystem::Oid& tcsId,
02736 const DateTime& ts
02737 ) const;
02738
02754 TcsVersion::Oid creTcsVersion(
02755 OSB_DB::Session& session,
02756 TcsVersion& tcsVs,
02757 const bool noWait
02758 );
02759
02771 OsbError updTcsVersion(
02772 OSB_DB::Session& session,
02773 TcsVersion& tcsVs,
02774 const bool noWait
02775 );
02776
02789 void delTcsVersion(
02790 OSB_DB::Session& session,
02791 const TcsVersion::Oid& oid,
02792 const bool noWait
02793 );
02794
02796 const TcsVersions& tcsVersions() const;
02797
02808 bool changeTcsVsStatus(
02809 OSB_DB::Session& session,
02810 const TcsVersion::Oid& tcsVsId,
02811 CfgStatus reqStatus,
02812 OsbErrors& errors,
02813 const bool noWait
02814 );
02815
02817 void sortTcsVersions();
02818
02820 void sortCfgOfTcsVersion(
02821 const TariffZone::Oid& oid
02822 );
02824
02825
02826
02828
02829 private:
02836 Tariff* tariff(const Tariff::Oid& oid);
02837
02838 public:
02846 const Tariff* findTariff(const Tariff::Oid& oid) const;
02847
02854 const Tariff& getTariff(const Tariff::Oid& oid) const;
02855
02863 bool isTariffUsed(const Tariff::Oid& oid);
02864
02876 Tariff::Oid creTariff(
02877 OSB_DB::Session& session,
02878 Tariff& tf,
02879 bool noWait
02880 );
02881
02894 OsbError updTariff(
02895 OSB_DB::Session& session,
02896 Tariff& tf,
02897 bool noWait
02898 );
02899
02909 void delTariff(
02910 OSB_DB::Session& session,
02911 const Tariff::Oid& oid,
02912 const bool noWait
02913 );
02914
02916 Tariffs& tariffs() { return tariffs_; }
02917
02919 void sortTariffs();
02921
02922
02923
02925
02926 private:
02935 TfVersion* tfVersion(const TfVersion::Oid& oid);
02936
02937 public:
02945 const TfVersion* findTfVersion(const TfVersion::Oid& oid) const;
02946
02956 const TfVersion& getTfVersion(const TfVersion::Oid& oid) const;
02957
02968 const TfVersion& getReleasedTfVersion(
02969 const Tariff::Oid& tf,
02970 const DateTime& ts
02971 ) const;
02972
02988 TfVersion::Oid creTfVersion(
02989 OSB_DB::Session& session,
02990 TfVersion& tfVs,
02991 const bool noWait
02992 );
02993
03023 bool patchTfVersion(
03024 OSB_DB::Session& session,
03025 const TfVersion::Oid& oid,
03026 const TfVersion::Oid& replacing,
03027 std::vector<OsbError>& err,
03028 const bool noWait);
03029
03042 OsbError updTfVersion(
03043 OSB_DB::Session& session,
03044 TfVersion& tfVs,
03045 const bool noWait
03046 );
03047
03061 void delTfVersion(
03062 OSB_DB::Session& session,
03063 const TfVersion::Oid& oid,
03064 bool noWait
03065 );
03066
03068 const TfVersions& tfVersions() const;
03069
03080 bool changeTfVsStatus(
03081 OSB_DB::Session& session,
03082 const TfVersion::Oid& tfVsId,
03083 CfgStatus reqStatus,
03084 OsbErrors& errors,
03085 const bool noWait
03086 );
03087
03096 bool canRevokeTfVersion(
03097 OSB_DB::Session& session,
03098 const TfVersion::Oid& oid
03099 );
03101 void sortTfVersions();
03103
03104 private:
03114 bool changeToCfgStatus(
03115 OSB_DB::Session& session,
03116 ToCfgBase& toCfg,
03117 CfgStatus reqStatus,
03118 OsbErrors& errors
03119 );
03120
03121
03122
03124
03125 public:
03134 RatingFn* ratingFn(const RatingFn::Oid& oid) const;
03135
03143 const RatingFn* findRatingFn(const RatingFn::Oid& oid) const;
03144
03154 const RatingFn& getRatingFn(const RatingFn::Oid& oid) const;
03155
03177 bool creRatingFn(
03178 OSB_DB::Session& session,
03179 RatingFn& rf,
03180 const bool noWait
03181 );
03182
03196 OsbError updRatingFn(
03197 OSB_DB::Session& session,
03198 RatingFn& rf,
03199 const bool noWait
03200 );
03201
03217 void delRatingFn(
03218 OSB_DB::Session& session,
03219 const RatingFn::Oid& oid,
03220 const bool noWait
03221 );
03222
03224 const RatingFns& ratingFns();
03225
03236 bool changeRfStatus(
03237 OSB_DB::Session& session,
03238 const RatingFn::Oid& rfId,
03239 CfgStatus reqStatus,
03240 OsbErrors& errors,
03241 const bool noWait
03242 );
03243
03245 void sortRatingFns();
03247
03248 public:
03249
03250
03252
03253
03254 const SeTree& seTree() const;
03255
03263 const ServiceElement*
03264 findServiceElement(const ServiceElement::Oid& seId) const;
03265
03273 const ServiceElement* findServiceElement(
03274 const ServiceElement& se
03275 ) const;
03276
03285 const ServiceElement&
03286 getServiceElement(const ServiceElement::Oid& seId) const;
03288
03289
03290
03292
03293 private:
03302 RatedServices::iterator
03303 ratedService(const RatedService::Oid& oid);
03304
03305 public:
03313 const RatedService*
03314 findRatedService(const RatedService::Oid& oid) const;
03315
03323 const RatedService&
03324 getRatedService(const RatedService::Oid& oid) const;
03325
03327 const RatedServices& ratedServices() const;
03328
03339 RatedService::Oid findRatedService(const ServiceTuple& st) const;
03340
03349 RatedService::Oid creRatedService(
03350 OSB_DB::Session& session,
03351 RatedService& service,
03352 bool noWait
03353 );
03354
03363 void updRatedService(
03364 OSB_DB::Session& session,
03365 RatedService& service,
03366 bool noWait
03367 );
03368
03369
03370
03371
03372
03373
03374
03375
03376 void delRatedService(
03377 OSB_DB::Session& session,
03378 const RatedService::Oid& rsId,
03379 bool noWait
03380 );
03381
03392 bool changeRsStatus(
03393 OSB_DB::Session& session,
03394 const RatedService::Oid& rsId,
03395 CfgStatus reqStatus,
03396 OsbErrors& errors,
03397 const bool noWait
03398 );
03400
03401 private:
03403 long gracePeriod_;
03405 UsageTypeList* usageTypeList_;
03406
03408
03409
03410 SpecialDates specialDates_;
03412 DayClasses dayClasses_;
03414 TariffPeriods tariffPeriods_;
03416 TpSystems tpSystems_;
03418 TpsVersions tpsVersions_;
03420
03422
03423
03424 Cgis cgis_;
03434 mutable CgiMap cgiMap_;
03435
03437 E164s e164s_;
03447 mutable E164Map* e164Map_;
03448
03450 TariffClasses tariffClasses_;
03452 TariffZones tariffZones_;
03454 TcSystems tcSystems_;
03456 TcsVersions tcsVersions_;
03458 TzConfigs tzConfigs_;
03460 CpTree* cpTree_;
03462 CpMapperList cpMapperList_;
03464
03466
03467 TariffSystems tariffSystems_;
03468 TsVersions tsVersions_;
03469
03470
03472
03473
03474 ServiceClasses serviceClasses_;
03476 ScSystems scSystems_;
03478 ScsVersions scsVersions_;
03480
03482
03483
03484 Tariffs tariffs_;
03486 TfVersions tfVersions_;
03488 RatingFns ratingFns_;
03490
03492
03493
03494 SeTree* seTree_;
03496
03498 RatedServices ratedServices_;
03499
03500
03501
03502
03503
03504
03505 };
03506 }
03507 #endif // #ifndef _TARIFFCATALOGUE_H_