]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliCDBStorage.h
Seperate process tags for mb, non-diff, single and double-diffraction.
[u/mrichter/AliRoot.git] / STEER / AliCDBStorage.h
CommitLineData
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>
6dc56e97 19#include <TObjArray.h>
fe913d8f 20
fe913d8f 21class AliCDBEntry;
62032124 22class AliCDBPath;
fe913d8f 23
24class AliCDBStorage: public TObject {
fe913d8f 25
9e1ceb13 26public:
27 AliCDBStorage();
9e1ceb13 28
7d160419 29 void SetURI(const TString& uri) {fURI = uri;}
30 const TString& GetURI() const {return fURI;}
62032124 31 const TString& GetType() const {return fType;}
32 const TString& GetBaseFolder() const {return fBaseFolder;}
33
7d160419 34
b05400be 35 void ReadSelectionFromFile(const char *fileName);
36
9e1ceb13 37 void AddSelection(const AliCDBId& selection);
38
39 void AddSelection(const AliCDBPath& path,
40 const AliCDBRunRange& runRange,
41 Int_t version,
42 Int_t subVersion = -1);
43
44 void AddSelection(const AliCDBPath& path,
45 Int_t firstRun,
46 Int_t lastRun,
47 Int_t version,
48 Int_t subVersion = -1);
49
50 void RemoveSelection(const AliCDBId& selection);
51
52 void RemoveSelection(const AliCDBPath& path,
53 const AliCDBRunRange& runRange);
54
55 void RemoveSelection(const AliCDBPath& path,
56 Int_t firstRun = -1,
57 Int_t lastRun = -1);
58
eb0b1051 59 void RemoveSelection(int position);
9e1ceb13 60 void RemoveAllSelections();
61
02c4845e 62 void PrintSelectionList();
63
9e1ceb13 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);
69
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,
7d160419 74 Int_t version = -1, Int_t subVersion = -1);
9e1ceb13 75
9e1ceb13 76 Bool_t Put(TObject* object, AliCDBId& id, AliCDBMetaData* metaData);
77 Bool_t Put(AliCDBEntry* entry);
78
79
fdf65bb5 80 virtual Bool_t IsReadOnly() const = 0;
81 virtual Bool_t HasSubVersion() const = 0;
b05400be 82 virtual Bool_t Contains(const char* path) const = 0;
c3a7b59a 83 virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const = 0;
b05400be 84
c3a7b59a 85 void QueryCDB(Int_t run, const char* pathFilter="*",
62032124 86 Int_t version=-1, AliCDBMetaData *mdFilter=0);
87 void PrintQueryCDB();
6dc56e97 88 TObjArray* GetQueryCDBList() {return &fValidFileIds;}
62032124 89
c3a7b59a 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;
92
fe913d8f 93protected:
62032124 94
95 virtual ~AliCDBStorage();
4b5e0dce 96 void GetSelection(/*const*/ AliCDBId* id);
9e1ceb13 97 virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0;
98 virtual TList* GetEntries(const AliCDBId& query) = 0;
62032124 99 virtual Bool_t PutEntry(AliCDBEntry* entry) = 0;
b05400be 100 virtual TList *GetIdListFromFile(const char* fileName)=0;
62032124 101 virtual void QueryValidFiles() = 0;
fe913d8f 102
6dc56e97 103 TObjArray fValidFileIds; // list of Id's of the files valid for a given run (cached as fRun)
c3a7b59a 104 Int_t fRun; // run number, used to manage list of valid files
62032124 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
fe913d8f 108
7d160419 109 TList fSelections; // list of selection criteria
62032124 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
fe913d8f 113
c3a7b59a 114private:
fe12e09c 115 AliCDBStorage(const AliCDBStorage & source);
116 AliCDBStorage & operator=(const AliCDBStorage & source);
117
9e1ceb13 118 ClassDef(AliCDBStorage, 0);
fe913d8f 119};
120
121#endif