Ping function added to check connection to DAQ/DCS/HLT servers.
[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:
7d4cf768 23 enum RunMode {kTest=0, kProd};
fb40ead4 24 enum SystemCode { kDAQ = 0, kDCS, kHLT, kGlobal, kAmanda };
7d4cf768 25
b948db8d 26 AliShuttleConfig(const char* host, Int_t port = LDAP_PORT,
27 const char* binddn = 0, const char* password = 0,
28 const char* basedn = "o=alice,dc=cern,dc=ch");
73abe331 29 virtual ~AliShuttleConfig();
a18e8fa6 30 AliShuttleConfig(const AliShuttleConfig & other);
31 AliShuttleConfig& operator= (const AliShuttleConfig& other);
73abe331 32
33 Bool_t IsValid() const {return fIsValid;};
34
57c1a579 35 const char* GetConfigHost() const {return fConfigHost.Data();}
36
b8cf5e0f 37 const char* GetAlienPath() const {return fAlienPath.Data();}
38
57f50b3c 39 const char* GetDAQlbHost() const {return fDAQlbHost.Data();}
fc5a4708 40 UInt_t GetDAQlbPort() const {return fDAQlbPort;}
57f50b3c 41 const char* GetDAQlbUser() const {return fDAQlbUser.Data();}
42 const char* GetDAQlbPass() const {return fDAQlbPass.Data();}
2c15234c 43 const char* GetDAQlbDB() const {return fDAQlbDB.Data();}
44 const char* GetDAQlbTable() const {return fDAQlbTable.Data();}
441b0e9c 45 const char* GetShuttlelbTable() const {return fShuttlelbTable.Data();}
46 const char* GetRunTypelbTable() const {return fRunTypelbTable.Data();}
b948db8d 47
fb40ead4 48 const char* GetFXSHost(Int_t sys) const {return fFXSHost[sys].Data();}
49 UInt_t GetFXSPort(Int_t sys) const {return fFXSPort[sys];}
50 const char* GetFXSUser(Int_t sys) const {return fFXSUser[sys].Data();}
51 const char* GetFXSPass(Int_t sys) const {return fFXSPass[sys].Data();}
339adafa 52 const char* GetFXSBaseFolder(Int_t sys) const {return fFXSBaseFolder[sys].Data();}
57f50b3c 53
fb40ead4 54 const char* GetFXSdbHost(Int_t sys) const {return fFXSdbHost[sys].Data();}
55 UInt_t GetFXSdbPort(Int_t sys) const {return fFXSdbPort[sys];}
56 const char* GetFXSdbUser(Int_t sys) const {return fFXSdbUser[sys].Data();}
57 const char* GetFXSdbPass(Int_t sys) const {return fFXSdbPass[sys].Data();}
58 const char* GetFXSdbName(Int_t sys) const {return fFXSdbName[sys].Data();}
59 const char* GetFXSdbTable(Int_t sys) const {return fFXSdbTable[sys].Data();}
d477ad88 60
fb40ead4 61 const TObjArray* GetAdmins(Int_t sys) const;
62
63 Bool_t SendMail() const { return fSendMail; }
64
2bb7b766 65 Int_t GetMaxRetries() const { return fMaxRetries; }
5164a766 66
cb343cfd 67 Int_t GetPPTimeOut() const { return fPPTimeOut; }
ff3781ad 68 Int_t GetDCSTimeOut() const { return fDCSTimeOut; }
69 Int_t GetDCSRetries() const { return fDCSRetries; }
2eb98462 70 UInt_t GetDCSQueryOffset() const { return fDCSQueryOffset; }
71 UInt_t GetDCSDelay() const { return fDCSDelay; }
9827400b 72 Int_t GetPPMaxMem() const { return fPPMaxMem; }
fb40ead4 73
74 Bool_t KeepDCSMap() const { return fKeepDCSMap; }
75 Bool_t KeepTempFolder() const { return fKeepTempFolder; }
b832ec02 76
fb40ead4 77
b832ec02 78 const char* GetMonitorHost() const {return fMonitorHost.Data();}
79 const char* GetMonitorTable() const {return fMonitorTable.Data();}
cb343cfd 80
7d4cf768 81 Int_t GetTriggerWait() const {return fTriggerWait;}
82
83 RunMode GetRunMode() const {return fRunMode;}
84
36c99a6a 85 const TObjArray* GetDetectors() const;
73abe331 86
87 Bool_t HasDetector(const char* detector) const;
1d172743 88
89 Int_t GetNServers(const char* detector) const;
90
91 const char* GetDCSHost(const char* detector, Int_t iServ) const;
92 Int_t GetDCSPort(const char* detector, Int_t iServ) const;
93
542b6cc8 94 Int_t GetMultiSplit(const char* detector, Int_t iServ) const;
95
1d172743 96 const TObjArray* GetDCSAliases(const char* detector, Int_t iServ) const;
97 const TObjArray* GetDCSDataPoints(const char* detector, Int_t iServ) const;
98 const TObjArray* GetCompactDCSAliases(const char* detector, Int_t iServ) const;
99 const TObjArray* GetCompactDCSDataPoints(const char* detector, Int_t iServ) const;
100
57c1a579 101 const TObjArray* GetResponsibles(const char* detector) const;
be48e3ea 102 Bool_t StrictRunOrder(const char* detector) const;
b948db8d 103
104 void SetProcessAll(Bool_t flag=kTRUE) {fProcessAll=flag;}
58bc3020 105 Bool_t ProcessAll() const {return fProcessAll;}
b948db8d 106
107 Bool_t HostProcessDetector(const char* detector) const;
73abe331 108
109 virtual void Print(Option_t* option = NULL) const;
110
111private:
b948db8d 112
1d172743 113 class AliShuttleDCSConfigHolder: public TObject {
73abe331 114 public:
1d172743 115 AliShuttleDCSConfigHolder(const TLDAPEntry* entry);
116 ~AliShuttleDCSConfigHolder();
117
118 const char* GetDCSHost() const {return fDCSHost;}
57f50b3c 119 Int_t GetDCSPort() const {return fDCSPort;}
542b6cc8 120 Int_t GetMultiSplit() const {return fMultiSplit;}
121
2bb7b766 122 const TObjArray* GetDCSAliases() const {return fDCSAliases;}
2c15234c 123 const TObjArray* GetDCSDataPoints() const {return fDCSDataPoints;}
36c99a6a 124 const TObjArray* GetCompactDCSAliases() const {return fDCSAliasesComp;}
125 const TObjArray* GetCompactDCSDataPoints() const {return fDCSDataPointsComp;}
1d172743 126
f59d2f8f 127 void ExpandAndAdd(TObjArray* target, const char* entry);
1d172743 128 Bool_t IsValid() const {return fIsValid;}
40150741 129
58bc3020 130 private:
1d172743 131 AliShuttleDCSConfigHolder(const AliShuttleDCSConfigHolder& other); // not implemented
132 AliShuttleDCSConfigHolder& operator= (const AliShuttleDCSConfigHolder& other); // not implemented
1bcd28db 133
58bc3020 134 TString fDCSHost; // Host name of the DCS server
135 Int_t fDCSPort; // port of the DCS server
542b6cc8 136 Int_t fMultiSplit; // N. of DPs to be queried in each query chunk
2bb7b766 137 TObjArray* fDCSAliases; // List of DCS aliases to be retrieved
1d172743 138 TObjArray* fDCSDataPoints; // List of DCS data points to be retrieved
139 TObjArray* fDCSAliasesComp; // Compact list of DCS aliases to be printed
36c99a6a 140 TObjArray* fDCSDataPointsComp; // Compact list of DCS data points to be printed
1d172743 141 Bool_t fIsValid; // flag for the validity of the configuration
142
143 ClassDef(AliShuttleDCSConfigHolder, 0);
144 };
145
146 class AliShuttleDetConfigHolder: public TObject {
147 public:
148 AliShuttleDetConfigHolder(const TLDAPEntry* entry);
149 ~AliShuttleDetConfigHolder();
150
151 const char* GetDetector() const {return fDetector.Data();}
152 const TObjArray* GetDCSConfig() const {return fDCSConfig;}
153 void AddDCSConfig(AliShuttleDCSConfigHolder* holder);
154
155 Int_t GetNServers() const {return fDCSConfig ? fDCSConfig->GetEntries() : 0;}
156
157 const char* GetDCSHost(Int_t iServ) const;
158 Int_t GetDCSPort(Int_t iServ) const;
542b6cc8 159 Int_t GetMultiSplit(Int_t iServ) const;
160
1d172743 161 const TObjArray* GetDCSAliases(Int_t iServ) const;
162 const TObjArray* GetDCSDataPoints(Int_t iServ) const;
163 const TObjArray* GetCompactDCSAliases(Int_t iServ) const;
164 const TObjArray* GetCompactDCSDataPoints(Int_t iServ) const;
165
166 const TObjArray* GetResponsibles() const {return fResponsibles;}
167 Bool_t IsValid() const {return fIsValid;}
168 Bool_t SkipDCSQuery() const {return fSkipDCSQuery;}
169 Bool_t StrictRunOrder() const {return fStrictRunOrder;}
170
171 private:
172 AliShuttleDetConfigHolder(const AliShuttleDetConfigHolder& other); // not implemented
173 AliShuttleDetConfigHolder& operator= (const AliShuttleDetConfigHolder& other); // not implemented
174
175 TString fDetector; // Detector name
176 TObjArray* fDCSConfig; // Array of DCS configuration objects (AliShuttleDCSConfigHolder)
57c1a579 177 TObjArray* fResponsibles; // List of email addresses of the detector's responsible(s)
58bc3020 178 Bool_t fIsValid; // flag for the validity of the configuration
57f50b3c 179 Bool_t fSkipDCSQuery; // flag - if TRUE (-> DCS config empty) skip DCS archive data query
be48e3ea 180 Bool_t fStrictRunOrder; // flag - if TRUE connect data in a strict run ordering
58bc3020 181
1d172743 182 ClassDef(AliShuttleDetConfigHolder, 0);
73abe331 183 };
184
185
1d172743 186 UInt_t SetGlobalConfig(TList* globalList);
187 UInt_t SetSysConfig(TList* sysList);
6ea86315 188 UInt_t SetPasswords();
1d172743 189 UInt_t SetDetConfig(TList* detList, TList* dcsList);
190 UInt_t SetHostConfig(TList* hostList);
191
b832ec02 192 TString fConfigHost; // Host of the Shuttle configuration LDAP server
193
b8cf5e0f 194 TString fAlienPath; // Alien Path for CDB/Reference objs in the Alien catalogue
195
b832ec02 196 TString fDAQlbHost; // Host of the DAQ logbook MySQL Server
197 UInt_t fDAQlbPort; // port of the DAQ logbook MySQL Server
198 TString fDAQlbUser; // username of the DAQ logbook MySQL Server
199 TString fDAQlbPass; // password of the DAQ logbook MySQL Server
200 TString fDAQlbDB; // DB name of the DAQ logbook MySQL Server
201 TString fDAQlbTable; // Table name of the DAQ logbook
202 TString fShuttlelbTable; // Table name of the Shuttle logbook
203 TString fRunTypelbTable; // Table name of the Run typr logbook
6ea86315 204 TString fPasswdFilePath; // Path for the local file where the passwords are stored
b832ec02 205
206 TString fFXSHost[3]; // Host of the [DAQ, DCS, HLT] File eXchange Server
207 UInt_t fFXSPort[3]; // Port of the [DAQ, DCS, HLT] File eXchange Server
208 TString fFXSUser[3]; // username of the [DAQ, DCS, HLT] File eXchange Server
209 TString fFXSPass[3]; // password of the [DAQ, DCS, HLT] File eXchange Server
339adafa 210 TString fFXSBaseFolder[3]; // base folder of the [DAQ, DCS, HLT] File eXchange Server
b832ec02 211
212 TString fFXSdbHost[3]; // Host of the [DAQ, DCS, HLT] FXS database
213 UInt_t fFXSdbPort[3]; // Port of the [DAQ, DCS, HLT] FXS database
214 TString fFXSdbUser[3]; // username of the [DAQ, DCS, HLT] FXS database
215 TString fFXSdbPass[3]; // password of the [DAQ, DCS, HLT] FXS database
216 TString fFXSdbName[3]; // name of the [DAQ, DCS, HLT] FXS database
217 TString fFXSdbTable[3]; // Table name of the [DAQ, DCS, HLT] FXS database
218
219 Int_t fMaxRetries; // number of retries of a failed preprocessor
220
221 Int_t fPPTimeOut; // timeout until a preprocessor is killed
ff3781ad 222 Int_t fDCSTimeOut; // timeout until the query to DCS is terminated
223 Int_t fDCSRetries; // number of retries until the query to DCS connection is terminated
2eb98462 224 UInt_t fDCSQueryOffset; // offset for the DCS DPs query, to be subracted from the StartTime and
225 // added to the EndTime
226 UInt_t fDCSDelay; // delay to make the query to DCS
b832ec02 227 Int_t fPPMaxMem; // maximum allowed memory until a preprocessor is killed
228
229 TString fMonitorHost; // host of the MonaLisa monitoring server
230 TString fMonitorTable; // Monalisa's SHUTTLE table name
7d4cf768 231
232 Int_t fTriggerWait; // time to wait for DIM trigger before starting new collection
233 RunMode fRunMode; // Working mode (0=test; 1=prod)
b832ec02 234
235 TMap fDetectorMap; // Map of the detector-by-detector configuration
236 TObjArray fDetectorList; // List of detectors with valid configuration
fb40ead4 237
a18e8fa6 238 TObjArray *fAdmin[5]; // Array of system administrators' email addresses (DAQ, DCS, HLT, Global, Amanda)
b832ec02 239
240 TString fShuttleInstanceHost; // Instance of the SHUTTLE
241 TObjArray fProcessedDetectors; // list of the detector to be processed by this machine
fb40ead4 242
243 Bool_t fKeepDCSMap; // Flag to keep DCS map also in case of success
244 Bool_t fKeepTempFolder; // Flag to keep temp folder also in case of success
245
246 Bool_t fSendMail; // Send mail flag
247
b832ec02 248 Bool_t fProcessAll; // flag indicating that all detectors will be processed
249 Bool_t fIsValid; // flag for the validity of the configuration
73abe331 250
251 ClassDef(AliShuttleConfig, 0);
252};
253
254#endif
255