Back to index

nordugrid-arc-nox  1.1.0~rc6
XACMLEvaluator.h
Go to the documentation of this file.
00001 #ifndef __ARC_SEC_XACMLEVALUATOR_H__
00002 #define __ARC_SEC_XACMLEVALUATOR_H__
00003 
00004 #include <list>
00005 #include <fstream>
00006 
00007 #include <arc/XMLNode.h>
00008 #include <arc/Logger.h>
00009 #include <arc/security/ArcPDP/Evaluator.h>
00010 #include <arc/security/ArcPDP/fn/FnFactory.h>
00011 #include <arc/security/ArcPDP/attr/AttributeFactory.h>
00012 #include <arc/security/ArcPDP/alg/AlgFactory.h>
00013 #include <arc/security/ArcPDP/Request.h>
00014 #include <arc/security/ArcPDP/Response.h>
00015 #include <arc/security/ArcPDP/PolicyStore.h>
00016 
00017 namespace ArcSec {
00018 
00020 class XACMLEvaluator : public Evaluator {
00021 friend class EvaluatorContext;
00022 private:
00023   static Arc::Logger logger;
00024   PolicyStore *plstore;
00025   FnFactory* fnfactory;
00026   AttributeFactory* attrfactory;  
00027   AlgFactory* algfactory;
00028   
00029   EvaluatorContext* context;
00030 
00031   Arc::XMLNode* m_cfg;
00032   std::string request_classname;
00033 
00034   EvaluatorCombiningAlg combining_alg;
00035 
00036   CombiningAlg* combining_alg_ex;
00037 
00038 public:
00039   XACMLEvaluator (Arc::XMLNode* cfg);
00040   XACMLEvaluator (const char * cfgfile);
00041   virtual ~XACMLEvaluator();
00042 
00044   virtual Response* evaluate(Request* request);
00045   virtual Response* evaluate(const Source& request);
00046 
00047   virtual Response* evaluate(Request* request, const Source& policy);
00048   virtual Response* evaluate(const Source& request, const Source& policy);
00049   virtual Response* evaluate(Request* request, Policy* policyobj);
00050   virtual Response* evaluate(const Source& request, Policy* policyobj);
00051 
00052   virtual AttributeFactory* getAttrFactory () { return attrfactory;};
00053   virtual FnFactory* getFnFactory () { return fnfactory; };
00054   virtual AlgFactory* getAlgFactory () { return algfactory; };
00055 
00056   virtual void addPolicy(const Source& policy,const std::string& id = "") {
00057     plstore->addPolicy(policy, context, id);
00058   };
00059 
00060   virtual void addPolicy(Policy* policy,const std::string& id = "") {
00061     plstore->addPolicy(policy, context, id);
00062   };
00063 
00064   virtual void removePolicies(void) { plstore->removePolicies(); };
00065 
00066   virtual void setCombiningAlg(EvaluatorCombiningAlg alg);
00067 
00068   virtual void setCombiningAlg(CombiningAlg* alg);
00069 
00070   virtual const char* getName(void) const;
00071 
00072   static Arc::Plugin* get_evaluator(Arc::PluginArgument* arg);
00073 
00074 protected:
00075   virtual Response* evaluate(EvaluationCtx* ctx);
00076 
00077 private:
00078   virtual void parsecfg(Arc::XMLNode& cfg);
00079   virtual Request* make_reqobj(Arc::XMLNode& reqnode);
00080 };
00081 
00082 } // namespace ArcSec
00083 
00084 #endif /* __ARC_SEC_XACMLEVALUATOR_H__ */