summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/acl/Acl.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/acl/Acl.h')
-rw-r--r--cpp/src/qpid/acl/Acl.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/cpp/src/qpid/acl/Acl.h b/cpp/src/qpid/acl/Acl.h
index a82add556c..e153187b3d 100644
--- a/cpp/src/qpid/acl/Acl.h
+++ b/cpp/src/qpid/acl/Acl.h
@@ -23,9 +23,12 @@
#include "qpid/acl/AclReader.h"
-#include "qpid/shared_ptr.h"
#include "qpid/RefCounted.h"
#include "qpid/broker/AclModule.h"
+#include "qpid/management/Manageable.h"
+#include "qpid/management/ManagementAgent.h"
+#include "qmf/org/apache/qpid/acl/Acl.h"
+
#include <map>
#include <string>
@@ -38,14 +41,11 @@ class Broker;
namespace acl {
struct AclValues {
- bool noEnforce;
- std::string aclFile;
-
- AclValues() {noEnforce = false; aclFile = "policy.acl"; }
+ std::string aclFile;
};
-class Acl : public broker::AclModule, public RefCounted
+class Acl : public broker::AclModule, public RefCounted, public management::Manageable
{
private:
@@ -53,7 +53,8 @@ private:
broker::Broker* broker;
bool transferAcl;
boost::shared_ptr<AclData> data;
-
+ qmf::org::apache::qpid::acl::Acl* mgmtObject; // mgnt owns lifecycle
+ qpid::management::ManagementAgent* agent;
public:
Acl (AclValues& av, broker::Broker& b);
@@ -63,20 +64,21 @@ public:
inline virtual bool doTransferAcl() {return transferAcl;};
// create specilied authorise methods for cases that need faster matching as needed.
- virtual bool authorise(std::string id, acl::Action action, acl::ObjectType objType, std::string name, std::map<std::string, std::string>* params);
- virtual bool authorise(std::string id, acl::Action action, acl::ObjectType objType, std::string ExchangeName, std::string RoutingKey);
+ virtual bool authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params=0);
+ virtual bool authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& ExchangeName,const std::string& RoutingKey);
virtual ~Acl();
private:
- std::string printAction(acl::Action action);
- std::string printObjType(acl::ObjectType objType);
- bool result(AclResult aclreslt, std::string id, acl::Action action, acl::ObjectType objType, std::string name);
- bool readAclFile();
- bool readAclFile(std::string aclFile);
+ bool result(const AclResult& aclreslt, const std::string& id, const Action& action, const ObjectType& objType, const std::string& name);
+ bool readAclFile(std::string& errorText);
+ bool readAclFile(std::string& aclFile, std::string& errorText);
+ virtual qpid::management::ManagementObject* GetManagementObject(void) const;
+ virtual management::Manageable::status_t ManagementMethod (uint32_t methodId, management::Args& args, std::string& text);
+
};
-
+
}} // namespace qpid::acl
#endif // QPID_ACL_ACL_H