balancesheet_i.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00008 /*
00009   AUTHOR(S): Darryl Kang (dk)
00010 
00011   RCS information
00012    $Name: OSB_060808 $
00013    $Revision: 1.24 $
00014 
00015   License
00016    OSB rating and billing library for communication networks
00017    Copyright (C) 2004, 2005, 2006  OSB systems
00018 
00019    This file may be distributed and/or modify under the terms of the
00020    GNU General Public License (GPL) as published by the Free Software
00021    Foundation which is provided in the file LICENSE.GPL included in the
00022    packaging of this file.
00023 
00024    The file is distributed in the hope that it will be useful, but WITHOUT
00025    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00026    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00027    for more details.
00028 
00029    Holders of a OSB Commercial License may use this file under the terms
00030    and conditions of this commercial license.
00031  */
00032 #ifndef _BALANCESHEET_I_H_
00033 #define _BALANCESHEET_I_H_
00034 
00035 // *********************************************************************
00036 #include "balancesheetS.h"
00037 #include "servantlocators.h"
00038 #include "balancesheet.h"
00039 
00040 namespace OSB_LIB {
00041     class  BsPage;
00042     class  BsTotal;
00043     class  BalanceSheet;
00044     struct OnetimeCharge;
00045 }
00046 
00047 namespace OSB_CORBA {
00048     class ContractAdmin_i;
00049 }
00050 
00051 namespace OSB_CORBA {
00052     using namespace corba::cadmin::contract;
00053 
00054     using corba::cadmin::BsPageId;
00055     using corba::cadmin::OtcId;
00056     using corba::cadmin::PersProdId;
00057     using corba::common::Date;
00058     using corba::common::DateTime;
00059     using corba::common::OsbCorbaException;
00060     using corba::common::Utf8String;
00061     using corba::pcat::pp::ProductPartId;
00062 
00063     class BsPageWriter_i :
00064         public virtual POA_corba::cadmin::contract::BsPageWriter
00065     {
00066     public :
00067 
00068         static const std::string IFC;
00069 
00070         // Constructor
00071         BsPageWriter_i(
00072                   ContractAdmin_i&       cadmin,
00073                   OSB_LIB::BalanceSheet& bs,
00074             const OSB_LIB::BsPage::Oid&  page
00075         );
00076 
00078         ~BsPageWriter_i();
00079 
00081         const Locators::Key& key() const
00082         {
00083             return key_;
00084         }
00085 
00087         const OSB_LIB::BsPage& page() const
00088             throw (OsbCorbaException);
00089 
00091         OSB_LIB::BsPage& page()
00092             throw (OsbCorbaException);
00093 
00095         virtual BsPageId id()
00096             throw (CORBA::SystemException);
00097 
00099         virtual BpStatus status()
00100             throw (CORBA::SystemException, OsbCorbaException);
00101 
00103         virtual void setRerate(
00104             CORBA::Boolean noWait
00105         ) throw (CORBA::SystemException, OsbCorbaException);
00106 
00108         virtual void setDontBill(
00109             CORBA::Boolean noWait
00110         ) throw (CORBA::SystemException, OsbCorbaException);
00111 
00113         virtual void setNormal(
00114             CORBA::Boolean noWait
00115         ) throw (CORBA::SystemException, OsbCorbaException);
00116 
00118         virtual DateTime* opened()
00119             throw (CORBA::SystemException, OsbCorbaException);
00120 
00122         virtual DateTime* closed()
00123             throw (CORBA::SystemException, OsbCorbaException);
00124 
00126         virtual Date startDate()
00127             throw (CORBA::SystemException, OsbCorbaException);
00128 
00130         virtual Date endDate()
00131             throw (CORBA::SystemException, OsbCorbaException);
00132 
00134         virtual DateTime* lastCharged()
00135             throw (CORBA::SystemException, OsbCorbaException);
00136 
00138         virtual BsTotal* charges()
00139             throw (CORBA::SystemException, OsbCorbaException);
00140 
00142         virtual OnetimeCharge* getOnetimeCharge(
00143             const OtcId& id,
00144             CORBA::Boolean noWait
00145         ) throw (CORBA::SystemException, OsbCorbaException);
00146 
00148         virtual OnetimeChargeSeq* getOnetimeCharges(
00149             CORBA::Boolean noWait
00150         ) throw (CORBA::SystemException, OsbCorbaException);
00151 
00156         virtual OnetimeChargeSeq* getOtcOfPersProd(
00157             const PersProdId& ppId,
00158             CORBA::Boolean noWait
00159         ) throw (CORBA::SystemException, OsbCorbaException);
00160 
00162         virtual OnetimeChargeSeq* getOtcOfPersProdNode(
00163             const ProductPartId& ppId,
00164             CORBA::Boolean noWait
00165         ) throw (CORBA::SystemException, OsbCorbaException);
00166 
00168         virtual AdvanceChargeSeq* getAdvanceCharges()
00169             throw (CORBA::SystemException);
00170 
00172         virtual CORBA::Boolean removeOtc(
00173             const OtcId& id,
00174             CORBA::Boolean noWait
00175         ) throw (CORBA::SystemException, OsbCorbaException);
00176 
00177     private:
00179         ContractAdmin_i& cadmin_;
00180 
00182         OSB_LIB::BalanceSheet& bs_;
00183 
00185         OSB_LIB::BsPage::Oid pageId_;
00186 
00188         Locators::Key key_;
00189     };                                  // class BsPageWriter_i
00190 
00191     class BalanceSheetWriter_i :
00192         public virtual POA_corba::cadmin::contract::BalanceSheetWriter
00193     {
00194     public :
00195 
00196         static const std::string IFC;
00197 
00199         BalanceSheetWriter_i(
00200                   ContractAdmin_i&       cadmin,
00201             const OSB_LIB::BalanceSheet& bs
00202         );
00203 
00205         ~BalanceSheetWriter_i();
00206 
00208         const Locators::Key& key() const
00209         {
00210             return key_;
00211         }
00212 
00214         virtual BsPageWriter_ptr getBsPage(
00215             const BsPageId& id
00216         ) throw (CORBA::SystemException, OsbCorbaException);
00217 
00219         virtual BsPageSeq* getBsPages()
00220             throw (CORBA::SystemException, OsbCorbaException);
00221 
00223         virtual BsTotal* totalCharges()
00224             throw (CORBA::SystemException);
00225 
00227         virtual BsPageId addOtc(
00228             const OnetimeCharge& otc,
00229             CORBA::Boolean noWait
00230         ) throw (CORBA::SystemException, OsbCorbaException);
00231 
00233         virtual CORBA::Boolean hasOtc()
00234             throw (CORBA::SystemException);
00235 
00237         virtual CORBA::Boolean hasAdvCharges()
00238             throw (CORBA::SystemException);
00239 
00240     private:
00242         typedef std::list<Locators::Key> Servants;
00243 
00245         ContractAdmin_i& cadmin_;
00246 
00248         OSB_LIB::BalanceSheet bs_;
00249 
00251         Locators::Key key_;
00252 
00254         Servants bpServants_;
00255     };                                  // class BalanceSheetWriter_i
00256 
00257     // Convert a onetime charge from OSB_LIB to OSB_CORBA namspace.
00258     OnetimeCharge otc(
00259         const OSB_LIB::OnetimeCharge& otc,
00260         bool noWait
00261     ) throw (OsbCorbaException);
00262 
00263     // Convert advance charge from OSB_LIB to OSB_CORBA namespace.
00264     AdvanceCharge adv(const OSB_LIB::AdvanceCharge& adv);
00265 
00266     // Convert BsTotal from OSB_LIB to OSB_CORBA namespace.
00267     BsTotal* bsTotal(
00268         const OSB_LIB::BsTotal& bs);
00269 
00270     // Convert status of balance page from OSB_LIB to OSB_CORBA
00271     // namespace.
00272     BpStatus bpStatus(const OSB_LIB::BsPage::Status& stat);
00273 }                                       // namespace OSB_CORBA
00274 #endif                                 // #ifndef _BALANCESHEET_I_H_

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