pricelist_i.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00010 /*
00011   AUTHOR(S): Elangovan Angannan (aen)
00012 
00013   RCS information
00014    $Name: OSB_060808 $
00015    $Revision: 1.13 $
00016 
00017   License
00018    OSB rating and billing library for communication networks
00019    Copyright (C) 2004, 2005, 2006  OSB systems
00020 
00021    This file may be distributed and/or modify under the terms of the
00022    GNU General Public License (GPL) as published by the Free Software
00023    Foundation which is provided in the file LICENSE.GPL included in the
00024    packaging of this file.
00025 
00026    The file is distributed in the hope that it will be useful, but WITHOUT
00027    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00028    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00029    for more details.
00030 
00031    Holders of a OSB Commercial License may use this file under the terms
00032    and conditions of this commercial license.
00033  */
00034 #ifndef _PRICELIST_I_H_
00035 #define _PRICELIST_I_H_
00036 
00037 // *********************************************************************
00038 // included header files
00039 // + standard includes
00040 
00041 // + libraries
00042 #include <osbid.h>
00043 
00044 // + local headers
00045 #include "pricelistS.h"
00046 #include "corba_utility.h"
00047 #include "productcat.h"
00048 
00049 // *********************************************************************
00050 // class declarations
00051 namespace OSB_LIB {
00052     class Pricelist;
00053     class PricelistCfg;
00054 }
00055 
00056 namespace OSB_CORBA {
00057     class ProductCatalogue_i;
00058 }
00059 
00060 // *********************************************************************
00061 // namespace extensions
00062 namespace OSB_CORBA {
00063 
00064     using namespace corba::pcat::pl;
00065     using corba::pcat::pl::ChargeTraitsId;
00066 
00067 // *********************************************************************
00068 // forward declarations
00069 
00070 // *********************************************************************
00071 // type definitions
00072 
00073 // *********************************************************************
00074 // class definitions
00078     class Pricelist_i : public virtual POA_corba::pcat::pl::Pricelist {
00080         typedef OSB_LIB::PcatLockMgr::PricelistRg ReadGuard;
00081 
00082     public:
00083         static const std::string IFC;
00084 
00092         Pricelist_i(
00093                 ProductCatalogue_i&                      pcati,
00094           const OSB_LIB::Id<OSB_LIB::Pricelist>& plId
00095         );
00096 
00102         virtual PricelistId id() throw (CORBA::SystemException);
00103 
00114         virtual Utf8String* name()
00115           throw(CORBA::SystemException, OsbCorbaException);
00116 
00127         virtual Utf8String* desc()
00128           throw (CORBA::SystemException, OsbCorbaException);
00129 
00138         virtual PricelistWriter_ptr getWriter()
00139           throw (CORBA::SystemException);
00140 
00149         static OSB_LIB::PcatLockMgr::PricelistRg lockPricelist(
00150             const OSB_LIB::Pricelist::Oid& plOid
00151         ) throw (OsbCorbaException);
00152 
00153     private:                            // member functions
00154 
00162         ReadGuard lockPricelist() throw (OsbCorbaException);
00163 
00164     private:
00166         ProductCatalogue_i&                     pcati_;
00168         OSB_LIB::Id<OSB_LIB::Pricelist> plId_;
00169     };
00170 
00174     class PricelistWriter_i :
00175       public virtual POA_corba::pcat::pl::PricelistWriter,
00176       public virtual Pricelist_i
00177     {
00179         typedef OSB_LIB::PcatLockMgr::PricelistRg ReadGuard;
00180 
00181     public:
00182 
00183         static const std::string IFC;
00184 
00193         PricelistWriter_i(
00194                   ProductCatalogue_i&     pcati,
00195             const OSB_LIB::Pricelist* pl
00196         );
00197 
00203         virtual ~PricelistWriter_i();
00204 
00210         virtual void setName(const Utf8String& name)
00211           throw (CORBA::SystemException);
00212 
00219         virtual void setDesc(const Utf8String& desc)
00220           throw(CORBA::SystemException);
00221 
00235         virtual void commitChanges(CORBA::Boolean noWait)
00236           throw (CORBA::SystemException, OsbCorbaException);
00237 
00238     private:                            // data members
00240         OSB_LIB::Pricelist* pl_;
00241     };
00242 
00246     class PricelistCfg_i :
00247       public virtual POA_corba::pcat::pl::PricelistCfg
00248     {
00250         typedef OSB_LIB::PcatLockMgr::PricelistRg ReadGuard;
00251 
00252     public:
00253 
00254         static const std::string IFC;
00255 
00263         PricelistCfg_i(
00264                 ProductCatalogue_i&                      pcati,
00265           const OSB_LIB::Id<OSB_LIB::Pricelist>& plId
00266         );
00267 
00274         virtual PricelistId plId() throw (CORBA::SystemException);
00275 
00286         virtual ChargeTraitsId ctId()
00287           throw (CORBA::SystemException, OsbCorbaException);
00288 
00299         virtual CORBA::Double charge()
00300           throw (CORBA::SystemException, OsbCorbaException);
00301 
00312         virtual CfgStatus status()
00313           throw (CORBA::SystemException, OsbCorbaException);
00314 
00326         virtual Date releaseDate()
00327           throw (CORBA::SystemException, OsbCorbaException);
00328 
00337         virtual PricelistCfgWriter_ptr getWriter()
00338           throw (CORBA::SystemException);
00339 
00340     private:                            // member functions
00348         ReadGuard lockPricelist() throw (OsbCorbaException);
00349 
00351         const OSB_LIB::PricelistCfg& getPlCfg();
00352 
00354         const OSB_LIB::PricelistCfg::OnetimeChargeDefs& getOtcDefs();
00355 
00356     private:
00358         ProductCatalogue_i&                     pcati_;
00360         OSB_LIB::Id<OSB_LIB::Pricelist> plId_;
00361     };
00362 
00366     class PricelistCfgWriter_i :
00367       public virtual POA_corba::pcat::pl::PricelistCfgWriter,
00368       public virtual PricelistCfg_i
00369     {
00370     public:
00371 
00372         static const std::string IFC;
00373 
00382         PricelistCfgWriter_i(
00383                   ProductCatalogue_i&        pcati,
00384             const OSB_LIB::PricelistCfg* plCfg
00385         );
00386 
00392         virtual ~PricelistCfgWriter_i();
00393 
00403         virtual void setChargeTraitsId(
00404             const ChargeTraitsId& id
00405         ) throw (CORBA::SystemException, OsbCorbaException);
00406 
00416         virtual void setCharge(CORBA::Double charge)
00417           throw (CORBA::SystemException, OsbCorbaException);
00418 
00430         virtual void commitChanges(CORBA::Boolean noWait)
00431           throw (CORBA::SystemException, OsbCorbaException);
00432 
00433     private:                            // Member functions
00434         OSB_LIB::OnetimeChargeDef& getOtcDef()
00435             throw (OsbCorbaException);
00436 
00437     private:                            // Data members
00439         OSB_LIB::PricelistCfg* plCfg_;
00441         OSB_LIB::ChargeTraits::Oid ctOid_;
00443         double charge_;
00444     };
00445 
00446 }                                       // namespace OSB_CORBA
00447 #endif                                  // #ifndef _PRICELIST_I_H_

Generated on Sat Sep 2 14:25:52 2006 for OSB Library by  doxygen 1.4.7