javax.wbem.client
Class UserPrincipal

java.lang.Object
  extended byjavax.wbem.client.UserPrincipal
All Implemented Interfaces:
java.security.Principal

public class UserPrincipal
extends java.lang.Object
implements java.security.Principal

This class implements a Principal identity for a client user identity that authenticates with a username and password. That is, it represents the user's login identity on the remote system which is running the WBEM Server.

Since:
JSR48 1.0

Constructor Summary
UserPrincipal(java.lang.String userName)
          This constructor accepts the user name.
 
Method Summary
 boolean equals(java.lang.Object otherPrincipal)
          The equals method checks if the specified object is the same principal as this object.
 java.lang.String getName()
          Return the name of this principal identity; that is, return the login name.
 java.lang.String getUserName()
          Return the principal's login user name.
 int hashCode()
          The hashCode method returns an integer hash code to represent this principal.
 java.lang.String toString()
          The toString method returns a string representation of the principal suitable for displaying in messages.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserPrincipal

public UserPrincipal(java.lang.String userName)
This constructor accepts the user name.

Parameters:
userName - The user login name.
Throws:
If - the userName is null
Method Detail

equals

public boolean equals(java.lang.Object otherPrincipal)
The equals method checks if the specified object is the same principal as this object. The principals are equal if the specified object is an instance of UserPrincipal and the user name and authentication host name are the same.

Specified by:
equals in interface java.security.Principal
Parameters:
otherPrincipal - Principal instance to compare for equality
Returns:
true if the object are equal; false otherwise

getName

public java.lang.String getName()
Return the name of this principal identity; that is, return the login name.

Specified by:
getName in interface java.security.Principal
Returns:
The name of this principal identity.

getUserName

public java.lang.String getUserName()
Return the principal's login user name.

Returns:
The user login name.

hashCode

public int hashCode()
The hashCode 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.

Specified by:
hashCode in interface java.security.Principal
Returns:
An integer hash code representing the principal.

toString

public java.lang.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, however.

Specified by:
toString in interface java.security.Principal
Returns:
A printable string form of the principal identity.


Java™ WBEM (JSR48) 1.0.0 API