Improved diagnostic messages. Different access strings for AliCDBGrid. New or renamed...
[u/mrichter/AliRoot.git] / STEER / AliCDBGrid.h
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                                               //
10 //  access class to a DataBase in an AliEn storage                 //
11 //                                                                 //
12 /////////////////////////////////////////////////////////////////////
13
14 #include "AliCDBStorage.h"
15 #include "AliCDBManager.h"
16
17 class AliCDBGrid: public AliCDBStorage {
18         friend class AliCDBGridFactory;
19
20 public:
21                   
22         virtual Bool_t IsReadOnly() const {return kFALSE;};
23         virtual Bool_t HasSubVersion() const {return kFALSE;};
24         virtual Bool_t Contains(const char* path) const;
25   
26 protected:
27
28         virtual AliCDBEntry*    GetEntry(const AliCDBId& queryId);
29         virtual TList*          GetEntries(const AliCDBId& queryId);
30         virtual Bool_t          PutEntry(AliCDBEntry* entry);
31         virtual TList*          GetIdListFromFile(const char* fileName);
32
33 private:
34  
35         AliCDBGrid(const char *gridUrl, const char *user, const char* dbFolder, const char *se);
36
37         virtual ~AliCDBGrid();
38
39         AliCDBGrid(const AliCDBGrid& db);
40         AliCDBGrid& operator = (const AliCDBGrid& db);
41
42         Bool_t FilenameToId(const char* filename, AliCDBRunRange& runRange, Int_t& version);
43         Bool_t IdToFilename(const AliCDBRunRange& runRange, Int_t version, TString& filename);
44
45         Bool_t PrepareId(AliCDBId& id);
46         AliCDBId GetId(const AliCDBId& query);
47
48
49         void GetEntriesForLevel0(const char* level0, const AliCDBId& query, TList* result);
50         void GetEntriesForLevel1(const char* level0, const char* level1, 
51                                  const AliCDBId& query, TList* result);
52
53         TString    fGridUrl;    // Grid Url ("alien://aliendb4.cern.ch:9000")
54         TString    fUser;       // User
55         TString    fDBFolder;   // path of the DB folder
56         TString    fSE;         // Storage Element 
57
58 ClassDef(AliCDBGrid, 0)      // access class to a DataBase in an AliEn storage 
59 };
60
61 /////////////////////////////////////////////////////////////////////
62 //                                                                 //
63 //  class AliCDBGridFactory                                        //
64 //                                                                 //
65 /////////////////////////////////////////////////////////////////////
66
67 class AliCDBGridFactory: public AliCDBStorageFactory {
68
69 public:
70
71         virtual Bool_t Validate(const char* gridString);
72         virtual AliCDBParam* CreateParameter(const char* gridString);
73
74 protected:
75         virtual AliCDBStorage* Create(const AliCDBParam* param);
76
77         ClassDef(AliCDBGridFactory, 0);
78 };
79
80 /////////////////////////////////////////////////////////////////////
81 //                                                                 //
82 //  class AliCDBGridParam                                          //
83 //                                                                 //
84 /////////////////////////////////////////////////////////////////////
85
86 class AliCDBGridParam: public AliCDBParam {
87         
88 public:
89         AliCDBGridParam();
90         AliCDBGridParam(const char* gridUrl, const char* user, 
91                         const char* dbFolder, const char* se);
92         
93         virtual ~AliCDBGridParam();
94
95         const TString& GridUrl() const {return fGridUrl;};
96         const TString& GetUser() const {return fUser;};
97         const TString& GetDBFolder() const {return fDBFolder;};
98         const TString& GetSE()   const {return fSE;};
99
100         virtual AliCDBParam* CloneParam() const;
101
102         virtual ULong_t Hash() const;
103         virtual Bool_t IsEqual(const TObject* obj) const;
104
105 private:
106         TString fGridUrl;    // Grid url "Host:port"
107         TString fUser;       // User
108         TString fDBFolder;   // path of the DB folder
109         TString fSE;         // Storage Element 
110
111         ClassDef(AliCDBGridParam, 0);
112 };
113
114
115 #endif