Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes | Static Private Attributes
ArcSec::ArcEvaluationCtx Class Reference

EvaluationCtx, in charge of storing some context information for evaluation, including Request, current time, etc. More...

#include <ArcEvaluationCtx.h>

Inheritance diagram for ArcSec::ArcEvaluationCtx:
Inheritance graph
[legend]
Collaboration diagram for ArcSec::ArcEvaluationCtx:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ArcEvaluationCtx (Request *request)
 Construct a new EvaluationCtx based on the given request.
virtual ~ArcEvaluationCtx ()
virtual RequestgetRequest () const
virtual void setRequestItem (RequestItem *reqit)
virtual RequestItemgetRequestItem () const
virtual void split ()
 Convert/split one RequestItem ( one tuple <SubList, ResList, ActList, CtxList>) into a few <Subject, Resource, Action, Context> tuples.
virtual std::list< RequestTuple * > getRequestTuples () const
virtual void setEvalTuple (RequestTuple *tuple)
virtual RequestTuplegetEvalTuple () const
virtual std::list
< AttributeValue * > 
getSubjectAttributes (std::string &id, std::string &type, std::string &issuer, std::string &category, AttributeFactory *attrfactory)
virtual std::list
< AttributeValue * > 
getResourceAttributes (std::string &id, std::string &type, std::string &issuer, AttributeFactory *attrfactory)
virtual std::list
< AttributeValue * > 
getActionAttributes (std::string &id, std::string &type, std::string &issuer, AttributeFactory *attrfactory)
virtual std::list
< AttributeValue * > 
getContextAttributes (std::string &id, std::string &type, std::string &issuer, AttributeFactory *attrfactory)
virtual std::list
< AttributeValue * > 
getAttributes (std::string &reqctxpath, Arc::XMLNode &policy, std::string &data_type, AttributeFactory *attrfactory)

Private Attributes

Requestreq
RequestItemreqitem
std::list< RequestTuple * > reqtuples
RequestTupleevaltuple
 The RequestTuple for evaluation at present.

Static Private Attributes

static Arc::Logger logger

Detailed Description

EvaluationCtx, in charge of storing some context information for evaluation, including Request, current time, etc.

Definition at line 25 of file ArcEvaluationCtx.h.


Constructor & Destructor Documentation

Construct a new EvaluationCtx based on the given request.

Definition at line 158 of file ArcEvaluationCtx.cpp.

                                                   : req(NULL), EvaluationCtx(req) {
  req = request;
}

Definition at line 162 of file ArcEvaluationCtx.cpp.

                                   {
  //if(req)
  //  delete req;
  while(!(reqtuples.empty())) {
    delete reqtuples.back();
    reqtuples.pop_back();
  } 
}

Member Function Documentation

virtual std::list<AttributeValue*> ArcSec::EvaluationCtx::getActionAttributes ( std::string &  id,
std::string &  type,
std::string &  issuer,
AttributeFactory attrfactory 
) [inline, virtual, inherited]

Reimplemented in ArcSec::XACMLEvaluationCtx.

Definition at line 49 of file EvaluationCtx.h.

{ std::list<AttributeValue*> attrlist; return attrlist; };

Here is the caller graph for this function:

virtual std::list<AttributeValue*> ArcSec::EvaluationCtx::getAttributes ( std::string &  reqctxpath,
Arc::XMLNode policy,
std::string &  data_type,
AttributeFactory attrfactory 
) [inline, virtual, inherited]

Reimplemented in ArcSec::XACMLEvaluationCtx.

Definition at line 53 of file EvaluationCtx.h.

{ std::list<AttributeValue*> attrlist; return attrlist; };

Here is the caller graph for this function:

virtual std::list<AttributeValue*> ArcSec::EvaluationCtx::getContextAttributes ( std::string &  id,
std::string &  type,
std::string &  issuer,
AttributeFactory attrfactory 
) [inline, virtual, inherited]

Reimplemented in ArcSec::XACMLEvaluationCtx.

Definition at line 51 of file EvaluationCtx.h.

