]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliCDBGrid.h
Common class for DCS sensors (Haavard, Marian)
[u/mrichter/AliRoot.git] / STEER / AliCDBGrid.h
CommitLineData
9e1ceb13 1#ifndef ALICDBGRID_H
2#define ALICDBGRID_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 AliCDBGrid //
b05400be 10// access class to a DataBase in an AliEn storage //
9e1ceb13 11// //
12/////////////////////////////////////////////////////////////////////
13
14#include "AliCDBStorage.h"
15#include "AliCDBManager.h"
6dc56e97 16#include "AliCDBMetaData.h"
9e1ceb13 17
18class AliCDBGrid: public AliCDBStorage {
19 friend class AliCDBGridFactory;
20
21public:
22
c3a7b59a 23 virtual Bool_t IsReadOnly() const {return kFALSE;}
24 virtual Bool_t HasSubVersion() const {return kFALSE;}
b05400be 25 virtual Bool_t Contains(const char* path) const;
c3a7b59a 26 virtual Int_t GetLatestVersion(const char* path, Int_t run);
27 virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version);
28 virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const;
29
9e1ceb13 30protected:
31
32 virtual AliCDBEntry* GetEntry(const AliCDBId& queryId);
33 virtual TList* GetEntries(const AliCDBId& queryId);
34 virtual Bool_t PutEntry(AliCDBEntry* entry);
b05400be 35 virtual TList* GetIdListFromFile(const char* fileName);
9e1ceb13 36
37private:
38
b05400be 39 AliCDBGrid(const char *gridUrl, const char *user, const char* dbFolder, const char *se);
9e1ceb13 40
41 virtual ~AliCDBGrid();
42
43 AliCDBGrid(const AliCDBGrid& db);
44 AliCDBGrid& operator = (const AliCDBGrid& db);
45
62032124 46 Bool_t FilenameToId(TString& filename, AliCDBId& id);
9e1ceb13 47
48 Bool_t PrepareId(AliCDBId& id);
6dc56e97 49 AliCDBId* GetId(const TObjArray& validFileIds, const AliCDBId& query);
8e245d15 50 AliCDBEntry* GetEntryFromFile(TString& filename, AliCDBId* dataId);
9e1ceb13 51
62032124 52 Bool_t AddTag(TString& foldername, const char* tagname);
c3a7b59a 53 Bool_t TagFileId(TString& filename, const AliCDBId* id);
54 Bool_t TagFileMetaData(TString& filename, const AliCDBMetaData* md);
9e1ceb13 55
6dc56e97 56 void MakeQueryFilter(Int_t firstRun, Int_t lastRun, const AliCDBMetaData* md, TString& result) const;
62032124 57
58 virtual void QueryValidFiles();
9e1ceb13 59
b05400be 60 TString fGridUrl; // Grid Url ("alien://aliendb4.cern.ch:9000")
9e1ceb13 61 TString fUser; // User
b05400be 62 TString fDBFolder; // path of the DB folder
62032124 63 TString fSE; // Storage Element
9e1ceb13 64
65ClassDef(AliCDBGrid, 0) // access class to a DataBase in an AliEn storage
66};
67
68/////////////////////////////////////////////////////////////////////
69// //
70// class AliCDBGridFactory //
71// //
72/////////////////////////////////////////////////////////////////////
73
74class AliCDBGridFactory: public AliCDBStorageFactory {
75
76public:
77
78 virtual Bool_t Validate(const char* gridString);
79 virtual AliCDBParam* CreateParameter(const char* gridString);
f430a9ce 80 virtual ~AliCDBGridFactory(){}
9e1ceb13 81
82protected:
83 virtual AliCDBStorage* Create(const AliCDBParam* param);
84
85 ClassDef(AliCDBGridFactory, 0);
86};
87
88/////////////////////////////////////////////////////////////////////
89// //
90// class AliCDBGridParam //
91// //
92/////////////////////////////////////////////////////////////////////
93
94class AliCDBGridParam: public AliCDBParam {
95
96public:
97 AliCDBGridParam();
62032124 98 AliCDBGridParam(const char* gridUrl, const char* user,
b05400be 99 const char* dbFolder, const char* se);
9e1ceb13 100
101 virtual ~AliCDBGridParam();
102
b05400be 103 const TString& GridUrl() const {return fGridUrl;};
9e1ceb13 104 const TString& GetUser() const {return fUser;};
b05400be 105 const TString& GetDBFolder() const {return fDBFolder;};
9e1ceb13 106 const TString& GetSE() const {return fSE;};
107
108 virtual AliCDBParam* CloneParam() const;
109
110 virtual ULong_t Hash() const;
111 virtual Bool_t IsEqual(const TObject* obj) const;
112
113private:
b05400be 114 TString fGridUrl; // Grid url "Host:port"
9e1ceb13 115 TString fUser; // User
b05400be 116 TString fDBFolder; // path of the DB folder
4005d0b5 117 TString fSE; // Storage Element
9e1ceb13 118
119 ClassDef(AliCDBGridParam, 0);
120};
121
122
123#endif