org.opennms.web.admin.users.parsers
Class User

java.lang.Object
  extended by org.opennms.web.admin.users.parsers.User
All Implemented Interfaces:
Cloneable

public class User
extends Object
implements Cloneable

This is a data class for storing the information on a user. This information is stored in the users.xml file and is manipulated via the "Users, Groups and Views" screen.

Version:
1.1.1.1
Author:
Jason Johns , OpenNMS

Field Summary
static String USER_ID_PROPERTY
           
 
Constructor Summary
User()
          Creates a User.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 Object clone()
           
 boolean comparePasswords(String aPassword)
          This method compares two encrypted strings for equality
static String encryptPassword(String aPassword)
          This method encrypts the password using MD5 hashing.
 String getFullName()
          Returns the full name of this user
 NotificationInfo getNotificationInfo()
          Returns the notification information for this user
 String getPassword()
          Returns the password for this user
 String getUserComments()
          Returns the user comments for this user
 String getUserId()
          Returns the user id for this user
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void setEncryptedPassword(String aPassword)
          Sets the password for this user, assuming that the value passed in is already encrypted properly
 void setFullName(String aFullName)
          Sets the full name for this user
 void setNotificationInfo(NotificationInfo someInfo)
          Sets the notificaton information for this user
 void setUnencryptedPassword(String aPassword)
          Sets the password for this user, first encrypting it
 void setUserComments(String someUserComments)
          Sets the user comments for this user
 void setUserId(String aUserId)
          Sets the user id for this user
 String toString()
          Returns a String representation of the user info, used primarily for debugging purposes.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

USER_ID_PROPERTY

public static final String USER_ID_PROPERTY
See Also:
Constant Field Values
Constructor Detail

User

public User()
Creates a User. Default constructor, intializes the member variables.

Method Detail

clone

public Object clone()
Overrides:
clone in class Object

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)

getNotificationInfo

public NotificationInfo getNotificationInfo()
Returns the notification information for this user

Returns:
the notification info

setNotificationInfo

public void setNotificationInfo(NotificationInfo someInfo)
Sets the notificaton information for this user

Parameters:
someInfo - the notification info

setUserId

public void setUserId(String aUserId)
Sets the user id for this user

Parameters:
aUserId - the user id

getUserId

public String getUserId()
Returns the user id for this user

Returns:
the user id

setFullName

public void setFullName(String aFullName)
Sets the full name for this user

Parameters:
aFullName - the full name

getFullName

public String getFullName()
Returns the full name of this user

Returns:
the full name

setUserComments

public void setUserComments(String someUserComments)
Sets the user comments for this user

Parameters:
someUserComments - the user comments

getUserComments

public String getUserComments()
Returns the user comments for this user

Returns:
the user comments

setEncryptedPassword

public void setEncryptedPassword(String aPassword)
Sets the password for this user, assuming that the value passed in is already encrypted properly

Parameters:
aPassword - the encrypted password

setUnencryptedPassword

public void setUnencryptedPassword(String aPassword)
                            throws IllegalStateException
Sets the password for this user, first encrypting it

Parameters:
aPassword - the password
Throws:
IllegalStateException

encryptPassword

public static String encryptPassword(String aPassword)
                              throws IllegalStateException
This method encrypts the password using MD5 hashing.

Parameters:
aPassword - the password to encrypt
Returns:
the MD5 hash of the password, or null if the encryption fails
Throws:
IllegalStateException

comparePasswords

public boolean comparePasswords(String aPassword)
This method compares two encrypted strings for equality

Parameters:
aPassword - the password to check for equality
Returns:
true if the two passwords are equal (after encryption), false otherwise

getPassword

public String getPassword()
Returns the password for this user

Returns:
the password for the user

toString

public String toString()
Returns a String representation of the user info, used primarily for debugging purposes.

Overrides:
toString in class Object
Returns:
a string representation


Copyright © 2009. All Rights Reserved.