Package ndg :: Package xacml :: Package core :: Module attributevalue :: Class AttributeValue
[hide private]

Class AttributeValue

source code

       object --+        
                |        
    XacmlCoreBase --+    
                    |    
expression.Expression --+
                        |
                       AttributeValue
Known Subclasses:

XACML Attribute Value type

Nested Classes [hide private]

Inherited from expression.Expression: __metaclass__

Instance Methods [hide private]
 
__init__(self, value=None)
Derived classes must override setting TYPE class variable
source code
 
__repr__(self)
repr(x)
source code
 
__eq__(self, attrVal)
Check for equality by comparing the value attributes
source code
any - constrained in derived classes
_get_value(self)
Get value
source code
 
_set_value(self, value)
Set value
source code
AttributeValue
evaluate(self, context)
Evaluate the result of the expression in a condition.
source code
dict
__getstate__(self)
Enable pickling
source code

Inherited from XacmlCoreBase (private): _getXmlns, _setXmlns

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

Class Variables [hide private]
NoneType but implement as string in derived classes ELEMENT_LOCAL_NAME = 'AttributeValue'
XML element local name for the given type
string CLASS_NAME_SUFFIX = 'AttributeValue'
all attribute value classes end with this suffix
string IDENTIFIER_PREFIX = 'http://www.w3.org/2001/XMLSchema#'
geberic prefix for attribute value URNs
NoneType - derived classes should set to appropriate string IDENTIFIER = None
URN for attribute value in derived class
  STRING_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#string'
  ANY_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#anyURI'
  INTEGER_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#integer'
  BOOLEAN_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#boolean'
  DOUBLE_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#double'
  DATE_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#date'
  DATETIME_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#dateTime'
  TIME_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#time'
  DAYTIMEDURATION_TYPE_URI = 'http://www.w3.org/TR/2002/WD-xquer...
  YEARMONTHDURATION_TYPE_URI = 'http://www.w3.org/TR/2002/WD-xqu...
  X500NAME_TYPE_URI = 'urn:oasis:names:tc:xacml:1.0:data-type:x5...
  RFC822NAME_TYPE_URI = 'urn:oasis:names:tc:xacml:1.0:data-type:...
  HEXBINARY_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#hexBinary'
  BASE64BINARY_TYPE_URI = 'http://www.w3.org/2001/XMLSchema#base...
  IPADDRESS_TYPE_URI = 'urn:oasis:names:tc:xacml:2.0:data-type:i...
  DNSNAME_TYPE_URI = 'urn:oasis:names:tc:xacml:2.0:data-type:dns...
