diff --git a/esp/scm/ws_dali.ecm b/esp/scm/ws_dali.ecm index 0172796a3a9..ac0240dc27d 100644 --- a/esp/scm/ws_dali.ecm +++ b/esp/scm/ws_dali.ecm @@ -135,8 +135,24 @@ ESPrequest [nil_remove] GetProtectedListRequest string CallerId; }; +ESPrequest [nil_remove] GetConnectionsRequest +{ +}; + +ESPrequest [nil_remove] GetClientsRequest +{ +}; + +ESPrequest [nil_remove] GetSDSStatsRequest +{ +}; + +ESPrequest [nil_remove] GetSDSSubscribersRequest +{ +}; + ESPservice [auth_feature("NONE"), //This declares that the method logic handles feature level authorization - version("1.04"), default_client_version("1.04"), exceptions_inline("./smc_xslt/exceptions.xslt")] WSDali + version("1.05"), default_client_version("1.05"), exceptions_inline("./smc_xslt/exceptions.xslt")] WSDali { ESPmethod [min_ver("1.01")] SetValue(SetValueRequest, ResultResponse); ESPmethod [min_ver("1.01")] GetValue(GetValueRequest, ResultResponse); @@ -156,6 +172,10 @@ ESPservice [auth_feature("NONE"), //This declares that the method logic handles ESPmethod [min_ver("1.04")] SetProtected(SetProtectedRequest, ResultResponse); ESPmethod [min_ver("1.04")] SetUnprotected(SetUnprotectedRequest, ResultResponse); ESPmethod [min_ver("1.04")] GetProtectedList(GetProtectedListRequest, ResultResponse); + ESPmethod [min_ver("1.05")] GetConnections(GetConnectionsRequest, ResultResponse); + ESPmethod [min_ver("1.05")] GetClients(GetClientsRequest, ResultResponse); + ESPmethod [min_ver("1.05")] GetSDSStats(GetSDSStatsRequest, ResultResponse); + ESPmethod [min_ver("1.05")] GetSDSSubscribers(GetSDSSubscribersRequest, ResultResponse); }; SCMexportdef(WSDali); diff --git a/esp/services/ws_dali/ws_daliservice.cpp b/esp/services/ws_dali/ws_daliservice.cpp index 6b88895c43e..05cd3c3d16f 100644 --- a/esp/services/ws_dali/ws_daliservice.cpp +++ b/esp/services/ws_dali/ws_daliservice.cpp @@ -23,6 +23,7 @@ #include "jlib.hpp" #include "dautils.hpp" #include "daadmin.hpp" +#include "dadiags.hpp" using namespace daadmin; @@ -525,3 +526,71 @@ bool CWSDaliEx::onGetProtectedList(IEspContext& context, IEspGetProtectedListReq } return true; } + +bool CWSDaliEx::onGetConnections(IEspContext& context, IEspGetConnectionsRequest& req, IEspResultResponse& resp) +{ + try + { + checkAccess(context); + + StringBuffer result; + querySDS().getConnections(result); + resp.setResult(result); + } + catch(IException* e) + { + FORWARDEXCEPTION(context, e, ECLWATCH_INTERNAL_ERROR); + } + return true; +} + +bool CWSDaliEx::onGetClients(IEspContext& context, IEspGetClientsRequest& req, IEspResultResponse& resp) +{ + try + { + checkAccess(context); + + StringBuffer result; + getDaliDiagnosticValue("clients", result); + resp.setResult(result); + } + catch(IException* e) + { + FORWARDEXCEPTION(context, e, ECLWATCH_INTERNAL_ERROR); + } + return true; +} + +bool CWSDaliEx::onGetSDSStats(IEspContext& context, IEspGetSDSStatsRequest& req, IEspResultResponse& resp) +{ + try + { + checkAccess(context); + + StringBuffer result; + querySDS().getUsageStats(result); + resp.setResult(result); + } + catch(IException* e) + { + FORWARDEXCEPTION(context, e, ECLWATCH_INTERNAL_ERROR); + } + return true; +} + +bool CWSDaliEx::onGetSDSSubscribers(IEspContext& context, IEspGetSDSSubscribersRequest& req, IEspResultResponse& resp) +{ + try + { + checkAccess(context); + + StringBuffer result; + querySDS().getSubscribers(result); + resp.setResult(result); + } + catch(IException* e) + { + FORWARDEXCEPTION(context, e, ECLWATCH_INTERNAL_ERROR); + } + return true; +} diff --git a/esp/services/ws_dali/ws_daliservice.hpp b/esp/services/ws_dali/ws_daliservice.hpp index 7ccfdac8841..272ea0d06fe 100644 --- a/esp/services/ws_dali/ws_daliservice.hpp +++ b/esp/services/ws_dali/ws_daliservice.hpp @@ -68,6 +68,10 @@ class CWSDaliEx : public CWSDali virtual bool onSetProtected(IEspContext& context, IEspSetProtectedRequest& req, IEspResultResponse& resp) override; virtual bool onSetUnprotected(IEspContext& context, IEspSetUnprotectedRequest& req, IEspResultResponse& resp) override; virtual bool onGetProtectedList(IEspContext& context, IEspGetProtectedListRequest& req, IEspResultResponse& resp) override; + virtual bool onGetConnections(IEspContext& context, IEspGetConnectionsRequest& req, IEspResultResponse& resp) override; + virtual bool onGetClients(IEspContext& context, IEspGetClientsRequest& req, IEspResultResponse& resp) override; + virtual bool onGetSDSStats(IEspContext& context, IEspGetSDSStatsRequest& req, IEspResultResponse& resp) override; + virtual bool onGetSDSSubscribers(IEspContext& context, IEspGetSDSSubscribersRequest& req, IEspResultResponse& resp) override; }; class CWSDaliSoapBindingEx : public CWSDaliSoapBinding