Class RolePrincipal

java.lang.Object
javax.wbem.client.RolePrincipal
All Implemented Interfaces:
Principal

public class RolePrincipal extends Object implements Principal
RolePrincipal implements a Principal identity for a role. That is, it represents the role name to be assumed on a system. RolePrincipal includes the role and optionally the host information for which the role is used to authenticate.
  • Constructor Summary

    Constructors
    Constructor
    Description
    This constructor accepts the role name.
    RolePrincipal(String pRole, String pHost)
    This constructor accepts the role name and host name.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object pObj)
    The equals method checks if the specified principal is the same principal as this object.
    Get the host for which the principal uses to authenticate.
    Return the name of this principal identity; that is, return the login name.
    int
    The hashCode() method returns an integer hash code to represent this principal.
    The toString() method returns a string representation of the principal suitable for displaying in messages.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.security.Principal

    implies
  • Constructor Details

    • RolePrincipal

      public RolePrincipal(String pRole)
      This constructor accepts the role name.
      Parameters:
      pRole - The role name.
    • RolePrincipal

      public RolePrincipal(String pRole, String pHost)
      This constructor accepts the role name and host name.
      Parameters:
      pRole - The role name.
      pHost - The host name.
  • Method Details

    • equals

      public boolean equals(Object pObj)
      The equals method checks if the specified principal is the same principal as this object. The principals are equal if the specified object is an instance of RolePrincipal and the user name and host name are the same.
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class Object
      Parameters:
      pObj - The Principal to compare for equality.
      Returns:
      true if they are equal, otherwise false .
    • getHostName

      public String getHostName()
      Get the host for which the principal uses to authenticate.
      Returns:
      The host name.
    • getName

      public String getName()
      Return the name of this principal identity; that is, return the login name.
      Specified by:
      getName in interface Principal
      Returns:
      The name of this principal identity.
      See Also:
    • hashCode

      public int hashCode()
      The hashCode() method returns an integer hash code to represent this principal.
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class Object
      Returns:
      An integer hash code representing the principal.
    • toString

      public String toString()
      The toString() method returns a string representation of the principal suitable for displaying in messages. It should not be used for making authorization checks.
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
      Returns:
      A printable string form of the role principal.