#ifndef __ARC_SEC_REQUESTITEM_H__ #define __ARC_SEC_REQUESTITEM_H__ #include #include #include "attr/AttributeFactory.h" #include "attr/RequestAttribute.h" namespace ArcSec { ///Attribute containers, which includes a few RequestAttribute objects /** Why do we need such containers? A Subject node could be like below, include a few attributes at the same time: administrator /O=NorduGrid/OU=UIO/CN=admin Or only include one attribute: /O=NorduGrid/OU=UIO/CN=test Or include a few the same types of attributes at the same time: administrator /O=NorduGrid/OU=UIO/CN=admin Note, (or others) node with more than one s means the owns all the included attributes at the same time. e.g. a person with email: abc@xyz and DN:/O=XYZ/OU=ABC/CN=theguy and role: administrator However, Parallel s inside one SubList (see below about definition if ***List) does not means there is any relationship between these s. Then if there are two examples of here: Subject1: administrator /O=NorduGrid/OU=UIO/CN=admin and, Subject2: /O=NorduGrid/OU=UIO/CN=test Subject3: administrator the former one will be explained as the request tuple has two attributes at the same time the later one will be explained as the two , independently has one attribute. If we consider the Policy side, a policy snipet example like this: /O=NorduGrid/OU=UIO/CN=admin administrator ...... ...... ...... then all of the Subject1 Subject2 Subject3 will satisfy the in policy. but if the policy snipet is like this: /O=NorduGrid/OU=UIO/CN=admin administrator ...... ...... ...... then only Subject1 can satisfy the in policy. A complete request item could be like: /O=NorduGrid/OU=UIO/CN=test administrator guest /O=NorduGrid/OU=UIO/CN=anonymous file://home/test read copy 2007-09-10T20:30:20/P1Y1M Here putting a few s s s or s together (inside one RequestItem) is only for the convinient of expression (there is no logical relationship between them). For more than one <, , , > tuples, if there is one element (e.g. ) which is different to each other, you can put these tuples together by using one tuple <,, , , > tuple, and don't need to write a few tuples. */ typedef std::list Subject, Resource, Action, Context; ///Containers, which include a few Subject, Resource, Action or Context objects typedef std::list SubList; typedef std::list ResList; typedef std::list ActList; typedef std::list CtxList; ///Interface for request item container, tuple class RequestItem{ public: /**Constructor @param node The XMLNode structure of the request item @param attributefactory The AttributeFactory which will be used to generate RequestAttribute */ RequestItem(Arc::XMLNode&, AttributeFactory*){}; virtual ~RequestItem(){}; protected: SubList subjects; ResList actions; ActList resources; CtxList contexts; public: virtual SubList getSubjects () const = 0; virtual void setSubjects (const SubList& sl) = 0; virtual ResList getResources () const = 0; virtual void setResources (const ResList& rl) = 0; virtual ActList getActions () const = 0; virtual void setActions (const ActList& al) = 0; virtual CtxList getContexts () const = 0; virtual void setContexts (const CtxList& ctx) = 0; }; } // namespace Arc #endif /* __ARC_SEC_REQUESTITEM_H__ */