associate_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.55 $
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 _ASSOCIATE_I_H_
00033 #define _ASSOCIATE_I_H_
00034 
00035 // *********************************************************************
00036 // included header files
00037 // + standard includes
00038 #include <list>
00039 
00040 // + libraries
00041 #include "associate.h"
00042 
00043 // + local headers
00044 #include "associateS.h"
00045 #include "servantlocators.h"
00046 
00047 // + class declarations
00048 namespace OSB_LIB {
00049     class Contract;
00050 }
00051 namespace OSB_CORBA {
00052     class AddressWriter_i;
00053     class AnCList_i;
00054 }
00055 
00056 // ************************************************************************
00057 // namespace extensions
00058 namespace OSB_CORBA {
00059     using namespace corba::cadmin::addr;
00060     using namespace corba::cadmin::assoc;
00061     using namespace corba::cadmin::contract;
00062 
00063     using corba::cadmin::AssociateId;
00064     using corba::cadmin::Status;
00065     using corba::cadmin::StatusHistory;
00066     using corba::cadmin::StatusRequest;
00067     using corba::cadmin::StatusValue;
00068     using corba::common::Account;
00069     using corba::common::CfgErrorSeq_out;
00070     using corba::common::DateTime;
00071     using corba::common::TaxKeyId;
00072     using corba::common::Utf8String;
00073 
00077     class AssociateWriter_i :
00078         public virtual POA_corba::cadmin::assoc::AssociateWriter
00079     {
00080     public :
00081 
00082         static const std::string IFC;
00083 
00085         AssociateWriter_i(
00086                   AnCList_i&          anclist,
00087             const OSB_LIB::Associate& assoc
00088         );
00089 
00090         virtual ~AssociateWriter_i();
00091 
00093         const Locators::Key& key() const
00094         {
00095             return key_;
00096         }
00097 
00099         virtual AssociateId id()
00100             throw (CORBA::SystemException);
00101 
00105         virtual Utf8String* name()
00106             throw (CORBA::SystemException);
00107 
00109         virtual AssociateId parentId()
00110             throw (CORBA::SystemException);
00111 
00113         virtual CORBA::ULong levelId()
00114             throw (CORBA::SystemException);
00115 
00117         virtual AssociateType asType()
00118             throw (CORBA::SystemException);
00119 
00121         virtual AssociateIdSeq* getChildren()
00122             throw (CORBA::SystemException);
00123 
00125         virtual TaxKeyId tkId()
00126             throw (CORBA::SystemException);
00127 
00135         virtual AddressWriter_ptr getAddress(
00136             const AddrTypeId& addr
00137         ) throw (CORBA::SystemException, OsbCorbaException);
00138 
00140         virtual AddressSeq* getAddresses()
00141             throw (CORBA::SystemException, OsbCorbaException);
00142 
00147         virtual ContractIdSeq* getContractIds()
00148             throw (CORBA::SystemException);
00149 
00151         virtual Status effStatus()
00152             throw (CORBA::SystemException);
00153 
00155         virtual Status prefStatus()
00156             throw (CORBA::SystemException);
00157 
00159         virtual DateTime* effStatusDate()
00160             throw (CORBA::SystemException);
00161 
00163         virtual DateTime* prefStatusDate()
00164             throw (CORBA::SystemException);
00165 
00177         virtual StatusValue requestedStatus(
00178             const DateTime& ts
00179         ) throw (CORBA::SystemException, OsbCorbaException);
00180 
00193         StatusHistory* statusHistory(
00194             const DateTime& from,
00195             const DateTime& to,
00196             CORBA::Boolean  noWait
00197         ) throw (CORBA::SystemException, OsbCorbaException);
00198 
00200         virtual Account* salesLedger()
00201             throw (CORBA::SystemException);
00202 
00204         virtual Account* purchaseLedger()
00205             throw (CORBA::SystemException);
00206 
00208         virtual Utf8String* accNo()
00209             throw (CORBA::SystemException);
00210 
00226         virtual CORBA::Boolean addChild(
00227             const AssociateId& id,
00228             CORBA::Boolean     noWait
00229         ) throw (CORBA::SystemException, OsbCorbaException);
00230 
00246         virtual CORBA::Boolean removeChild(
00247             const AssociateId& id,
00248             CORBA::Boolean     noWait
00249         ) throw (CORBA::SystemException, OsbCorbaException);
00250 
00252         virtual void setTaxKey(
00253             const TaxKeyId& id
00254         ) throw (CORBA::SystemException);
00255 
00270         AddressWriter_ptr getNewAddress(
00271             const AddrTypeIdSeq& types
00272         ) throw (CORBA::SystemException, OsbCorbaException);
00273 
00286         CORBA::Boolean removeAddress(
00287             const AddrTypeId& type,
00288             CORBA::Boolean noWait,
00289             CfgErrorSeq_out errors
00290         ) throw (CORBA::SystemException, OsbCorbaException);
00291 
00307         CORBA::Boolean linkAddressType(
00308             const AddrTypeId& type,
00309             const AddrTypeId& newType,
00310             CORBA::Boolean    noWait
00311         ) throw (CORBA::SystemException, OsbCorbaException);
00312 
00328         CORBA::Boolean unlinkAddressType(
00329             const AddrTypeId& type,
00330             CORBA::Boolean noWait
00331         ) throw (CORBA::SystemException, OsbCorbaException);
00332 
00334         virtual void setSalesLedger(
00335             const Account& salesLedger
00336         ) throw (CORBA::SystemException);
00337 
00339         virtual void setPurchaseLedger(
00340             const Account& purchaseLedger
00341         ) throw (CORBA::SystemException);
00342 
00344         virtual void setName(
00345             const Utf8String& name
00346         ) throw (CORBA::SystemException);
00347 
00349         virtual void setAccountNo(
00350             const Utf8String& accNo
00351         ) throw (CORBA::SystemException);
00352 
00365         virtual AssociateId create(
00366             CORBA::Boolean noWait
00367         ) throw (CORBA::SystemException, OsbCorbaException);
00368 
00370         virtual CORBA::Boolean commitChanges(
00371             CORBA::Boolean noWait
00372         ) throw (CORBA::SystemException, OsbCorbaException);
00373 
00375 
00376 
00389         CORBA::Boolean changeStatus (
00390             StatusRequest&  status,
00391             CORBA::Boolean  noWait,
00392             CfgErrorSeq_out errors
00393         ) throw (CORBA::SystemException, OsbCorbaException);
00395 
00406         void checkRefUsage() throw (OsbCorbaException);
00407 
00408     private:
00410         typedef std::list<Locators::Key> Servants;
00411 
00413         AnCList_i& ancList_;
00415         OSB_LIB::Associate* assoc_;
00417         Locators::Key key_;
00418 
00420         Servants addrList_;
00421     };
00422 
00427     class CustomerWriter_i :
00428         public virtual POA_corba::cadmin::assoc::CustomerWriter,
00429         public virtual AssociateWriter_i
00430     {
00431     public :
00432 
00433         static const std::string IFC;
00434 
00435         // Constructor
00436         CustomerWriter_i(
00437                   AnCList_i&          anclist,
00438             const OSB_LIB::Associate& assoc
00439         ) : AssociateWriter_i(anclist, assoc)
00440         {
00441             // empty body
00442         };
00443     };
00444 
00451     class AssociateServantFactory {
00452     public :
00453         AssociateWriter_i* makeAssociateWriter(
00454                   AnCList_i&          anclist,
00455             const OSB_LIB::Associate& assoc
00456         ) throw (OsbCorbaException);
00457     };
00458 
00465     OSB_LIB::Associate::Type assocType(const AssociateType type);
00466 
00473     AssociateType assocType(const OSB_LIB::Associate::Type type);
00474 
00475 // *********************************************************************
00476 // inline definitions
00477 
00478 }   // namespace OSB_CORBA
00479 
00480 #endif                                 // #ifndef _ASSOCIATE_I_H_

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