]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTHOMERProxyHandler.h
* Added new Handler Classes for HOMER Proxy
[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   Int_t FillSourceList(TList *srcList);
64
65   ///////////////////////////////////////////////////////////////////////////////////
66
67 private:
68
69   /** copy constructor prohibited */
70   AliHLTHOMERProxyHandler(const AliHLTHOMERProxyHandler&);            // Not implemented.
71
72   /** assignment operator prohibited */
73   AliHLTHOMERProxyHandler& operator=(const AliHLTHOMERProxyHandler&); // Not implemented.
74
75   /*
76    * ---------------------------------------------------------------------------------
77    *                        Realms - private
78    * ---------------------------------------------------------------------------------
79    */
80
81   /** Realms */
82   enum HOMERRealms_t { 
83     kHLT,            /**< HLT realm */
84     kACR,            /**< ACR realm */
85     kGPN,            /**< GPN realm */
86     kKIP,            /**< KIP realm */
87     kHOMERRealmsMax  /**< Number of enum entries */
88   };
89
90   /** Array of proxy nodes per realm */
91   static const Char_t *fgkHOMERProxyNode[];     
92
93   /** Indentifies the realm and sets it
94    *  @return 0 on success, <0 for failure
95    */
96   void IdentifyRealm();
97   
98   /*
99    * ---------------------------------------------------------------------------------
100    *                        Proxy Communication - private
101    * ---------------------------------------------------------------------------------
102    */
103
104   /** Get xmlrpc response from the proxy 
105    *  @return 0 on success, <0 for failure
106    */
107   Int_t RequestXmlRpcResponse();
108
109   /** process xmlrpc response and fill the source list
110    *  @return 0 on success, <0 for failure
111    */
112   Int_t ProcessXmlRpcResponse();
113   
114   /*
115    * ---------------------------------------------------------------------------------
116    *                            Source Resolving - private
117    * ---------------------------------------------------------------------------------
118    */
119   
120   /** Add a new Service to list
121    *  @param xmlNode   Ptr to service node
122    *  @return          0 on sucess, <0 for failure
123    */
124   Int_t AddService(TXMLNode *innerNode);
125   
126   /*
127    * ---------------------------------------------------------------------------------
128    *                            Members - private
129    * ---------------------------------------------------------------------------------
130    */
131
132   /** Realm, which can be ACR, GPN, HLT, KIP */
133   Int_t       fRealm;                             // see above
134
135   /** xmlRPC response */
136   TString     fXmlRpcResponse;                    // see above
137
138   /** List to HOMER sources */
139   TList*      fSourceList;                        //! transient
140
141   ClassDef(AliHLTHOMERProxyHandler, 0); // Handles HLT xml sources.
142 };
143
144 #endif