associate-gw.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00006 /*
00007   AUTHOR(S): Lilian Qin Lan (lan)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.51 $
00012 
00013   License
00014    OSB rating and billing library for communication networks
00015    Copyright (C) 2004, 2005, 2006  OSB systems
00016 
00017    This file may be distributed and/or modify under the terms of the
00018    GNU General Public License (GPL) as published by the Free Software
00019    Foundation which is provided in the file LICENSE.GPL included in the
00020    packaging of this file.
00021 
00022    The file is distributed in the hope that it will be useful, but WITHOUT
00023    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00024    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00025    for more details.
00026 
00027    Holders of a OSB Commercial License may use this file under the terms
00028    and conditions of this commercial license.
00029  */
00030 
00031 #ifndef _AssociateGw_H_
00032 #define _AssociateGw_H_
00033 
00034 // *********************************************************************
00035 // included header files
00036 // + standard includes
00037 
00038 // + local headers
00039 #include "osbid.h"
00040 #include "osbconst.h"
00041 #include "associate.h"
00042 
00043 // + class declarations
00044 namespace OSB_DB {
00045     class Session;
00046 }
00047 
00048 namespace OSB_LIB {
00049     class AnCFilter;
00050     class AnCList;
00051 }
00052 
00053 // ************************************************************************
00054 // namespace extensions
00055 namespace OSB_DB {
00056 
00060     class AssociateGw {
00062         AssociateGw(const AssociateGw& rhs);
00064         AssociateGw& operator=(const AssociateGw& rhs);
00066         friend class OSB_LIB::Associate;
00068         friend class OSB_LIB::AnCList;
00069 
00071         friend class OSB_LIB::Contract; // ToDo: remove
00072     public:
00073         typedef OSB_LIB::Id<OSB_LIB::Associate> AssociateId;
00074         typedef std::set<AssociateId>           AssociateIds;
00075 
00076     public:
00078         AssociateGw() {}
00079 
00096         OSB_LIB::Associate::AutoPtr fetch(
00097             const Session&                 session,
00098             const OSB_LIB::Associate::Oid& asId
00099         );
00100 
00116         bool fetch(
00117             const Session&            session,
00118                   OSB_LIB::Associate& assoc
00119         );
00120 
00129         long searchByName(
00130             const Session&            session,
00131                   AssociateIds&       idList,
00132                   OSB_LIB::AnCFilter& filter
00133         );
00134 
00135     private:
00146         long fetchChildren(
00147             const Session&            session,
00148                   OSB_LIB::Associate& associate
00149         );
00150 
00165         bool insert(
00166             const Session&            session,
00167                   OSB_LIB::Associate& assoc
00168         );
00169 
00181         bool update(
00182             const Session&            session,
00183             const OSB_LIB::Associate& assoc
00184         );
00185 
00196         bool remove(
00197             const Session&            session,
00198             const OSB_LIB::Associate& assoc
00199         );
00200 
00209         bool incObjVs(
00210             const Session&            session,
00211                   OSB_LIB::Associate& assoc
00212         );
00213 
00214     private:
00222         bool setPrefStatus(
00223             const Session&            session,
00224             const OSB_LIB::Associate& assoc
00225         );
00226 
00235         bool setEffStatus(
00236             const Session&            session,
00237             const OSB_LIB::Associate& assoc
00238         );
00239 
00247         void storeRequest(
00248             const Session&                 session,
00249             const OSB_LIB::Associate::Oid& asId,
00250                   OSB_LIB::StatusRequest&  status
00251         );
00252 
00260         void storeChange(
00261             const Session&                 session,
00262             const OSB_LIB::Associate::Oid& asId,
00263                   OSB_LIB::StatusChange&   change
00264         );
00265 
00275         OSB_LIB::ObjectStatus lock(
00276             const Session&                 session,
00277             const OSB_LIB::Associate::Oid& asId,
00278                   bool                     noWait
00279         );
00280 
00289         OSB_LIB::ObjectStatus lock(
00290             const Session&            session,
00291             const OSB_LIB::Associate& assoc,
00292                   bool                noWait
00293         );
00294 
00302         void lockChildren(
00303             const Session&                 session,
00304             const OSB_LIB::Associate::Oid& asId,
00305                   bool                     noWait
00306         );
00307 
00315         void lockContracts(
00316             const Session&                 session,
00317             const OSB_LIB::Associate::Oid& asId,
00318                   bool                     noWait
00319         );
00320     };                                  // class AssociateGw
00321 }                                       // namespace OSB_DB
00322 
00323 // ************************************************************************
00324 // inline definitions
00325 namespace OSB_DB {
00326 }                                       // namespace OSB_DB
00327 #endif                                  // #ifndef _ASSOCIATEGW_H_

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