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