com.limegroup.gnutella.security
Class Cookies

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

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

Maintains user's information for variety of services Note: Implements Singleton Design Pattern

See Also:
Serialized Form

Constructor Summary
protected Cookies()
          Creates new Cookies Note: Implements Singleton Design Pattern
 
Method Summary
 User getUserInfo(java.lang.String host)
          Returns the user data corresponding to the given host name
static Cookies instance()
          Returns an instance of Cookies Note: Implements Singleton Design Pattern
static void main(java.lang.String[] args)
           
 void putCookie(java.lang.String host, User user)
          Adds the passed user info for the given host
 void save()
          Saves the cookies to file
 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
 

Constructor Detail

Cookies

protected Cookies()
Creates new Cookies Note: Implements Singleton Design Pattern

Method Detail

instance

public static Cookies instance()
Returns an instance of Cookies Note: Implements Singleton Design Pattern


getUserInfo

public User getUserInfo(java.lang.String host)
Returns the user data corresponding to the given host name

Parameters:
host - The name of the host for whom the corresponding information is requested.
Returns:
The user data corresponding to the given host Returns null if no data exists for the given host

putCookie

public void putCookie(java.lang.String host,
                      User user)
Adds the passed user info for the given host

Parameters:
host - The name of the host for whom to add information
user - The user info to be added

save

public void save()
Saves the cookies to file


toString

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

Returns:
the string representation of the contents

main

public static void main(java.lang.String[] args)