]> git.uio.no Git - u/mrichter/AliRoot.git/blob - SHUTTLE/AliShuttleConfig.h
Removed old ldif files, added TOF, MCH ldif files. Added some options in
[u/mrichter/AliRoot.git] / SHUTTLE / AliShuttleConfig.h
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.
12 // For more info see AliShuttleConfig.cxx
13 //
14
15 #include <TObject.h>
16 #include <TString.h>
17 #include <TObjArray.h>
18 #include <TMap.h>
19 #include <TLDAPServer.h>
20
21 class AliShuttleConfig: public TObject {
22 public:
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");
26         virtual ~AliShuttleConfig();
27
28         Bool_t IsValid() const {return fIsValid;};
29
30         const char* GetConfigHost() const {return fConfigHost.Data();}
31
32         const char* GetDAQlbHost() const {return fDAQlbHost.Data();}
33         UInt_t      GetDAQlbPort() const {return fDAQlbPort;}
34         const char* GetDAQlbUser() const {return fDAQlbUser.Data();}
35         const char* GetDAQlbPass() const {return fDAQlbPass.Data();}
36         const char* GetDAQlbDB() const {return fDAQlbDB.Data();}
37         const char* GetDAQlbTable() const {return fDAQlbTable.Data();}
38
39         const char* GetFXSHost(Int_t system) const {return fFXSHost[system].Data();}
40         UInt_t      GetFXSPort(Int_t system) const {return fFXSPort[system];}
41         const char* GetFXSUser(Int_t system) const {return fFXSUser[system].Data();}
42         const char* GetFXSPass(Int_t system) const {return fFXSPass[system].Data();}
43
44         const char* GetFXSdbHost(Int_t system) const {return fFXSdbHost[system].Data();}
45         UInt_t      GetFXSdbPort(Int_t system) const {return fFXSdbPort[system];}
46         const char* GetFXSdbUser(Int_t system) const {return fFXSdbUser[system].Data();}
47         const char* GetFXSdbPass(Int_t system) const {return fFXSdbPass[system].Data();}
48         const char* GetFXSdbName(Int_t system) const {return fFXSdbName[system].Data();}
49         const char* GetFXSdbTable(Int_t system) const {return fFXSdbTable[system].Data();}
50
51         Int_t GetMaxRetries() const { return fMaxRetries; }
52
53         Int_t GetPPTimeOut() const { return fPPTimeOut; }
54
55         const TObjArray* GetDetectors() const;
56
57         Bool_t HasDetector(const char* detector) const;
58         const char* GetDCSHost(const char* detector) const;
59         Int_t GetDCSPort(const char* detector) const;
60         const TObjArray* GetDCSAliases(const char* detector) const;
61         const TObjArray* GetDCSDataPoints(const char* detector) const;
62         const TObjArray* GetCompactDCSAliases(const char* detector) const;
63         const TObjArray* GetCompactDCSDataPoints(const char* detector) const;
64         const TObjArray* GetResponsibles(const char* detector) const;
65         Bool_t StrictRunOrder(const char* detector) const;
66
67         void SetProcessAll(Bool_t flag=kTRUE) {fProcessAll=flag;}
68         Bool_t ProcessAll() const {return fProcessAll;}
69
70         Bool_t HostProcessDetector(const char* detector) const;
71
72         virtual void Print(Option_t* option = NULL) const;
73
74 private:
75
76         class AliShuttleConfigHolder: public TObject {
77         public:
78                 AliShuttleConfigHolder(const TLDAPEntry* entry);
79                 ~AliShuttleConfigHolder();
80
81                 const char* GetDetector() const {return fDetector.Data();}
82                 const char* GetDCSHost() const {return fDCSHost.Data();}
83                 Int_t GetDCSPort() const {return fDCSPort;}
84                 const TObjArray* GetDCSAliases() const {return fDCSAliases;}
85                 const TObjArray* GetDCSDataPoints() const {return fDCSDataPoints;}
86                 const TObjArray* GetCompactDCSAliases() const {return fDCSAliasesComp;}
87                 const TObjArray* GetCompactDCSDataPoints() const {return fDCSDataPointsComp;}
88                 const TObjArray* GetResponsibles() const {return fResponsibles;}
89
90                 Bool_t IsValid() const {return fIsValid;}
91                 Bool_t SkipDCSQuery() const {return fSkipDCSQuery;}
92                 Bool_t StrictRunOrder() const {return fStrictRunOrder;}
93
94                 void ExpandAndAdd(TObjArray* target, const char* entry);
95
96         private:
97                 TString fDetector;      // Detector name
98                 TString fDCSHost;       // Host name of the DCS server
99                 Int_t   fDCSPort;       // port of the DCS server
100                 TObjArray* fDCSAliases; // List of DCS aliases to be retrieved
101                 TObjArray* fDCSDataPoints; // List of DCS data points to be retrieved
102                 TObjArray* fDCSAliasesComp; // Compact list of DCS aliases to be printed
103                 TObjArray* fDCSDataPointsComp; // Compact list of DCS data points to be printed
104                 TObjArray* fResponsibles; // List of email addresses of the detector's responsible(s)
105                 Bool_t fIsValid;        // flag for the validity of the configuration
106                 Bool_t fSkipDCSQuery;   // flag - if TRUE (-> DCS config empty) skip DCS archive data query
107                 Bool_t fStrictRunOrder; // flag - if TRUE connect data in a strict run ordering
108
109
110                 ClassDef(AliShuttleConfigHolder, 0);
111         };
112
113
114         Bool_t fIsValid;                //! flag for the validity of the configuration
115
116         TString fConfigHost;            //! Host of the Shuttle configuration LDAP server
117
118         TString fDAQlbHost;             //! Host of the DAQ logbook MySQL Server
119         UInt_t  fDAQlbPort;             //! port of the DAQ logbook MySQL Server
120         TString fDAQlbUser;             //! username of the DAQ logbook MySQL Server
121         TString fDAQlbPass;             //! password of the DAQ logbook MySQL Server
122         TString fDAQlbDB;               //! DB name of the DAQ logbook MySQL Server
123         TString fDAQlbTable;            //! Table name of the DAQ logbook MySQL Server
124
125         TString fFXSHost[3];            //! Host of the [DAQ, DCS, HLT] File eXchange Server
126         UInt_t  fFXSPort[3];            //! Port of the [DAQ, DCS, HLT] File eXchange Server
127         TString fFXSUser[3];            //! username of the [DAQ, DCS, HLT] File eXchange Server
128         TString fFXSPass[3];            //! password of the [DAQ, DCS, HLT] File eXchange Server
129
130         TString fFXSdbHost[3];          //! Host of the [DAQ, DCS, HLT] FXS database
131         UInt_t  fFXSdbPort[3];          //! Port of the [DAQ, DCS, HLT] FXS database
132         TString fFXSdbUser[3];          //! username of the [DAQ, DCS, HLT] FXS database
133         TString fFXSdbPass[3];          //! password of the [DAQ, DCS, HLT] FXS database
134         TString fFXSdbName[3];          //! name of the [DAQ, DCS, HLT] FXS database
135         TString fFXSdbTable[3];         //! Table name of the [DAQ, DCS, HLT] FXS database
136
137         Int_t fMaxRetries;        // number of retries of a failed preprocessor
138
139         Int_t fPPTimeOut;         // timeout until a preprocessor is canceled
140
141         TMap fDetectorMap;              //! Map of the detector-by-detector configuration
142         TObjArray fDetectorList;        //! List of detectors with valid configuration
143
144         TString fShuttleInstanceHost;   //! Instance of the SHUTTLE
145         TObjArray fProcessedDetectors;  //! list of the detector to be processed by this machine
146         Bool_t fProcessAll;             //! flag indicating that all detectors will be processed
147
148         ClassDef(AliShuttleConfig, 0);
149 };
150
151 #endif
152