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;
83 void QueryCDB(Long64_t run, const char* pathFilter="*",
84 Int_t version=-1, AliCDBMetaData *mdFilter=0);
86 TList* GetQueryCDBList() {return &fValidFileIds;}
90 virtual ~AliCDBStorage();
91 void GetSelection(/*const*/ AliCDBId* id);
92 virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0;
93 virtual TList* GetEntries(const AliCDBId& query) = 0;
94 virtual Bool_t PutEntry(AliCDBEntry* entry) = 0;
95 virtual TList *GetIdListFromFile(const char* fileName)=0;
96 virtual void QueryValidFiles() = 0;
98 TList fValidFileIds; // list of Id's of the files valid for a given run (cached as fRun)
99 Long64_t fRun; // run number, used to manage list of valid files
100 AliCDBPath fPathFilter; // path filter, used to manage list of valid files
101 Int_t fVersion; // version, used to manage list of valid files
102 AliCDBMetaData* fMetaDataFilter; // metadata, used to manage list of valid files
104 TList fSelections; // list of selection criteria
105 TString fURI; // storage URI;
106 TString fType; //! Local, Grid: base folder name - Dump: file name
107 TString fBaseFolder; //! Local, Grid: base folder name - Dump: file name
110 AliCDBStorage(const AliCDBStorage & source);
111 AliCDBStorage & operator=(const AliCDBStorage & source);
113 ClassDef(AliCDBStorage, 0);