Back to index

nordugrid-arc-nox  1.1.0~rc6
XACMLPolicy.h
Go to the documentation of this file.
00001 #ifndef __ARC_SEC_XACMLPOLICY_H__
00002 #define __ARC_SEC_XACMLPOLICY_H__
00003 
00004 #include <list>
00005 
00006 #include <arc/XMLNode.h>
00007 #include <arc/security/ArcPDP/policy/Policy.h>
00008 #include <arc/security/ArcPDP/alg/CombiningAlg.h>
00009 #include <arc/security/ArcPDP/alg/AlgFactory.h>
00010 #include <arc/security/ArcPDP/Evaluator.h>
00011 
00012 #include "XACMLTarget.h"
00013 
00014 namespace ArcSec {
00015 
00017 class XACMLPolicy : public Policy {
00018 public:
00020   XACMLPolicy(void);
00021 
00023   XACMLPolicy(const Arc::XMLNode node);
00024 
00026   XACMLPolicy(const Arc::XMLNode node, EvaluatorContext* ctx);  
00027 
00028   virtual ~XACMLPolicy();  
00029 
00030   virtual operator bool(void) const { return (bool)policynode; };
00031 
00032   virtual Result eval(EvaluationCtx* ctx);
00033 
00034   virtual void setEvaluatorContext(EvaluatorContext* evaluatorcontext) { evaluatorctx = evaluatorcontext; };
00035 
00037   virtual void make_policy();
00038 
00039   virtual MatchResult match(EvaluationCtx* ctx);
00040 
00041   virtual std::string getEffect() const { return "Not_applicable";};
00042 
00043   virtual EvalResult& getEvalResult();
00044 
00045   virtual void setEvalResult(EvalResult& res) { evalres = res; };
00046 
00047   const char* getEvalName() const {   return "xacml.evaluator"; };
00048 
00049   const char* getName() const {   return "xacml.policy"; };
00050 
00051   static Arc::Plugin* get_policy(Arc::PluginArgument* arg);
00052 
00053 private:
00054   //std::list<Arc::Policy*> rules;
00055   std::string id;
00056   std::string version;
00057   
00059   CombiningAlg *comalg;
00060   std::string description;
00061 
00063   EvaluatorContext* evaluatorctx;
00064 
00066   AlgFactory *algfactory;
00067 
00068   EvalResult evalres;
00069 
00071   Arc::XMLNode policynode;
00072 
00074   Arc::XMLNode policytop;
00075 
00077   XACMLTarget* target;
00078 
00079 protected:
00080   static Arc::Logger logger;
00081 
00082 };
00083 
00084 } // namespace ArcSec
00085 
00086 #endif /* __ARC_SEC_XACMLPOLICY_H__ */
00087