source: TI12-security/trunk/NDG_XACML/ndg/xacml/core/apply.py @ 6753

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDG_XACML/ndg/xacml/core/apply.py@6793
Revision 6753, 1.4 KB checked in by pjkersha, 10 years ago (diff)

Started adding parsing for Condition and Apply types.

Line 
1"""NDG Security Condition type definition
2
3NERC DataGrid Project
4"""
5__author__ = "P J Kershaw"
6__date__ = "19/03/10"
7__copyright__ = "(C) 2010 Science and Technology Facilities Council"
8__contact__ = "Philip.Kershaw@stfc.ac.uk"
9__license__ = "BSD - see LICENSE file in top-level directory"
10__contact__ = "Philip.Kershaw@stfc.ac.uk"
11__revision__ = "$Id: $"
12from ndg.xacml.utils import TypedList
13from ndg.xacml.core.expression import Expression
14
15
16class Apply(Expression):
17    """XACML Apply type"""
18    ELEMENT_LOCAL_NAME = 'Apply'
19    FUNCTION_ID_ATTRIB_NAME = 'FunctionId'
20   
21    __slots__ = ('__functionId', '__expressions')
22   
23    def __init__(self):
24        super(Apply, self).__init__()
25        self.__functionId = None
26        self.__expressions = TypedList(Expression)
27       
28    def _get_functionId(self):
29        return self.__functionId
30
31    def _set_functionId(self, value):
32        if not isinstance(value, basestring):
33            raise TypeError('Expecting %r type for "functionId" '
34                            'attribute; got %r' % (basestring, type(value)))
35           
36        self.__functionId = value   
37
38    functionId = property(_get_functionId, _set_functionId, None, 
39                          "Apply type Function ID") 
40   
41    @property
42    def expressions(self):
43        """List of expression sub-elements"""
44        return self.__expressions
45         
Note: See TracBrowser for help on using the repository browser.