Class STSUniversalUser

java.lang.Object
com.tivoli.am.fim.trustserver.sts.STSUniversalUser

public class STSUniversalUser extends Object
Java representation of STSUniversalUser schema.
Version:
@VERSION@
  • Field Details

  • Constructor Details

    • STSUniversalUser

      public STSUniversalUser(Node node) throws com.tivoli.am.fim.trustserver.sts.STSRuntimeException
      Constructs a STSUniversalUser containing the data specified in the given org.w3c.dom.Node.
      Parameters:
      node - a STSUniversalUser represented in XML following the STSUniversalUser's XML schema.
      Throws:
      com.tivoli.am.fim.trustserver.sts.STSRuntimeException
    • STSUniversalUser

      public STSUniversalUser()
      Constructs an empty STSUniversalUser.
      Throws:
      com.tivoli.am.fim.trustserver.sts.STSRuntimeException
  • Method Details

    • fromXML

      public void fromXML(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(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(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(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.
    • fromPAC

      public void fromPAC(String intoken)
      Populates an STSUniversalUser from an IV_CREDS token (in the form of an String).
      Parameters:
      jsonString - the iv_creds String to populate this STSUniversalUser from. If String is null or not valid, nothing will be done to this object.
    • 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 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 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 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 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(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(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(String principalUUID) throws com.tivoli.am.fim.trustserver.sts.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:
      com.tivoli.am.fim.trustserver.sts.STSRuntimeException
    • setPrincipalDomain

      public void setPrincipalDomain(String principalDomain) throws com.tivoli.am.fim.trustserver.sts.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:
      com.tivoli.am.fim.trustserver.sts.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 Iterator getAttributes()
      Returns an Iterator that references all the Attributes in the AttributeList.
      Returns:
      Iterator
    • getPrincipalAttributes

      public Iterator getPrincipalAttributes()
      Returns an Iterator that references all the Principal Attributes in the Principal.
      Returns:
      Iterator
    • getAttributeStatements

      public Iterator getAttributeStatements()
      Returns an Iterator that references all the AtributStatements
      Returns:
      Iterator
    • getRequestSecurityTokenAttributes

      public 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 String getAttributeValueByName(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 String getPrincipalAttributeValueByName(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 Iterator getGroups()
      Returns an Iterator 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 String getRequestSecurityTokenAttributeByName(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 String toString() throws com.tivoli.am.fim.trustserver.sts.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 class Object
      Returns:
      a String representation of this STSUniversalUser object.
      Throws:
      com.tivoli.am.fim.trustserver.sts.STSRuntimeException
    • maskSTSUUString

      public static String maskSTSUUString(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 String toClearTextString() throws com.tivoli.am.fim.trustserver.sts.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:
      com.tivoli.am.fim.trustserver.sts.STSRuntimeException
    • toXML

      public Document toXML() throws com.tivoli.am.fim.trustserver.sts.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:
      com.tivoli.am.fim.trustserver.sts.STSRuntimeException
    • removeGroup

      public int removeGroup(String name, 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(String name, 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(String name, 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