Class AttributeContainer
java.lang.Object
com.tivoli.am.fim.trustserver.sts.uuser.AttributeContainer
- Direct Known Subclasses:
AttributeList
,AttributeStatement
,ContextAttributes
,Group
,Principal
,RequestSecurityToken
Container for Attributes. Used as a base class for STS Universal User types
that hold attributes.
- Version:
- @VERSION@
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs an AttributeContainer object.AttributeContainer
(Attribute[] attributes) Constructs an AttributeContainer using an array of Attribute objects. -
Method Summary
Modifier and TypeMethodDescriptionstatic Attribute[]
attributesFromXml
(Element element) Adds the Attributes from the Element to this AttributeContainer.void
clear()
Clears this AttributeContainer.getAttributeByName
(String attributeName) Returns an Attribute from this AttributeContainer based on the AttributeName string provided.getAttributeByNameAndType
(String name, String type) Returns an Attribute from this AttributeContainer based on the name string and type string provided.Returns an Iterator over the values in this Attribute container.Returns an Attribute array containing this AttributeContainers Attribute objects.getAttributesByType
(String attributeType) Returns an array of attributes from this AttributeContainer based on the specified attribute typegetAttributeValueByName
(String attributeName) Return the first attribute value as a String based on the attribute name String provided.getAttributeValueByNameAndType
(String attributeName, String attributeType) Return the first attribute value as a String based on the attribute name and type provided.String[]
getAttributeValuesByName
(String attributeName) Returns a String array of attribute values based on the attribute name String provided.String[]
getAttributeValuesByNameAndType
(String name, String type) Returns Attribute values as a String array from this AttributeContainer based on the name string and type string provided.int
Returns the number of Attributes in this AttributeContainer.boolean
removeAttribute
(Attribute attr) Removes an Attribute from this AttributeContainer based on the Attribute provided (Matches on the name and type).String[]
removeAttributeByNameAndType
(String name, String type) Removes an Attribute from this AttributeContainer based on the name string and type string provided.int
removeAttributes
(String name, String type) Return attributes that match name and type.setAttribute
(Attribute attr) Sets an attribute in this AttributeContainer based on the Attribute provided.String[]
setAttribute
(String name, String type, String[] values) Sets an Attribute in this AttributeContainer based on the name, type and String array of values provided.String[]
setAttribute
(String name, String type, String nickname, String[] values) Sets an Attribute in this AttributeContainer based on the name, type and String array of values provided.void
Set attributes in this AttributeContainer based on the name, type and Node array values provided.Node[]
setAttribute
(String name, String type, String nickname, Node[] values) Set attributes in this AttributeContainer based on the name, type, nickname and Node array values provided.Node[]
setAttribute
(String name, String type, Node[] values) Set attributes in this AttributeContainer based on the name, type and Node array values provided.final void
setAttributes
(Attribute[] attributes) Sets the attributes in this AttributeContainer using the supplied Attribute array.Converts this AttributeContainer to XML in the form of an org.w3c.dom.Element object.
-
Field Details
-
AttributeContainer_java_sourceCodeID
- See Also:
-
AttributeContainer_java_copyright
- See Also:
-
-
Constructor Details
-
AttributeContainer
public AttributeContainer()Constructs an AttributeContainer object. -
AttributeContainer
Constructs an AttributeContainer using an array of Attribute objects.- Parameters:
attributes
- an array of Attribute objects
-
-
Method Details
-
getAttributes
Returns an Attribute array containing this AttributeContainers Attribute objects.- Returns:
- an Attribute array containing this AttributeContainers Attribute objects.
-
setAttributes
Sets the attributes in this AttributeContainer using the supplied Attribute array.- Parameters:
attributes
- an Attribute[] of Attributes to be added to this AttributeContainer.
-
getAttributeValueByName
Return the first attribute value as a String based on the attribute name String provided.- Parameters:
attributeName
- the name of an attribute- Returns:
- the first attribute value, as a String, of the attribute name provided. Returns null if the attribute name is not present in this AttributeContainer.
-
getAttributeValueByNameAndType
Return the first attribute value as a String based on the attribute name and type provided.- Parameters:
attributeName
- the name of an attributeattributeType
- the type of the attribute- Returns:
- the first attribute value, as a String, of the attribute name provided. Returns null if the attribute name is not present in this AttributeContainer.
-
getAttributeValuesByName
Returns a String array of attribute values based on the attribute name String provided.- Parameters:
attributeName
- the name of an attribute- Returns:
- a String array of attribute values based on the attribute name String provided. Returns null if the attribute name is not present in this AttributeContainer.
-
getAttributeByName
Returns an Attribute from this AttributeContainer based on the AttributeName string provided.- Parameters:
attributeName
- the name of an attribute- Returns:
- the Attribute from this AttributeContainer based on the attribute name String provided. Returns null if the attribute name is not present in this AttributeContainer.
-
getAttributesByType
Returns an array of attributes from this AttributeContainer based on the specified attribute type- Parameters:
attributeType
- the type of the attribute(s) to be returned- Returns:
- An array of attributes from this AttributeContainer based on the specified attribute type. provided. Returns null if no matching attributes present in this AttributeContainer.
-
getAttributeByNameAndType
Returns an Attribute from this AttributeContainer based on the name string and type string provided.- Parameters:
name
- the name of an Attributetype
- the type of Attribute- Returns:
- the Attribute from this AttributeContainer based on the attribute name string and type string provided. Returns null if the attribute name and type is not present in this AttributeContainer.
-
getAttributeValuesByNameAndType
Returns Attribute values as a String array from this AttributeContainer based on the name string and type string provided.- Parameters:
name
- the name of an Attributetype
- the type of Attribute- Returns:
- the attribute values as a String array from this AttributeContainer based on the attribute name string and type string provided. Returns null if the attribute name and type is not present in this AttributeContainer.
-
removeAttributeByNameAndType
Removes an Attribute from this AttributeContainer based on the name string and type string provided. Returns the Attribute values as a String array the Attribute was found in this AttributeContainer.- Parameters:
name
- the name of an Attributetype
- the type of Attribute- Returns:
- the attribute values as a String array from this AttributeContainer based on the attribute name string and type string provided. Returns null if the attribute name and type is not present in this AttributeContainer.
-
removeAttribute
Removes an Attribute from this AttributeContainer based on the Attribute provided (Matches on the name and type). Returns true if the attribute was found and removed, otherwise returns false.- Parameters:
attr
- the Attribute to remove from this AttributeContainer.- Returns:
- true if the attribute was found and removed, otherwise returns false.
-
setAttribute
Sets an Attribute in this AttributeContainer based on the name, type and String array of values provided.- Parameters:
name
- the name of the attributetype
- the Attribute typevalues
- a String array of attribute values- Returns:
- the values as a String array of the Attribute
-
setAttribute
Sets an Attribute in this AttributeContainer based on the name, type and String array of values provided.- Parameters:
name
- the name of the Attribute to be added to this AttributeContainertype
- the Attribute typenickname
- the nickname of the Attribute to be added to this AttributeContainervalues
- a String array of attribute values- Returns:
- the values as a String array of the Attribute added to or modified in this AttributeContainer.
-
setAttribute
Set attributes in this AttributeContainer based on the name, type and Node array values provided.- Parameters:
name
- the Attribute nametype
- the type of Attributevalues
- the values of the Attribute to be added to this AttributeContainer as an array of Nodes.- Returns:
- a Node array of the values of the Attribute added to this AttributeContainer.
-
setAttribute
Set attributes in this AttributeContainer based on the name, type and Node array values provided.- Parameters:
name
- the Attribute name to be set in the AttributeContainertype
- the type of Attribute to be set in the AttributeContainernickname
- the nickname of the Attribute to be set in the AttributeContainervalues
- the values of the Attribute to be added to this AttributeContainer as an array of Strings.nodes
- the values of the Attribute to be added to this AttributeContainer as an array of Nodes.
-
setAttribute
Set attributes in this AttributeContainer based on the name, type, nickname and Node array values provided.- Parameters:
name
- the Attribute nametype
- the type of Attributenickname
- the nickname of the Attributevalues
- the values of the Attribute to be added to this AttributeContainer as an array of Nodes.- Returns:
- a Node array of the values of the Attribute added to this AttributeContainer.
-
setAttribute
Sets an attribute in this AttributeContainer based on the Attribute provided.- Parameters:
attr
- the Attribute to set in this AttributeContainer.- Returns:
- the Attribute set in this AttributeContainer.
-
getAttributeIterator
Returns an Iterator over the values in this Attribute container.- Returns:
- an Iterator over the values in this Attribute container.
-
getNumberOfAttributes
public int getNumberOfAttributes()Returns the number of Attributes in this AttributeContainer.- Returns:
- the number of Attributes in this AttributeContainer.
-
clear
public void clear()Clears this AttributeContainer. -
removeAttributes
Return attributes that match name and type. If either input is null, it'll match any value. Effectively name = null invalid input: '&'invalid input: '&' type = null is clear()- Parameters:
name
- The name to match or null to match alltype
- The type to match or null to match all- Returns:
- The number of attributes removed.
-
attributesFromXml
Adds the Attributes from the Element to this AttributeContainer.- Parameters:
element
- the element which contains attributes to add to this AttributeContainer.- Returns:
- an array of Attributes added to this AttributeContainer or null if element is null.
-
toXml
Converts this AttributeContainer to XML in the form of an org.w3c.dom.Element object.- Parameters:
owner
- owner XML Document- Returns:
- the XML in the form of an org.w3c.dom.Element object.
-