Package javax.wbem.client
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 TypeMethodDescriptionboolean
Theequals
method 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.int
hashCode()
ThehashCode
method returns an integer hash code to represent this principal.toString()
ThetoString
method 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 thepUserName
isnull
.
-
-
Method Details
-
equals
Theequals
method checks if the specified object is the same principal as this object. The principals are equal if the specified object is an instance ofUserPrincipal
and the user name and authentication host name are the same. -
getHostName
Return the host name associated with this principal.- Returns:
- The host name.
-
getName
Return the name of this principal identity; that is, return the login name. -
getUserName
Return the principal's login user name.- Returns:
- The user login name.
-
hashCode
public int hashCode()ThehashCode
method 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
ThetoString
method returns a string representation of the principal suitable for displaying in messages. It should not be used for making authorization checks, however.
-