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