Ignore:
Timestamp:
14/04/10 09:45:50 (9 years ago)
Author:
pjkersha
Message:

Working class factories for each function module. Function class evaluate methods need to be refactored to accept *AttributeValue? types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDG_XACML/ndg/xacml/core/functions/v1/round.py

    r6803 r6804  
    99__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1010__revision__ = '$Id: $' 
    11 from ndg.xacml.core.functions import AbstractFunction, FunctionClassFactoryBase 
     11from ndg.xacml.core.functions import (AbstractFunction,  
     12                                      FunctionClassFactoryInterface) 
    1213from ndg.xacml.core.context.exceptions import XacmlContextTypeError 
    1314 
    1415 
    15 class RoundBase(AbstractFunction): 
     16class Round(AbstractFunction): 
    1617    """Base class for XACML <type>-round functions""" 
    1718    FUNCTION_NS = AbstractFunction.V1_0_FUNCTION_NS + 'round' 
     
    2930 
    3031     
    31  
    32 class FunctionClassFactory(FunctionClassFactoryBase): 
    33     """Class Factory for *-round XACML function classes 
     32class FunctionClassFactory(FunctionClassFactoryInterface): 
     33    """Class Factory for round XACML function class 
    3434    """ 
    35     FUNCTION_NS_SUFFIX = '-round' 
    36     FUNCTION_BASE_CLASS = RoundBase 
     35    def __call__(self, identifier): 
     36        '''Create class for the Round XACML function identifier 
     37         
     38        @param identifier: XACML round function identifier 
     39        @type identifier: basestring 
     40        @return: round function class or None if identifier doesn't match 
     41        @rtype: ndg.xacml.core.functions.v1.round.Round / NoneType 
     42        ''' 
     43        if identifier == Round.FUNCTION_NS: 
     44            return Round 
     45        else: 
     46            return None 
Note: See TracChangeset for help on using the changeset viewer.