diff options
Diffstat (limited to 'cpp/examples')
-rw-r--r-- | cpp/examples/qmf-agent/example.cpp | 12 | ||||
-rw-r--r-- | cpp/examples/qmf-agent/schema.xml | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/cpp/examples/qmf-agent/example.cpp b/cpp/examples/qmf-agent/example.cpp index b432c2a065..f9be4f0164 100644 --- a/cpp/examples/qmf-agent/example.cpp +++ b/cpp/examples/qmf-agent/example.cpp @@ -24,6 +24,7 @@ #include <qpid/agent/ManagementAgent.h> #include <qpid/sys/Mutex.h> #include <qpid/sys/Time.h> +#include <qpid/log/Statement.h> #include "qpid/types/Variant.h" #include "qmf/org/apache/qpid/agent/example/Parent.h" #include "qmf/org/apache/qpid/agent/example/Child.h" @@ -72,7 +73,8 @@ public: { return mgmtObject; } void doLoop(); - status_t ManagementMethod (uint32_t methodId, Args& args, string& text); + bool AuthorizeMethod(uint32_t methodId, Args& args, const string& userId); + status_t ManagementMethod(uint32_t methodId, Args& args, string& text); }; class ChildClass : public Manageable @@ -137,6 +139,14 @@ void CoreClass::doLoop() } } + +bool CoreClass::AuthorizeMethod(uint32_t methodId, Args& args, const string& userId) +{ + QPID_LOG(trace, "AuthorizeMethod for methodId=" << methodId << " userId=" << userId); + return methodId != _qmf::Parent::METHOD_AUTH_FAIL; +} + + Manageable::status_t CoreClass::ManagementMethod(uint32_t methodId, Args& args, string& /*text*/) { Mutex::ScopedLock _lock(vectorLock); diff --git a/cpp/examples/qmf-agent/schema.xml b/cpp/examples/qmf-agent/schema.xml index 84dc8b7643..2a3bb461cc 100644 --- a/cpp/examples/qmf-agent/schema.xml +++ b/cpp/examples/qmf-agent/schema.xml @@ -45,6 +45,9 @@ <arg name="aList" dir="IO" type="list"/> </method> + <method name="auth_fail" desc="Method that fails authorization"> + </method> + </class> |