Package javax.wbem.client
Class RolePrincipal
- java.lang.Object
-
- javax.wbem.client.RolePrincipal
-
- All Implemented Interfaces:
java.security.Principal
public class RolePrincipal extends java.lang.Object implements java.security.PrincipalRolePrincipalimplements a Principal identity for a role. That is, it represents the role name to be assumed on a system.RolePrincipalincludes the role and optionally the host information for which the role is used to authenticate.
-
-
Constructor Summary
Constructors Constructor Description RolePrincipal(java.lang.String pRole)This constructor accepts the role name.RolePrincipal(java.lang.String pRole, java.lang.String pHost)This constructor accepts the role name and host name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object pObj)Theequalsmethod checks if the specified principal is the same principal as this object.java.lang.StringgetHostName()Get the host for which the principal uses to authenticate.java.lang.StringgetName()Return the name of this principal identity; that is, return the login name.inthashCode()ThehashCode()method returns an integer hash code to represent this principal.java.lang.StringtoString()ThetoString()method returns a string representation of the principal suitable for displaying in messages.
-
-
-
Constructor Detail
-
RolePrincipal
public RolePrincipal(java.lang.String pRole)
This constructor accepts the role name.- Parameters:
pRole- The role name.
-
RolePrincipal
public RolePrincipal(java.lang.String pRole, java.lang.String pHost)This constructor accepts the role name and host name.- Parameters:
pRole- The role name.pHost- The host name.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object pObj)
Theequalsmethod checks if the specified principal is the same principal as this object. The principals are equal if the specified object is an instance ofRolePrincipaland the user name and host name are the same.- Specified by:
equalsin interfacejava.security.Principal- Overrides:
equalsin classjava.lang.Object- Parameters:
pObj- The Principal to compare for equality.- Returns:
trueif they are equal, otherwisefalse.
-
getHostName
public java.lang.String getHostName()
Get the host for which the principal uses to authenticate.- Returns:
- The host name.
-
getName
public java.lang.String getName()
Return the name of this principal identity; that is, return the login name.- Specified by:
getNamein interfacejava.security.Principal- Returns:
- The name of this principal identity.
- See Also:
Principal.getName()
-
hashCode
public int hashCode()
ThehashCode()method returns an integer hash code to represent this principal.- Specified by:
hashCodein interfacejava.security.Principal- Overrides:
hashCodein classjava.lang.Object- Returns:
- An integer hash code representing the principal.
-
toString
public java.lang.String toString()
ThetoString()method returns a string representation of the principal suitable for displaying in messages. It should not be used for making authorization checks.- Specified by:
toStringin interfacejava.security.Principal- Overrides:
toStringin classjava.lang.Object- Returns:
- A printable string form of the role principal.
-
-