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

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

 1  """NDG Security Context handler base class 
 2   
 3  NERC DataGrid 
 4  """ 
 5  __author__ = "P J Kershaw" 
 6  __date__ = "24/02/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: handler.py 7665 2010-10-28 13:48:06Z pjkersha $" 
12  from ndg.xacml.core.context.handlerinterface import CtxHandlerInterface 
13  from ndg.xacml.core.context.pdpinterface import PDPInterface 
14  from ndg.xacml.core.context.pipinterface import PIPInterface 
15       
16   
17 -class CtxHandlerBase(CtxHandlerInterface):
18 """Base class for Context handlers - extends Context handler interface to 19 include Policy Decision Point and Policy Information Point references 20 """ 21 22 __slots__ = ( 23 '__pip', 24 '__pdp', 25 ) 26
27 - def __init__(self):
28 self.__pip = None 29 self.__pdp = None
30
31 - def _getPip(self):
32 return self.__pip
33
34 - def _setPip(self, value):
35 if not isinstance(value, PIPInterface): 36 raise TypeError('Expecting %r type for "pip" attribute; got %r ' 37 'instead' % 38 (PIPInterface, value)) 39 40 self.__pip = value
41 42 pip = property(_getPip, _setPip, None, "Policy Information Point") 43
44 - def _getPdp(self):
45 return self.__pdp
46
47 - def _setPdp(self, value):
48 if not isinstance(value, PDPInterface): 49 raise TypeError('Expecting %r type for "pdp" attribute; got %r ' 50 'instead' % 51 (PDPInterface, value)) 52 53 self.__pdp = value
54 55 pdp = property(_getPdp, _setPdp, None, "Policy Decision Point")
56