]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliCDBGrid.h
Coding conventions
[u/mrichter/AliRoot.git] / STEER / AliCDBGrid.h
CommitLineData
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 //
10// access class to a DataBase in an AliEn storage //
11// //
12/////////////////////////////////////////////////////////////////////
13
14#include "AliCDBStorage.h"
15#include "AliCDBManager.h"
16
17class AliCDBGrid: public AliCDBStorage {
18 friend class AliCDBGridFactory;
19
20public:
21
fdf65bb5 22 virtual Bool_t IsReadOnly() const {return kFALSE;};
23 virtual Bool_t HasSubVersion() const {return kFALSE;};
9e1ceb13 24
25protected:
26
27 virtual AliCDBEntry* GetEntry(const AliCDBId& queryId);
28 virtual TList* GetEntries(const AliCDBId& queryId);
29 virtual Bool_t PutEntry(AliCDBEntry* entry);
30
31private:
32
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");
38
39 virtual ~AliCDBGrid();
40
41 AliCDBGrid(const AliCDBGrid& db);
42 AliCDBGrid& operator = (const AliCDBGrid& db);
43
44 Bool_t FilenameToId(const char* filename, AliCDBRunRange& runRange, Int_t& version);
45 Bool_t IdToFilename(const AliCDBRunRange& runRange, Int_t version, TString& filename);
46
47 Bool_t PrepareId(AliCDBId& id);
48 AliCDBId GetId(const AliCDBId& query);
49
50
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);
54
55 TString fHost; // Grid host
56 Int_t fPort; // port
57 TString fUser; // User
58 TString fDBPath; // path of the DB folder
59 TString fSE; // Storage Element
60
61ClassDef(AliCDBGrid, 0) // access class to a DataBase in an AliEn storage
62};
63
64/////////////////////////////////////////////////////////////////////
65// //
66// class AliCDBGridFactory //
67// //
68/////////////////////////////////////////////////////////////////////
69
70class AliCDBGridFactory: public AliCDBStorageFactory {
71
72public:
73
74 virtual Bool_t Validate(const char* gridString);
75 virtual AliCDBParam* CreateParameter(const char* gridString);
76
77protected:
78 virtual AliCDBStorage* Create(const AliCDBParam* param);
79
80 ClassDef(AliCDBGridFactory, 0);
81};
82
83/////////////////////////////////////////////////////////////////////
84// //
85// class AliCDBGridParam //
86// //
87/////////////////////////////////////////////////////////////////////
88
89class AliCDBGridParam: public AliCDBParam {
90
91public:
92 AliCDBGridParam();
93 AliCDBGridParam(const char* host, const Int_t port, const char* user,
94 const char* dbPath, const char* se);
95
96 virtual ~AliCDBGridParam();
97
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;};
103
104 virtual AliCDBParam* CloneParam() const;
105
106 virtual ULong_t Hash() const;
107 virtual Bool_t IsEqual(const TObject* obj) const;
108
109private:
110 TString fHost; // Grid host
111 Int_t fPort; // port
112 TString fUser; // User
113 TString fDBPath; // path of the DB folder
114 TString fSE; // Storage Element
115
116 ClassDef(AliCDBGridParam, 0);
117};
118
119
120#endif