]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/CDB/AliCDBGrid.h
We can now remove the deprecated methods GetLatestVersion and GetLatestSubVersion
[u/mrichter/AliRoot.git] / STEER / CDB / 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 Bool_t IdToFilename(const AliCDBId& id, TString& filename) const;
5bfe3965 27 virtual void SetRetry(Int_t nretry, Int_t initsec);
c5941d67 28 virtual void SetMirrorSEs(const char* mirrors) {fMirrorSEs=mirrors;}
29 virtual const char* GetMirrorSEs() const {return fMirrorSEs;}
30
c3a7b59a 31
9e1ceb13 32protected:
33
34 virtual AliCDBEntry* GetEntry(const AliCDBId& queryId);
4667c116 35 virtual AliCDBId* GetEntryId(const AliCDBId& queryId);
9e1ceb13 36 virtual TList* GetEntries(const AliCDBId& queryId);
06eeadea 37 virtual Bool_t PutEntry(AliCDBEntry* entry, const char* mirrors="");
b05400be 38 virtual TList* GetIdListFromFile(const char* fileName);
9e1ceb13 39
40private:
c75fabed 41
42 AliCDBGrid(const char *gridUrl, const char *user, const char* dbFolder,
43 const char *se, const char* cacheFolder, Bool_t operateDisconnected,
44 Long64_t cacheSize, Long_t cleanupInterval);
9e1ceb13 45
46 virtual ~AliCDBGrid();
47
48 AliCDBGrid(const AliCDBGrid& db);
49 AliCDBGrid& operator = (const AliCDBGrid& db);
50
62032124 51 Bool_t FilenameToId(TString& filename, AliCDBId& id);
9e1ceb13 52
53 Bool_t PrepareId(AliCDBId& id);
6dc56e97 54 AliCDBId* GetId(const TObjArray& validFileIds, const AliCDBId& query);
8e245d15 55 AliCDBEntry* GetEntryFromFile(TString& filename, AliCDBId* dataId);
9e1ceb13 56
4667c116 57 // TODO use AliEnTag classes!
62032124 58 Bool_t AddTag(TString& foldername, const char* tagname);
c3a7b59a 59 Bool_t TagFileId(TString& filename, const AliCDBId* id);
60 Bool_t TagFileMetaData(TString& filename, const AliCDBMetaData* md);
4667c116 61 Bool_t TagShortLived(TString& filename, Bool_t value);
9e1ceb13 62
6dc56e97 63 void MakeQueryFilter(Int_t firstRun, Int_t lastRun, const AliCDBMetaData* md, TString& result) const;
62032124 64
65 virtual void QueryValidFiles();
9e1ceb13 66
c75fabed 67 TString fGridUrl; // Grid Url ("alien://aliendb4.cern.ch:9000")
68 TString fUser; // User
69 TString fDBFolder; // path of the DB folder
70 TString fSE; // Storage Element
c5941d67 71 TString fMirrorSEs; // Mirror Storage Elements
c75fabed 72 TString fCacheFolder; // local cache folder
73 Bool_t fOperateDisconnected; // Operate disconnected flag
74 Long64_t fCacheSize; // local cache size (in bytes)
75 Long_t fCleanupInterval; // local cache cleanup interval
9e1ceb13 76
4667c116 77ClassDef(AliCDBGrid, 0) // access class to a DataBase in an AliEn storage
9e1ceb13 78};
79
80/////////////////////////////////////////////////////////////////////
81// //
82// class AliCDBGridFactory //
83// //
84/////////////////////////////////////////////////////////////////////
85
86class AliCDBGridFactory: public AliCDBStorageFactory {
87
88public:
89
90 virtual Bool_t Validate(const char* gridString);
91 virtual AliCDBParam* CreateParameter(const char* gridString);
f430a9ce 92 virtual ~AliCDBGridFactory(){}
9e1ceb13 93
94protected:
95 virtual AliCDBStorage* Create(const AliCDBParam* param);
96
97 ClassDef(AliCDBGridFactory, 0);
98};
99
100/////////////////////////////////////////////////////////////////////
101// //
102// class AliCDBGridParam //
103// //
104/////////////////////////////////////////////////////////////////////
105
106class AliCDBGridParam: public AliCDBParam {
107
108public:
109 AliCDBGridParam();
62032124 110 AliCDBGridParam(const char* gridUrl, const char* user,
c75fabed 111 const char* dbFolder, const char* se,
112 const char* cacheFolder, Bool_t operateDisconnected,
113 Long64_t cacheSize, Long_t cleanupInterval);
9e1ceb13 114
115 virtual ~AliCDBGridParam();
116
c75fabed 117 const TString& GridUrl() const {return fGridUrl;}
118 const TString& GetUser() const {return fUser;}
119 const TString& GetDBFolder() const {return fDBFolder;}
120 const TString& GetSE() const {return fSE;}
121 const TString& GetCacheFolder() const {return fCacheFolder;}
122 Bool_t GetOperateDisconnected() const {return fOperateDisconnected;}
123 Long64_t GetCacheSize() const {return fCacheSize;}
124 Long_t GetCleanupInterval() const {return fCleanupInterval;}
9e1ceb13 125
126 virtual AliCDBParam* CloneParam() const;
127
128 virtual ULong_t Hash() const;
129 virtual Bool_t IsEqual(const TObject* obj) const;
130
131private:
c75fabed 132 TString fGridUrl; // Grid url "Host:port"
133 TString fUser; // User
134 TString fDBFolder; // path of the DB folder
135 TString fSE; // Storage Element
136 TString fCacheFolder; // Cache folder
137 Bool_t fOperateDisconnected; // Operate disconnected flag
138 Long64_t fCacheSize; // local cache size (in bytes)
139 Long_t fCleanupInterval; // local cache cleanup interval
9e1ceb13 140
141 ClassDef(AliCDBGridParam, 0);
142};
143
144
145#endif