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