product-gw.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00009 /*
00010   AUTHOR(S): Ashwin Pakramzis (ap)
00011              Stephan Broennimann (vb)
00012 
00013   RCS information
00014    $Name: OSB_060808 $
00015    $Revision: 1.54 $
00016 
00017   License
00018    OSB rating and billing library for communication networks
00019    Copyright (C) 2004, 2005, 2006  OSB systems
00020 
00021    This file may be distributed and/or modify under the terms of the
00022    GNU General Public License (GPL) as published by the Free Software
00023    Foundation which is provided in the file LICENSE.GPL included in the
00024    packaging of this file.
00025 
00026    The file is distributed in the hope that it will be useful, but WITHOUT
00027    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00028    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00029    for more details.
00030 
00031    Holders of a OSB Commercial License may use this file under the terms
00032    and conditions of this commercial license.
00033  */
00034 #ifndef _PRODUCTGW_H_
00035 #define _PRODUCTGW_H_
00036 
00037 // *********************************************************************
00038 // included header files
00039 // + standard includes
00040 #include <memory>
00041 
00042 // + local headers
00043 #include "osbid.h"
00044 #include "product.h"
00045 
00046 // ************************************************************************
00047 // class declarations
00048 namespace OSB_DB {
00049     class Session;
00050 }
00051 namespace OSB_LIB {
00052     class ProductItem;
00053     class ProductItemTypes;
00054 }
00055 
00056 // ************************************************************************
00057 // namespace extensions
00058 namespace OSB_DB {
00059 
00060 // *********************************************************************
00061 // class definitions
00062 
00063     // *****************************************************************
00064     // class ProductGw
00074     class ProductGw {
00076         friend class OSB_LIB::ProductItem;
00077 
00078     public:
00080 
00081 
00088         long fetch(
00089             const Session&           session,
00090                   OSB_LIB::Products* pds
00091         );
00092 
00100         bool fetch(
00101             const Session&          session,
00102                   OSB_LIB::Product* pd
00103         );
00104 
00120         OSB_LIB::Product::Oid creProduct(
00121             const Session&          session,
00122                   OSB_LIB::Product& pd
00123         );
00124 
00138         void delProduct(
00139             const Session&          session,
00140             const OSB_LIB::Product* pd
00141         );
00142 
00156         void updProduct(
00157             const Session&          session,
00158             const OSB_LIB::Product* pd
00159         );
00161 
00162     private:
00164 
00165 
00176         bool checkObjVs(
00177             const Session&          session,
00178             const OSB_LIB::Product* pd
00179         );
00180 
00192         bool checkName(
00193             const Session&          session,
00194             const OSB_LIB::Product* pd
00195         );
00197 
00198     public:
00200 
00201 
00223         std::auto_ptr<OSB_LIB::ProductItem> fetch(
00224             const Session&                           session,
00225             const OSB_LIB::Id<OSB_LIB::ProductItem>& oid
00226         );
00228 
00229     private:
00250         bool fetch(
00251             const Session&              session,
00252                   OSB_LIB::ProductItem& item
00253         );
00254 
00268         bool insProductItem(
00269             const Session&              session,
00270                   OSB_LIB::ProductItem& item
00271         );
00272 
00290         bool updProductItem(
00291             const Session&              session,
00292                   OSB_LIB::ProductItem& item
00293         );
00294 
00311         bool delProductItem(
00312             const Session&              session,
00313                   OSB_LIB::ProductItem& item
00314         );
00316 
00317     public:
00319 
00320 
00331         long fetch(
00332             const Session&                   session,
00333             const OSB_LIB::Product::Oid&     pid,
00334                   OSB_LIB::ProductNodeParts& pnList
00335         );
00336 
00347         void creProductNode(
00348             const Session&               session,
00349             const OSB_LIB::Product::Oid& productId,
00350                   OSB_LIB::ProductNode&  productNode
00351         );
00352 
00370         void updProductNode(
00371             const Session&               session,
00372             const OSB_LIB::Product::Oid& prodId,
00373                   OSB_LIB::ProductNode&  pNode
00374         );
00375 
00394         void delProductNode(
00395             const Session&              session,
00396             const OSB_LIB::ProductNode& pNode
00397         );
00399 
00412         void checkPiName(
00413             const Session&               session,
00414             const std::string&           name,
00415             const OSB_LIB::Product::Oid& pid
00416         );
00417 
00419 
00420 
00431         long fetch(
00432             const Session&                   session,
00433                   OSB_LIB::ProductItemTypes& dest
00434         );
00436     };                                  // class ProductGw
00437 }                                       // namespace OSB_DB
00438 #endif                                  // #ifndef _PRODUCTGW_H_

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