loggingmanager.hpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 LOGGINGMANAGER_EXPORTS
  21. #define LOGGINGMANAGER_API DECL_EXPORT
  22. #else
  23. #define LOGGINGMANAGER_API DECL_IMPORT
  24. #endif
  25. class CLoggingManager : implements ILoggingManager, public CInterface
  26. {
  27. typedef std::vector<IUpdateLogThread*> LOGGING_AGENTTHREADS;
  28. LOGGING_AGENTTHREADS loggingAgentThreads;
  29. bool initialized;
  30. IEspLogAgent* loadLoggingAgent(const char* name, const char* dll, const char* type, IPropertyTree* cfg);
  31. bool updateLog(IEspContext& espContext, IEspUpdateLogRequestWrap& req, IEspUpdateLogResponse& resp, StringBuffer& status);
  32. public:
  33. IMPLEMENT_IINTERFACE;
  34. CLoggingManager(void) { initialized = false; };
  35. virtual ~CLoggingManager(void);
  36. virtual bool init(IPropertyTree* cfg, const char* service);
  37. virtual bool updateLog(const char* option, IEspContext& espContext, IPropertyTree* userContext, IPropertyTree* userRequest,
  38. const char* backEndResp, const char* userResp, const char* logDatasets, StringBuffer& status);
  39. virtual bool updateLog(IEspContext& espContext, const char* option, const char* logContent, StringBuffer& status);
  40. virtual bool updateLog(IEspContext& espContext, IEspUpdateLogRequestWrap& req, IEspUpdateLogResponse& resp);
  41. virtual bool getTransactionSeed(StringBuffer& transactionSeed, StringBuffer& status);
  42. virtual bool getTransactionSeed(IEspGetTransactionSeedRequest& req, IEspGetTransactionSeedResponse& resp);
  43. virtual bool getTransactionID(StringAttrMapping* transFields, StringBuffer& transactionID, StringBuffer& status);
  44. };
  45. #endif // !defined(__LOGGINGMANAGER_HPP__)