javax.wbem.client

Class UserPrincipal

public class UserPrincipal extends Object implements Principal

This class implements a Java security Principal identity for a client user identity that authenticates with a Unix username and login password. That is, it represents the user's login identity on the remote server system which is running the CIMOM.
Constructor Summary
UserPrincipal(String userName)
This constructor accepts the user name.
Method Summary
booleanequals(Object otherPrincipal)
The equals method checks if the specified object is the same principal as this object.
StringgetName()
Return the name of this principal identity; that is, return the Unix user login name.
StringgetUserName()
Return the principal's login user name.
inthashCode()
The hashCode method returns an integer hash code to represent this principal.
StringtoString()
The toString method returns a string representation of the principal suitable for displaying in messages.

Constructor Detail

UserPrincipal

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

Parameters: userName - The user login name.

Throws: IllegalArgumentException - If the userName is null.

Method Detail

equals

public boolean equals(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.

Parameters: otherPrincipal - Principal instance to compare for equality.

Returns: true if the object are equal; false otherwise.

See Also: java.lang.Object#equals(java.lang.Object)

getName

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

Returns: The name of this principal identity.

See Also: java.security.Principal#getName()

getUserName

public 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.

Returns: An integer hash code representing the principal.

See Also: java.lang.Object#hashCode()

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, however.

Returns: A printable string form of the principal identity.

See Also: java.lang.Object#toString()

Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.