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