Class UserPrincipal
java.lang.Object
javax.wbem.client.UserPrincipal
- All Implemented Interfaces:
Principal
UserPrincipal implements a Principal identity for a client user
identity that authenticates with a username and password. In other words, it
represents the user's login identity on the remote system.
UserPrincipal includes the username and optionally the host
information for which the username is used to authenticate.-
Constructor Summary
ConstructorsConstructorDescriptionUserPrincipal(String pUserName) This constructor accepts the user name.UserPrincipal(String pUserName, String pHostName) This constructor accepts the user name and host name. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTheequalsmethod checks if the specified object is the same principal as this object.Return the host name associated with this principal.getName()Return the name of this principal identity; that is, return the login name.Return the principal's login user name.inthashCode()ThehashCodemethod returns an integer hash code to represent this principal.toString()ThetoStringmethod returns a string representation of the principal suitable for displaying in messages.
-
Constructor Details
-
UserPrincipal
This constructor accepts the user name.- Parameters:
pUserName- The user login name.- Throws:
IllegalArgumentException- If the invalid input: '<'codepUuserName isnull.
-
UserPrincipal
This constructor accepts the user name and host name.- Parameters:
pUserName- The user login name.pHostName- The host name for this principal.- Throws:
IllegalArgumentException- If thepUserNameisnull.
-
-
Method Details
-
equals
Theequalsmethod checks if the specified object is the same principal as this object. The principals are equal if the specified object is an instance ofUserPrincipaland the user name and authentication host name are the same. -
getHostName
Return the host name associated with this principal.- Returns:
- The host name.
-
getName
-
getUserName
-
hashCode
public int hashCode()ThehashCodemethod returns an integer hash code to represent this principal. It can be used to test for non-equality, or as an index key in a hash table. -
toString
ThetoStringmethod returns a string representation of the principal suitable for displaying in messages. It should not be used for making authorization checks, however.
-