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"
19 #include <TObjArray.h>
24 class AliCDBStorage: public TObject {
29 void SetURI(const TString& uri) {fURI = uri;}
30 const TString& GetURI() const {return fURI;}
31 const TString& GetType() const {return fType;}
32 const TString& GetBaseFolder() const {return fBaseFolder;}
35 void ReadSelectionFromFile(const char *fileName);
37 void AddSelection(const AliCDBId& selection);
39 void AddSelection(const AliCDBPath& path,
40 const AliCDBRunRange& runRange,
42 Int_t subVersion = -1);
44 void AddSelection(const AliCDBPath& path,
48 Int_t subVersion = -1);
50 void RemoveSelection(const AliCDBId& selection);
52 void RemoveSelection(const AliCDBPath& path,
53 const AliCDBRunRange& runRange);
55 void RemoveSelection(const AliCDBPath& path,
59 void RemoveSelection(int position);
60 void RemoveAllSelections();
62 void PrintSelectionList();
64 AliCDBEntry* Get(const AliCDBId& query);
65 AliCDBEntry* Get(const AliCDBPath& path, Int_t runNumber,
66 Int_t version = -1, Int_t subVersion = -1);
67 AliCDBEntry* Get(const AliCDBPath& path, const AliCDBRunRange& runRange,
68 Int_t version = -1, Int_t subVersion = -1);
70 TList* GetAll(const AliCDBId& query);
71 TList* GetAll(const AliCDBPath& path, Int_t runNumber,
72 Int_t version = -1, Int_t subVersion = -1);
73 TList* GetAll(const AliCDBPath& path, const AliCDBRunRange& runRange,
74 Int_t version = -1, Int_t subVersion = -1);
76 Bool_t Put(TObject* object, AliCDBId& id, AliCDBMetaData* metaData);
77 Bool_t Put(AliCDBEntry* entry);
80 virtual Bool_t IsReadOnly() const = 0;
81 virtual Bool_t HasSubVersion() const = 0;
82 virtual Bool_t Contains(const char* path) const = 0;
83 virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const = 0;
85 void QueryCDB(Int_t run, const char* pathFilter="*",
86 Int_t version=-1, AliCDBMetaData *mdFilter=0);
88 TObjArray* GetQueryCDBList() {return &fValidFileIds;}
90 virtual Int_t GetLatestVersion(const char* path, Int_t run)=0;
91 virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version=-1)=0;
95 virtual ~AliCDBStorage();
96 void GetSelection(/*const*/ AliCDBId* id);
97 virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0;
98 virtual TList* GetEntries(const AliCDBId& query) = 0;
99 virtual Bool_t PutEntry(AliCDBEntry* entry) = 0;
100 virtual TList *GetIdListFromFile(const char* fileName)=0;
101 virtual void QueryValidFiles() = 0;
103 TObjArray fValidFileIds; // list of Id's of the files valid for a given run (cached as fRun)
104 Int_t fRun; // run number, used to manage list of valid files
105 AliCDBPath fPathFilter; // path filter, used to manage list of valid files
106 Int_t fVersion; // version, used to manage list of valid files
107 AliCDBMetaData* fMetaDataFilter; // metadata, used to manage list of valid files
109 TList fSelections; // list of selection criteria
110 TString fURI; // storage URI;
111 TString fType; //! Local, Grid: base folder name - Dump: file name
112 TString fBaseFolder; //! Local, Grid: base folder name - Dump: file name
115 AliCDBStorage(const AliCDBStorage & source);
116 AliCDBStorage & operator=(const AliCDBStorage & source);
118 ClassDef(AliCDBStorage, 0);