00001 #ifndef CDBBDBSHARED_SLAVE_REGISTRY_P_HH 00002 #define CDBBDBSHARED_SLAVE_REGISTRY_P_HH 00003 00004 // File and Version Information: 00005 // $Id: CdbBdbSSlaveRegistryP.ddl,v 1.3 2002/09/23 22:41:12 gapon Exp $ 00006 00007 #include "BdbUtil/Bdb.hh" 00008 00009 //------------------------------- 00010 // Collaborating Class Headers -- 00011 //------------------------------- 00012 00013 #include "CdbBdbShared/CdbBdbSRegistryP.hh" 00014 00015 /// A Registry for the SLAVE kind of databases 00016 /** 00017 * See details below. 00018 */ 00019 class CdbBdbSSlaveRegistryP : public CdbBdbSRegistryP { 00020 00021 public: 00022 00023 /// Factory method for objects of this class. 00024 /** 00025 * IMPORTANT: This operation can only be run against a federation, which 00026 * already loaded with CDB infrastructure for the corresponding 00027 * MASTER database. 00028 * 00029 * The parameters of the registry will be inquired from the collection 00030 * of origins by identifying one of the SLAVE kinds of them (origins) having 00031 * the same DBID range as the local one. It means that the origin should already 00032 * be known to the MASTER. 00033 */ 00034 static CdbStatus create( BdbHandle(CdbBdbSRegistryP)& theRegistryH /**< the resulting persistent object */ 00035 ); 00036 00037 private: 00038 00039 /// Default constructor (NOT IMPLEMENTED) 00040 00041 CdbBdbSSlaveRegistryP( ); 00042 00043 public: 00044 00045 /// Normal constructor 00046 /** 00047 * NOTES: 00048 * 00049 * - the "id" of a SLAVE database must be the same as its MASTER's one. 00050 * 00051 * - the "origin" of a SLAVE must be not be the reserved one. See a list 00052 * of the reserved identifiers in the header file of the CdbBdbSOriginP class. 00053 * 00054 * ATTENTION: Use the above defined static factory method to create 00055 * persistent objects of this class. 00056 * 00057 * @see CdbBdbSSlaveRegistryP::create() 00058 * @see CdbBdbSOriginP 00059 */ 00060 CdbBdbSSlaveRegistryP( d_UShort theOriginId, /**< the origin identifier of this part */ 00061 const char* theDescription, /**< the description of the database */ 00062 const BdbTime& theCreationTime, /**< the time when the database is supposed to be created */ 00063 const BdbTime& theId /**< the unique identifier of the whole Condition/DB database */ 00064 ); 00065 00066 /// Destructor 00067 /** 00068 */ 00069 virtual ~CdbBdbSSlaveRegistryP( ); 00070 00071 /// Check if it's the master 00072 00073 virtual bool isMaster( ) const; 00074 00075 // MASTER-only collections and resources. Null references are always 00076 // returned by these methods. 00077 00078 virtual BdbRef(CdbBdbSOriginCollectionP) originCollection( ) const; 00079 00080 virtual BdbRef(CdbBdbSRallocatorP< d_UShort >) originRallocator( ) const; 00081 virtual BdbRef(CdbBdbSRallocatorP< d_UShort >) partitionRallocator( ) const; 00082 00083 virtual BdbRef(CdbBdbSClusterCollectionP) pClusterCollection( ) const; 00084 00085 virtual BdbRef(CdbBdbSRallocatorP< d_UShort >) pClusterRallocator ( ) const; 00086 00087 // These collection is needed since SLAVE may own partitions, 00088 // Therefore it needs to create local partition descriptors in a writable set 00089 // of databases. The contense of this P-Layout is a subject for re-synchronizations 00090 // done by the Data Distribution procedures. 00091 // 00092 // We don't need the Rallocator for partitions ID since partitions 00093 // are only created in the MASTER database. SLAVE-s may only write into these 00094 // partitions. 00095 00096 // Neither we need the local clusters of partitionable conditions since 00097 // there is just one partitions layout amd since partitionable conditions can only be 00098 // created and assiciated with partitionable cluster at the MASTER database. 00099 00100 virtual BdbRef(CdbBdbSPartitionsLayoutP) partitionsLayout ( ) const; 00101 00102 private: 00103 00104 // Data members 00105 00106 BdbRef(CdbBdbSPartitionsLayoutP) _partitionsLayoutRef; 00107 00108 // These data members are not currently used. They were introduced 00109 // by a mistake. 00110 00111 BdbRef(CdbBdbSClusterCollectionP) _pClusterCollectionRef; 00112 BdbRef(CdbBdbSRallocatorP< d_UShort >) _pClusterRallocatorRef; 00113 }; 00114 00115 #endif /* CDBBDBSHARED_SLAVE_REGISTRY_P_HH */
1.3-rc3