]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTHOMERProxyHandler.h
* removed HLT logging
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTHOMERProxyHandler.h
1 //-*- Mode: C++ -*-
2
3 // $Id: AliHLTHOMERProxyHandler.h $
4
5 #ifndef ALIHLTHOMERPROXYHANDLER_H
6 #define ALIHLTHOMERPROXYHANDLER_H
7
8 /* This file is property of and copyright by the ALICE HLT Project        * 
9  * ALICE Experiment at CERN, All rights reserved.                         *
10  * See cxx source for full Copyright notice     
11  */
12
13 /** @file   AliHLTHOMERProxyHandler.h
14     @author Jochen Thaeder
15     @date
16     @brief  HOMER proxy handler for HomerManger
17 */
18
19 #include "TString.h"
20 #include "TList.h"
21 #include "TXMLNode.h" 
22 // -- -- -- -- -- -- -- 
23 #include "AliHLTHOMERSourceDesc.h"
24 // -- -- -- -- -- -- -- 
25 //#include "AliHLTLogging.h"
26
27 /**
28  * @class AliHLTHOMERProxyHandler
29  * This Class should handle the communication with the proxy
30  * and fill the source list.
31  *
32  * @ingroup alihlt_homer
33  */
34
35 class AliHLTHOMERProxyHandler : public TObject//, public AliHLTLogging
36 {
37 public:
38
39   /*
40    * ---------------------------------------------------------------------------------
41    *                            Constructor / Destructor
42    * ---------------------------------------------------------------------------------
43    */
44
45   /** constructor */
46   AliHLTHOMERProxyHandler();
47
48   /** destructor */
49   virtual ~AliHLTHOMERProxyHandler();
50
51   /** Initialize 
52    *  @return 0 on success, <0 for failure
53    */
54   Int_t Initialize();
55
56   /*
57    * ---------------------------------------------------------------------------------
58    *                             Source List - public
59    * ---------------------------------------------------------------------------------
60    */
61
62   /** Fill's source list, with entries 
63    *  @return 0 on success, <0 for failure, 1 for no active service
64    */
65   Int_t FillSourceList(TList *srcList);
66
67   ///////////////////////////////////////////////////////////////////////////////////
68
69 private:
70
71   /** copy constructor prohibited */
72   AliHLTHOMERProxyHandler(const AliHLTHOMERProxyHandler&);            // Not implemented.
73
74   /** assignment operator prohibited */
75   AliHLTHOMERProxyHandler& operator=(const AliHLTHOMERProxyHandler&); // Not implemented.
76
77   /*
78    * ---------------------------------------------------------------------------------
79    *                        Realms - private
80    * ---------------------------------------------------------------------------------
81    */
82
83   /** Realms */
84   enum HOMERRealms_t { 
85     kHLT,            /**< HLT realm */
86     kACR,            /**< ACR realm */
87     kGPN,            /**< GPN realm */
88     kKIP,            /**< KIP realm */
89     kHOMERRealmsMax  /**< Number of enum entries */
90   };
91
92   /** Array of proxy nodes per realm */
93   static const Char_t *fgkHOMERProxyNode[];     
94
95   /** Indentifies the realm and sets it
96    *  @return 0 on success, <0 for failure
97    */
98   void IdentifyRealm();
99   
100   /*
101    * ---------------------------------------------------------------------------------
102    *                        Proxy Communication - private
103    * ---------------------------------------------------------------------------------
104    */
105
106   /** Get xmlrpc response from the proxy 
107    *  @return 0 on success, <0 for failure
108    */
109   Int_t RequestXmlRpcResponse();
110
111   /** process xmlrpc response and fill the source list
112    *  @return 0 on success, <0 for failure, 1 for no active service
113    */
114   Int_t ProcessXmlRpcResponse();
115   
116   /*
117    * ---------------------------------------------------------------------------------
118    *                            Source Resolving - private
119    * ---------------------------------------------------------------------------------
120    */
121   
122   /** Add a new Service to list
123    *  @param xmlNode   Ptr to service node
124    *  @return          0 on sucess, <0 for failure
125    */
126   Int_t AddService(TXMLNode *innerNode);
127   
128   /*
129    * ---------------------------------------------------------------------------------
130    *                            Members - private
131    * ---------------------------------------------------------------------------------
132    */
133
134   /** Realm, which can be ACR, GPN, HLT, KIP */
135   Int_t       fRealm;                             // see above
136
137   /** xmlRPC response */
138   TString     fXmlRpcResponse;                    // see above
139
140   /** List to HOMER sources */
141   TList*      fSourceList;                        //! transient
142
143   ClassDef(AliHLTHOMERProxyHandler, 0); // Handles HLT xml sources.
144 };
145
146 #endif