Monalisa configuration added: host and table name
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttleConfig.h
CommitLineData
73abe331 1#ifndef ALI_SHUTTLE_CONFIG_H
2#define ALI_SHUTTLE_CONFIG_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9//
10// This class keeps the AliShuttle configuration.
11// It reads the configuration for LDAP server.
58bc3020 12// For more info see AliShuttleConfig.cxx
73abe331 13//
14
15#include <TObject.h>
16#include <TString.h>
d477ad88 17#include <TObjArray.h>
73abe331 18#include <TMap.h>
19#include <TLDAPServer.h>
20
21class AliShuttleConfig: public TObject {
22public:
b948db8d 23 AliShuttleConfig(const char* host, Int_t port = LDAP_PORT,
24 const char* binddn = 0, const char* password = 0,
25 const char* basedn = "o=alice,dc=cern,dc=ch");
73abe331 26 virtual ~AliShuttleConfig();
27
28 Bool_t IsValid() const {return fIsValid;};
29
57c1a579 30 const char* GetConfigHost() const {return fConfigHost.Data();}
31
57f50b3c 32 const char* GetDAQlbHost() const {return fDAQlbHost.Data();}
fc5a4708 33 UInt_t GetDAQlbPort() const {return fDAQlbPort;}
57f50b3c 34 const char* GetDAQlbUser() const {return fDAQlbUser.Data();}
35 const char* GetDAQlbPass() const {return fDAQlbPass.Data();}
2c15234c 36 const char* GetDAQlbDB() const {return fDAQlbDB.Data();}
37 const char* GetDAQlbTable() const {return fDAQlbTable.Data();}
441b0e9c 38 const char* GetShuttlelbTable() const {return fShuttlelbTable.Data();}
39 const char* GetRunTypelbTable() const {return fRunTypelbTable.Data();}
b948db8d 40
2c15234c 41 const char* GetFXSHost(Int_t system) const {return fFXSHost[system].Data();}
fc5a4708 42 UInt_t GetFXSPort(Int_t system) const {return fFXSPort[system];}
2c15234c 43 const char* GetFXSUser(Int_t system) const {return fFXSUser[system].Data();}
44 const char* GetFXSPass(Int_t system) const {return fFXSPass[system].Data();}
57f50b3c 45
2c15234c 46 const char* GetFXSdbHost(Int_t system) const {return fFXSdbHost[system].Data();}
fc5a4708 47 UInt_t GetFXSdbPort(Int_t system) const {return fFXSdbPort[system];}
2c15234c 48 const char* GetFXSdbUser(Int_t system) const {return fFXSdbUser[system].Data();}
49 const char* GetFXSdbPass(Int_t system) const {return fFXSdbPass[system].Data();}
50 const char* GetFXSdbName(Int_t system) const {return fFXSdbName[system].Data();}
51 const char* GetFXSdbTable(Int_t system) const {return fFXSdbTable[system].Data();}
d477ad88 52
2bb7b766 53 Int_t GetMaxRetries() const { return fMaxRetries; }
5164a766 54
cb343cfd 55 Int_t GetPPTimeOut() const { return fPPTimeOut; }
9827400b 56 Int_t GetPPMaxMem() const { return fPPMaxMem; }
b832ec02 57
58 const char* GetMonitorHost() const {return fMonitorHost.Data();}
59 const char* GetMonitorTable() const {return fMonitorTable.Data();}
cb343cfd 60
36c99a6a 61 const TObjArray* GetDetectors() const;
73abe331 62
63 Bool_t HasDetector(const char* detector) const;
1d172743 64
65 Int_t GetNServers(const char* detector) const;
66
67 const char* GetDCSHost(const char* detector, Int_t iServ) const;
68 Int_t GetDCSPort(const char* detector, Int_t iServ) const;
69
542b6cc8 70 Int_t GetMultiSplit(const char* detector, Int_t iServ) const;
71
1d172743 72 const TObjArray* GetDCSAliases(const char* detector, Int_t iServ) const;
73 const TObjArray* GetDCSDataPoints(const char* detector, Int_t iServ) const;
74 const TObjArray* GetCompactDCSAliases(const char* detector, Int_t iServ) const;
75 const TObjArray* GetCompactDCSDataPoints(const char* detector, Int_t iServ) const;
76
57c1a579 77 const TObjArray* GetResponsibles(const char* detector) const;
be48e3ea 78 Bool_t StrictRunOrder(const char* detector) const;
b948db8d 79
80 void SetProcessAll(Bool_t flag=kTRUE) {fProcessAll=flag;}
58bc3020 81 Bool_t ProcessAll() const {return fProcessAll;}
b948db8d 82
83 Bool_t HostProcessDetector(const char* detector) const;
73abe331 84
85 virtual void Print(Option_t* option = NULL) const;
86
87private:
b948db8d 88
1d172743 89 class AliShuttleDCSConfigHolder: public TObject {
73abe331 90 public:
1d172743 91 AliShuttleDCSConfigHolder(const TLDAPEntry* entry);
92 ~AliShuttleDCSConfigHolder();
93
94 const char* GetDCSHost() const {return fDCSHost;}
57f50b3c 95 Int_t GetDCSPort() const {return fDCSPort;}
542b6cc8 96 Int_t GetMultiSplit() const {return fMultiSplit;}
97
2bb7b766 98 const TObjArray* GetDCSAliases() const {return fDCSAliases;}
2c15234c 99 const TObjArray* GetDCSDataPoints() const {return fDCSDataPoints;}
36c99a6a 100 const TObjArray* GetCompactDCSAliases() const {return fDCSAliasesComp;}
101 const TObjArray* GetCompactDCSDataPoints() const {return fDCSDataPointsComp;}
1d172743 102
f59d2f8f 103 void ExpandAndAdd(TObjArray* target, const char* entry);
1d172743 104 Bool_t IsValid() const {return fIsValid;}
40150741 105
58bc3020 106 private:
1d172743 107 AliShuttleDCSConfigHolder(const AliShuttleDCSConfigHolder& other); // not implemented
108 AliShuttleDCSConfigHolder& operator= (const AliShuttleDCSConfigHolder& other); // not implemented
1bcd28db 109
58bc3020 110 TString fDCSHost; // Host name of the DCS server
111 Int_t fDCSPort; // port of the DCS server
542b6cc8 112 Int_t fMultiSplit; // N. of DPs to be queried in each query chunk
2bb7b766 113 TObjArray* fDCSAliases; // List of DCS aliases to be retrieved
1d172743 114 TObjArray* fDCSDataPoints; // List of DCS data points to be retrieved
115 TObjArray* fDCSAliasesComp; // Compact list of DCS aliases to be printed
36c99a6a 116 TObjArray* fDCSDataPointsComp; // Compact list of DCS data points to be printed
1d172743 117 Bool_t fIsValid; // flag for the validity of the configuration
118
119 ClassDef(AliShuttleDCSConfigHolder, 0);
120 };
121
122 class AliShuttleDetConfigHolder: public TObject {
123 public:
124 AliShuttleDetConfigHolder(const TLDAPEntry* entry);
125 ~AliShuttleDetConfigHolder();
126
127 const char* GetDetector() const {return fDetector.Data();}
128 const TObjArray* GetDCSConfig() const {return fDCSConfig;}
129 void AddDCSConfig(AliShuttleDCSConfigHolder* holder);
130
131 Int_t GetNServers() const {return fDCSConfig ? fDCSConfig->GetEntries() : 0;}
132
133 const char* GetDCSHost(Int_t iServ) const;
134 Int_t GetDCSPort(Int_t iServ) const;
542b6cc8 135 Int_t GetMultiSplit(Int_t iServ) const;
136
1d172743 137 const TObjArray* GetDCSAliases(Int_t iServ) const;
138 const TObjArray* GetDCSDataPoints(Int_t iServ) const;
139 const TObjArray* GetCompactDCSAliases(Int_t iServ) const;
140 const TObjArray* GetCompactDCSDataPoints(Int_t iServ) const;
141
142 const TObjArray* GetResponsibles() const {return fResponsibles;}
143 Bool_t IsValid() const {return fIsValid;}
144 Bool_t SkipDCSQuery() const {return fSkipDCSQuery;}
145 Bool_t StrictRunOrder() const {return fStrictRunOrder;}
146
147 private:
148 AliShuttleDetConfigHolder(const AliShuttleDetConfigHolder& other); // not implemented
149 AliShuttleDetConfigHolder& operator= (const AliShuttleDetConfigHolder& other); // not implemented
150
151 TString fDetector; // Detector name
152 TObjArray* fDCSConfig; // Array of DCS configuration objects (AliShuttleDCSConfigHolder)
57c1a579 153 TObjArray* fResponsibles; // List of email addresses of the detector's responsible(s)
58bc3020 154 Bool_t fIsValid; // flag for the validity of the configuration
57f50b3c 155 Bool_t fSkipDCSQuery; // flag - if TRUE (-> DCS config empty) skip DCS archive data query
be48e3ea 156 Bool_t fStrictRunOrder; // flag - if TRUE connect data in a strict run ordering
58bc3020 157
1d172743 158 ClassDef(AliShuttleDetConfigHolder, 0);
73abe331 159 };
160
161
1d172743 162 UInt_t SetGlobalConfig(TList* globalList);
163 UInt_t SetSysConfig(TList* sysList);
164 UInt_t SetDetConfig(TList* detList, TList* dcsList);
165 UInt_t SetHostConfig(TList* hostList);
166
b832ec02 167 TString fConfigHost; // Host of the Shuttle configuration LDAP server
168
169 TString fDAQlbHost; // Host of the DAQ logbook MySQL Server
170 UInt_t fDAQlbPort; // port of the DAQ logbook MySQL Server
171 TString fDAQlbUser; // username of the DAQ logbook MySQL Server
172 TString fDAQlbPass; // password of the DAQ logbook MySQL Server
173 TString fDAQlbDB; // DB name of the DAQ logbook MySQL Server
174 TString fDAQlbTable; // Table name of the DAQ logbook
175 TString fShuttlelbTable; // Table name of the Shuttle logbook
176 TString fRunTypelbTable; // Table name of the Run typr logbook
177
178 TString fFXSHost[3]; // Host of the [DAQ, DCS, HLT] File eXchange Server
179 UInt_t fFXSPort[3]; // Port of the [DAQ, DCS, HLT] File eXchange Server
180 TString fFXSUser[3]; // username of the [DAQ, DCS, HLT] File eXchange Server
181 TString fFXSPass[3]; // password of the [DAQ, DCS, HLT] File eXchange Server
182
183 TString fFXSdbHost[3]; // Host of the [DAQ, DCS, HLT] FXS database
184 UInt_t fFXSdbPort[3]; // Port of the [DAQ, DCS, HLT] FXS database
185 TString fFXSdbUser[3]; // username of the [DAQ, DCS, HLT] FXS database
186 TString fFXSdbPass[3]; // password of the [DAQ, DCS, HLT] FXS database
187 TString fFXSdbName[3]; // name of the [DAQ, DCS, HLT] FXS database
188 TString fFXSdbTable[3]; // Table name of the [DAQ, DCS, HLT] FXS database
189
190 Int_t fMaxRetries; // number of retries of a failed preprocessor
191
192 Int_t fPPTimeOut; // timeout until a preprocessor is killed
193 Int_t fPPMaxMem; // maximum allowed memory until a preprocessor is killed
194
195 TString fMonitorHost; // host of the MonaLisa monitoring server
196 TString fMonitorTable; // Monalisa's SHUTTLE table name
197
198 TMap fDetectorMap; // Map of the detector-by-detector configuration
199 TObjArray fDetectorList; // List of detectors with valid configuration
200
201 TString fShuttleInstanceHost; // Instance of the SHUTTLE
202 TObjArray fProcessedDetectors; // list of the detector to be processed by this machine
203 Bool_t fProcessAll; // flag indicating that all detectors will be processed
204 Bool_t fIsValid; // flag for the validity of the configuration
73abe331 205
206 ClassDef(AliShuttleConfig, 0);
207};
208
209#endif
210