bootstrapP
Class RegisteredUser
java.lang.Object
bootstrapP.RegisteredUser
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<java.lang.Object>
public class RegisteredUser
- extends java.lang.Object
- implements java.lang.Comparable<java.lang.Object>, java.io.Serializable
A representation of a user registered into the gossip system, witch is assigned to a message server.
- Author:
- Marco Cornolti
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- RegisteredUser version.
- See Also:
- Constant Field Values
password
private java.lang.String password
nickname
private java.lang.String nickname
ms
private ManagedMessageServer ms
RegisteredUser
public RegisteredUser(java.lang.String nick,
java.lang.String pw,
ManagedMessageServer ms)
- Parameters:
nick
- the user nickname.pw
- the user password.ms
- the message server the user is assigned to.
checkPassword
public boolean checkPassword(java.lang.String pw)
- Checks the user password against the password given as argument.
- Parameters:
pw
- the password to check.
- Returns:
- true if the given password is right, false otherwise.
getMS
public ManagedMessageServer getMS()
- Returns:
- the message server this user is assigned to.
getNick
public java.lang.String getNick()
- Returns:
- the user nickname.
compareTo
public int compareTo(java.lang.Object usr2)
- Specified by:
compareTo
in interface java.lang.Comparable<java.lang.Object>
equals
public boolean equals(java.lang.Object usr2)
- Overrides:
equals
in class java.lang.Object
setMS
public void setMS(ManagedMessageServer ms)
- Sets the message server this user is assigned to.
- Parameters:
ms
- the new user's message server.