Implementing the exponential retry when putting an object in the OCDB. The function...
[u/mrichter/AliRoot.git] / STEER / CDB / AliCDBDump.h
CommitLineData
9e1ceb13 1#ifndef ALI_CDB_DUMP_H
2#define ALI_CDB_DUMP_H
3
fe913d8f 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
9e1ceb13 7/////////////////////////////////////////////////////////////////////
8// //
9// class AliCDBDump //
10// access class to a DataBase in a dump storage (single file) //
11// //
12/////////////////////////////////////////////////////////////////////
fe913d8f 13
14#include "AliCDBStorage.h"
9e1ceb13 15#include "AliCDBManager.h"
fe913d8f 16
9e1ceb13 17class TDirectory;
fe913d8f 18class TFile;
19
fe913d8f 20class AliCDBDump: public AliCDBStorage {
9e1ceb13 21 friend class AliCDBDumpFactory;
22
23public:
24
fdf65bb5 25 virtual Bool_t IsReadOnly() const {return fReadOnly;};
26 virtual Bool_t HasSubVersion() const {return kFALSE;};
b05400be 27 virtual Bool_t Contains(const char* path) const;
c3a7b59a 28 virtual Int_t GetLatestVersion(const char* path, Int_t run);
29 virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version=-1);
30 virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const;
89004e35 31 virtual void SetRetry(Int_t nretry, Int_t totsec);
9e1ceb13 32
33protected:
34
b05400be 35 virtual AliCDBEntry* GetEntry(const AliCDBId& query);
4667c116 36 virtual AliCDBId* GetEntryId(const AliCDBId& query);
b05400be 37 virtual TList* GetEntries(const AliCDBId& query);
38 virtual Bool_t PutEntry(AliCDBEntry* entry);
39 virtual TList* GetIdListFromFile(const char* fileName);
9e1ceb13 40
41private:
42
fe12e09c 43 AliCDBDump(const AliCDBDump & source);
44 AliCDBDump & operator=(const AliCDBDump & source);
9e1ceb13 45 AliCDBDump(const char* dbFile, Bool_t readOnly);
46 virtual ~AliCDBDump();
47
48 Bool_t KeyNameToId(const char* keyname, AliCDBRunRange& runRange,
49 Int_t& version, Int_t& subVersion);
50 Bool_t IdToKeyName(const AliCDBRunRange& runRange, Int_t version,
51 Int_t subVersion, TString& keyname);
52
53 Bool_t MkDir(const TString& dir);
54
55
56 Bool_t PrepareId(AliCDBId& id);
4667c116 57// Bool_t GetId(const AliCDBId& query, AliCDBId& result);
58 AliCDBId* GetId(const AliCDBId& query);
9e1ceb13 59
62032124 60 virtual void QueryValidFiles();
9e1ceb13 61
62 void GetEntriesForLevel0(const AliCDBId& query, TList* result);
63 void GetEntriesForLevel1(const AliCDBId& query, TList* result);
64
65 TFile* fFile; // Dump file
66 Bool_t fReadOnly; // ReadOnly flag
67
68 ClassDef(AliCDBDump, 0);
69};
70
71/////////////////////////////////////////////////////////////////////
72// //
73// class AliCDBDumpFactory //
74// //
75/////////////////////////////////////////////////////////////////////
76
77class AliCDBDumpFactory: public AliCDBStorageFactory {
78
fe913d8f 79public:
9e1ceb13 80
81 virtual Bool_t Validate(const char* dbString);
82 virtual AliCDBParam* CreateParameter(const char* dbString);
fe913d8f 83
84protected:
9e1ceb13 85 virtual AliCDBStorage* Create(const AliCDBParam* param);
86
87 ClassDef(AliCDBDumpFactory, 0);
88};
89
90/////////////////////////////////////////////////////////////////////
91// //
92// class AliCDBDumpParam //
93// //
94/////////////////////////////////////////////////////////////////////
95
96class AliCDBDumpParam: public AliCDBParam {
97
98public:
99 AliCDBDumpParam();
100 AliCDBDumpParam(const char* dbPath, Bool_t readOnly = kFALSE);
101
102 virtual ~AliCDBDumpParam();
103
104 const TString& GetPath() const {return fDBPath;};
105 Bool_t IsReadOnly() const {return fReadOnly;};
fe913d8f 106
9e1ceb13 107 virtual AliCDBParam* CloneParam() const;
fe913d8f 108
9e1ceb13 109 virtual ULong_t Hash() const;
110 virtual Bool_t IsEqual(const TObject* obj) const;
111
fe913d8f 112private:
fe913d8f 113
9e1ceb13 114 TString fDBPath; // Dump file path name
115 Bool_t fReadOnly; // ReadOnly flag
fe913d8f 116
9e1ceb13 117 ClassDef(AliCDBDumpParam, 0);
fe913d8f 118};
119
120#endif