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"
17 class AliCDBGrid: public AliCDBStorage {
18 friend class AliCDBGridFactory;
22 virtual Bool_t IsReadOnly() {return kFALSE;};
23 virtual Bool_t HasSubVersion() {return kFALSE;};
27 virtual AliCDBEntry* GetEntry(const AliCDBId& queryId);
28 virtual TList* GetEntries(const AliCDBId& queryId);
29 virtual Bool_t PutEntry(AliCDBEntry* entry);
33 AliCDBGrid(const char *host="aliendb4.cern.ch",
34 const Int_t port = 9000,
35 const char *user="colla",
36 const char* dbPath = "/alice/cern.ch/user/c/colla/DB",
37 const char *SE="ALICE::CERN::Server");
39 virtual ~AliCDBGrid();
41 AliCDBGrid(const AliCDBGrid& db);
42 AliCDBGrid& operator = (const AliCDBGrid& db);
44 Bool_t FilenameToId(const char* filename, AliCDBRunRange& runRange, Int_t& version);
45 Bool_t IdToFilename(const AliCDBRunRange& runRange, Int_t version, TString& filename);
47 Bool_t PrepareId(AliCDBId& id);
48 AliCDBId GetId(const AliCDBId& query);
51 void GetEntriesForLevel0(const char* level0, const AliCDBId& query, TList* result);
52 void GetEntriesForLevel1(const char* level0, const char* level1,
53 const AliCDBId& query, TList* result);
55 TString fHost; // Grid host
57 TString fUser; // User
58 TString fDBPath; // path of the DB folder
59 TString fSE; // Storage Element
61 ClassDef(AliCDBGrid, 0) // access class to a DataBase in an AliEn storage
64 /////////////////////////////////////////////////////////////////////
66 // class AliCDBGridFactory //
68 /////////////////////////////////////////////////////////////////////
70 class AliCDBGridFactory: public AliCDBStorageFactory {
74 virtual Bool_t Validate(const char* gridString);
75 virtual AliCDBParam* CreateParameter(const char* gridString);
78 virtual AliCDBStorage* Create(const AliCDBParam* param);
80 ClassDef(AliCDBGridFactory, 0);
83 /////////////////////////////////////////////////////////////////////
85 // class AliCDBGridParam //
87 /////////////////////////////////////////////////////////////////////
89 class AliCDBGridParam: public AliCDBParam {
93 AliCDBGridParam(const char* host, const Int_t port, const char* user,
94 const char* dbPath, const char* se);
96 virtual ~AliCDBGridParam();
98 const TString& GetHost() const {return fHost;};
99 const Int_t& GetPort() const {return fPort;};
100 const TString& GetUser() const {return fUser;};
101 const TString& GetPath() const {return fDBPath;};
102 const TString& GetSE() const {return fSE;};
104 virtual AliCDBParam* CloneParam() const;
106 virtual ULong_t Hash() const;
107 virtual Bool_t IsEqual(const TObject* obj) const;
110 TString fHost; // Grid host
112 TString fUser; // User
113 TString fDBPath; // path of the DB folder
114 TString fSE; // Storage Element
116 ClassDef(AliCDBGridParam, 0);