]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliCDBGrid.h
Switch off branches by hand.
[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);
4667c116 33 virtual AliCDBId* GetEntryId(const AliCDBId& queryId);
9e1ceb13 34 virtual TList* GetEntries(const AliCDBId& queryId);
35 virtual Bool_t PutEntry(AliCDBEntry* entry);
b05400be 36 virtual TList* GetIdListFromFile(const char* fileName);
9e1ceb13 37
38private:
39
b05400be 40 AliCDBGrid(const char *gridUrl, const char *user, const char* dbFolder, const char *se);
9e1ceb13 41
42 virtual ~AliCDBGrid();
43
44 AliCDBGrid(const AliCDBGrid& db);
45 AliCDBGrid& operator = (const AliCDBGrid& db);
46
62032124 47 Bool_t FilenameToId(TString& filename, AliCDBId& id);
9e1ceb13 48
49 Bool_t PrepareId(AliCDBId& id);
6dc56e97 50 AliCDBId* GetId(const TObjArray& validFileIds, const AliCDBId& query);
8e245d15 51 AliCDBEntry* GetEntryFromFile(TString& filename, AliCDBId* dataId);
9e1ceb13 52
4667c116 53 // TODO use AliEnTag classes!
62032124 54 Bool_t AddTag(TString& foldername, const char* tagname);
c3a7b59a 55 Bool_t TagFileId(TString& filename, const AliCDBId* id);
56 Bool_t TagFileMetaData(TString& filename, const AliCDBMetaData* md);
4667c116 57 Bool_t TagShortLived(TString& filename, Bool_t value);
9e1ceb13 58
6dc56e97 59 void MakeQueryFilter(Int_t firstRun, Int_t lastRun, const AliCDBMetaData* md, TString& result) const;
62032124 60
61 virtual void QueryValidFiles();
9e1ceb13 62
b05400be 63 TString fGridUrl; // Grid Url ("alien://aliendb4.cern.ch:9000")
9e1ceb13 64 TString fUser; // User
b05400be 65 TString fDBFolder; // path of the DB folder
62032124 66 TString fSE; // Storage Element
9e1ceb13 67
4667c116 68ClassDef(AliCDBGrid, 0) // access class to a DataBase in an AliEn storage
9e1ceb13 69};
70
71/////////////////////////////////////////////////////////////////////
72// //
73// class AliCDBGridFactory //
74// //
75/////////////////////////////////////////////////////////////////////
76
77class AliCDBGridFactory: public AliCDBStorageFactory {
78
79public:
80
81 virtual Bool_t Validate(const char* gridString);
82 virtual AliCDBParam* CreateParameter(const char* gridString);
f430a9ce 83 virtual ~AliCDBGridFactory(){}
9e1ceb13 84
85protected:
86 virtual AliCDBStorage* Create(const AliCDBParam* param);
87
88 ClassDef(AliCDBGridFactory, 0);
89};
90
91/////////////////////////////////////////////////////////////////////
92// //
93// class AliCDBGridParam //
94// //
95/////////////////////////////////////////////////////////////////////
96
97class AliCDBGridParam: public AliCDBParam {
98
99public:
100 AliCDBGridParam();
62032124 101 AliCDBGridParam(const char* gridUrl, const char* user,
b05400be 102 const char* dbFolder, const char* se);
9e1ceb13 103
104 virtual ~AliCDBGridParam();
105
b05400be 106 const TString& GridUrl() const {return fGridUrl;};
9e1ceb13 107 const TString& GetUser() const {return fUser;};
b05400be 108 const TString& GetDBFolder() const {return fDBFolder;};
9e1ceb13 109 const TString& GetSE() const {return fSE;};
110
111 virtual AliCDBParam* CloneParam() const;
112
113 virtual ULong_t Hash() const;
114 virtual Bool_t IsEqual(const TObject* obj) const;
115
116private:
b05400be 117 TString fGridUrl; // Grid url "Host:port"
9e1ceb13 118 TString fUser; // User
b05400be 119 TString fDBFolder; // path of the DB folder
4005d0b5 120 TString fSE; // Storage Element
9e1ceb13 121
122 ClassDef(AliCDBGridParam, 0);
123};
124
125
126#endif