]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliCDBStorage.h
I've tried to make some output messages lighter (and moved others
[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"
b8ec52f6 17#include "AliCDBManager.h"
fe913d8f 18
9e1ceb13 19#include <TList.h>
6dc56e97 20#include <TObjArray.h>
fe913d8f 21
fe913d8f 22class AliCDBEntry;
62032124 23class AliCDBPath;
b8ec52f6 24class AliCDBParam;
fe913d8f 25
26class AliCDBStorage: public TObject {
fe913d8f 27
9e1ceb13 28public:
b8ec52f6 29
9e1ceb13 30 AliCDBStorage();
9e1ceb13 31
7d160419 32 void SetURI(const TString& uri) {fURI = uri;}
33 const TString& GetURI() const {return fURI;}
62032124 34 const TString& GetType() const {return fType;}
35 const TString& GetBaseFolder() const {return fBaseFolder;}
b8ec52f6 36 AliCDBManager::DataType GetDataType() const;
62032124 37
7d160419 38
b05400be 39 void ReadSelectionFromFile(const char *fileName);
40
9e1ceb13 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
eb0b1051 63 void RemoveSelection(int position);
9e1ceb13 64 void RemoveAllSelections();
65
02c4845e 66 void PrintSelectionList();
67
9e1ceb13 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,
7d160419 78 Int_t version = -1, Int_t subVersion = -1);
9e1ceb13 79
b8ec52f6 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);
9e1ceb13 83
fdf65bb5 84 virtual Bool_t IsReadOnly() const = 0;
85 virtual Bool_t HasSubVersion() const = 0;
b05400be 86 virtual Bool_t Contains(const char* path) const = 0;
c3a7b59a 87 virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const = 0;
b05400be 88
c3a7b59a 89 void QueryCDB(Int_t run, const char* pathFilter="*",
62032124 90 Int_t version=-1, AliCDBMetaData *mdFilter=0);
91 void PrintQueryCDB();
6dc56e97 92 TObjArray* GetQueryCDBList() {return &fValidFileIds;}
62032124 93
c3a7b59a 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
fe913d8f 97protected:
62032124 98
99 virtual ~AliCDBStorage();
4b5e0dce 100 void GetSelection(/*const*/ AliCDBId* id);
9e1ceb13 101 virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0;
102 virtual TList* GetEntries(const AliCDBId& query) = 0;
62032124 103 virtual Bool_t PutEntry(AliCDBEntry* entry) = 0;
b05400be 104 virtual TList *GetIdListFromFile(const char* fileName)=0;
62032124 105 virtual void QueryValidFiles() = 0;
fe913d8f 106
6dc56e97 107 TObjArray fValidFileIds; // list of Id's of the files valid for a given run (cached as fRun)
c3a7b59a 108 Int_t fRun; // run number, used to manage list of valid files
62032124 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
fe913d8f 112
7d160419 113 TList fSelections; // list of selection criteria
62032124 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
fe913d8f 117
c3a7b59a 118private:
fe12e09c 119 AliCDBStorage(const AliCDBStorage & source);
120 AliCDBStorage & operator=(const AliCDBStorage & source);
121
9e1ceb13 122 ClassDef(AliCDBStorage, 0);
fe913d8f 123};
124
125#endif