Back to index

nordugrid-arc-nox  1.1.0~rc6
Request.h
Go to the documentation of this file.
00001 #ifndef __ARC_SEC_REQUEST_H__
00002 #define __ARC_SEC_REQUEST_H__
00003 
00004 #include <list>
00005 #include <arc/security/ClassLoader.h>
00006 #include <arc/XMLNode.h>
00007 #include <arc/Logger.h>
00008 #include <arc/security/ArcPDP/attr/AttributeFactory.h>
00009 #include <arc/security/ArcPDP/RequestItem.h>
00010 #include <arc/security/ArcPDP/Source.h>
00011 
00012 namespace ArcSec {
00013 
00016 
00018 typedef std::list<RequestItem*> ReqItemList;
00019 
00021 typedef struct{
00022   std::string value;
00023   std::string type;
00024 } Attr;
00025 
00027 
00028 class Attrs {
00029 public:
00030   void addItem(Attr attr) { 
00031     int n = (attrs.size());  
00032     attrs.insert(std::pair<int, Attr>(n, attr)); 
00033   };
00034   int size() { return attrs.size();};
00035   Attr& getItem(int n) { return attrs[n]; };
00036   Attr& operator[](int n) { return attrs[n]; };
00037 private:
00038   std::map<int, Attr> attrs;
00039 };
00040 
00041 
00043 
00055 class Request : public Arc::LoadableClass {
00056 protected:
00057   ReqItemList rlist;
00058 public:
00060   virtual ReqItemList getRequestItems () const { ReqItemList list; return list; };
00061 
00063   virtual void setRequestItems (ReqItemList sl) { };
00064 
00066   virtual void addRequestItem(Attrs& sub, Attrs& res, Attrs& act, Attrs& ctx) { };
00067 
00069   virtual void setAttributeFactory(AttributeFactory* attributefactory) = 0;
00070 
00072   virtual void make_request() = 0;
00073 
00075   virtual const char* getEvalName() const = 0;
00076 
00078   virtual const char* getName() const = 0;
00079 
00081   Request () {};
00082 
00084   Request (const Source&) {};
00085 
00086   virtual Arc::XMLNode& getReqNode() = 0;
00087 
00088   virtual ~Request(){};
00089 };
00090 
00091 } // namespace ArcSec
00092 
00093 #endif /* __ARC_SEC_REQUEST_H__ */