]>
Commit | Line | Data |
---|---|---|
9e1ceb13 | 1 | #ifndef ALI_CDB_LOCAL_H |
2 | #define ALI_CDB_LOCAL_H | |
fe913d8f | 3 | |
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 AliCDBLocal // | |
10 | // access class to a DataBase in a local storage // | |
11 | // // | |
12 | ///////////////////////////////////////////////////////////////////// | |
fe913d8f | 13 | |
14 | #include "AliCDBStorage.h" | |
9e1ceb13 | 15 | #include "AliCDBManager.h" |
fe913d8f | 16 | |
17 | class AliCDBLocal: public AliCDBStorage { | |
5078a13f | 18 | friend class AliCDBLocalFactory; |
9e1ceb13 | 19 | |
5078a13f | 20 | public: |
9e1ceb13 | 21 | |
5078a13f | 22 | virtual Bool_t IsReadOnly() const {return kFALSE;}; |
23 | virtual Bool_t HasSubVersion() const {return kTRUE;}; | |
24 | virtual Bool_t Contains(const char* path) const; | |
25 | virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const; | |
26 | virtual void SetRetry(Int_t /* nretry */, Int_t /* initsec */); | |
9e1ceb13 | 27 | |
5078a13f | 28 | protected: |
9e1ceb13 | 29 | |
5078a13f | 30 | virtual AliCDBEntry* GetEntry(const AliCDBId& queryId); |
31 | virtual AliCDBId* GetEntryId(const AliCDBId& queryId); | |
32 | virtual TList* GetEntries(const AliCDBId& queryId); | |
33 | virtual Bool_t PutEntry(AliCDBEntry* entry, const char* mirrors=""); | |
34 | virtual TList* GetIdListFromFile(const char* fileName); | |
9e1ceb13 | 35 | |
5078a13f | 36 | private: |
9e1ceb13 | 37 | |
5078a13f | 38 | AliCDBLocal(const AliCDBLocal & source); |
39 | AliCDBLocal & operator=(const AliCDBLocal & source); | |
40 | AliCDBLocal(const char* baseDir); | |
41 | virtual ~AliCDBLocal(); | |
9e1ceb13 | 42 | |
5078a13f | 43 | Bool_t FilenameToId(const char* filename, AliCDBRunRange& runRange, |
44 | Int_t& version, Int_t& subVersion); | |
9e1ceb13 | 45 | |
5078a13f | 46 | Bool_t PrepareId(AliCDBId& id); |
47 | // Bool_t GetId(const AliCDBId& query, AliCDBId& result); | |
48 | AliCDBId* GetId(const AliCDBId& query); | |
62032124 | 49 | |
5078a13f | 50 | virtual void QueryValidFiles(); |
51 | void QueryValidCVMFSFiles(TString& cvmfsOcdbTag); | |
9e1ceb13 | 52 | |
5078a13f | 53 | void GetEntriesForLevel0(const char* level0, const AliCDBId& query, TList* result); |
54 | void GetEntriesForLevel1(const char* level0, const char* Level1, | |
55 | const AliCDBId& query, TList* result); | |
9e1ceb13 | 56 | |
5078a13f | 57 | TString fBaseDirectory; // path of the DB folder |
58 | ||
59 | ClassDef(AliCDBLocal, 0); // access class to a DataBase in a local storage | |
9e1ceb13 | 60 | }; |
61 | ||
62 | ///////////////////////////////////////////////////////////////////// | |
63 | // // | |
64 | // class AliCDBLocalFactory // | |
65 | // // | |
66 | ///////////////////////////////////////////////////////////////////// | |
67 | ||
68 | class AliCDBLocalFactory: public AliCDBStorageFactory { | |
fe913d8f | 69 | |
5078a13f | 70 | public: |
fe913d8f | 71 | |
5078a13f | 72 | virtual Bool_t Validate(const char* dbString); |
73 | virtual AliCDBParam* CreateParameter(const char* dbString); | |
9e1ceb13 | 74 | |
5078a13f | 75 | protected: |
76 | virtual AliCDBStorage* Create(const AliCDBParam* param); | |
9e1ceb13 | 77 | |
5078a13f | 78 | ClassDef(AliCDBLocalFactory, 0); |
9e1ceb13 | 79 | }; |
80 | ||
81 | ///////////////////////////////////////////////////////////////////// | |
82 | // // | |
83 | // class AliCDBLocalParam // | |
84 | // // | |
85 | ///////////////////////////////////////////////////////////////////// | |
86 | ||
87 | class AliCDBLocalParam: public AliCDBParam { | |
9e1ceb13 | 88 | |
5078a13f | 89 | public: |
90 | AliCDBLocalParam(); | |
91 | AliCDBLocalParam(const char* dbPath); | |
92 | AliCDBLocalParam(const char* dbPath, const char* uri); | |
93 | ||
94 | virtual ~AliCDBLocalParam(); | |
95 | ||
96 | const TString& GetPath() const {return fDBPath;}; | |
9e1ceb13 | 97 | |
5078a13f | 98 | virtual AliCDBParam* CloneParam() const; |
9e1ceb13 | 99 | |
5078a13f | 100 | virtual ULong_t Hash() const; |
101 | virtual Bool_t IsEqual(const TObject* obj) const; | |
fe913d8f | 102 | |
5078a13f | 103 | private: |
fe913d8f | 104 | |
5078a13f | 105 | TString fDBPath; // path of the DB folder |
fe913d8f | 106 | |
5078a13f | 107 | ClassDef(AliCDBLocalParam, 0); |
fe913d8f | 108 | }; |
109 | ||
110 | #endif |