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

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

 1  """NDG XACML module for Response type  
 2   
 3  NERC DataGrid 
 4  """ 
 5  __author__ = "P J Kershaw" 
 6  __date__ = "23/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: response.py 8010 2012-01-30 16:24:06Z rwilkinson $" 
12  import logging 
13  log = logging.getLogger(__name__) 
14   
15  from ndg.xacml.utils import TypedList 
16  from ndg.xacml.core.context import XacmlContextBase 
17  from ndg.xacml.core.context.result import Result 
18 19 20 -class Response(XacmlContextBase):
21 """XACML Response type 22 @cvar ELEMENT_LOCAL_NAME: XML local element name for the response 23 @type ELEMENT_LOCAL_NAME: string 24 25 @ivar __results: resource content 26 @type __results: ndg.xacml.utils.TypedList 27 """ 28 ELEMENT_LOCAL_NAME = 'Response' 29 30 __slots__ = ('__results', ) 31
32 - def __init__(self):
33 """"Initialise results list""" 34 super(Response, self).__init__() 35 self.__results = TypedList(Result)
36 37 @property
38 - def results(self):
39 """Get Response results list 40 41 @return: results list 42 @rtype: ndg.xacml.utils.TypedList 43 """ 44 return self.__results
45
46 - def __getstate__(self):
47 '''Enable pickling 48 49 @return: object's attribute dictionary 50 @rtype: dict 51 ''' 52 _dict = super(Response, self).__getstate__() 53 for attrName in Response.__slots__: 54 # Ugly hack to allow for derived classes setting private member 55 # variables 56 if attrName.startswith('__'): 57 attrName = "_Response" + attrName 58 59 _dict[attrName] = getattr(self, attrName) 60 61 return _dict
62