persproditem_i.h

Go to the documentation of this file.
00001 // OSB library ************************************************ -*- C++ -*-
00009 /*
00010   AUTHOR(S): Darryl Kang (dk)
00011 
00012   RCS information
00013    $Name: OSB_060808 $
00014    $Revision: 1.43 $
00015 
00016   License
00017    OSB rating and billing library for communication networks
00018    Copyright (C) 2004, 2005, 2006  OSB systems
00019 
00020    This file may be distributed and/or modify under the terms of the
00021    GNU General Public License (GPL) as published by the Free Software
00022    Foundation which is provided in the file LICENSE.GPL included in the
00023    packaging of this file.
00024 
00025    The file is distributed in the hope that it will be useful, but WITHOUT
00026    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00027    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00028    for more details.
00029 
00030    Holders of a OSB Commercial License may use this file under the terms
00031    and conditions of this commercial license.
00032  */
00033 #ifndef _PERSPRODITEM_I_H_
00034 #define _PERSPRODITEM_I_H_
00035 
00036 // ************************************************************************
00037 // included header files
00038 // + standard includes
00039 #include <memory>
00040 
00041 // + libraries
00042 #include <e164item.h>
00043 #include <resourcelists.h>
00044 
00045 // + local headers
00046 #include "persproditemS.h"
00047 #include "servantlocators.h"
00048 
00049 // + class declarations
00050 namespace OSB_LIB {
00051     class ProductItem;
00052     class PersProduct;
00053     class PersProductItem;
00054     class PersTariffSystem;
00055     class ResourceLists;
00056 }
00057 
00058 namespace OSB_CORBA {
00059     class ContractAdmin_i;
00060     class PersProductWriter_i;
00061 }
00062 
00063 // ************************************************************************
00064 // namespace extensions
00065 namespace OSB_CORBA {
00066 
00067     using namespace corba::cadmin::persproditem;
00068     using namespace corba::common;
00069 
00070     using corba::cadmin::PersItemId;
00071     using corba::tcat::ts::TariffSystemId;
00072     using corba::tcat::ts::TariffSystem;
00073     using corba::tcat::ts::TariffSystemSeq;
00074     using corba::pcat::pp::PpTypeId;
00075 
00076     class PersProdItemWriter_i :
00077         public virtual POA_corba::cadmin::persproditem::PersProdItemWriter
00078     {
00079     public:
00080         static const std::string IFC;
00081 
00082     public:
00084         PersProdItemWriter_i (
00085                   ContractAdmin_i&                        cadmin,
00086                   PersProductWriter_i&                    ppServant,
00087             const OSB_LIB::ProductNode*                   pn,
00088                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00089         );
00090 
00091         virtual ~PersProdItemWriter_i();
00092 
00093     private:
00095         PersProdItemWriter_i(const PersProdItemWriter_i&);
00097         PersProdItemWriter_i& operator=(const PersProdItemWriter_i&);
00098 
00099     public:
00101         const Locators::Key& key() const
00102         {
00103             return key_;
00104         }
00105 
00107         virtual PersItemId id() throw ();
00108 
00113         virtual Utf8String* name()
00114             throw (OsbCorbaException);
00115 
00120         virtual Utf8String* desc()
00121             throw (OsbCorbaException);
00122 
00124         virtual DateTime* assignDate() throw ();
00125 
00127         virtual DateTime* deassignDate() throw ();
00128 
00130         virtual PpTypeId type() throw ();
00131 
00133         virtual Utf8String* personalization() throw ();
00134 
00136         virtual CORBA::Boolean canConfig() throw ();
00137 
00151         virtual PersItemId create(
00152             CORBA::Boolean noWait
00153         ) throw (OsbCorbaException);
00154 
00168         virtual PersItemId commitChanges(
00169             CORBA::Boolean noWait
00170         ) throw (OsbCorbaException);
00171 
00185         void checkRefUsage() throw (OsbCorbaException);
00186 
00196         virtual void checkConfig() throw (OsbCorbaException) = 0;
00197 
00198     protected:
00204         OSB_LIB::PersProduct* persProduct();
00205 
00206     protected:
00208         ContractAdmin_i& cadmin_;
00210         PersProductWriter_i& ppServant_;
00211 
00216         const OSB_LIB::ProductNode* pn_;
00217 
00219         OSB_LIB::PersProductItem* ppi_;
00220 
00222         Locators::Key key_;
00223     };                                  // class PersProdItemWriter_i
00224 
00225     // ********************************************************************
00226     // Personalised service
00227     class PersServiceWriter_i :
00228         public virtual POA_corba::cadmin::persproditem::PersServiceWriter,
00229         public virtual PersProdItemWriter_i
00230     {
00231     public:
00232 
00233         static const std::string IFC;
00234 
00235         PersServiceWriter_i(
00236                   ContractAdmin_i&                        cadmin,
00237                   PersProductWriter_i&                    ppServant,
00238             const OSB_LIB::ProductNode*                   pn,
00239                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00240         ) : PersProdItemWriter_i(cadmin, ppServant, pn, ppi)
00241         {
00242             // empty body
00243         }
00244 
00251         void checkConfig() throw (OsbCorbaException);
00252     };                                  // class PersServiceWriter_i
00253 
00254     // ********************************************************************
00255     // Personalised tariff system
00256     class PersTariffSystemWriter_i :
00257         public virtual POA_corba::cadmin::persproditem::PersTariffSystemWriter,
00258         public virtual PersProdItemWriter_i
00259     {
00260     public:
00261 
00262         static const std::string IFC;
00263 
00264         PersTariffSystemWriter_i(
00265                   ContractAdmin_i&                        cadmin,
00266                   PersProductWriter_i&                    ppServant,
00267             const OSB_LIB::ProductNode*                   pn,
00268                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00269         ) : PersProdItemWriter_i(cadmin, ppServant, pn, ppi)
00270         {
00271             // empty body
00272         }
00273 
00275         OSB_LIB::PersTariffSystem* persTs()
00276             throw (OsbCorbaException);
00277 
00285         virtual TariffSystem* ts()
00286             throw (OsbCorbaException);
00287 
00289         virtual TariffSystemSeq* tsList()
00290             throw (OsbCorbaException);
00291 
00300         virtual void setTsId(
00301             const TariffSystemId& id
00302         ) throw (OsbCorbaException);
00303 
00313         void checkConfig() throw (OsbCorbaException);
00314     };                                  // class PersTariffSystemWriter_i
00315 
00316     // ********************************************************************
00317     // Personalised resource
00318     class PersResource_i :
00319         public virtual POA_corba::cadmin::persproditem::PersResource,
00320         public virtual PersProdItemWriter_i
00321     {
00322     public:
00323 
00324         static const std::string IFC;
00325 
00326         PersResource_i(
00327                   ContractAdmin_i&                        cadmin,
00328                   PersProductWriter_i&                    ppServant,
00329             const OSB_LIB::ProductNode*                   pn,
00330                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00331         ) : PersProdItemWriter_i(cadmin, ppServant, pn, ppi)
00332         {
00333             // empty body
00334         }
00335 
00343         ResourceId rsId()
00344             throw (OsbCorbaException);
00345 
00347         OSB_LIB::PersResource* persResource()
00348             throw (OsbCorbaException);
00349     };                                  // class PersResource_i
00350 
00351 /*
00352     // ********************************************************************
00353     // Personalised calling card
00354     class PersCcWriter_i :
00355         public virtual POA_corba::cadmin::persproditem::PersCcWriter,
00356         public virtual PersResource_i
00357     {
00358     public:
00359 
00360         static const std::string IFC;
00361 
00362         PersCcWriter_i(
00363                   ContractAdmin_i&                        cadmin,
00364                   PersProductWriter_i&                    ppServant,
00365             const OSB_LIB::ProductNode*                   pn,
00366                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00367         ) : PersResourceWriter_i(cadmin, ppServant, pn, ppi),
00368             PersProdItemWriter_i(cadmin, ppServant, pn, ppi)
00369         {
00370             // empty body
00371         }
00372 */
00380 //        virtual Utf8String* serialNumber()
00381 //            throw (OsbCorbaException);
00382 
00389 //        void checkConfig() throw (OsbCorbaException);
00390 //    };
00391 
00392     // ********************************************************************
00393     // Personalised E.164 number
00394     class PersE164Writer_i :
00395         public virtual POA_corba::cadmin::persproditem::PersE164Writer,
00396         public virtual PersResource_i
00397     {
00398     public:
00400         static const std::string IFC;
00401 
00402     public:
00408         PersE164Writer_i(
00409                   ContractAdmin_i&                        cadmin,
00410                   PersProductWriter_i&                    ppServant,
00411             const OSB_LIB::ProductNode*                   pn,
00412                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00413         ) throw (OsbCorbaException);
00414 
00415     public:
00425         void checkConfig() throw (OsbCorbaException);
00426 
00428         BasicResInfo* e164Number()
00429             throw (OsbCorbaException);
00430 
00432         BasicResSeq* search(
00433             const Utf8String& pattern,
00434                   int         numSearch
00435         ) throw (OsbCorbaException);
00436 
00445         CORBA::Boolean setE164Number(
00446             const ResourceId& id
00447         ) throw (OsbCorbaException);
00448 
00449     private:
00451         OSB_LIB::PersE164Item* persE164()
00452             throw (OsbCorbaException);
00453 
00454     private:
00456         typedef OSB_LIB::ResourceList<OSB_LIB::E164Resource> E164List;
00462         E164List e164s_;
00463     };                                  // class PersE164Writer_i
00464 
00465     // ********************************************************************
00466     // Personalised trunk
00467     class PersTrunkItemWriter_i :
00468         public virtual POA_corba::cadmin::persproditem::PersTrunkItemWriter,
00469         public virtual PersResource_i
00470     {
00471     public:
00472 
00473         static const std::string IFC;
00474 
00475         PersTrunkItemWriter_i(
00476                   ContractAdmin_i&                        cadmin,
00477                   PersProductWriter_i&                    ppServant,
00478             const OSB_LIB::ProductNode*                   pn,
00479                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00480         ) throw (OsbCorbaException);
00481 
00482         ~PersTrunkItemWriter_i();
00483 
00490         virtual TrkResInfo* trkResource(
00491             const OSB_LIB::TrunkResource* trkres
00492         ) throw (OsbCorbaException);
00493 
00495         virtual TrkResInfo* trkRes()
00496             throw (OsbCorbaException);
00497 
00499         virtual TrkResInfoSeq* trkResList()
00500             throw (OsbCorbaException);
00501 
00503         virtual CORBA::Boolean setTrkRes(
00504             const ResourceId& id
00505         ) throw (OsbCorbaException);
00506 
00508         OSB_LIB::PersTrunk* persTrunk()
00509             throw (OsbCorbaException);
00510 
00520         void checkConfig() throw (OsbCorbaException);
00521 
00522     private:
00529         OSB_LIB::ResourceLists* resList_;
00530     };                                  // class PersTrunkItemWriter_i
00531 
00532     // ********************************************************************
00533     // Personalised IP group.
00534     class PersIpGroupItemWriter_i :
00535         public virtual POA_corba::cadmin::persproditem::PersIpGroupItemWriter,
00536         public virtual PersResource_i
00537     {
00538     public:
00539 
00540         static const std::string IFC;
00541 
00542         PersIpGroupItemWriter_i(
00543                   ContractAdmin_i&                        cadmin,
00544                   PersProductWriter_i&                    ppServant,
00545             const OSB_LIB::ProductNode*                   pn,
00546                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00547         ) throw (OsbCorbaException);
00548 
00549         ~PersIpGroupItemWriter_i();
00550 
00557         virtual IpGroupInfo* ipGroup(
00558             const OSB_LIB::IpGroup* grp
00559         ) throw (OsbCorbaException);
00560 
00562         virtual IpGroupInfo* ipGroup()
00563             throw (OsbCorbaException);
00564 
00566         virtual IpGroupSeq* ipGroupList()
00567             throw (OsbCorbaException);
00568 
00570         virtual CORBA::Boolean setIpGroup(
00571             const ResourceId& id
00572         ) throw (OsbCorbaException);
00573 
00575         OSB_LIB::PersIpGroup* persIpGroup()
00576             throw (OsbCorbaException);
00577 
00587         void checkConfig() throw (OsbCorbaException);
00588 
00589     private:
00596         OSB_LIB::ResourceLists* resList_;
00597     };                                  // class PersIpGroupItemWriter_i
00598 
00599     // ********************************************************************
00600     // Personalised access number
00601     class PersAnItemWriter_i :
00602         public virtual POA_corba::cadmin::persproditem::PersAnItemWriter,
00603         public virtual PersResource_i
00604     {
00605     public:
00606 
00607         static const std::string IFC;
00608 
00609         PersAnItemWriter_i(
00610                   ContractAdmin_i&                        cadmin,
00611                   PersProductWriter_i&                    ppServant,
00612             const OSB_LIB::ProductNode*                   pn,
00613                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00614         ) throw (OsbCorbaException);
00615 
00616         ~PersAnItemWriter_i();
00617 
00624         virtual BasicResInfo* accessNumber(
00625             const OSB_LIB::AccessNumber* an);
00626 
00628         virtual BasicResInfo* aNum()
00629             throw (OsbCorbaException);
00630 
00632         virtual BasicResSeq* anList() throw ();
00633 
00635         virtual CORBA::Boolean setAn(
00636             const ResourceId& id
00637         ) throw (OsbCorbaException);
00638 
00640         OSB_LIB::PersAn* persAn()
00641             throw (OsbCorbaException);
00642 
00652         void checkConfig() throw (OsbCorbaException);
00653 
00654     private :
00661         OSB_LIB::ResourceLists* resList_;
00662     };                                  // class PersAnItemWriter_i
00663 
00664 /*
00665     // ********************************************************************
00666     // Personalised credit
00667     class PersCreditWriter_i :
00668         public virtual POA_corba::cadmin::persproditem::PersCreditWriter,
00669         public virtual PersProdItemWriter_i
00670     {
00671     public:
00672 
00673         static const std::string IFC;
00674 
00675         PersCreditWriter_i(
00676                   ContractAdmin_i&                        cadmin,
00677                   PersProductWriter_i&                    ppServant,
00678             const OSB_LIB::ProductNode*                   pn,
00679                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00680         ) : PersProdItemWriter_i(cadmin, ppServant, pn, ppi)
00681         {
00682             // empty body
00683         }
00684 
00686         OSB_LIB::PersCredit* persCredit()
00687             throw (OsbCorbaException);
00688 */
00697 //        virtual Money credit()
00698 //            throw (OsbCorbaException);
00699 
00711 /*
00712         virtual CORBA::Boolean add(
00713             const Money& amount,
00714             CORBA::Boolean noWait
00715         ) throw (OsbCorbaException);
00716 */
00728 /*
00729         virtual CORBA::Boolean deduct(
00730             const Money& amount,
00731             CORBA::Boolean noWait
00732         ) throw (OsbCorbaException);
00733 */
00740 //        void checkConfig() throw (OsbCorbaException);
00741 //    };
00742 
00743     // ********************************************************************
00744     // Personalised product item servant factory.
00745     class PpiServantFactory {
00746     public:
00747         PersProdItemWriter_i* makePpiWriter(
00748                   ContractAdmin_i&                        cadmin,
00749                   PersProductWriter_i&                    ppServant,
00750             const OSB_LIB::ProductNode*                   pn,
00751                   std::auto_ptr<OSB_LIB::PersProductItem> ppi
00752         ) throw (OsbCorbaException);
00753     };
00754 
00755 // *********************************************************************
00756 // inline definitions
00757 
00758 }   // namespace OSB_CORBA
00759 
00760 #endif                                 // #ifndef _PERSPRODITEM_I_H_

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