Package ndg :: Package xacml :: Package core :: Package context :: Module subject
[hide private]

Source Code for Module ndg.xacml.core.context.subject

 1  """NDG XACML Context Subject type 
 2   
 3  NERC DataGrid 
 4  """ 
 5  __author__ = "P J Kershaw" 
 6  __date__ = "24/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: subject.py 7087 2010-06-25 11:23:09Z pjkersha $" 
12  from ndg.xacml.core.context import RequestChildBase 
13   
14   
15 -class Subject(RequestChildBase):
16 """XACML Context Subject type 17 18 @cvar ELEMENT_LOCAL_NAME: XML Local Name of this element 19 @type ELEMENT_LOCAL_NAME: string 20 21 @cvar SUBJECT_CATEGORY_ATTRIB_NAME: subject category XML attribute name 22 @type SUBJECT_CATEGORY_ATTRIB_NAME: string 23 24 @ivar __subjectCategory: subject category XML attribute name 25 @type __subjectCategory: string 26 """ 27 ELEMENT_LOCAL_NAME = 'Subject' 28 SUBJECT_CATEGORY_ATTRIB_NAME = 'SubjectCategory' 29 30 __slots__ = ('__subjectCategory',) 31
32 - def __init__(self):
33 super(Subject, self).__init__() 34 self.__subjectCategory = None
35
36 - def _get_subjectCategory(self):
37 """Get subject category 38 39 @return: subject category XML attribute name 40 @rtype: string 41 """ 42 return self.__subjectCategory
43
44 - def _set_subjectCategory(self, value):
45 """Set subject category 46 47 @param value: subject category XML attribute name 48 @type value: string 49 50 @raise TypeError: incorrect type for input 51 """ 52 if not isinstance(value, basestring): 53 raise TypeError('Expecting %r type for "subjectCategory" ' 54 'attribute; got %r' % (basestring, type(value))) 55 56 self.__subjectCategory = value
57 58 subjectCategory = property(_get_subjectCategory, _set_subjectCategory, None, 59 "Subject category")
60