1 #ifndef ALI_CDB_STORAGE_H
2 #define ALI_CDB_STORAGE_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /////////////////////////////////////////////////////////////////////
9 // class AliCDBStorage //
10 // interface to specific storage classes //
11 // (AliCDBGrid, AliCDBLocal, AliCDBDump) //
13 /////////////////////////////////////////////////////////////////////
16 #include "AliCDBMetaData.h"
23 class AliCDBStorage: public TObject {
28 void SetURI(const TString& uri) {fURI = uri;}
29 const TString& GetURI() const {return fURI;}
30 const TString& GetType() const {return fType;}
31 const TString& GetBaseFolder() const {return fBaseFolder;}
34 void ReadSelectionFromFile(const char *fileName);
36 void AddSelection(const AliCDBId& selection);
38 void AddSelection(const AliCDBPath& path,
39 const AliCDBRunRange& runRange,
41 Int_t subVersion = -1);
43 void AddSelection(const AliCDBPath& path,
47 Int_t subVersion = -1);
49 void RemoveSelection(const AliCDBId& selection);
51 void RemoveSelection(const AliCDBPath& path,
52 const AliCDBRunRange& runRange);
54 void RemoveSelection(const AliCDBPath& path,
58 void RemoveSelection(int position);
59 void RemoveAllSelections();
61 void PrintSelectionList();
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);
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,
73 Int_t version = -1, Int_t subVersion = -1);
75 Bool_t Put(TObject* object, AliCDBId& id, AliCDBMetaData* metaData);
76 Bool_t Put(AliCDBEntry* entry);
79 virtual Bool_t IsReadOnly() const = 0;
80 virtual Bool_t HasSubVersion() const = 0;
81 virtual Bool_t Contains(const char* path) const = 0;
82 virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const = 0;
84 void QueryCDB(Int_t run, const char* pathFilter="*",
85 Int_t version=-1, AliCDBMetaData *mdFilter=0);
87 TList* GetQueryCDBList() {return &fValidFileIds;}
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;
94 virtual ~AliCDBStorage();
95 void GetSelection(/*const*/ AliCDBId* id);
96 virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0;
97 virtual TList* GetEntries(const AliCDBId& query) = 0;
98 virtual Bool_t PutEntry(AliCDBEntry* entry) = 0;
99 virtual TList *GetIdListFromFile(const char* fileName)=0;
100 virtual void QueryValidFiles() = 0;
102 TList fValidFileIds; // list of Id's of the files valid for a given run (cached as fRun)
103 Int_t fRun; // run number, used to manage list of valid files
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
108 TList fSelections; // list of selection criteria
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
114 AliCDBStorage(const AliCDBStorage & source);
115 AliCDBStorage & operator=(const AliCDBStorage & source);
117 ClassDef(AliCDBStorage, 0);