]>
Commit | Line | Data |
---|---|---|
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 | |
18 | class AliCDBGrid: public AliCDBStorage { | |
5078a13f | 19 | friend class AliCDBGridFactory; |
9e1ceb13 | 20 | |
5078a13f | 21 | public: |
c5941d67 | 22 | |
5078a13f | 23 | virtual Bool_t IsReadOnly() const {return kFALSE;} |
24 | virtual Bool_t HasSubVersion() const {return kFALSE;} | |
25 | virtual Bool_t Contains(const char* path) const; | |
26 | virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const; | |
27 | virtual void SetRetry(Int_t nretry, Int_t initsec); | |
28 | virtual void SetMirrorSEs(const char* mirrors) {fMirrorSEs=mirrors;} | |
29 | virtual const char* GetMirrorSEs() const {return fMirrorSEs;} | |
c3a7b59a | 30 | |
9e1ceb13 | 31 | |
5078a13f | 32 | protected: |
9e1ceb13 | 33 | |
5078a13f | 34 | virtual AliCDBEntry* GetEntry(const AliCDBId& queryId); |
35 | virtual AliCDBId* GetEntryId(const AliCDBId& queryId); | |
36 | virtual TList* GetEntries(const AliCDBId& queryId); | |
37 | virtual Bool_t PutEntry(AliCDBEntry* entry, const char* mirrors=""); | |
38 | virtual TList* GetIdListFromFile(const char* fileName); | |
c75fabed | 39 | |
5078a13f | 40 | private: |
9e1ceb13 | 41 | |
5078a13f | 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 | |
5078a13f | 46 | virtual ~AliCDBGrid(); |
9e1ceb13 | 47 | |
5078a13f | 48 | AliCDBGrid(const AliCDBGrid& db); |
49 | AliCDBGrid& operator = (const AliCDBGrid& db); | |
9e1ceb13 | 50 | |
5078a13f | 51 | Bool_t FilenameToId(TString& filename, AliCDBId& id); |
9e1ceb13 | 52 | |
5078a13f | 53 | Bool_t PrepareId(AliCDBId& id); |
54 | AliCDBId* GetId(const TObjArray& validFileIds, const AliCDBId& query); | |
55 | AliCDBEntry* GetEntryFromFile(TString& filename, AliCDBId* dataId); | |
9e1ceb13 | 56 | |
5078a13f | 57 | // TODO use AliEnTag classes! |
58 | Bool_t AddTag(TString& foldername, const char* tagname); | |
59 | Bool_t TagFileId(TString& filename, const AliCDBId* id); | |
60 | Bool_t TagFileMetaData(TString& filename, const AliCDBMetaData* md); | |
61 | Bool_t TagShortLived(TString& filename, Bool_t value); | |
62032124 | 62 | |
5078a13f | 63 | void MakeQueryFilter(Int_t firstRun, Int_t lastRun, const AliCDBMetaData* md, TString& result) const; |
9e1ceb13 | 64 | |
5078a13f | 65 | virtual void QueryValidFiles(); |
9e1ceb13 | 66 | |
5078a13f | 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 | |
71 | TString fMirrorSEs; // Mirror Storage Elements | |
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 | |
76 | ||
77 | ClassDef(AliCDBGrid, 0) // access class to a DataBase in an AliEn storage | |
9e1ceb13 | 78 | }; |
79 | ||
80 | ///////////////////////////////////////////////////////////////////// | |
81 | // // | |
82 | // class AliCDBGridFactory // | |
83 | // // | |
84 | ///////////////////////////////////////////////////////////////////// | |
85 | ||
86 | class AliCDBGridFactory: public AliCDBStorageFactory { | |
87 | ||
5078a13f | 88 | public: |
9e1ceb13 | 89 | |
5078a13f | 90 | virtual Bool_t Validate(const char* gridString); |
91 | virtual AliCDBParam* CreateParameter(const char* gridString); | |
92 | virtual ~AliCDBGridFactory(){} | |
9e1ceb13 | 93 | |
5078a13f | 94 | protected: |
95 | virtual AliCDBStorage* Create(const AliCDBParam* param); | |
9e1ceb13 | 96 | |
5078a13f | 97 | ClassDef(AliCDBGridFactory, 0); |
9e1ceb13 | 98 | }; |
99 | ||
100 | ///////////////////////////////////////////////////////////////////// | |
101 | // // | |
102 | // class AliCDBGridParam // | |
103 | // // | |
104 | ///////////////////////////////////////////////////////////////////// | |
105 | ||
106 | class AliCDBGridParam: public AliCDBParam { | |
5078a13f | 107 | |
108 | public: | |
109 | AliCDBGridParam(); | |
110 | AliCDBGridParam(const char* gridUrl, const char* user, | |
111 | const char* dbFolder, const char* se, | |
112 | const char* cacheFolder, Bool_t operateDisconnected, | |
113 | Long64_t cacheSize, Long_t cleanupInterval); | |
114 | ||
115 | virtual ~AliCDBGridParam(); | |
116 | ||
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;} | |
125 | ||
126 | virtual AliCDBParam* CloneParam() const; | |
127 | ||
128 | virtual ULong_t Hash() const; | |
129 | virtual Bool_t IsEqual(const TObject* obj) const; | |
130 | ||
131 | private: | |
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 | |
140 | ||
141 | ClassDef(AliCDBGridParam, 0); | |
9e1ceb13 | 142 | }; |
143 | ||
144 | ||
145 | #endif |