tuple TYPE_URIS = ('http://www.w3.org/2001/XMLSchema#string', 'http:...
URIs for all the different supported types
tuple TYPE_NAMES = ('String', 'AnyURI', 'Integer', 'Boolean', 'Doubl...
corresponding short names for all the types
  NATIVE_TYPES = (<type 'basestring'>, <type 'basestring'>, <typ...
equivalent python types as implemented
dict TYPE_MAP = {'AnyURI': <type 'basestring'>, 'Base64Binary': Not...
mapping from type names to python types
dict TYPE_URI_MAP = {'AnyURI': 'http://www.w3.org/2001/XMLSchema#an...
mapping from type names to type URIs
NoneType / string in derived type TYPE = None
type name for derived type - set to None in this parent class
  __abstractmethods__ = frozenset([])
  _abc_cache = <_weakrefset.WeakSet object at 0x1011b9910>

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]
any - constrained in derived classes __value
setting for this attribute value
Properties [hide private]
  value
expression value

Inherited from expression.Expression: dataType

Inherited from XacmlCoreBase: elem, isValidXmlns, xmlns

Inherited from object: __class__

Method Details [hide private]

__init__(self, value=None)
(Constructor)

source code 

Derived classes must override setting TYPE class variable

Parameters:
  • value ((set by self.__class__.TYPE)) - initialise the attribute value by setting this keyword
Raises:
  • NotImplementedError - derived classes must set ELEMENT_LOCAL_NAME to a string
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

_get_value(self)

source code 

Get value

Returns: any - constrained in derived classes
setting for this attribute value

_set_value(self, value)

source code 

Set value

Parameters:
  • value (any - constrained in derived classes) - setting for this attribute value
Raises:
  • TypeError - if type doesn't match TYPE class variable. Derived classes should set this

evaluate(self, context)

source code 

Evaluate the result of the expression in a condition. In the case of an attribute value it's simply itself

Parameters:
  • context (ndg.xacml.core.context.request.Request) - the request context
Returns: AttributeValue
this attribute value
Overrides: expression.Expression.evaluate

__getstate__(self)

source code 

Enable pickling

Returns: dict
object's attribute dictionary
Overrides: XacmlCoreBase.__getstate__

Class Variable Details [hide private]

DAYTIMEDURATION_TYPE_URI

Value:
'http://www.w3.org/TR/2002/WD-xquery-operators-20020816#dayTimeDuratio\
n'

YEARMONTHDURATION_TYPE_URI

Value:
'http://www.w3.org/TR/2002/WD-xquery-operators-20020816#yearMonthDurat\
ion'

X500NAME_TYPE_URI

Value:
'urn:oasis:names:tc:xacml:1.0:data-type:x500Name'

RFC822NAME_TYPE_URI

Value:
'urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name'

BASE64BINARY_TYPE_URI

Value:
'http://www.w3.org/2001/XMLSchema#base64Binary'

IPADDRESS_TYPE_URI

Value:
'urn:oasis:names:tc:xacml:2.0:data-type:ipAddress'

DNSNAME_TYPE_URI

Value:
'urn:oasis:names:tc:xacml:2.0:data-type:dnsName'

TYPE_URIS

URIs for all the different supported types
Type:
tuple
Value:
('http://www.w3.org/2001/XMLSchema#string',
 'http://www.w3.org/2001/XMLSchema#anyURI',
 'http://www.w3.org/2001/XMLSchema#integer',
 'http://www.w3.org/2001/XMLSchema#boolean',
 'http://www.w3.org/2001/XMLSchema#double',
 'http://www.w3.org/2001/XMLSchema#date',
 'http://www.w3.org/2001/XMLSchema#dateTime',
 'http://www.w3.org/2001/XMLSchema#time',
...

TYPE_NAMES

corresponding short names for all the types
Type:
tuple
Value:
('String',
 'AnyURI',
 'Integer',
 'Boolean',
 'Double',
 'Date',
 'DateTime',
 'Time',
...

NATIVE_TYPES

equivalent python types as implemented
Value:
(<type 'basestring'>,
 <type 'basestring'>,
 <type 'int'>,
 <type 'bool'>,
 <type 'float'>,
 <type 'datetime.datetime'>,
 <type 'datetime.datetime'>,
 <type 'datetime.datetime'>,
...

TYPE_MAP

mapping from type names to python types
Type:
dict
Value:
{'AnyURI': <type 'basestring'>,
 'Base64Binary': NotImplemented,
 'Boolean': <type 'bool'>,
 'Date': <type 'datetime.datetime'>,
 'DateTime': <type 'datetime.datetime'>,
 'DayTimeDuration': <type 'datetime.timedelta'>,
 'DnsName': <type 'basestring'>,
 'Double': <type 'float'>,
...

TYPE_URI_MAP

mapping from type names to type URIs
Type:
dict
Value:
{'AnyURI': 'http://www.w3.org/2001/XMLSchema#anyURI',
 'Base64Binary': 'http://www.w3.org/2001/XMLSchema#base64Binary',
 'Boolean': 'http://www.w3.org/2001/XMLSchema#boolean',
 'Date': 'http://www.w3.org/2001/XMLSchema#date',
 'DateTime': 'http://www.w3.org/2001/XMLSchema#dateTime',
 'DayTimeDuration': 'http://www.w3.org/TR/2002/WD-xquery-operators-200\
20816#dayTimeDuration',
 'DnsName': 'urn:oasis:names:tc:xacml:2.0:data-type:dnsName',
...

Property Details [hide private]

value

expression value

Get Method:
_get_value(self) - Get value
Set Method:
_set_value(self, value) - Set value