1 #ifndef ALI_SHUTTLE_CONFIG_H
2 #define ALI_SHUTTLE_CONFIG_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 // This class keeps the AliShuttle configuration.
11 // It reads the configuration for LDAP server.
12 // For more info see AliShuttleConfig.cxx
17 #include <TObjArray.h>
19 #include <TLDAPServer.h>
21 class AliShuttleConfig: public TObject {
23 enum RunMode {kTest=0, kProd};
24 enum SystemCode { kDAQ = 0, kDCS, kHLT, kGlobal, kAmanda };
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");
29 virtual ~AliShuttleConfig();
30 AliShuttleConfig(const AliShuttleConfig & other);
31 AliShuttleConfig& operator= (const AliShuttleConfig& other);
33 Bool_t IsValid() const {return fIsValid;};
35 const char* GetConfigHost() const {return fConfigHost.Data();}
37 const char* GetDAQlbHost() const {return fDAQlbHost.Data();}
38 UInt_t GetDAQlbPort() const {return fDAQlbPort;}
39 const char* GetDAQlbUser() const {return fDAQlbUser.Data();}
40 const char* GetDAQlbPass() const {return fDAQlbPass.Data();}
41 const char* GetDAQlbDB() const {return fDAQlbDB.Data();}
42 const char* GetDAQlbTable() const {return fDAQlbTable.Data();}
43 const char* GetShuttlelbTable() const {return fShuttlelbTable.Data();}
44 const char* GetRunTypelbTable() const {return fRunTypelbTable.Data();}
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();}
51 const char* GetFXSdbHost(Int_t sys) const {return fFXSdbHost[sys].Data();}
52 UInt_t GetFXSdbPort(Int_t sys) const {return fFXSdbPort[sys];}
53 const char* GetFXSdbUser(Int_t sys) const {return fFXSdbUser[sys].Data();}
54 const char* GetFXSdbPass(Int_t sys) const {return fFXSdbPass[sys].Data();}
55 const char* GetFXSdbName(Int_t sys) const {return fFXSdbName[sys].Data();}
56 const char* GetFXSdbTable(Int_t sys) const {return fFXSdbTable[sys].Data();}
58 const TObjArray* GetAdmins(Int_t sys) const;
60 Bool_t SendMail() const { return fSendMail; }
62 Int_t GetMaxRetries() const { return fMaxRetries; }
64 Int_t GetPPTimeOut() const { return fPPTimeOut; }
65 Int_t GetDCSTimeOut() const { return fDCSTimeOut; }
66 Int_t GetDCSRetries() const { return fDCSRetries; }
67 Int_t GetPPMaxMem() const { return fPPMaxMem; }
69 Bool_t KeepDCSMap() const { return fKeepDCSMap; }
70 Bool_t KeepTempFolder() const { return fKeepTempFolder; }
73 const char* GetMonitorHost() const {return fMonitorHost.Data();}
74 const char* GetMonitorTable() const {return fMonitorTable.Data();}
76 Int_t GetTriggerWait() const {return fTriggerWait;}
78 RunMode GetRunMode() const {return fRunMode;}
80 const TObjArray* GetDetectors() const;
82 Bool_t HasDetector(const char* detector) const;
84 Int_t GetNServers(const char* detector) const;
86 const char* GetDCSHost(const char* detector, Int_t iServ) const;
87 Int_t GetDCSPort(const char* detector, Int_t iServ) const;
89 Int_t GetMultiSplit(const char* detector, Int_t iServ) const;
91 const TObjArray* GetDCSAliases(const char* detector, Int_t iServ) const;
92 const TObjArray* GetDCSDataPoints(const char* detector, Int_t iServ) const;
93 const TObjArray* GetCompactDCSAliases(const char* detector, Int_t iServ) const;
94 const TObjArray* GetCompactDCSDataPoints(const char* detector, Int_t iServ) const;
96 const TObjArray* GetResponsibles(const char* detector) const;
97 Bool_t StrictRunOrder(const char* detector) const;
99 void SetProcessAll(Bool_t flag=kTRUE) {fProcessAll=flag;}
100 Bool_t ProcessAll() const {return fProcessAll;}
102 Bool_t HostProcessDetector(const char* detector) const;
104 virtual void Print(Option_t* option = NULL) const;
108 class AliShuttleDCSConfigHolder: public TObject {
110 AliShuttleDCSConfigHolder(const TLDAPEntry* entry);
111 ~AliShuttleDCSConfigHolder();
113 const char* GetDCSHost() const {return fDCSHost;}
114 Int_t GetDCSPort() const {return fDCSPort;}
115 Int_t GetMultiSplit() const {return fMultiSplit;}
117 const TObjArray* GetDCSAliases() const {return fDCSAliases;}
118 const TObjArray* GetDCSDataPoints() const {return fDCSDataPoints;}
119 const TObjArray* GetCompactDCSAliases() const {return fDCSAliasesComp;}
120 const TObjArray* GetCompactDCSDataPoints() const {return fDCSDataPointsComp;}
122 void ExpandAndAdd(TObjArray* target, const char* entry);
123 Bool_t IsValid() const {return fIsValid;}
126 AliShuttleDCSConfigHolder(const AliShuttleDCSConfigHolder& other); // not implemented
127 AliShuttleDCSConfigHolder& operator= (const AliShuttleDCSConfigHolder& other); // not implemented
129 TString fDCSHost; // Host name of the DCS server
130 Int_t fDCSPort; // port of the DCS server
131 Int_t fMultiSplit; // N. of DPs to be queried in each query chunk
132 TObjArray* fDCSAliases; // List of DCS aliases to be retrieved
133 TObjArray* fDCSDataPoints; // List of DCS data points to be retrieved
134 TObjArray* fDCSAliasesComp; // Compact list of DCS aliases to be printed
135 TObjArray* fDCSDataPointsComp; // Compact list of DCS data points to be printed
136 Bool_t fIsValid; // flag for the validity of the configuration
138 ClassDef(AliShuttleDCSConfigHolder, 0);
141 class AliShuttleDetConfigHolder: public TObject {
143 AliShuttleDetConfigHolder(const TLDAPEntry* entry);
144 ~AliShuttleDetConfigHolder();
146 const char* GetDetector() const {return fDetector.Data();}
147 const TObjArray* GetDCSConfig() const {return fDCSConfig;}
148 void AddDCSConfig(AliShuttleDCSConfigHolder* holder);
150 Int_t GetNServers() const {return fDCSConfig ? fDCSConfig->GetEntries() : 0;}
152 const char* GetDCSHost(Int_t iServ) const;
153 Int_t GetDCSPort(Int_t iServ) const;
154 Int_t GetMultiSplit(Int_t iServ) const;
156 const TObjArray* GetDCSAliases(Int_t iServ) const;
157 const TObjArray* GetDCSDataPoints(Int_t iServ) const;
158 const TObjArray* GetCompactDCSAliases(Int_t iServ) const;
159 const TObjArray* GetCompactDCSDataPoints(Int_t iServ) const;
161 const TObjArray* GetResponsibles() const {return fResponsibles;}
162 Bool_t IsValid() const {return fIsValid;}
163 Bool_t SkipDCSQuery() const {return fSkipDCSQuery;}
164 Bool_t StrictRunOrder() const {return fStrictRunOrder;}
167 AliShuttleDetConfigHolder(const AliShuttleDetConfigHolder& other); // not implemented
168 AliShuttleDetConfigHolder& operator= (const AliShuttleDetConfigHolder& other); // not implemented
170 TString fDetector; // Detector name
171 TObjArray* fDCSConfig; // Array of DCS configuration objects (AliShuttleDCSConfigHolder)
172 TObjArray* fResponsibles; // List of email addresses of the detector's responsible(s)
173 Bool_t fIsValid; // flag for the validity of the configuration
174 Bool_t fSkipDCSQuery; // flag - if TRUE (-> DCS config empty) skip DCS archive data query
175 Bool_t fStrictRunOrder; // flag - if TRUE connect data in a strict run ordering
177 ClassDef(AliShuttleDetConfigHolder, 0);
181 UInt_t SetGlobalConfig(TList* globalList);
182 UInt_t SetSysConfig(TList* sysList);
183 UInt_t SetDetConfig(TList* detList, TList* dcsList);
184 UInt_t SetHostConfig(TList* hostList);
186 TString fConfigHost; // Host of the Shuttle configuration LDAP server
188 TString fDAQlbHost; // Host of the DAQ logbook MySQL Server
189 UInt_t fDAQlbPort; // port of the DAQ logbook MySQL Server
190 TString fDAQlbUser; // username of the DAQ logbook MySQL Server
191 TString fDAQlbPass; // password of the DAQ logbook MySQL Server
192 TString fDAQlbDB; // DB name of the DAQ logbook MySQL Server
193 TString fDAQlbTable; // Table name of the DAQ logbook
194 TString fShuttlelbTable; // Table name of the Shuttle logbook
195 TString fRunTypelbTable; // Table name of the Run typr logbook
197 TString fFXSHost[3]; // Host of the [DAQ, DCS, HLT] File eXchange Server
198 UInt_t fFXSPort[3]; // Port of the [DAQ, DCS, HLT] File eXchange Server
199 TString fFXSUser[3]; // username of the [DAQ, DCS, HLT] File eXchange Server
200 TString fFXSPass[3]; // password of the [DAQ, DCS, HLT] File eXchange Server
202 TString fFXSdbHost[3]; // Host of the [DAQ, DCS, HLT] FXS database
203 UInt_t fFXSdbPort[3]; // Port of the [DAQ, DCS, HLT] FXS database
204 TString fFXSdbUser[3]; // username of the [DAQ, DCS, HLT] FXS database
205 TString fFXSdbPass[3]; // password of the [DAQ, DCS, HLT] FXS database
206 TString fFXSdbName[3]; // name of the [DAQ, DCS, HLT] FXS database
207 TString fFXSdbTable[3]; // Table name of the [DAQ, DCS, HLT] FXS database
209 Int_t fMaxRetries; // number of retries of a failed preprocessor
211 Int_t fPPTimeOut; // timeout until a preprocessor is killed
212 Int_t fDCSTimeOut; // timeout until the query to DCS is terminated
213 Int_t fDCSRetries; // number of retries until the query to DCS connection is terminated
214 Int_t fPPMaxMem; // maximum allowed memory until a preprocessor is killed
216 TString fMonitorHost; // host of the MonaLisa monitoring server
217 TString fMonitorTable; // Monalisa's SHUTTLE table name
219 Int_t fTriggerWait; // time to wait for DIM trigger before starting new collection
220 RunMode fRunMode; // Working mode (0=test; 1=prod)
222 TMap fDetectorMap; // Map of the detector-by-detector configuration
223 TObjArray fDetectorList; // List of detectors with valid configuration
225 TObjArray *fAdmin[5]; // Array of system administrators' email addresses (DAQ, DCS, HLT, Global, Amanda)
227 TString fShuttleInstanceHost; // Instance of the SHUTTLE
228 TObjArray fProcessedDetectors; // list of the detector to be processed by this machine
230 Bool_t fKeepDCSMap; // Flag to keep DCS map also in case of success
231 Bool_t fKeepTempFolder; // Flag to keep temp folder also in case of success
233 Bool_t fSendMail; // Send mail flag
235 Bool_t fProcessAll; // flag indicating that all detectors will be processed
236 Bool_t fIsValid; // flag for the validity of the configuration
238 ClassDef(AliShuttleConfig, 0);