{ std::list<AttributeValue*> attrlist; return attrlist; };

Here is the caller graph for this function:

virtual RequestTuple* ArcSec::ArcEvaluationCtx::getEvalTuple ( ) const [inline, virtual]

Definition at line 48 of file ArcEvaluationCtx.h.

{ return evaltuple; };

Here is the caller graph for this function:

Request * ArcEvaluationCtx::getRequest ( ) const [virtual]

Reimplemented from ArcSec::EvaluationCtx.

Definition at line 171 of file ArcEvaluationCtx.cpp.

                                            {
  return req;
}
virtual RequestItem* ArcSec::ArcEvaluationCtx::getRequestItem ( ) const [inline, virtual]

Definition at line 36 of file ArcEvaluationCtx.h.

{return reqitem;};
virtual std::list<RequestTuple*> ArcSec::ArcEvaluationCtx::getRequestTuples ( ) const [inline, virtual]

Definition at line 44 of file ArcEvaluationCtx.h.

{ return reqtuples; };

Here is the caller graph for this function:

virtual std::list<AttributeValue*> ArcSec::EvaluationCtx::getResourceAttributes ( std::string &  id,
std::string &  type,
std::string &  issuer,
AttributeFactory attrfactory 
) [inline, virtual, inherited]

Reimplemented in ArcSec::XACMLEvaluationCtx.

Definition at line 47 of file EvaluationCtx.h.

{ std::list<AttributeValue*> attrlist; return attrlist; };

Here is the caller graph for this function:

virtual std::list<AttributeValue*> ArcSec::EvaluationCtx::getSubjectAttributes ( std::string &  id,
std::string &  type,
std::string &  issuer,
std::string &  category,
AttributeFactory attrfactory 
) [inline, virtual, inherited]

Reimplemented in ArcSec::XACMLEvaluationCtx.

Definition at line 45 of file EvaluationCtx.h.

{ std::list<AttributeValue*> attrlist; return attrlist; };

Here is the caller graph for this function:

virtual void ArcSec::ArcEvaluationCtx::setEvalTuple ( RequestTuple tuple) [inline, virtual]

Definition at line 46 of file ArcEvaluationCtx.h.

{ evaltuple = tuple; };

Here is the caller graph for this function:

virtual void ArcSec::ArcEvaluationCtx::setRequestItem ( RequestItem reqit) [inline, virtual]

Definition at line 34 of file ArcEvaluationCtx.h.

{reqitem = reqit;};
void ArcEvaluationCtx::split ( ) [virtual]

Convert/split one RequestItem ( one tuple <SubList, ResList, ActList, CtxList>) into a few <Subject, Resource, Action, Context> tuples.

The purpose is for evaluation. The evaluator will evaluate each RequestTuple one by one, not the RequestItem because it includes some independent <Subject, Resource, Action, Context>s and the evaluator should deal with them independently.

