Package ndg :: Package xacml :: Package core :: Module apply :: Class Apply
[hide private]

Class Apply

source code

       object --+        
                |        
    XacmlCoreBase --+    
                    |    
expression.Expression --+
                        |
                       Apply

XACML Apply type

Nested Classes [hide private]

Inherited from expression.Expression: __metaclass__

Instance Methods [hide private]
 
__init__(self)
Initialise attributes
source code
basestring/NoneType
_get_functionId(self)
Get function ID
source code
 
_set_functionId(self, value)
Set function ID
source code
 
setFunctionFromMap(self, functionMap)
Set the function from a function map - a dictionary of function ID to function mappings.
source code
AttributeValue/NoneType
evaluate(self, context)
Evaluate a given <Apply> statement in a rule condition
source code

Inherited from expression.Expression: __getstate__

Inherited from XacmlCoreBase (private): _getXmlns, _setXmlns

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
NoneType but implement as string in derived classes ELEMENT_LOCAL_NAME = 'Apply'
XML element local name for the given type
string FUNCTION_ID_ATTRIB_NAME = 'FunctionId'
function ID XML attribute name
  __abstractmethods__ = frozenset([])

Inherited from expression.Expression: DATA_TYPE_ATTRIB_NAME

Inherited from XacmlCoreBase: XACML_1_0_NS_PREFIX, XACML_2_0_NS_PREFIX, XMLNS

Instance Variables [hide private]
ndg.xacml.utils.TypedList __expressions
list of expressions contained in the Apply statement
ndg.xacml.core.functions.AbstractFunction derived type __function
function to be applied
basestring/NoneType __functionId
URN corresponding to function to be applied
ndg.xacml.core.functions.FunctionMap __functionMap
function mapping object to map URNs to function class implementations
bool __loadFunctionFromId
boolean determines whether or not to load function classes for given function URN in functionId set property method
Properties [hide private]
bool loadFunctionFromId
Set to False to stop the functionId property set method automatically trying to load the corresponding function for the given functionId
  functionId
Apply type Function ID
ndg.xacml.core.functions.FunctionMap functionMap
functionMap object for PDP to retrieve functions from given XACML function URNs
ndg.xacml.core.functions.AbstractFunction derived type function
Get Function for this <Apply> instance
ndg.xacml.utils.TypedList expressions
List of expression sub-elements

Inherited from expression.Expression: dataType

Inherited from XacmlCoreBase: elem, isValidXmlns, xmlns

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initialise attributes

Raises:
  • NotImplementedError - derived classes must set ELEMENT_LOCAL_NAME to a string
Overrides: object.__init__

_get_functionId(self)

source code 

Get function ID

Returns: basestring/NoneType
function ID for this Apply statement

_set_functionId(self, value)

source code 

Set function ID

Parameters:
  • value (basestring) - function URN
Raises:
  • TypeError - incorrect input type

setFunctionFromMap(self, functionMap)

source code 

Set the function from a function map - a dictionary of function ID to function mappings. The function is looked up based on the "functionId" attribute. This method is automatically called when the functionId set property method is invoked. To switch off this behaviour set

loadFunctionFromId = False

Parameters:
  • functionMap (ndg.xacml.core.functions.FunctionMap) - function mapping object to map URNs to function class implementations
Raises:

evaluate(self, context)

source code 

Evaluate a given <Apply> statement in a rule condition

Parameters:
  • context (ndg.xacml.core.context.request.Request) - the request context
Returns: AttributeValue/NoneType
attribute value(s) resulting from execution of this expression in a condition
Overrides: expression.Expression.evaluate

Property Details [hide private]

loadFunctionFromId

Set to False to stop the functionId property set method automatically trying to load the corresponding function for the given functionId

Get Method:
unreachable.loadFunctionFromId(self) - Set to False to stop the functionId property set method automatically trying to load the corresponding function for the given functionId
Set Method:
unreachable.loadFunctionFromId(self, value) - Set to False to stop the functionId property set method automatically trying to load the corresponding function for the given functionId
Type:
bool

functionId

Apply type Function ID

Get Method:
_get_functionId(self) - Get function ID
Set Method:
_set_functionId(self, value) - Set function ID

functionMap

functionMap object for PDP to retrieve functions from given XACML function URNs

Get Method:
unreachable.functionMap(self) - functionMap object for PDP to retrieve functions from given XACML function URNs
Set Method:
unreachable.functionMap(self, value) - functionMap object for PDP to retrieve functions from given XACML function URNs
Type:
ndg.xacml.core.functions.FunctionMap

function

Get Function for this <Apply> instance

Get Method:
unreachable.function(self) - Get Function for this <Apply> instance
Type:
ndg.xacml.core.functions.AbstractFunction derived type

expressions

List of expression sub-elements

Get Method:
unreachable.expressions(self) - List of expression sub-elements
Type:
ndg.xacml.utils.TypedList