Ignore:
Timestamp:
28/10/10 16:39:24 (10 years ago)
Author:
pjkersha
Message:

Modified apply and match classes to use a FunctionMap? class singleton to enable easy addition of new function types.

Location:
TI12-security/trunk/ndg_xacml/ndg/xacml/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/ndg_xacml/ndg/xacml/core/apply.py

    r7365 r7668  
    1212from ndg.xacml.utils import TypedList 
    1313from ndg.xacml.core.expression import Expression 
    14 from ndg.xacml.core.functions import (FunctionMap, UnsupportedStdFunctionError, 
     14from ndg.xacml.core.functions import (FunctionMap, functionMap, 
     15                                      UnsupportedStdFunctionError, 
    1516                                      UnsupportedFunctionError) 
    1617 
     
    5354        self.__functionId = None 
    5455        self.__function = None 
    55         self.__functionMap = FunctionMap() 
     56        self.__functionMap = functionMap 
    5657        self.__loadFunctionFromId = True 
    5758        self.__expressions = TypedList(Expression) 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/core/functions/__init__.py

    r7351 r7668  
    598598        return True  
    599599            
    600     def loadAll(self): 
    601         """Load function map with implementations from the relevant function 
    602         package""" 
     600    def loadAllCore(self): 
     601        """Load all core XACML functions""" 
    603602         
    604603        for functionNs in XacmlFunctionNames.FUNCTION_NAMES: 
     
    698697            return functionClass 
    699698 
    700  
    701          
     699# Function map singleton used by match and apply classes - add new keys to 
     700# this dictionary to enable support for custom functions 
     701functionMap = FunctionMap() 
     702         
  • TI12-security/trunk/ndg_xacml/ndg/xacml/core/match.py

    r7351 r7668  
    1717from ndg.xacml.core.attributedesignator import AttributeDesignator 
    1818from ndg.xacml.core.attributeselector import AttributeSelector 
    19 from ndg.xacml.core.functions import (FunctionMap, UnsupportedStdFunctionError, 
     19from ndg.xacml.core.functions import (FunctionMap, functionMap, 
     20                                      UnsupportedStdFunctionError, 
    2021                                      UnsupportedFunctionError) 
    2122from ndg.xacml.core.context.exceptions import XacmlContextError 
     
    8283         
    8384        self.__function = None 
    84         self.__functionMap = FunctionMap() 
     85        self.__functionMap = functionMap 
    8586        self.__loadFunctionFromId = True 
    8687         
Note: See TracChangeset for help on using the changeset viewer.