Back to index

nordugrid-arc-nox  1.1.0~rc6
PolicyStore.h
Go to the documentation of this file.
00001 #ifndef __ARC_SEC_POLICYSTORE_H__
00002 #define __ARC_SEC_POLICYSTORE_H__
00003 
00004 #include <list>
00005 #include <arc/security/ArcPDP/policy/Policy.h>
00006 
00007 namespace ArcSec {
00008 
00009 class EvaluatorContext;
00010 
00012 class PolicyStore {
00013 
00014 public:
00015 
00016   class PolicyElement {
00017   private:
00018     Policy* policy;
00019     std::string id;
00020   public:
00021     PolicyElement(Policy* policy_):policy(policy_) { };
00022     PolicyElement(Policy* policy_, const std::string& id_):policy(policy_),id(id_) { };
00023     operator Policy*(void) const { return policy; };
00024     const std::string& Id(void) const { return id; };
00025   };
00026 
00027   PolicyStore();
00028 
00031   PolicyStore(const std::string& alg, const std::string& policyclassname, EvaluatorContext* ctx);
00032 
00033   virtual ~PolicyStore();
00034   
00035   virtual std::list<PolicyElement> findPolicy(EvaluationCtx* context);
00036 
00037   virtual void addPolicy(const Source& policy, EvaluatorContext* ctx,const std::string& id);
00038 
00039   virtual void addPolicy(Policy* policyobj, EvaluatorContext* ctx,const std::string& id);
00040 
00041   virtual void removePolicies();
00042 
00043   virtual void releasePolicies();
00044 
00045   // std::list<std::string> policysrclist;
00046 private:
00047   std::list<PolicyElement> policies;
00048   //std::string combalg;
00049   
00050   std::string policy_classname;
00051 };
00052 
00053 } // namespace ArcSec
00054 
00055 #endif /* __ARC_SEC_POLICYSTORE_H__ */
00056