]>
Commit | Line | Data |
---|---|---|
9e1ceb13 | 1 | #ifndef ALI_CDB_STORAGE_H |
2 | #define ALI_CDB_STORAGE_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 AliCDBStorage // | |
10 | // interface to specific storage classes // | |
11 | // (AliCDBGrid, AliCDBLocal, AliCDBDump) // | |
12 | // // | |
13 | ///////////////////////////////////////////////////////////////////// | |
fe913d8f | 14 | |
9e1ceb13 | 15 | #include "AliCDBId.h" |
fe913d8f | 16 | #include "AliCDBMetaData.h" |
17 | ||
9e1ceb13 | 18 | #include <TList.h> |
fe913d8f | 19 | |
fe913d8f | 20 | class AliCDBEntry; |
62032124 | 21 | class AliCDBPath; |
fe913d8f | 22 | |
23 | class AliCDBStorage: public TObject { | |
fe913d8f | 24 | |
9e1ceb13 | 25 | public: |
26 | AliCDBStorage(); | |
9e1ceb13 | 27 | |
7d160419 | 28 | void SetURI(const TString& uri) {fURI = uri;} |
29 | const TString& GetURI() const {return fURI;} | |
62032124 | 30 | const TString& GetType() const {return fType;} |
31 | const TString& GetBaseFolder() const {return fBaseFolder;} | |
32 | ||
7d160419 | 33 | |
b05400be | 34 | void ReadSelectionFromFile(const char *fileName); |
35 | ||
9e1ceb13 | 36 | void AddSelection(const AliCDBId& selection); |
37 | ||
38 | void AddSelection(const AliCDBPath& path, | |
39 | const AliCDBRunRange& runRange, | |
40 | Int_t version, | |
41 | Int_t subVersion = -1); | |
42 | ||
43 | void AddSelection(const AliCDBPath& path, | |
44 | Int_t firstRun, | |
45 | Int_t lastRun, | |
46 | Int_t version, | |
47 | Int_t subVersion = -1); | |
48 | ||
49 | void RemoveSelection(const AliCDBId& selection); | |
50 | ||
51 | void RemoveSelection(const AliCDBPath& path, | |
52 | const AliCDBRunRange& runRange); | |
53 | ||
54 | void RemoveSelection(const AliCDBPath& path, | |
55 | Int_t firstRun = -1, | |
56 | Int_t lastRun = -1); | |
57 | ||
eb0b1051 | 58 | void RemoveSelection(int position); |
9e1ceb13 | 59 | void RemoveAllSelections(); |
60 | ||
02c4845e | 61 | void PrintSelectionList(); |
62 | ||
9e1ceb13 | 63 | AliCDBEntry* Get(const AliCDBId& query); |
64 | AliCDBEntry* Get(const AliCDBPath& path, Int_t runNumber, | |
65 | Int_t version = -1, Int_t subVersion = -1); | |
66 | AliCDBEntry* Get(const AliCDBPath& path, const AliCDBRunRange& runRange, | |
67 | Int_t version = -1, Int_t subVersion = -1); | |
68 | ||
69 | TList* GetAll(const AliCDBId& query); | |
70 | TList* GetAll(const AliCDBPath& path, Int_t runNumber, | |
71 | Int_t version = -1, Int_t subVersion = -1); | |
72 | TList* GetAll(const AliCDBPath& path, const AliCDBRunRange& runRange, | |
7d160419 | 73 | Int_t version = -1, Int_t subVersion = -1); |
9e1ceb13 | 74 | |
9e1ceb13 | 75 | Bool_t Put(TObject* object, AliCDBId& id, AliCDBMetaData* metaData); |
76 | Bool_t Put(AliCDBEntry* entry); | |
77 | ||
78 | ||
fdf65bb5 | 79 | virtual Bool_t IsReadOnly() const = 0; |
80 | virtual Bool_t HasSubVersion() const = 0; | |
b05400be | 81 | virtual Bool_t Contains(const char* path) const = 0; |
c3a7b59a | 82 | virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const = 0; |
b05400be | 83 | |
c3a7b59a | 84 | void QueryCDB(Int_t run, const char* pathFilter="*", |
62032124 | 85 | Int_t version=-1, AliCDBMetaData *mdFilter=0); |
86 | void PrintQueryCDB(); | |
87 | TList* GetQueryCDBList() {return &fValidFileIds;} | |
88 | ||
c3a7b59a | 89 | virtual Int_t GetLatestVersion(const char* path, Int_t run)=0; |
90 | virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version=-1)=0; | |
91 | ||
fe913d8f | 92 | protected: |
62032124 | 93 | |
94 | virtual ~AliCDBStorage(); | |
4b5e0dce | 95 | void GetSelection(/*const*/ AliCDBId* id); |
9e1ceb13 | 96 | virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0; |
97 | virtual TList* GetEntries(const AliCDBId& query) = 0; | |
62032124 | 98 | virtual Bool_t PutEntry(AliCDBEntry* entry) = 0; |
b05400be | 99 | virtual TList *GetIdListFromFile(const char* fileName)=0; |
62032124 | 100 | virtual void QueryValidFiles() = 0; |
fe913d8f | 101 | |
62032124 | 102 | TList fValidFileIds; // list of Id's of the files valid for a given run (cached as fRun) |
c3a7b59a | 103 | Int_t fRun; // run number, used to manage list of valid files |
62032124 | 104 | AliCDBPath fPathFilter; // path filter, used to manage list of valid files |
105 | Int_t fVersion; // version, used to manage list of valid files | |
106 | AliCDBMetaData* fMetaDataFilter; // metadata, used to manage list of valid files | |
fe913d8f | 107 | |
7d160419 | 108 | TList fSelections; // list of selection criteria |
62032124 | 109 | TString fURI; // storage URI; |
110 | TString fType; //! Local, Grid: base folder name - Dump: file name | |
111 | TString fBaseFolder; //! Local, Grid: base folder name - Dump: file name | |
fe913d8f | 112 | |
c3a7b59a | 113 | private: |
fe12e09c | 114 | AliCDBStorage(const AliCDBStorage & source); |
115 | AliCDBStorage & operator=(const AliCDBStorage & source); | |
116 | ||
9e1ceb13 | 117 | ClassDef(AliCDBStorage, 0); |
fe913d8f | 118 | }; |
119 | ||
120 | #endif |