Back to index

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