com.limegroup.gnutella.security
Class User

java.lang.Object
  extended bycom.limegroup.gnutella.security.User
All Implemented Interfaces:
java.io.Serializable

public class User
extends java.lang.Object
implements java.io.Serializable

Contains authentication information for a user

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_UNAUTHENTICATED_DOMAIN
           
 
Constructor Summary
User(java.lang.String username, java.lang.String password)
          creates a new user
User(java.lang.String username, java.lang.String password, java.util.Set domains)
          creates a new user
 
Method Summary
 void addDomain(java.lang.String domain)
          Adds the passed domain to the set of domains user belongs to
static java.util.Set createDefaultDomainSet()
          creates a default domain set, that contains defualt domain
 java.util.Set getDomains()
          Returns the set of domains to which the user belongs
 java.lang.String getPassword()
          Returns the password for the user
 java.lang.String getUsername()
          Returns the username for the user
 void removeDomain(java.lang.String domain)
          Removes the passed domain from the set of domains user belongs to
 java.lang.String toString()
          returns the string representation of the contents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_UNAUTHENTICATED_DOMAIN

public static final java.lang.String DEFAULT_UNAUTHENTICATED_DOMAIN
See Also:
Constant Field Values
Constructor Detail

User

public User(java.lang.String username,
            java.lang.String password)
creates a new user

Parameters:
username - unique name for the user
password - User's password to be used for authentication

User

public User(java.lang.String username,
            java.lang.String password,
            java.util.Set domains)
creates a new user

Parameters:
username - Unique name for the user
password - User's password to be used for authentication
domains - The set of domains to which the user belongs
Method Detail

createDefaultDomainSet

public static java.util.Set createDefaultDomainSet()
creates a default domain set, that contains defualt domain

Returns:
Set (of String) of default domains

getUsername

public java.lang.String getUsername()
Returns the username for the user

Returns:
the username for the user

getPassword

public java.lang.String getPassword()
Returns the password for the user

Returns:
the password for the user

addDomain

public void addDomain(java.lang.String domain)
Adds the passed domain to the set of domains user belongs to

Parameters:
domain - The domain to be added

removeDomain

public void removeDomain(java.lang.String domain)
Removes the passed domain from the set of domains user belongs to

Parameters:
domain - The domain to be removed

getDomains

public java.util.Set getDomains()
Returns the set of domains to which the user belongs

Returns:
the set of domains to which the user belongs

toString

public java.lang.String toString()
returns the string representation of the contents

Returns:
the string representation of the contents