Back to index

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

Function factory class for XACML specified attributes. More...

#include <XACMLFnFactory.h>

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

List of all members.

Public Member Functions

 XACMLFnFactory ()
virtual ~XACMLFnFactory ()
virtual FunctioncreateFn (const std::string &type)
 return a Function object according to the "Function" attribute in the XML node; The XACMLFnFactory itself will release the Function objects

Protected Attributes

FnMap fnmap

Private Member Functions

void initFunctions ()

Detailed Description

Function factory class for XACML specified attributes.

Definition at line 11 of file XACMLFnFactory.h.


Constructor & Destructor Documentation

Definition at line 83 of file XACMLFnFactory.cpp.

                              {
  initFunctions();
}

Definition at line 99 of file XACMLFnFactory.cpp.

                               {
  FnMap::iterator it;
  for(it = fnmap.begin(); it != fnmap.end(); it = fnmap.begin()){
    Function* fn = (*it).second;
    fnmap.erase(it);
    if(fn) delete fn;
  }
}

Member Function Documentation

Function * ArcSec::XACMLFnFactory::createFn ( const std::string &  type) [virtual]

return a Function object according to the "Function" attribute in the XML node; The XACMLFnFactory itself will release the Function objects

Implements ArcSec::FnFactory.

Definition at line 87 of file XACMLFnFactory.cpp.

                                                       {
  FnMap::iterator it; 
  if((it=fnmap.find(type)) != fnmap.end()) 
    return (*it).second;
  else { //Default: string-equal
    std::string tp("string-equal");
    if((it=fnmap.find(tp)) != fnmap.end())
      return (*it).second;
  }
  return NULL;
}

TODO: other function type.............

Definition at line 24 of file XACMLFnFactory.cpp.

                                  {
  //EqualFunctions
  std::string fnName = EqualFunction::getFunctionName(StringAttribute::getIdentifier());
  std::string argType = StringAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(DateTimeAttribute::getIdentifier());
  argType = DateTimeAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(DateAttribute::getIdentifier());
  argType = DateAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(TimeAttribute::getIdentifier());
  argType = TimeAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(DurationAttribute::getIdentifier());
  argType = DurationAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(PeriodAttribute::getIdentifier());
  argType = PeriodAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(X500NameAttribute::getIdentifier());
  argType = X500NameAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  fnName = EqualFunction::getFunctionName(AnyURIAttribute::getIdentifier());
  argType = AnyURIAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new EqualFunction(fnName, argType)));

  //MatchFunctions
  fnName = MatchFunction::getFunctionName(StringAttribute::getIdentifier());
  argType = StringAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new MatchFunction(fnName, argType)));

  fnName = MatchFunction::getFunctionName(X500NameAttribute::getIdentifier());
  argType = X500NameAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new MatchFunction(fnName, argType)));

  fnName = MatchFunction::getFunctionName(AnyURIAttribute::getIdentifier());
  argType = AnyURIAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new MatchFunction(fnName, argType)));

  //InRangeFunctions
  fnName = InRangeFunction::getFunctionName(StringAttribute::getIdentifier());
  argType = StringAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new InRangeFunction(fnName, argType)));

  fnName = InRangeFunction::getFunctionName(PeriodAttribute::getIdentifier());
  argType = PeriodAttribute::getIdentifier();
  fnmap.insert(std::pair<std::string, Function*>(fnName, new InRangeFunction(fnName, argType)));

}

Member Data Documentation

FnMap ArcSec::FnFactory::fnmap [protected, inherited]

Definition at line 32 of file FnFactory.h.


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