Skip to content

Commit

Permalink
Merge pull request #18279 from wangkx/h31195
Browse files Browse the repository at this point in the history
HPCC-31195 Add GetConnections, etc to WsDali

Reviewed-by: Jake Smith <[email protected]>
Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Feb 9, 2024
2 parents 104de84 + bea065d commit ca902ba
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 1 deletion.
22 changes: 21 additions & 1 deletion esp/scm/ws_dali.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
69 changes: 69 additions & 0 deletions esp/services/ws_dali/ws_daliservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "jlib.hpp"
#include "dautils.hpp"
#include "daadmin.hpp"
#include "dadiags.hpp"

using namespace daadmin;

Expand Down Expand Up @@ -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;
}
4 changes: 4 additions & 0 deletions esp/services/ws_dali/ws_daliservice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca902ba

Please sign in to comment.