tcdist-gw.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00006 /*
00007   AUTHOR(S): Stephan Broennimann (vb)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.29 $
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 _TCDISTGW_H_
00031 #define _TCDISTGW_H_
00032 
00033 // *********************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + local headers
00038 #include "tcdist.h"
00039 
00040 // *********************************************************************
00041 // class declarations
00042 namespace OSB_LIB {
00043     class MappingDistTcs;
00044 }
00045 
00046 namespace OSB_DB {
00047     class Session;
00048 }
00049 
00050 // ************************************************************************
00051 // namespace extensions
00052 namespace OSB_DB {
00053 
00054 // *********************************************************************
00055 // class definitions
00056 
00057     // *****************************************************************
00058     // TariffZoneGw
00065     struct TariffZoneGw {
00077         long fetch(
00078             const Session&              session,
00079                   OSB_LIB::TariffZones& tzs
00080         );
00081 
00094         long fetch(
00095             const Session&             session,
00096                   OSB_LIB::TariffZone& tz
00097         );
00098 
00113         bool insTariffZone(
00114             const Session&             session,
00115                   OSB_LIB::TariffZone& tz
00116         );
00117 
00132         bool delTariffZone(
00133             const Session&             session,
00134                   OSB_LIB::TariffZone& tz
00135         );
00136 
00152         bool updTariffZone(
00153             const Session&             session,
00154                   OSB_LIB::TariffZone& tz
00155         );
00156 
00171         OSB_LIB::ObjectStatus checkObjVs(
00172             const Session&             session,
00173             const OSB_LIB::TariffZone& tz
00174         );
00175     };
00176 
00177     // *****************************************************************
00178     // class TzConfigGw
00182     struct TzConfigGw {
00196         long fetch(
00197             const Session&            session,
00198                   OSB_LIB::TzConfigs& tzcfgs
00199         );
00200 
00214         bool fetch(
00215             const Session&           session,
00216                   OSB_LIB::TzConfig& tzcfg
00217         );
00218 
00231         bool insTzConfig(
00232             const Session&           session,
00233                   OSB_LIB::TzConfig& tzCfg
00234         );
00235 
00249         bool delTzConfig(
00250             const Session&           session,
00251                   OSB_LIB::TzConfig& tzcfg
00252         );
00253 
00268         bool delAllTzConfig(
00269             const Session&                  session,
00270             const OSB_LIB::TariffZone::Oid& oid
00271         );
00272 
00287         bool updTzConfig(
00288             const Session&           session,
00289                   OSB_LIB::TzConfig& tzcfg
00290         );
00291 
00300         void originFreezed(
00301             const Session&                            session,
00302             const OSB_LIB::Id<OSB_LIB::ConnectionPt>& origin,
00303                   OSB_LIB::OsbErrors&                 errors
00304         );
00305 
00314         void destinationFreezed(
00315             const Session&                            session,
00316             const OSB_LIB::Id<OSB_LIB::ConnectionPt>& dest,
00317                   OSB_LIB::OsbErrors&                 errors
00318         );
00319 
00328         void originReleased(
00329             const Session&                            session,
00330             const OSB_LIB::Id<OSB_LIB::ConnectionPt>& origin,
00331                   OSB_LIB::OsbErrors&                 errors
00332         );
00333 
00342         void destinationReleased(
00343             const Session&                            session,
00344             const OSB_LIB::Id<OSB_LIB::ConnectionPt>& dest,
00345                   OSB_LIB::OsbErrors&                 errors
00346         );
00347 
00360         void checkOverLap(
00361             const Session&            session,
00362             const OSB_LIB::TzConfig&  tzConfig,
00363                   OSB_LIB::OsbErrors& errors
00364         );
00365 
00376         void bothDateInFuture(
00377             const Session&                session,
00378             const OSB_LIB::TzConfig::Oid& oid,
00379                   OSB_LIB::OsbErrors&     errors
00380         );
00381 
00392         void noDateConflict(
00393             const Session&                session,
00394             const OSB_LIB::TzConfig::Oid& oid,
00395                   OSB_LIB::OsbErrors&     errors
00396         );
00397 
00412         void originCoverWholeTzConfigReleasedPeriod(
00413             const Session&                session,
00414             const OSB_LIB::TzConfig::Oid& oid,
00415                   OSB_LIB::OsbErrors&     errors
00416         );
00417 
00433         void destinationCoverWholeTzConfigReleasedPeriod(
00434             const Session&                session,
00435             const OSB_LIB::TzConfig::Oid& oid,
00436                   OSB_LIB::OsbErrors&     errors
00437         );
00438 
00453         bool originCoverWholeTzCfgReleasedPeriod(
00454             const Session&                session,
00455             const OSB_LIB::TzConfig::Oid& oid
00456         );
00457 
00473         bool destinationCoverWholeTzCfgReleasedPeriod(
00474             const Session&                session,
00475             const OSB_LIB::TzConfig::Oid& oid
00476         );
00477 
00486         void gracePeriodExpired(
00487             const Session&                session,
00488             const OSB_LIB::TzConfig::Oid& oid,
00489                   OSB_LIB::OsbErrors&     errors
00490         );
00491 
00500         bool isUsedByReleasedDistTcs(
00501             const Session&                  session,
00502             const OSB_LIB::TariffZone::Oid& tzOid
00503         );
00504 
00512         void updStatus(
00513             const Session&           session,
00514                   OSB_LIB::TzConfig& tzConfig
00515         );
00516 
00529         OSB_LIB::ObjectStatus checkObjVs(
00530             const Session&           session,
00531             const OSB_LIB::TzConfig& tzConfig
00532         );
00533     };
00534 
00535     // *****************************************************************
00536     // class MappingDistTcsGw
00541     class MappingDistTcsGw {
00543         friend class OSB_LIB::MappingDistTcs;
00544 
00560         bool readSpecific(
00561             const Session&                 session,
00562                   OSB_LIB::MappingDistTcs& tcs
00563         );
00564 
00575         bool insSpecific(
00576             const Session&                 session,
00577             const OSB_LIB::MappingDistTcs& tcs
00578         );
00579 
00590         bool updSpecific(
00591             const Session&                 session,
00592                   OSB_LIB::MappingDistTcs& tcs
00593         );
00594 
00604         bool delSpecific(
00605             const Session&                 session,
00606                   OSB_LIB::MappingDistTcs& tcs
00607         );
00608 
00622         void readMappings(
00623             const Session&                 session,
00624                   OSB_LIB::MappingDistTcs& tcs
00625         );
00626 
00643         void insMappings(
00644             const Session&                 session,
00645             const OSB_LIB::MappingDistTcs& tcs
00646         );
00647 
00657         void delMappings(
00658             const Session&                 session,
00659             const OSB_LIB::MappingDistTcs& tcs
00660         );
00661 
00675         bool mappingsComplete(
00676             const Session&                      session,
00677             const OSB_LIB::MappingDistTcs::Oid& tcsId,
00678                   OSB_LIB::OsbErrors&           errors
00679         );
00680 
00696         bool distTcsFreezed(
00697             const Session&                      session,
00698             const OSB_LIB::MappingDistTcs::Oid& tcsId,
00699                   OSB_LIB::OsbErrors&           errors
00700         );
00701 
00725         bool sameTariffClasses(
00726             const Session&                      session,
00727             const OSB_LIB::MappingDistTcs::Oid& tcsId,
00728                   OSB_LIB::OsbErrors&           errors
00729         );
00730 
00745         bool distTcsReleased(
00746             const Session&                      session,
00747             const OSB_LIB::MappingDistTcs::Oid& tcsId,
00748             const OSB_LIB::DateTime&            releaseDate,
00749                   OSB_LIB::OsbErrors&           errors
00750         );
00751     };
00752 
00753     // *****************************************************************
00754     // struct DistTcsGw
00758     struct DistTcsGw {
00762         friend class OSB_LIB::DistTcs;
00763 
00776         bool fetch(
00777             const Session&          session,
00778                   OSB_LIB::DistTcs& distTcs
00779         );
00780 
00781         private:
00792         bool insDistTcs(
00793             const Session&          session,
00794                   OSB_LIB::DistTcs& distTcs
00795         );
00796 
00807         bool delDistTcs(
00808             const Session&          session,
00809                   OSB_LIB::DistTcs& distTcs
00810         );
00811 
00822         bool updDistTcs(
00823             const Session&          session,
00824                   OSB_LIB::DistTcs& distTcs
00825         );
00826 
00838         bool hasConfiguration(
00839             const Session&                  session,
00840             const OSB_LIB::TcsVersion::Oid& oid
00841         );
00842 
00856         bool allReleasedTzConfigUnique(
00857             const Session&                  session,
00858             const OSB_LIB::TcsVersion::Oid& oid,
00859                   OSB_LIB::OsbErrors&       errors
00860         );
00861 
00873         bool isUsedByReleasedMappingDistTcs(
00874             const Session&                  session,
00875             const OSB_LIB::TcsVersion::Oid& oid
00876         );
00877 
00889         bool isUsedByFreezedMappingDistTcs(
00890             const Session&                  session,
00891             const OSB_LIB::TcsVersion::Oid& oid
00892         );
00893 
00902         OSB_LIB::DateTime findReplacementReleasedDistTcs(
00903             const Session&                  session,
00904             const OSB_LIB::TcsVersion::Oid& oid
00905         );
00906 
00914         bool hasOtherReleasedDistTcs(
00915             const Session&                  session,
00916             const OSB_LIB::TcsVersion::Oid& oid
00917         );
00918 
00926         bool findReplacementFreezedDistTcs(
00927             const Session&                  session,
00928             const OSB_LIB::TcsVersion::Oid& oid
00929         );
00930 
00945         bool identicalTariffClasses(
00946             const Session&                  session,
00947             const OSB_LIB::TcsVersion::Oid& oid
00948         );
00949     };
00950 }                                       // namespace OSB_DB
00951 #endif                                  // #ifndef _TCDISTGW_H_

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