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