Class AttributeImpl
- java.lang.Object
-
- com.sun.identity.xacml.context.impl.AttributeImpl
-
- All Implemented Interfaces:
Attribute
public class AttributeImpl extends Object implements Attribute
TheAttributeelement specifies information about the action/subject/resource requested in theRequestcontext by listing a sequence ofAttributeelements associated with the action.<xs:element name="Attribute" type="xacml-context:AttributeType"/> <xs:complexType name="AttributeType"> <xs:sequence> <xs:element ref="xacml-context:AttributeValue" maxOccurs="unbounded"/> <xs:sequence> <xs:attribute name="AttributeId" type="xs:anyURI" use="required"/> <xs:attribute name="DataType" type="xs:anyURI" use="required"/> <xs:attribute name="Issuer" type="xs:string" use="optional"/> <xs:complexType>
-
-
Constructor Summary
Constructors Constructor Description AttributeImpl()Default constructorAttributeImpl(String xml)This constructor is used to buildAttributeobject from a XML string.AttributeImpl(Element element)This constructor is used to buildRequestobject from a block of existing XML that has already been built into a DOM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URIgetAttributeId()Returns the AttributeId of theAttributewhich the attribute identifier.ListgetAttributeValues()Returns one to many values in theAttributeValueelements of this objectURIgetDataType()Returns the datatype of the contents of theAttributeValueelements.StringgetIssuer()Returns the issuer of theAttribute.booleanisMutable()Checks if the object is mutablevoidmakeImmutable()Makes the object immutablevoidsetAttributeId(URI attributeId)Sets the attribiteId of the>AttributevoidsetAttributeStringValues(List stringValues)Sets the attribute values for this objectvoidsetAttributeValues(List values)Sets theAttributeValueelements of this objectvoidsetDataType(URI dataType)Sets the data type of the contents of theAttributeValueelements.voidsetIssuer(String issuer)Sets the issuer of theAttribute.StringtoXMLString()Returns a string representation of this objectStringtoXMLString(boolean includeNSPrefix, boolean declareNS)Returns aStringrepresentation of this object
-
-
-
Constructor Detail
-
AttributeImpl
public AttributeImpl()
Default constructor
-
AttributeImpl
public AttributeImpl(String xml) throws XACMLException
This constructor is used to buildAttributeobject from a XML string.- Parameters:
xml- Ajava.lang.Stringrepresenting anAttributeobject- Throws:
XACMLException- if it could not process the XML string
-
AttributeImpl
public AttributeImpl(Element element) throws XACMLException
This constructor is used to buildRequestobject from a block of existing XML that has already been built into a DOM.- Parameters:
element- Aorg.w3c.dom.Elementrepresenting DOM tree forRequestobject- Throws:
XACML2Exception- if it could not process the ElementXACMLException
-
-
Method Detail
-
getIssuer
public String getIssuer()
Returns the issuer of theAttribute.
-
setIssuer
public void setIssuer(String issuer) throws XACMLException
Sets the issuer of theAttribute.- Specified by:
setIssuerin interfaceAttribute- Parameters:
issuer-Stringrepresenting the issuer. It MAY be an x500Name that binds to a public key or some other identification exchanged out-of-band by participating entities. This is optional so return value could be null or an emptyString.- Throws:
XACMLException- if the object is immutable
-
getAttributeId
public URI getAttributeId()
Returns the AttributeId of theAttributewhich the attribute identifier.- Specified by:
getAttributeIdin interfaceAttribute- Returns:
- the
URIrepresenting the data type.
-
setAttributeId
public void setAttributeId(URI attributeId) throws XACMLException
Sets the attribiteId of the>Attribute- Specified by:
setAttributeIdin interfaceAttribute- Parameters:
attributeId-URIrepresenting the attribite id.- Throws:
XACMLException- if the object is immutable
-
getDataType
public URI getDataType()
Returns the datatype of the contents of theAttributeValueelements. This will be either a primitive datatype defined by XACML 2.0 specification or a type ( primitive or structured) defined in a namespace declared in theelement. - Specified by:
getDataTypein interfaceAttribute- Returns:
- the
URIrepresenting the data type.
-
setDataType
public void setDataType(URI dataType) throws XACMLException
Sets the data type of the contents of theAttributeValueelements.- Specified by:
setDataTypein interfaceAttribute- Parameters:
dataType-URIrepresenting the data type.- Throws:
XACMLException- if the object is immutable
-
getAttributeValues
public List getAttributeValues()
Returns one to many values in theAttributeValueelements of this object- Specified by:
getAttributeValuesin interfaceAttribute- Returns:
- the List containing
Elements representing theAttributeValueof this object
-
setAttributeValues
public void setAttributeValues(List values) throws XACMLException
Sets theAttributeValueelements of this object- Specified by:
setAttributeValuesin interfaceAttribute- Parameters:
values- aListcontaining Element representingAttributeValueof this object.- Throws:
XACMLException- if the object is immutable An object is consideredimmutableifmakeImmutable()has been invoked on it. It can be determined by callingisMutableon the object.
-
setAttributeStringValues
public void setAttributeStringValues(List stringValues) throws XACMLException
Sets the attribute values for this object- Specified by:
setAttributeStringValuesin interfaceAttribute- Parameters:
stringValues- aListcontainingStringvalues of this object.- Throws:
XACMLException- if the object is immutable An object is consideredimmutableifmakeImmutable()has been invoked on it. It can be determined by callingisMutableon the object.
-
toXMLString
public String toXMLString(boolean includeNSPrefix, boolean declareNS) throws XACMLException
Returns aStringrepresentation of this object- Specified by:
toXMLStringin interfaceAttribute- Parameters:
includeNSPrefix- Determines whether or not the namespace qualifier is prepended to the Element when converteddeclareNS- Determines whether or not the namespace is declared within the Element.- Returns:
- a string representation of this object
- Throws:
XACMLException- if conversion fails for any reason
-
toXMLString
public String toXMLString() throws XACMLException
Returns a string representation of this object- Specified by:
toXMLStringin interfaceAttribute- Returns:
- a string representation of this object
- Throws:
XACMLException- if conversion fails for any reason
-
makeImmutable
public void makeImmutable()
Makes the object immutable- Specified by:
makeImmutablein interfaceAttribute
-
-