loggingmanager.hpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2014 HPCC Systems.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #if !defined(__LOGGINGMANAGER_HPP__)
  14. #define __LOGGINGMANAGER_HPP__
  15. #include <vector>
  16. #include "loggingcommon.hpp"
  17. #include "loggingagentbase.hpp"
  18. #include "logthread.hpp"
  19. #include "loggingmanager.h"
  20. #ifdef WIN32
  21. #ifdef LOGGINGMANAGER_EXPORTS
  22. #define LOGGINGMANAGER_API __declspec(dllexport)
  23. #else
  24. #define LOGGINGMANAGER_API __declspec(dllimport)
  25. #endif
  26. #else
  27. #define LOGGINGMANAGER_API
  28. #endif
  29. class CLoggingManager : implements ILoggingManager, public CInterface
  30. {
  31. typedef std::vector<IUpdateLogThread*> LOGGING_AGENTTHREADS;
  32. LOGGING_AGENTTHREADS loggingAgentThreads;
  33. bool initialized;
  34. IEspLogAgent* loadLoggingAgent(const char* name, const char* dll, const char* type, IPropertyTree* cfg);
  35. bool updateLog(IEspUpdateLogRequestWrap& req, IEspUpdateLogResponse& resp, StringBuffer& status);
  36. public:
  37. IMPLEMENT_IINTERFACE;
  38. CLoggingManager(void) { initialized = false; };
  39. virtual ~CLoggingManager(void);
  40. virtual bool init(IPropertyTree* cfg, const char* service);
  41. virtual bool updateLog(const char* option, IEspContext& espContext, IPropertyTree* userContext, IPropertyTree* userRequest,
  42. const char* backEndResp, const char* userResp, StringBuffer& status);
  43. virtual bool updateLog(const char* option, const char* logContent, StringBuffer& status);
  44. virtual bool updateLog(IEspUpdateLogRequestWrap& req, IEspUpdateLogResponse& resp);
  45. virtual bool getTransactionSeed(StringBuffer& transactionSeed, StringBuffer& status);
  46. virtual bool getTransactionSeed(IEspGetTransactionSeedRequest& req, IEspGetTransactionSeedResponse& resp);
  47. virtual bool getTransactionID(StringAttrMapping* transFields, StringBuffer& transactionID, StringBuffer& status);
  48. };
  49. #endif // !defined(__LOGGINGMANAGER_HPP__)