public interface AttributeValueFactoryRegistry extends PdpExtensionRegistry<AttributeValueFactory<?>>
A valid key in this registry, i.e. valid argument for PdpExtensionRegistry.getExtension(String)
, is an identifier of a datatype corresponding to the value factory, as returned by
PdpExtension.getId()
PdpExtensionRegistry.PdpExtensionComparator<E extends PdpExtension>
Modifier and Type | Method and Description |
---|---|
AttributeValueFactory<?> |
getCompatibleFactory(Class<? extends Serializable> rawValueClass)
Get value factory that can handle a given class of Java values
|
AttributeBag<?> |
newAttributeBag(Collection<? extends Serializable> rawValues)
Same as
newAttributeBag(Collection, AttributeSource) but with attributeValueSource set to AttributeSources.REQUEST |
AttributeBag<?> |
newAttributeBag(Collection<? extends Serializable> rawValues,
AttributeSource attributeValueSource)
Creates an
AttributeBag (bag of AttributeValue s) from collection of raw values using best compatible AttributeValueFactory available in this registry; compatible
means that it supports the raw value types as input types. |
AttributeValue |
newAttributeValue(Serializable rawValue)
Creates an
AttributeValue from raw value using best compatible AttributeValueFactory available in this registry; compatible means that it supports
rawValue.getClass() as input type |
ConstantExpression<? extends AttributeValue> |
newExpression(String datatypeId,
List<Serializable> content,
Map<QName,String> otherAttributes,
net.sf.saxon.s9api.XPathCompiler xPathCompiler)
Create internal model's AttributeValue expression
|
getExtension, getExtensions
ConstantExpression<? extends AttributeValue> newExpression(String datatypeId, List<Serializable> content, Map<QName,String> otherAttributes, net.sf.saxon.s9api.XPathCompiler xPathCompiler) throws IllegalArgumentException
datatypeId
- attribute datatype IDcontent
- raw value's mixed content, e.g. an element might be a String
for text, or Element
for XML element in the case of core XACML (XML) implemented with JAXB
framework; or possibly Number
or Boolean
in the case of JSON Profile of XACML implemented with common JSON frameworks. This list is a singleton in most cases.otherAttributes
- (mandatory) other XML attributes of the value node, may be empty if none (but not null)xPathCompiler
- XPath compiler for evaluating/compiling any XPath expression in value
ConstantExpression
for constant AttributeValues, or something like XPathExpression for context-dependent
xpathExpression-type of AttributeValues (quite similar to AttributeSelector)IllegalArgumentException
- value datatype unknown/not supported, or if value cannot be parsed into the value's defined datatypeAttributeValueFactory<?> getCompatibleFactory(Class<? extends Serializable> rawValueClass)
rawValueClass
- AttributeValue newAttributeValue(Serializable rawValue) throws IllegalArgumentException, UnsupportedOperationException
AttributeValue
from raw value using best compatible AttributeValueFactory
available in this registry; compatible means that it supports
rawValue.getClass()
as input typerawValue
- raw value to be converted to AttributeValue
AttributeValue
in internal model for (XACML) policy evaluationIllegalArgumentException
- if rawValue
is of the right type but actual value content is not valid for the selected (best compatible available) AttributeValueFactory
. For example, some
factories for numeric (e.g. integer, double) input may not support all kinds of integer (from -Infinity to +Infinity) but only in a limited range.UnsupportedOperationException
- if rawValue.getClass()
is not an input type supported by any AttributeValueFactory
in this registryAttributeBag<?> newAttributeBag(Collection<? extends Serializable> rawValues, AttributeSource attributeValueSource) throws UnsupportedOperationException, IllegalArgumentException
AttributeBag
(bag of AttributeValue
s) from collection of raw values using best compatible AttributeValueFactory
available in this registry; compatible
means that it supports the raw value types as input types. Beware that a bag has a single (XACML) datatype, so all value types must correspond to a single (XACML) datatype. Therefore, to
prevent unexpected behavior, rawVals
should all have the same concrete type. In other words, mixing different concrete Java types may cause IllegalArgumentException
. For
example, do not mix Integer (likely to be mapped to XACML integer) and Double (likely to be map to XACML double).rawValues
- raw values to be converted to AttributeBag
attributeValueSource
- attribute value sourceAttributeBag
in internal model for (XACML) policy evaluationIllegalArgumentException
- if one of the rawValues
is of the right type but actual value content is not valid for the selected (best compatible available) AttributeValueFactory
(for example,
some factories for numeric input, e.g. integer or double, may not support all kinds of integer (from -Infinity to +Infinity) but only in a limited range); or rawValues
do
not have a common type that can be mapped to a common (XACML) AttributeValue datatype, i.e. the input type mixing is not allowed by the factory.UnsupportedOperationException
- if one of the rawValues
does not have a type supported by any AttributeValueFactory
as input type in this registryAttributeBag<?> newAttributeBag(Collection<? extends Serializable> rawValues) throws UnsupportedOperationException, IllegalArgumentException
newAttributeBag(Collection, AttributeSource)
but with attributeValueSource
set to AttributeSources.REQUEST
rawValues
- raw values to be converted to AttributeBag
AttributeBag
in internal model for (XACML) policy evaluationIllegalArgumentException
- if one of the rawValues
is of the right type but actual value content is not valid for the selected (best compatible available) AttributeValueFactory
(for example,
some factories for numeric input, e.g. integer or double, may not support all kinds of integer (from -Infinity to +Infinity) but only in a limited range); or rawValues
do
not have a common type that can be mapped to a common (XACML) AttributeValue datatype, i.e. the input type mixing is not allowed by the factory.UnsupportedOperationException
- if one of the rawValues
does not have a type supported by any AttributeValueFactory
as input type in this registryCopyright © 2012–2020. All rights reserved.