Back to index

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

Storage place for policy objects. More...

#include <PolicyStore.h>

Collaboration diagram for ArcSec::PolicyStore:
Collaboration graph
[legend]

List of all members.

Classes

class  PolicyElement

Public Member Functions

 PolicyStore ()
 PolicyStore (const std::string &alg, const std::string &policyclassname, EvaluatorContext *ctx)
 Creates policy store with specified combing algorithm (alg - not used yet), policy name (policyclassname) and context (ctx)
virtual ~PolicyStore ()
virtual std::list< PolicyElementfindPolicy (EvaluationCtx *context)
virtual void addPolicy (const Source &policy, EvaluatorContext *ctx, const std::string &id)
virtual void addPolicy (Policy *policyobj, EvaluatorContext *ctx, const std::string &id)
virtual void removePolicies ()
virtual void releasePolicies ()

Private Attributes

std::list< PolicyElementpolicies
std::string policy_classname

Detailed Description

Storage place for policy objects.

Definition at line 12 of file PolicyStore.h.


Constructor & Destructor Documentation

PolicyStore::PolicyStore ( const std::string &  alg,
const std::string &  policyclassname,
EvaluatorContext ctx 
)

Creates policy store with specified combing algorithm (alg - not used yet), policy name (policyclassname) and context (ctx)

Definition at line 14 of file PolicyStore.cpp.

                                                                                                 {
  //combalg = alg;
  policy_classname = policyclassname;

  //PolicyParser plparser;  
  //for(std::list<std::string>::const_iterator it = filelist.begin(); it != filelist.end(); it++){
  //  policies.push_back(PolicyElement(plparser.parsePolicy((*it).c_str(), policy_classname, ctx)));
  //}    
}

Definition at line 76 of file PolicyStore.cpp.


Member Function Documentation

void PolicyStore::addPolicy ( const Source policy,
EvaluatorContext ctx,
const std::string &  id 
) [virtual]

Definition at line 46 of file PolicyStore.cpp.

                                                                                            {
  PolicyParser plparser;
  Policy* pls;
  pls = PolicyElement(plparser.parsePolicy(policy, policy_classname, ctx),id);
  if(pls != NULL)
    policies.push_back(pls);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PolicyStore::addPolicy ( Policy policyobj,
EvaluatorContext ctx,
const std::string &  id 
) [virtual]

Definition at line 54 of file PolicyStore.cpp.

                                                                                     {
  Policy* pls = dynamic_cast<Policy*>(policy);
  pls->setEvaluatorContext(ctx);
  pls->make_policy();
  if(pls!=NULL) {
    policies.push_back(PolicyElement(pls, id));
  }
}

Here is the call graph for this function:

std::list< PolicyStore::PolicyElement > PolicyStore::findPolicy ( EvaluationCtx context) [virtual]

Definition at line 27 of file PolicyStore.cpp.

                                                                        { //ctx){
  //For the existing Arc policy expression, we only need to return all the policies, because there is 
  //no Target definition in ArcPolicy (the Target is only in ArcRule)

  return policies;

/* 
  std::list<Policy*> ret;
  std::list<Policy*>::iterator it; 
  for(it = policies.begin(); it!=policies.end(); it++ ){
    MatchResult res = (*it)->match(ctx);
    if (res == MATCH )
      ret.push_back(*it);
  }
  return ret;
*/
 //TODO 
}

Here is the caller graph for this function:

void PolicyStore::releasePolicies ( void  ) [virtual]

Definition at line 70 of file PolicyStore.cpp.

                                      {
  while(!(policies.empty())){
    policies.pop_back();
  }
}

Here is the caller graph for this function:

void PolicyStore::removePolicies ( void  ) [virtual]

Definition at line 63 of file PolicyStore.cpp.

                                     {
  while(!(policies.empty())){
    delete (Policy*)(policies.back());
    policies.pop_back();
  }
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 47 of file PolicyStore.h.

Definition at line 50 of file PolicyStore.h.


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