Back to index

nordugrid-arc-nox  1.1.0~rc6
Policy.h
Go to the documentation of this file.
00001 #ifndef __ARC_SEC_POLICY_H__
00002 #define __ARC_SEC_POLICY_H__
00003 
00004 #include <list>
00005 #include <arc/XMLNode.h>
00006 #include <arc/Logger.h>
00007 #include <arc/security/ClassLoader.h>
00008 
00009 #include "../EvaluationCtx.h"
00010 #include "../Result.h"
00011 
00012 namespace ArcSec {
00013 
00014 class EvaluatorContext;
00015 
00017 
00024 class Policy : public Arc::LoadableClass {
00025 protected:
00026   std::list<Policy*> subelements;
00027   static Arc::Logger logger; 
00028  
00029 public:
00031   Policy() {};
00032 
00034 
00037   Policy(const Arc::XMLNode) {};  
00038 
00040 
00045   Policy(const Arc::XMLNode, EvaluatorContext*) {};
00046   virtual ~Policy(){};
00047 
00049   virtual operator bool(void) const = 0;
00050   
00052   virtual MatchResult match(EvaluationCtx*) = 0;
00053 
00061   virtual Result eval(EvaluationCtx*) = 0;
00062 
00064   virtual void addPolicy(Policy* pl){subelements.push_back(pl);};
00065 
00067   virtual void setEvaluatorContext(EvaluatorContext*) {};
00068 
00070   virtual void make_policy() {};
00071 
00073   virtual std::string getEffect() const = 0;
00074   
00076   virtual EvalResult& getEvalResult() = 0;
00077 
00079   virtual void setEvalResult(EvalResult& res) = 0;
00080 
00082   virtual const char* getEvalName() const = 0;
00083 
00085   virtual const char* getName() const = 0;
00086 };
00087 
00088 } // namespace ArcSec
00089 
00090 #endif /* __ARC_SEC_POLICY_H__ */
00091