4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /////////////////////////////////////////////////////////////////////
10 // access class to a DataBase in an AliEn storage //
12 /////////////////////////////////////////////////////////////////////
14 #include "AliCDBStorage.h"
15 #include "AliCDBManager.h"
16 #include "AliCDBMetaData.h"
18 class AliCDBGrid: public AliCDBStorage {
19 friend class AliCDBGridFactory;
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 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;
32 virtual AliCDBEntry* GetEntry(const AliCDBId& queryId);
33 virtual TList* GetEntries(const AliCDBId& queryId);
34 virtual Bool_t PutEntry(AliCDBEntry* entry);
35 virtual TList* GetIdListFromFile(const char* fileName);
39 AliCDBGrid(const char *gridUrl, const char *user, const char* dbFolder, const char *se);
41 virtual ~AliCDBGrid();
43 AliCDBGrid(const AliCDBGrid& db);
44 AliCDBGrid& operator = (const AliCDBGrid& db);
46 Bool_t FilenameToId(TString& filename, AliCDBId& id);
48 Bool_t PrepareId(AliCDBId& id);
49 AliCDBId* GetId(const TList& validFileIds, const AliCDBId& query);
50 AliCDBEntry* GetEntryFromFile(TString& filename, const AliCDBId* dataId);
52 Bool_t AddTag(TString& foldername, const char* tagname);
53 Bool_t TagFileId(TString& filename, const AliCDBId* id);
54 Bool_t TagFileMetaData(TString& filename, const AliCDBMetaData* md);
56 // Bool_t CheckVersion(const AliCDBId& query, AliCDBId* idToCheck, AliCDBId* result);
58 void MakeQueryFilter(Int_t firstRun, Int_t lastRun, const AliCDBPath& pathFilter, Int_t version,
59 const AliCDBMetaData* md, TString& result) const;
61 virtual void QueryValidFiles();
63 TString fGridUrl; // Grid Url ("alien://aliendb4.cern.ch:9000")
64 TString fUser; // User
65 TString fDBFolder; // path of the DB folder
66 TString fSE; // Storage Element
68 ClassDef(AliCDBGrid, 0) // access class to a DataBase in an AliEn storage
71 /////////////////////////////////////////////////////////////////////
73 // class AliCDBGridFactory //
75 /////////////////////////////////////////////////////////////////////
77 class AliCDBGridFactory: public AliCDBStorageFactory {
81 virtual Bool_t Validate(const char* gridString);
82 virtual AliCDBParam* CreateParameter(const char* gridString);
85 virtual AliCDBStorage* Create(const AliCDBParam* param);
87 ClassDef(AliCDBGridFactory, 0);
90 /////////////////////////////////////////////////////////////////////
92 // class AliCDBGridParam //
94 /////////////////////////////////////////////////////////////////////
96 class AliCDBGridParam: public AliCDBParam {
100 AliCDBGridParam(const char* gridUrl, const char* user,
101 const char* dbFolder, const char* se);
103 virtual ~AliCDBGridParam();
105 const TString& GridUrl() const {return fGridUrl;};
106 const TString& GetUser() const {return fUser;};
107 const TString& GetDBFolder() const {return fDBFolder;};
108 const TString& GetSE() const {return fSE;};
110 virtual AliCDBParam* CloneParam() const;
112 virtual ULong_t Hash() const;
113 virtual Bool_t IsEqual(const TObject* obj) const;
116 TString fGridUrl; // Grid url "Host:port"
117 TString fUser; // User
118 TString fDBFolder; // path of the DB folder
119 TString fSE; // Storage Element
121 ClassDef(AliCDBGridParam, 0);