00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _PRODUCTCATALOGUE_I_H_
00032 #define _PRODUCTCATALOGUE_I_H_
00033
00034
00035
00036
00037 #include <sstream>
00038 #include <string>
00039 #include <vector>
00040 #include <map>
00041 #include <memory>
00042
00043
00044 #include "mutex.h"
00045
00046
00047 #include "product.h"
00048 #include "pricelist.h"
00049 #include "servantlocators.h"
00050 #include "productcatalogueS.h"
00051 #include "tariffobjectC.h"
00052
00053
00054 namespace OSB_LIB {
00055 class OsbException;
00056 class ProductCatalogue;
00057 }
00058
00059 namespace OSB_CORBA {
00060 class ProductPartBase_i;
00061 }
00062
00063
00064
00065 namespace OSB_CORBA {
00066
00067 using namespace corba::common;
00068 using namespace corba::pcat::pd;
00069 using namespace corba::pcat::pp;
00070 using namespace corba::pcat::pl;
00071 using corba::service::ServiceElementId;
00072 using corba::service::ServiceElement;
00073 using corba::service::ServiceElementSeq;
00074 using corba::tcat::ts::TariffSystemId;
00075 using corba::tcat::ts::TariffSystem;
00076 using corba::tcat::ts::TariffSystemSeq;
00077
00078
00079
00080
00081
00082
00083
00084 class ProductCatalogue_i :
00085 public virtual POA_corba::pcat::ProductCatalogue
00086 {
00087 public:
00088 static const std::string IFC;
00089
00090 ProductCatalogue_i(
00091 const ServerInfo& info,
00092 PortableServer::POA_ptr rootPoa,
00093 PortableServer::POAManager_ptr poaManager
00094 ) throw (OsbCorbaException);
00095
00096 public:
00109 virtual ServerInfo* getServerInfo()
00110 throw (CORBA::SystemException);
00111
00112 virtual Product_ptr getProduct(
00113 const ProductId& id
00114 ) throw (CORBA::SystemException, OsbCorbaException);
00115
00116 virtual ProductSeq* getProducts()
00117 throw (CORBA::SystemException);
00118
00119 virtual ProductWriter_ptr creProduct()
00120 throw (CORBA::SystemException, OsbCorbaException);
00121
00122 virtual void delProduct(
00123 const ProductId& id
00124 ) throw (CORBA::SystemException, OsbCorbaException);
00125
00126 virtual PpTypeSeq* getPpTypes()
00127 throw (CORBA::SystemException);
00128
00129 virtual PpType_ptr getPpType(
00130 const PpTypeId& id
00131 ) throw (CORBA::SystemException, OsbCorbaException);
00132
00133 void deactivateObject(
00134 const OSB_LIB::Product::Oid& pdId
00135 );
00136
00137 public:
00138 PortableServer::POA_ptr writerPoa()
00139 {
00140 return writerPoa_.ptr();
00141 };
00142
00143 Locators& ppLocator()
00144 {
00145 return ppLocator_;
00146 }
00147
00148 PortableServer::ObjectId_var objectId(long id) const;
00149
00150 public:
00151
00161 virtual Pricelist_ptr getPricelist(const PricelistId& id)
00162 throw (CORBA::SystemException, OsbCorbaException);
00163
00175 virtual PricelistSeq* getPricelists()
00176 throw (CORBA::SystemException, OsbCorbaException);
00177
00187 virtual PricelistWriter_ptr crePricelist()
00188 throw (CORBA::SystemException);
00189
00205 virtual void delPricelist(
00206 const PricelistId& id,
00207 CORBA::Boolean noWait
00208 ) throw (CORBA::SystemException, OsbCorbaException);
00209
00218 virtual ::corba::pcat::pl::PricelistCfg_ptr getPricelistCfg (
00219 const corba::pcat::pl::PricelistId & id
00220 ) throw (CORBA::SystemException, OsbCorbaException);
00221
00223
00224
00240 virtual CORBA::Boolean checkPricelistCfg (
00241 const PricelistId& pricelistId,
00242 CORBA::Boolean noWait
00243 ) throw (CORBA::SystemException, OsbCorbaException);
00244
00260 virtual CORBA::Boolean releasePricelistCfg (
00261 const PricelistId& pricelistId,
00262 CORBA::Boolean noWait
00263 ) throw (CORBA::SystemException, OsbCorbaException);
00264
00280 virtual CORBA::Boolean revokePricelistCfg (
00281 const PricelistId& pricelistId,
00282 CORBA::Boolean noWait
00283 ) throw (CORBA::SystemException, OsbCorbaException);
00284
00300 virtual CORBA::Boolean unfreezePricelistCfg (
00301 const PricelistId& pricelistId,
00302 CORBA::Boolean noWait
00303 ) throw (CORBA::SystemException, OsbCorbaException);
00304
00306
00315 virtual Accounting_ptr getAccounting(
00316 CORBA::Boolean noWait
00317 ) throw (CORBA::SystemException);
00318
00346 virtual CORBA::Boolean creChargeTraits (
00347 const CurrencyCode& currency,
00348 const RoundRuleId& rrId,
00349 const Utf8String& accCode,
00350 const Utf8String& numFormat,
00351 const TaxKeyId& tkId,
00352 ChargeType cType,
00353 CORBA::Boolean noWait,
00354 ChargeTraits_out chrgTraits
00355 ) throw (CORBA::SystemException, OsbCorbaException);
00356
00358
00359
00367 virtual ServiceElement getServiceElement(
00368 const ServiceElementId& seId
00369 ) throw (CORBA::SystemException, OsbCorbaException);
00370
00372 virtual ServiceElementSeq* getServiceElements()
00373 throw (CORBA::SystemException);
00375
00377
00378
00386 virtual TariffSystem* getTariffSystem(
00387 const TariffSystemId& tsId
00388 ) throw (CORBA::SystemException, OsbCorbaException);
00389
00391 virtual TariffSystemSeq* getTariffSystems()
00392 throw (CORBA::SystemException);
00394
00395 private:
00397 ServerInfo info_;
00398
00399 PortableServer::POA_var pdPoa_;
00400 PortableServer::POA_var ppPoa_;
00401 PortableServer::POA_var pptPoa_;
00402
00403
00404 PortableServer::POA_var writerPoa_;
00405 Locators ppLocator_;
00406
00408 PortableServer::POA_var plPoa_;
00409
00410
00411 PortableServer::POA_var accPoa_;
00412
00414 Locators plLocator_;
00415
00416 private:
00417 void createPoas(
00418 PortableServer::POA_ptr rootPoa,
00419 PortableServer::POAManager_ptr poaManager
00420 );
00421
00422 void createPpPoa(
00423 PortableServer::POA_ptr rootPoa,
00424 PortableServer::POAManager_ptr poaManager
00425 );
00426
00427 void createPlPoa(
00428 PortableServer::POA_ptr rootPoa,
00429 PortableServer::POAManager_ptr poaManager
00430 );
00431
00432 void deactivateObject(
00433 const std::string& id,
00434 PortableServer::POA_ptr poa
00435 );
00436
00437 Product_ptr activateProduct(
00438 const OSB_LIB::Product::Oid& id
00439 ) throw (CORBA::SystemException);
00440
00441 Pricelist_ptr activatePricelist(
00442 const OSB_LIB::Pricelist::Oid& id
00443 ) throw (CORBA::SystemException);
00444
00445 template<typename T>
00446 std::string idToStr(const OSB_LIB::Id<T>& id)
00447 {
00448 std::ostringstream os;
00449 os << id.id();
00450 return os.str();
00451 }
00452
00453 template<typename T>
00454 std::string idToStr(const OSB_LIB::Id2<T>& id)
00455 {
00456 std::ostringstream os;
00457 os << id.id1 << '.' << id.id2;
00458 return os.str();
00459 }
00460
00461 Pricelist_ptr getPricelistServant(
00462 const OSB_LIB::Pricelist::Oid& plOid
00463 ) throw (CORBA::SystemException);
00464
00465 PricelistCfg_ptr getPricelistCfgServant(
00466 const OSB_LIB::PricelistCfg::Oid& plCfgOid
00467 ) throw (CORBA::SystemException);
00468
00469 };
00470 }
00471 #endif // #ifndef _ProductCATALOGUE_I_H_