Definition at line 248 of file ArcEvaluationCtx.cpp.

                            {
  while(!reqtuples.empty()) { 
    delete reqtuples.back();
    reqtuples.pop_back(); 
  }

  ReqItemList reqlist = req->getRequestItems();
 
  logger.msg(INFO,"There is %d RequestItems", reqlist.size()); 
  
  std::list<RequestItem*>::iterator it;
  for (it = reqlist.begin(); it != reqlist.end(); it++) {
    SubList subjects = (*it)->getSubjects();
    SubList::iterator sit;
    ResList resources = (*it)->getResources();
    ResList::iterator rit;
    ActList actions = (*it)->getActions();
    ActList::iterator ait;
    CtxList contexts = (*it)->getContexts();
    CtxList::iterator cit;
   
    //Scan subjects, resources, actions and contexts inside one RequestItem object
    //to split subjects, resources, actions or contexts into some tuple with one subject, one resource, one action and context
    //See more descrioption in inteface RequestItem.h
    add_subjects(reqtuples,subjects,resources,actions,contexts);
/*
    for(sit = subjects.begin(); sit != subjects.end(); sit++) { //The subject part will never be empty
      if(!resources.empty()) {
        for(rit = resources.begin(); rit != resources.end(); rit++){
          if(!actions.empty()){
            for(ait = actions.begin(); ait != actions.end(); ait++){
              if(!contexts.empty()){
                for(cit = contexts.begin(); cit != contexts.end(); cit++){
                  RequestTuple* reqtuple = new RequestTuple;
                  reqtuple->sub = *sit;
                  reqtuple->res = *rit;
                  reqtuple->act = *ait;
                  reqtuple->ctx = *cit;
                  reqtuples.push_back(reqtuple);
                }
              }
              else {
                RequestTuple* reqtuple = new RequestTuple;
                reqtuple->sub = *sit;
                reqtuple->res = *rit;
                reqtuple->act = *ait;
                reqtuples.push_back(reqtuple);             
              }         
            }
          }
          else {
            if(!contexts.empty()){
              for(cit = contexts.begin(); cit != contexts.end(); cit++){
                RequestTuple* reqtuple = new RequestTuple;
                reqtuple->sub = *sit;
                reqtuple->res = *rit;
                reqtuple->ctx = *cit;
                reqtuples.push_back(reqtuple);
              }
            }
            else {
              RequestTuple* reqtuple = new RequestTuple;
              reqtuple->sub = *sit;
              reqtuple->res = *rit;
              reqtuples.push_back(reqtuple);
            }
          }
        }
      }
      
      else{
        if(!actions.empty()){
          for(ait = actions.begin(); ait != actions.end(); ait++){
            if(!contexts.empty()){
              for(cit = contexts.begin(); cit != contexts.end(); cit++){
                RequestTuple* reqtuple = new RequestTuple;
                reqtuple->sub = *sit;
                reqtuple->act = *ait;
                reqtuple->ctx = *cit;
                reqtuples.push_back(reqtuple);
              }
            }
            else {
              RequestTuple* reqtuple = new RequestTuple;
              reqtuple->sub = *sit;
              reqtuple->act = *ait;
              reqtuples.push_back(reqtuple);
            }
          }
        }
        else {
          if(!contexts.empty()){
            for(cit = contexts.begin(); cit != contexts.end(); cit++){
              RequestTuple* reqtuple = new RequestTuple;
              reqtuple->sub = *sit;
              reqtuple->ctx = *cit;
              reqtuples.push_back(reqtuple);
            }
          }
          else {
            RequestTuple* reqtuple = new RequestTuple;
            reqtuple->sub = *sit;
            reqtuples.push_back(reqtuple);
          }
        }
      }
    }
*/

/*
    for(sit = subjects.begin(); sit != subjects.end(); sit++) {
      for(rit = resources.begin(); rit != resources.end(); rit++){
        for(ait = actions.begin(); ait != actions.end(); ait++){
          for(cit = contexts.begin(); cit != contexts.end(); cit++){
            RequestTuple* reqtuple = new RequestTuple;
            reqtuple->sub = *sit;
            reqtuple->res = *rit;
            reqtuple->act = *ait;
            reqtuple->ctx = *cit;
            reqtuples.push_back(reqtuple);  

            logger.msg(INFO, "Subject size:  %d", (*sit).size());
            Arc::Subject::iterator it;
            for (it = (*sit).begin(); it!= (*sit).end(); it++){
              AttributeValue *attr;
              attr = (*it)->getAttributeValue();
              if(attr!=NULL) 
                logger.msg(INFO, "%s", attr->encode());
            }
          }
        }
      }
    }*/
  }

}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

The RequestTuple for evaluation at present.

Definition at line 56 of file ArcEvaluationCtx.h.

Logger ArcEvaluationCtx::logger [static, private]

Definition at line 48 of file ArcEvaluationCtx.h.

Reimplemented from ArcSec::EvaluationCtx.

Definition at line 52 of file ArcEvaluationCtx.h.

Definition at line 53 of file ArcEvaluationCtx.h.

Definition at line 54 of file ArcEvaluationCtx.h.


The documentation for this class was generated from the following files: