00001 #ifndef QPID_ACL_ACL_H
00002 #define QPID_ACL_ACL_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "qpid/acl/AclReader.h"
00026 #include "qpid/shared_ptr.h"
00027 #include "qpid/RefCounted.h"
00028 #include "qpid/broker/AclModule.h"
00029 #include "qpid/management/Manageable.h"
00030 #include "qpid/agent/ManagementAgent.h"
00031 #include "qmf/org/apache/qpid/acl/Acl.h"
00032
00033 #include <map>
00034 #include <string>
00035
00036
00037 namespace qpid {
00038 namespace broker {
00039 class Broker;
00040 }
00041
00042 namespace acl {
00043
00044 struct AclValues {
00045 bool enforce;
00046 std::string aclFile;
00047
00048 AclValues() {enforce = false; aclFile = "policy.acl"; }
00049 };
00050
00051
00052 class Acl : public broker::AclModule, public RefCounted, public management::Manageable
00053 {
00054
00055 private:
00056 acl::AclValues aclValues;
00057 broker::Broker* broker;
00058 bool transferAcl;
00059 boost::shared_ptr<AclData> data;
00060 qmf::org::apache::qpid::acl::Acl* mgmtObject;
00061 qpid::management::ManagementAgent* agent;
00062
00063 public:
00064 Acl (AclValues& av, broker::Broker& b);
00065
00066 void initialize();
00067
00068 inline virtual bool doTransferAcl() {return transferAcl;};
00069
00070
00071 virtual bool authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params=0);
00072 virtual bool authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& ExchangeName,const std::string& RoutingKey);
00073
00074 virtual ~Acl();
00075 private:
00076 bool result(const AclResult& aclreslt, const std::string& id, const Action& action, const ObjectType& objType, const std::string& name);
00077 bool readAclFile();
00078 bool readAclFile(std::string& aclFile);
00079 virtual qpid::management::ManagementObject* GetManagementObject(void) const;
00080 virtual management::Manageable::status_t ManagementMethod (uint32_t methodId, management::Args& args, std::string& text);
00081
00082 };
00083
00084
00085
00086 }}
00087
00088 #endif // QPID_ACL_ACL_H