contract_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.42 $
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 _CONTRACT_I_H_
00033 #define _CONTRACT_I_H_
00034 
00035 // ************************************************************************
00036 // included header files
00037 // + standard includes
00038 #include <list>
00039 
00040 // + libraries
00041 #include <contractS.h>
00042 
00043 #include <contract.h>
00044 #include <invoicedir.h>
00045 
00046 // + local headers
00047 #include "servantlocators.h"
00048 
00049 // + class declarations
00050 namespace OSB_LIB {
00051     class Contract;
00052 }
00053 
00054 namespace OSB_CORBA {
00055     class AnCList_i;
00056     class AssociateWriter_i;
00057     class BalanceSheetWriter_i;
00058     class PersProductWriter_i;
00059 }
00060 
00061 // ************************************************************************
00062 // namespace extensions
00063 namespace OSB_CORBA {
00064     using namespace corba::cadmin::assoc;
00065     using namespace corba::cadmin::contract;
00066     using namespace corba::cadmin::persprod;
00067 
00068     using corba::cadmin::AssociateId;
00069     using corba::cadmin::BillCycleId;
00070     using corba::cadmin::ContractId;
00071     using corba::cadmin::PersProdId;
00072     using corba::cadmin::Status;
00073     using corba::cadmin::StatusHistory;
00074     using corba::cadmin::StatusRequest;
00075     using corba::cadmin::StatusValue;
00076     using corba::common::CfgErrorSeq_out;
00077     using corba::common::DateTime;
00078     using corba::common::Money;
00079     using corba::common::TaxKeyId;
00080     using corba::common::Utf8String;
00081     using corba::pcat::pd::ProductId;
00082 
00086     class ContractWriter_i :
00087         public virtual POA_corba::cadmin::contract::ContractWriter
00088     {
00089     public :
00090         static const std::string IFC;
00091 
00093         ContractWriter_i(
00094                   AnCList_i&         anclist,
00095             const OSB_LIB::Contract& contr
00096         );
00097 
00104         ~ContractWriter_i();
00105 
00107         const Locators::Key key() const
00108         {
00109             return key_;
00110         }
00111 
00113         virtual ContractId id()
00114             throw (CORBA::SystemException);
00115 
00127         virtual AssociateId owner()
00128             throw (CORBA::SystemException);
00129 
00137         Utf8String* getStatement(
00138             const Utf8String& fileInfo
00139         ) throw (CORBA::SystemException, OsbCorbaException);
00140 
00151         InvoiceInfoSeq* getStatements(
00152             StatementType type,
00153             CORBA::Boolean noWait
00154         ) throw (CORBA::SystemException, OsbCorbaException);
00155 
00164         virtual BalanceSheetWriter_ptr getBalanceSheet(
00165             CORBA::Boolean noWait
00166         ) throw (CORBA::SystemException, OsbCorbaException);
00167 
00177         virtual PersProductWriter_ptr getPersProduct(
00178             const PersProdId& id,
00179             CORBA::Boolean    noWait
00180         ) throw (CORBA::SystemException, OsbCorbaException);
00181 
00183         virtual PersProdSeq* getPersProducts(
00184             CORBA::Boolean noWait
00185         ) throw (CORBA::SystemException, OsbCorbaException);
00186 
00188         virtual TaxKeyId tkId()
00189             throw (CORBA::SystemException);
00190 
00192         virtual BillCycleId bcId()
00193             throw (CORBA::SystemException);
00194 
00196         virtual AccountingType acctType()
00197             throw (CORBA::SystemException);
00198 
00200         virtual Money* creditLimit()
00201             throw (CORBA::SystemException);
00202 
00204         virtual DateTime* createdDate()
00205             throw (CORBA::SystemException);
00206 
00208         virtual Status effStatus()
00209             throw (CORBA::SystemException);
00210 
00212         virtual Status prefStatus()
00213             throw (CORBA::SystemException);
00214 
00216         virtual DateTime* effStatusDate()
00217             throw (CORBA::SystemException);
00218 
00223         virtual DateTime* prefStatusDate()
00224             throw (CORBA::SystemException);
00225 
00237         virtual StatusValue requestedStatus(
00238             const DateTime& ts
00239         ) throw (CORBA::SystemException, OsbCorbaException);
00240 
00251         StatusHistory* statusHistory(
00252             const DateTime& from,
00253             const DateTime& to,
00254             CORBA::Boolean  noWait
00255         ) throw (CORBA::SystemException, OsbCorbaException);
00256 
00258         virtual CORBA::Boolean setTaxKey(
00259             const TaxKeyId& tkId
00260         ) throw (CORBA::SystemException);
00261 
00263         virtual CORBA::Boolean setBillCycle(
00264             const BillCycleId& bcId
00265         ) throw (CORBA::SystemException);
00266 
00268         virtual CORBA::Boolean setCreditLimit(
00269             const Money& credit
00270         ) throw (CORBA::SystemException);
00271 
00285         virtual PersProductWriter_ptr addPersProduct(
00286             const ProductId&   id,
00287             const AssociateId& userId,
00288             CORBA::Boolean     noWait
00289         ) throw (CORBA::SystemException, OsbCorbaException);
00290 
00302         virtual CORBA::Boolean removePersProduct(
00303             const PersProdId& id,
00304             CORBA::Boolean    noWait
00305         ) throw (CORBA::SystemException, OsbCorbaException);
00306 
00320         virtual ContractId create(
00321             const AssociateId&   owner,
00322                   CORBA::Boolean noWait
00323         ) throw (CORBA::SystemException, OsbCorbaException);
00324 
00326         virtual CORBA::Boolean commitChanges(
00327             CORBA::Boolean noWait
00328         ) throw (CORBA::SystemException, OsbCorbaException);
00329 
00331 
00332 
00345         CORBA::Boolean changeStatus (
00346             StatusRequest&  status,
00347             CORBA::Boolean  noWait,
00348             CfgErrorSeq_out errors
00349         ) throw (CORBA::SystemException, OsbCorbaException);
00351 
00362         void checkRefUsage() throw (OsbCorbaException);
00363 
00364     private:
00366         friend class PersProductWriter_i;
00367 
00373         void ppChanged(
00374             const OSB_DB::Session& session
00375         );
00376 
00377     private:
00379         typedef std::list<Locators::Key> Servants;
00380 
00382         AnCList_i& ancList_;
00383 
00385         OSB_LIB::Contract* contr_;
00387         Locators::Key key_;
00388 
00390         Servants ppServants_;
00392         Servants bsServants_;
00393     };                                  // class ContractWriter_i
00394 
00401     InvoiceInfo invoiceInfo(
00402         const OSB_LIB::InvoiceInfo& inv
00403     );
00404 
00411     OSB_LIB::Contract::AccountingType accountingType(
00412         const AccountingType acctType
00413     );
00414 
00421     AccountingType accountingType(
00422         const OSB_LIB::Contract::AccountingType acctType
00423     );
00424 
00431     OSB_LIB::InvoiceInfo::StatementType statementType(
00432         const StatementType statType
00433     );
00434 
00441     StatementType statementType(
00442         const OSB_LIB::InvoiceInfo::StatementType statType
00443     );
00444 }                                       // namespace OSB_CORBA
00445 #endif                                 // #ifndef _CONTRACT_I_H_

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