1 #ifndef ALI_DCS_CLIENT_H
2 #define ALI_DCS_CLIENT_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 // This class represents the AliDCSClient.
11 // The client used for data retrieval from DCS server.
12 // For more info see AliDCSClient.cxx
15 #include "AliDCSMessage.h"
22 class AliDCSClient: public TObject {
26 fgkBadState=-1, // Bad state
27 fgkInvalidParameter = -2, // Invalid parameter
28 fgkTimeout = -3, // Timeout
29 fgkBadMessage = -4, // Bad message
30 fgkCommError = -5, // Communication error
31 fgkServerError = -6 // Server error
34 //// friend class AliShuttle;
36 AliDCSClient(const char* host, Int_t port, UInt_t timeout = 5000,
37 Int_t retries = 5, Int_t multiSplit = 100);
38 virtual ~AliDCSClient();
41 Int_t GetDPValues(const char* dpName, UInt_t startTime, UInt_t endTime,
44 Int_t GetAliasValues(const char* alias, UInt_t startTime,
45 UInt_t endTime, TObjArray* result);
47 TMap* GetDPValues(const TSeqCollection* dpList, UInt_t startTime, UInt_t endTime, Int_t startIndex = 0, Int_t endIndex = -1);
49 TMap* GetAliasValues(const TSeqCollection* aliasList, UInt_t startTime, UInt_t endTime, Int_t startIndex = 0, Int_t endIndex = -1);
51 AliDCSMessage::ErrorCode GetServerErrorCode() const
52 { return fServerErrorCode;}
54 Int_t GetResultErrorCode() const {return fResultErrorCode;}
55 const TString& GetServerError() const {return fServerError;}
63 static const char* GetErrorString(Int_t code);
66 static const char* fgkBadStateString; // Bad state string
67 static const char* fgkInvalidParameterString; // Invalid parameter string
68 static const char* fgkTimeoutString; // Timeout string
69 static const char* fgkBadMessageString; // Bad message string
70 static const char* fgkCommErrorString; // Communication error string
71 static const char* fgkServerErrorString; // Server error string
73 TSocket* fSocket; // Pointer to the TCP socket client
74 TString fHost; // server host
75 Int_t fPort; // server port
76 UInt_t fTimeout; // timeout parameter
77 Int_t fRetries; // number of retries
78 Int_t fMultiSplit; // number of datapoints that are queried at a time in a multi dp request, if set to 1 forces single requests
79 AliDCSMessage::ErrorCode fServerErrorCode; // server error code
80 TString fServerError; // server error string
82 Int_t fResultErrorCode; // result error code
86 Int_t SendBuffer(const char* buffer, Int_t size);
88 Int_t ReceiveBuffer(char* buffer, Int_t size);
90 Int_t SendMessage(AliDCSMessage& message);
92 Int_t ReceiveMessage(AliDCSMessage& message);
94 Int_t GetValues(AliDCSMessage::RequestType requestType,
95 const char* requestString, UInt_t startTime, UInt_t endTime,
98 TMap* GetValues(AliDCSMessage::RequestType requestType,
99 const TSeqCollection* list, UInt_t startTime, UInt_t endTime,
100 Int_t startIndex, Int_t endIndex);
102 Int_t ReceiveValueSet(TObjArray* result);
104 AliDCSClient(const AliDCSClient& other); // not implemented
105 AliDCSClient& operator= (const AliDCSClient& other); // not implemented
107 ClassDef(AliDCSClient, 0);