resource-gw.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00008 /*
00009   AUTHOR(S): Stephan Broennimann (vb)
00010 
00011   RCS information
00012    $Name: OSB_060808 $
00013    $Revision: 1.47.2.1 $
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 _RESOURCEGW_H_
00033 #define _RESOURCEGW_H_
00034 
00035 // + standard includes
00036 
00037 // + local headers
00038 #include "resource.h"
00039 
00040 // ************************************************************************
00041 // class declarations
00042 namespace OSB_LIB {
00043     class Resource;
00044     class Period;
00045     class PersProduct;
00046 }
00047 
00048 namespace OSB_DB {
00049     class Session;
00050 }
00051 
00052 // ************************************************************************
00053 // namespace extensions
00054 namespace OSB_DB {
00055 
00056 // *********************************************************************
00057 // class definitions
00058 
00059     // *****************************************************************
00060     // class ResourceGw
00064     class ResourceGw {
00066         friend class OSB_LIB::Resource;
00067 
00068     public:
00096         OSB_LIB::Id<OSB_LIB::PersProduct> getPersProduct(
00097             const Session&              session,
00098             const OSB_LIB::ResourceKey& resourceKey,
00099             const OSB_LIB::DateTime&    timestamp,
00100                   OSB_LIB::Period&      assigned
00101         ) const;
00102 
00118         OSB_LIB::Period getBounds(
00119             const Session&              session,
00120             const OSB_LIB::ResourceKey& resourceKey,
00121             const OSB_LIB::DateTime&    timestamp
00122         );
00123 
00124     private:
00136         bool fetch(
00137             const Session&           session,
00138                   OSB_LIB::Resource& resource
00139         ) const;
00140 
00156         bool insert(
00157             const Session&           session,
00158                   OSB_LIB::Resource& resource
00159         ) const;
00160 
00169         bool updData(
00170             const Session&           session,
00171             const OSB_LIB::Resource& resource
00172         ) const;
00182         void updStatus(
00183             const Session&           session,
00184             const OSB_LIB::Resource& resource
00185         ) const;
00186 
00196         bool updAssigned(
00197             const Session&           session,
00198             const OSB_LIB::Resource& resource
00199         ) const;
00200 
00209         bool remove(
00210             const Session&           session,
00211             const OSB_LIB::Resource& resource
00212         ) const;
00213 
00226         bool getQuarantineDays(
00227             const Session&              session,
00228                   OSB_LIB::ResourceType rt,
00229                   long&                 days
00230         ) const;
00231 
00252         bool getPersResourceStatus(
00253             const Session&                session,
00254             const OSB_LIB::Resource::Oid& rid,
00255             const OSB_LIB::DateTime&      ts,
00256                   OSB_LIB::Status&        status
00257         );
00258 
00268         OSB_LIB::ObjectStatus lock(
00269             const Session&           session,
00270             const OSB_LIB::Resource& resource,
00271                   bool               noWait
00272         );
00273 
00287         bool incObjVs(
00288             const Session&           session,
00289                   OSB_LIB::Resource& resource
00290         );
00291     };
00292 }                                       // namespace OSB_DB
00293 #endif                                  // #ifndef _RESOURCEGW_H_

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