12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- /*##############################################################################
- HPCC SYSTEMS software Copyright (C) 2014 HPCC Systems.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ############################################################################## */
- #include "ws_sql_esp.ipp"
- //ESP Bindings
- #include "http/platform/httpprot.hpp"
- //ESP Service
- #include "ws_sqlService.hpp"
- #include "espplugin.hpp"
- extern "C"
- {
- //when we aren't loading dynamically
- // Change the function names when we stick with dynamic loading.
- ESP_FACTORY IEspService * esp_service_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
- {
- if (strcmp(type, "ws_sql")==0)
- {
- CwssqlEx* service = new CwssqlEx;
- service->init(cfg, process, name);
- return service;
- }
- return NULL;
- }
- ESP_FACTORY IEspRpcBinding * esp_binding_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
- {
- if (strcmp(type, "ws_sqlSoapBinding")==0)
- {
- CwssqlSoapBinding* binding = new CwssqlSoapBindingEx(cfg, name, process);
- return binding;
- }
- return NULL;
- }
- ESP_FACTORY IEspProtocol * esp_protocol_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
- {
- if (strcmp(type, "http_protocol")==0)
- {
- return new CHttpProtocol;
- }
- else if(strcmp(type, "secure_http_protocol") == 0)
- {
- IPropertyTree *sslSettings;
- sslSettings = cfg->getPropTree(StringBuffer("Software/EspProcess[@name=\"").append(process).append("\"]").append("/EspProtocol[@name=\"").append(name).append("\"]").str());
- if(sslSettings != NULL)
- {
- return new CSecureHttpProtocol(sslSettings);
- }
- }
- return NULL;
- }
- };
|