contract-gw.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00009 /*
00010   AUTHOR(S): Lilian Qin Lan (lan)
00011 
00012   RCS information
00013    $Name: OSB_060808 $
00014    $Revision: 1.46 $
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 
00034 #ifndef _CONTRACTGW_H_
00035 #define _CONTRACTGW_H_
00036 
00037 // *********************************************************************
00038 // included header files
00039 // + standard includes
00040 
00041 // + local headers
00042 #include "anclist.h"
00043 #include "osbid.h"
00044 #include "osbconst.h"
00045 #include "contract.h"
00046 
00047 // ************************************************************************
00048 // class declarations
00049 namespace OSB_DB {
00050     class Session;
00051 }
00052 
00053 // *********************************************************************
00054 // namespace extensions
00055 namespace OSB_DB {
00056 
00057 // *********************************************************************
00058 // class definitions
00062     class ContractGw {
00064         friend class OSB_LIB::Contract;
00066         friend class OSB_LIB::PersProduct; // ToDo: remove!
00067 
00069         ContractGw(const ContractGw& rhs);
00071         ContractGw& operator=(const ContractGw& rhs);
00072     public:
00074         typedef OSB_LIB::Id<OSB_LIB::Contract> ContractId;
00076         typedef std::map<ContractId, OSB_LIB::Contract> ContractList;
00078         typedef std::set<ContractId> ContractIds;
00079     public:
00080         ContractGw() {}
00081 
00094         bool fetch(
00095             const Session&           session,
00096                   OSB_LIB::Contract& co
00097         );
00098 
00112         long fetch(
00113             const Session&                 session,
00114             const OSB_LIB::Associate::Oid& asId,
00115                   ContractList&            dest
00116         );
00117 
00126         long fetch(
00127             const Session&                 session,
00128             const OSB_LIB::Associate::Oid& asId,
00129                   ContractIds&             idList
00130         );
00131 
00132     private:
00147         bool insContract(
00148             const Session&           session,
00149                   OSB_LIB::Contract& co
00150         );
00151 
00168         bool delContract(
00169             const Session&           session,
00170             const OSB_LIB::Contract& co
00171         );
00172 
00190         bool updContract(
00191             const Session&           session,
00192             const OSB_LIB::Contract& co
00193         );
00194 
00203         bool incObjVs(
00204             const Session&           session,
00205                   OSB_LIB::Contract& co
00206         );
00207 
00208     private:
00217         bool setPrefStatus(
00218             const Session&           session,
00219             const OSB_LIB::Contract& co
00220         );
00221 
00230         bool setEffStatus(
00231             const Session&           session,
00232             const OSB_LIB::Contract& co
00233         );
00234 
00242         void storeRequest(
00243             const Session&                session,
00244             const OSB_LIB::Contract::Oid& coId,
00245                   OSB_LIB::StatusRequest& status
00246         );
00247 
00255         void storeChange(
00256             const Session&                session,
00257             const OSB_LIB::Contract::Oid& coId,
00258                   OSB_LIB::StatusChange&  change
00259         );
00260 
00270         OSB_LIB::ObjectStatus lock(
00271             const Session&                session,
00272             const OSB_LIB::Contract::Oid& coId,
00273                   bool                    noWait
00274         );
00275 
00284         OSB_LIB::ObjectStatus lock(
00285             const Session&           session,
00286             const OSB_LIB::Contract& co,
00287                   bool               noWait
00288         );
00289 
00299         void lockPersProducts(
00300             const Session&                session,
00301             const OSB_LIB::Contract::Oid& coId,
00302                   bool                    noWait
00303         );
00304     };                                  // class ContractGw
00305 }                                       // namespace OSB_DB
00306 #endif                                  // #ifndef _CONTRACTGW_H_

Generated on Sat Sep 2 14:06:32 2006 for OSB Library by  doxygen 1.4.7