Class STSUniversalUser
- java.lang.Object
-
- com.tivoli.am.fim.trustserver.sts.STSUniversalUser
-
public class STSUniversalUser extends java.lang.Object
Java representation of STSUniversalUser schema.- Version:
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
STSUniversalUser_java_copyright
static java.lang.String
STSUniversalUser_java_sourceCodeID
-
Constructor Summary
Constructors Constructor Description STSUniversalUser()
Constructs an empty STSUniversalUser.STSUniversalUser(org.w3c.dom.Node node)
Constructs a STSUniversalUser containing the data specified in the givenorg.w3c.dom.Node
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(Attribute attr)
Adds the given Attribute to the list of attributes.void
addAttributeStatement(AttributeStatement attrstmt)
Adds the given AttributeStatement to the list of AttributeStatements.void
addContextAttribute(Attribute attr)
Adds the given Attribute to the list of ContextAttributesvoid
addGroup(Group group)
Adds the given group.void
addPrincipalAttribute(Attribute attr)
Add a principalAttribute to this STSUniversalUser.void
clear()
This method when called will reset and clear all data in the STSUniversalUser.void
clearAttributeList()
This method when called will reset and clear all data in the AttributeListvoid
clearAttributeStatements()
This method when called will reset and clear all data in the AttributeStatementsvoid
clearContextAttributes()
This method when called will reset and clear all data in the ContextAttributesvoid
clearGroupList()
This method when called will reset and clear all data in the GroupListvoid
clearPrincipal()
This method when called will reset and clear all data in the Principalvoid
clearRequestSecurityToken()
This method when called will reset and clear all data in the RequestSecurityTokenvoid
copy(STSUniversalUser stsuu)
Performs a shallow copy (by reference) of the given STSUniversalUser object's membersvoid
fromXML(java.lang.String xmlString)
Populates an STSUniversalUser from XML (in the form of an org.w3c.dom.Node).void
fromXML(org.w3c.dom.Document doc)
Populates the STSUniversalUser from XML (in the form of an org.w3c.dom.Document).void
fromXML(org.w3c.dom.Element element)
Builds the STSUniversalUser based on the given org.w3c.dom.Node.void
fromXML(org.w3c.dom.Node node)
Populates an STSUniversalUser from XML (in the form of an org.w3c.dom.Node).AttributeContainer
getAttributeContainer()
Return the AttributeContainer associated with this STSUniversalUser.java.util.Iterator
getAttributes()
Returns anIterator
that references all the Attributes in the AttributeList.java.util.Iterator
getAttributeStatements()
Returns anIterator
that references all the AtributStatementsjava.lang.String
getAttributeValueByName(java.lang.String name)
Returns an Attribute value of this STSUniversalUser based on the name provided.ContextAttributes
getContextAttributes()
Retrieve the Context atrributes containerAttributeContainer
getContextAttributesAttributeContainer()
Returns the ContextAttributes AttributeContainer of this STSUniversalUser.java.util.Iterator
getGroups()
Returns anIterator
that references all the Groups in the GroupList.int
getNumberOfAttributes()
Returns the number of Attributes in the AttributeListint
getNumberOfGroups()
Returns the number of groups in the GroupList.AttributeContainer
getPrincipalAttributeContainer()
Return the PrincipalAttributeContainer associated with this STSUniversalUser.java.util.Iterator
getPrincipalAttributes()
Returns anIterator
that references all the Principal Attributes in the Principal.java.lang.String
getPrincipalAttributeValueByName(java.lang.String name)
Returns a Principal Attribute value of this STSUniversalUser based on the name provided.java.lang.String
getPrincipalDomain()
This is a convenience method for retrieving the first Principal attribute value that has the name="domain".java.lang.String
getPrincipalName()
This is a convenience method for retrieving the first Principal attribute value that has the name="name".java.lang.String
getPrincipalRegistryID()
This is a convenience method for retrieving the first Principal attribute value that has the name="registryid".java.lang.String
getPrincipalUUID()
This is a convenience method for retrieving the first Principal attribute value that has the name="uuid".RequestSecurityToken
getRequestSecurityToken()
Return the RequestSecurityToken associated with this STSUniversalUser.java.lang.String
getRequestSecurityTokenAttributeByName(java.lang.String name)
Returns a RequestSecurityTokenAttribute based on the name provided.AttributeContainer
getRequestSecurityTokenAttributeContainer()
Return the RequestSecurityTokenAttributeContainer associated with this STSUniversalUser.java.util.Iterator
getRequestSecurityTokenAttributes()
Returns an Iterator that references all the attributes of the RequestSecurityToken elementstatic java.lang.String
maskSTSUUString(java.lang.String clearText)
Masks hidden data in a String that contains STSUU elements.int
removeAttribute(java.lang.String name, java.lang.String type)
Remove the attributes that match the given name and type, to match a attribute with no type pass null as the type. if * is passed for both name and type ALL attributes are removed.int
removeGroup(java.lang.String name, java.lang.String type)
Remove the groups that match the given name and type, to match a group with no type pass null as the type. if * is passed for both name and type ALL groups are removed.int
removePrincipalAttribute(java.lang.String name, java.lang.String type)
Remove the attributes that match the given name and type, to match a attribute with no type pass null as the type. if * is passed for both name and type ALL attributes are removed.void
setContextAttributes(ContextAttributes attributes)
Sets the ContextAttributesvoid
setPrincipalDomain(java.lang.String principalDomain)
This is a convenience method for creating a Principal attribute with the name="domain" type=null and value=principalDomain.void
setPrincipalName(java.lang.String principalName)
This is a convenience method for updating a Principal attribute with the name="name" type=and value=principalName. void
setPrincipalRegistryID(java.lang.String principalID)
This is a convenience method for creating a Principal attribute with the name="registryid" type=null and value=principalID.void
setPrincipalUUID(java.lang.String principalUUID)
This is a convenience method for creating a Principal attribute with the name="uuid" type=null and value=principalUUID.java.lang.String
toClearTextString()
Produces the same string as toString except any password attribute will be in the clearjava.lang.String
toString()
Returns a String representation of this STSUniversalUser object.org.w3c.dom.Document
toXML()
Returns this STSUniversalUser as XML in the form of an org.w3c.dom.Document object.
-
-
-
Field Detail
-
STSUniversalUser_java_sourceCodeID
public static final java.lang.String STSUniversalUser_java_sourceCodeID
- See Also:
- Constant Field Values
-
STSUniversalUser_java_copyright
public static final java.lang.String STSUniversalUser_java_copyright
-
-
Constructor Detail
-
STSUniversalUser
public STSUniversalUser(org.w3c.dom.Node node) throws STSRuntimeException
Constructs a STSUniversalUser containing the data specified in the givenorg.w3c.dom.Node
.- Parameters:
node
- a STSUniversalUser represented in XML following the STSUniversalUser's XML schema.- Throws:
STSRuntimeException
-
STSUniversalUser
public STSUniversalUser()
Constructs an empty STSUniversalUser.- Throws:
STSRuntimeException
-
-
Method Detail
-
fromXML
public void fromXML(org.w3c.dom.Node node)
Populates an STSUniversalUser from XML (in the form of an org.w3c.dom.Node).- Parameters:
node
- the Node to populate this STSUniversalUser from. If node is null, nothing will be done to this object.
-
fromXML
public void fromXML(java.lang.String xmlString)
Populates an STSUniversalUser from XML (in the form of an org.w3c.dom.Node).- Parameters:
xmlString
- the String to populate this STSUniversalUser from. If String is null, nothing will be done to this object.
-
fromXML
public void fromXML(org.w3c.dom.Document doc)
Populates the STSUniversalUser from XML (in the form of an org.w3c.dom.Document).- Parameters:
doc
- the Document to populate this STSUniversalUser from. If Document is null, nothing will be done to this object.
-
fromXML
public void fromXML(org.w3c.dom.Element element)
Builds the STSUniversalUser based on the given org.w3c.dom.Node.- Parameters:
element
- a STSUniversalUser represented in XML following the STSUniversalUser's XML schema.
-
copy
public void copy(STSUniversalUser stsuu)
Performs a shallow copy (by reference) of the given STSUniversalUser object's members- Parameters:
stsuu
- the STSUniversalUser to copy from.
-
getPrincipalName
public java.lang.String getPrincipalName()
This is a convenience method for retrieving the first Principal attribute value that has the name="name".- Returns:
- the principal name as a String object.
-
getPrincipalRegistryID
public java.lang.String getPrincipalRegistryID()
This is a convenience method for retrieving the first Principal attribute value that has the name="registryid".- Returns:
- the first principal attribute value with the name 'registryid' as a String object.
-
getPrincipalUUID
public java.lang.String getPrincipalUUID()
This is a convenience method for retrieving the first Principal attribute value that has the name="uuid".- Returns:
- the first principal attribute value with the name 'uid' as a String object.
-
getPrincipalDomain
public java.lang.String getPrincipalDomain()
This is a convenience method for retrieving the first Principal attribute value that has the name="domain".- Returns:
- the first principal attribute value with the name 'domain' as a String object.
-
setPrincipalName
public void setPrincipalName(java.lang.String principalName)
This is a convenience method for updating a Principal attribute with the name="name" type=and value=principalName. It will create a new Principal attribute if it does not already exist with name="name" type=null and value=principalName. - Parameters:
principalName
- the principal name as a String.
-
setPrincipalRegistryID
public void setPrincipalRegistryID(java.lang.String principalID)
This is a convenience method for creating a Principal attribute with the name="registryid" type=null and value=principalID. All other Principal attributes matching name="registryid" and type=null are removed before creating the new attribute.- Parameters:
principalID
- the principalDN as a String.
-
setPrincipalUUID
public void setPrincipalUUID(java.lang.String principalUUID) throws STSRuntimeException
This is a convenience method for creating a Principal attribute with the name="uuid" type=null and value=principalUUID. All other Principal attributes matching name="uuid" and type=null are removed before creating the new attribute.- Parameters:
principalUUID
- the principalUUID as a String- Throws:
STSRuntimeException
-
setPrincipalDomain
public void setPrincipalDomain(java.lang.String principalDomain) throws STSRuntimeException
This is a convenience method for creating a Principal attribute with the name="domain" type=null and value=principalDomain. All other Principal attributes matching name="domain" and type=null are removed before creating the new attribute.- Parameters:
principalDomain
- the principalDomain as a String.- Throws:
STSRuntimeException
-
getNumberOfGroups
public int getNumberOfGroups()
Returns the number of groups in the GroupList.- Returns:
- int number of groups.
-
addGroup
public void addGroup(Group group)
Adds the given group. The name of the group must not be null, if null the group entry is not added.- Parameters:
group
- the Group to be added.
-
getAttributes
public java.util.Iterator getAttributes()
Returns anIterator
that references all the Attributes in the AttributeList.- Returns:
- Iterator
-
getPrincipalAttributes
public java.util.Iterator getPrincipalAttributes()
Returns anIterator
that references all the Principal Attributes in the Principal.- Returns:
- Iterator
-
getAttributeStatements
public java.util.Iterator getAttributeStatements()
Returns anIterator
that references all the AtributStatements- Returns:
- Iterator
-
getRequestSecurityTokenAttributes
public java.util.Iterator getRequestSecurityTokenAttributes()
Returns an Iterator that references all the attributes of the RequestSecurityToken element- Returns:
- an Iterator that references all the attributes of the RequestSecurityToken element
-
getPrincipalAttributeContainer
public AttributeContainer getPrincipalAttributeContainer()
Return the PrincipalAttributeContainer associated with this STSUniversalUser.- Returns:
- the PrincipalAttributeContainer associated with this STSUniversalUser. If the PrincipalAttributeContainer is null, an empty AttributeContainer is returned.
-
getAttributeContainer
public AttributeContainer getAttributeContainer()
Return the AttributeContainer associated with this STSUniversalUser.- Returns:
- the AttributeContainer associated with this STSUniversalUser. If the AttributeContainer is null, an empty AttributeContainer is returned.
-
getRequestSecurityToken
public RequestSecurityToken getRequestSecurityToken()
Return the RequestSecurityToken associated with this STSUniversalUser.- Returns:
- the RequestSecurityToken associated with this STSUniversalUser. If the RequestSecurityToken is null, an empty RequestSecurityToken is returned.
-
getRequestSecurityTokenAttributeContainer
public AttributeContainer getRequestSecurityTokenAttributeContainer()
Return the RequestSecurityTokenAttributeContainer associated with this STSUniversalUser.- Returns:
- the RequestSecurityTokenAttributeContainer associated with this STSUniversalUser.
-
getAttributeValueByName
public java.lang.String getAttributeValueByName(java.lang.String name)
Returns an Attribute value of this STSUniversalUser based on the name provided.- Parameters:
name
- a String representing the name of the Attribute.- Returns:
- the first Attribute value of the named Attribute or null if there is no named Attribute.
-
getPrincipalAttributeValueByName
public java.lang.String getPrincipalAttributeValueByName(java.lang.String name)
Returns a Principal Attribute value of this STSUniversalUser based on the name provided.- Parameters:
name
- a String representing the name of the Attribute.- Returns:
- the first principal Attribute value of the named Attribute or null if there is no named Attribute.
-
getContextAttributes
public ContextAttributes getContextAttributes()
Retrieve the Context atrributes container- Returns:
- the Context atrributes container.
-
getContextAttributesAttributeContainer
public AttributeContainer getContextAttributesAttributeContainer()
Returns the ContextAttributes AttributeContainer of this STSUniversalUser.- Returns:
- the ContextAttributes AttributeContainer of this STSUniversalUser.
-
getGroups
public java.util.Iterator getGroups()
Returns anIterator
that references all the Groups in the GroupList.- Returns:
- Iterator
-
getNumberOfAttributes
public int getNumberOfAttributes()
Returns the number of Attributes in the AttributeList- Returns:
- int number of attributes
-
getRequestSecurityTokenAttributeByName
public java.lang.String getRequestSecurityTokenAttributeByName(java.lang.String name)
Returns a RequestSecurityTokenAttribute based on the name provided.- Parameters:
name
- the name of the RST Attribute to return.- Returns:
- a RequestSecurityTokenAttribute based on the name provided or if the name does not exist, returns null.
-
addAttribute
public void addAttribute(Attribute attr)
Adds the given Attribute to the list of attributes. The name of the Attribute must not be null, if null the Attribute is not added to the list.- Parameters:
attr
- the attribute to be added to the list of attributes.
-
addContextAttribute
public void addContextAttribute(Attribute attr)
Adds the given Attribute to the list of ContextAttributes- Parameters:
attr
-
-
setContextAttributes
public void setContextAttributes(ContextAttributes attributes)
Sets the ContextAttributes- Parameters:
attr
-
-
addAttributeStatement
public void addAttributeStatement(AttributeStatement attrstmt)
Adds the given AttributeStatement to the list of AttributeStatements.- Parameters:
attrstmt
- the AttributeStatement to be added to the list of AttributeStatements.
-
toString
public java.lang.String toString() throws STSRuntimeException
Returns a String representation of this STSUniversalUser object. This method masks private data in the returned String. For a clear text String call the toClearTextString() method.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a String representation of this STSUniversalUser object.
- Throws:
STSRuntimeException
-
maskSTSUUString
public static java.lang.String maskSTSUUString(java.lang.String clearText)
Masks hidden data in a String that contains STSUU elements. This method uses a pre-defined set of regular expressions to obscure secrets in the String representation of an STSUU.- Returns:
- a masked version of the input String, or the input String if no hidden data patterns were matched.
-
toClearTextString
public java.lang.String toClearTextString() throws STSRuntimeException
Produces the same string as toString except any password attribute will be in the clear- Returns:
- this STSUniversalUser as a String with the password in clear text.
- Throws:
STSRuntimeException
-
toXML
public org.w3c.dom.Document toXML() throws STSRuntimeException
Returns this STSUniversalUser as XML in the form of an org.w3c.dom.Document object.- Returns:
- this STSUniversalUser as XML in the form of an org.w3c.dom.Document object.
- Throws:
STSRuntimeException
-
removeGroup
public int removeGroup(java.lang.String name, java.lang.String type)
Remove the groups that match the given name and type, to match a group with no type pass null as the type. if * is passed for both name and type ALL groups are removed.- Parameters:
name
- the name of the Attribute as a String.type
- the type of Attribute as a String.- Returns:
- int the number of groups removed.
-
removeAttribute
public int removeAttribute(java.lang.String name, java.lang.String type)
Remove the attributes that match the given name and type, to match a attribute with no type pass null as the type. if * is passed for both name and type ALL attributes are removed.- Parameters:
name
- the name of the Attribute as a String.type
- the type of Attribute as a String.- Returns:
- int the number of attributes removed.
-
removePrincipalAttribute
public int removePrincipalAttribute(java.lang.String name, java.lang.String type)
Remove the attributes that match the given name and type, to match a attribute with no type pass null as the type. if * is passed for both name and type ALL attributes are removed.- Parameters:
name
- the name of the Attribute as a String.type
- the type of Attribute as a String.- Returns:
- int the number of attributes removed.
-
addPrincipalAttribute
public void addPrincipalAttribute(Attribute attr)
Add a principalAttribute to this STSUniversalUser.- Parameters:
attr
- the principal Attribute to be added to this STSUniversalUser.
-
clear
public void clear()
This method when called will reset and clear all data in the STSUniversalUser.
-
clearPrincipal
public void clearPrincipal()
This method when called will reset and clear all data in the Principal
-
clearGroupList
public void clearGroupList()
This method when called will reset and clear all data in the GroupList
-
clearAttributeList
public void clearAttributeList()
This method when called will reset and clear all data in the AttributeList
-
clearRequestSecurityToken
public void clearRequestSecurityToken()
This method when called will reset and clear all data in the RequestSecurityToken
-
clearAttributeStatements
public void clearAttributeStatements()
This method when called will reset and clear all data in the AttributeStatements
-
clearContextAttributes
public void clearContextAttributes()
This method when called will reset and clear all data in the ContextAttributes
-
-