ws_workunitsPlugin.cpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*##############################################################################
  2. Copyright (C) 2011 HPCC Systems.
  3. All rights reserved. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ############################################################################## */
  14. #pragma warning (disable : 4786)
  15. #include "ws_workunits_esp.ipp"
  16. //ESP Bindings
  17. #include "http/platform/httpprot.hpp"
  18. //ESP Service
  19. #include "ws_workunitsService.hpp"
  20. #include "espplugin.hpp"
  21. extern "C"
  22. {
  23. //when we aren't loading dynamically
  24. // Change the function names when we stick with dynamic loading.
  25. ESP_FACTORY IEspService * esp_service_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
  26. {
  27. if (strcmp(type, "WsWorkunits")==0)
  28. {
  29. CWsWorkunitsEx* service = new CWsWorkunitsEx;
  30. service->init(cfg, process, name);
  31. return service;
  32. }
  33. return NULL;
  34. }
  35. ESP_FACTORY IEspRpcBinding * esp_binding_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
  36. {
  37. if (strcmp(type, "ws_workunitsSoapBinding")==0)
  38. {
  39. #ifdef _DEBUG
  40. http_soap_log_level llevel = hsl_all;
  41. #else
  42. http_soap_log_level llevel = hsl_none;
  43. #endif
  44. return new CWsWorkunitsSoapBindingEx(cfg, name, process, llevel);
  45. }
  46. return NULL;
  47. }
  48. ESP_FACTORY IEspProtocol * esp_protocol_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
  49. {
  50. if (strcmp(type, "http_protocol")==0)
  51. {
  52. return new CHttpProtocol;
  53. }
  54. else if(strcmp(type, "secure_http_protocol") == 0)
  55. {
  56. IPropertyTree *sslSettings;
  57. sslSettings = cfg->getPropTree(StringBuffer("Software/EspProcess[@name=\"").append(process).append("\"]").append("/EspProtocol[@name=\"").append(name).append("\"]").str());
  58. if(sslSettings != NULL)
  59. {
  60. return new CSecureHttpProtocol(sslSettings);
  61. }
  62. }
  63. return NULL;
  64. }
  65. };