summaryrefslogtreecommitdiff
path: root/cpp/examples/qmf-agent/example.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/examples/qmf-agent/example.cpp')
-rw-r--r--cpp/examples/qmf-agent/example.cpp12
1 files changed, 11 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);