org.example.azapi
Interface AzAttributeValue<U extends java.lang.Enum<U> & AzDataTypeId,V>
- All Known Subinterfaces:
- AzAttributeValueAnyURI, AzAttributeValueBase64Binary, AzAttributeValueBoolean, AzAttributeValueDate, AzAttributeValueDateTime, AzAttributeValueDayTimeDuration, AzAttributeValueDnsName, AzAttributeValueDouble, AzAttributeValueHexBinary, AzAttributeValueInteger, AzAttributeValueIpAddress, AzAttributeValueRfc822Name, AzAttributeValueString, AzAttributeValueTime, AzAttributeValueX500Name, AzAttributeValueYearMonthDuration
public interface AzAttributeValue<U extends java.lang.Enum<U> & AzDataTypeId,V>
AzAttributeValue is the parent interface of all the subinterfaces
that provide for the implementation of each XACML DataType as
enumerated by the enums that implement AzDataTypeId
.
Subinterfaces of AzAttributeValue are implemented to meet the requirements
of each individual XACML DataType.
The basic design is that a Java object, which can handle the
requirements of the AzDataType be used for setValue(T). For
example, in the case of XACML #anyURI, the Java URI type is
used to meet those requirements.
In some cases there will be an obvious one to one mapping between
the XACML DataType identified by an AzDataType and a Java type
that meets the XACML DataType requirements.
In other cases there may be more complexity than a single available
Java class required to meet the requirements specified by the XACML
DataType. In those cases, custom interfaces may be implemented to
meet the requirements, as exampled by the AzData* interfaces that
are used for some interfaces.
Subclasses of AzAttributeValue are "type-safe" in the sense that they
define corresponding AzDataType and AzAttributeValueType members which
ensure that only the specific XACML DataType identifier (AzDataType)
that corresponds to the AzAttributeValueType subinterface are
kept together in a an AzAttributeValue subinterface of this
class.
Note: the Sun XACML Implementation:
http://sunxacml.sourceforge.net/javadoc/index.html
was used as the basis for defining the characteristics of many of
these datatypes, esp wrt to dates, times, durations, byte[], etc.
Note: it is an objective of the AzAPI to be able to "wrap" the
Sun XACML Client Implementation for the purpose of serializing
xml calls to the Sun XACML PDP. Note also in this regard that the
AzAPI is intended to be XACML 2.0 compliant, while the Sun
Implementation is a pre-XACML 2.0 implementation and lacks several
XACML 2.0 features. i.e. the AzAPI is intended to be "downward
compatible" to subset implementations.
- Author:
- Rich
Method Summary |
U |
getType()
Return the XACML DataType of this attribute |
V |
getValue()
Return the value in the Java object used to represent the
XACML DataType. |
void |
setValue(V azVal)
Set the AzAttributeValueType, which contains an actual instance
of a value for this attribute. |
java.lang.String |
toXacmlString()
Return a String which can be used in an XML representation
of the XACML Request. |
boolean |
validate()
Validate the value stored in this AzAttributeValue instance
against any internally specified constraints. |
getType
U getType()
- Return the XACML DataType of this attribute
- Returns:
- azDataType
setValue
void setValue(V azVal)
- Set the AzAttributeValueType, which contains an actual instance
of a value for this attribute. The subclass implementations of
the AzAttributeValueType will constrain the value data to
conform with the requirements of the AzDataType.
value
TBD: should this member be immutable?
- Parameters:
azVal
-
getValue
V getValue()
- Return the value in the Java object used to represent the
XACML DataType. This object will contain the value from
which the XACML value is derived, but it is not necessarily
the format necessary for XACML. The XACML value is obtained
from the toXacmlString() method.
- Returns:
- value
toXacmlString
java.lang.String toXacmlString()
- Return a String which can be used in an XML representation
of the XACML Request.
- Returns:
- the XACML String representation of the attribute's value
validate
boolean validate()
- Validate the value stored in this AzAttributeValue instance
against any internally specified constraints.
Subtype interfaces should override this method as it will
in general be implemented distinctively for each XACML
DataType.
Default return value is true, if validate() not implemented.
- Returns:
- true if valid; false if constraint violated