ws_roxiequeryplugin.cpp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 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. #pragma warning (disable : 4786)
  14. #ifndef WsRoxieQuery_API
  15. #ifdef _WIN32
  16. #define WsRoxieQuery_API __declspec(dllexport)
  17. #else
  18. #define WsRoxieQuery_API
  19. #endif //_WIN32
  20. #endif //WsRoxieQuery_API
  21. #include "ws_roxiequery_esp.ipp"
  22. //ESP Bindings
  23. #include "http/platform/httpprot.hpp"
  24. //ESP Service
  25. #include "ws_roxiequeryservice.hpp"
  26. #include "espplugin.hpp"
  27. extern "C"
  28. {
  29. //when we aren't loading dynamically
  30. // Change the function names when we stick with dynamic loading.
  31. ESP_FACTORY IEspService * esp_service_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
  32. {
  33. if (strcmp(type, "WsRoxieQuery")==0)
  34. {
  35. CWsRoxieQueryEx* service = new CWsRoxieQueryEx;
  36. service->init(cfg, process, name);
  37. return service;
  38. }
  39. return NULL;
  40. }
  41. ESP_FACTORY IEspRpcBinding * esp_binding_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
  42. {
  43. if (strcmp(type, "WsRoxieQuery")==0)
  44. {
  45. #ifdef _DEBUG
  46. http_soap_log_level log_level_ = hsl_all;
  47. #else
  48. http_soap_log_level log_level_ = hsl_none;
  49. #endif
  50. return new CWsRoxieQuerySoapBindingEx(cfg, name, process, log_level_);
  51. }
  52. return NULL;
  53. }
  54. ESP_FACTORY IEspProtocol * esp_protocol_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
  55. {
  56. if (strcmp(type, "http_protocol")==0)
  57. {
  58. return new CHttpProtocol;
  59. }
  60. else if(strcmp(type, "secure_http_protocol") == 0)
  61. {
  62. IPropertyTree *sslSettings;
  63. sslSettings = cfg->getPropTree(StringBuffer("Software/EspProcess[@name=\"").append(process).append("\"]").append("/EspProtocol[@name=\"").append(name).append("\"]").str());
  64. if(sslSettings != NULL)
  65. {
  66. return new CSecureHttpProtocol(sslSettings);
  67. }
  68. }
  69. return NULL;
  70. }
  71. };