base
Class InternetCafeManager

java.lang.Object
  extended by java.util.Observable
      extended by base.InternetCafeManager

public class InternetCafeManager
extends java.util.Observable


Constructor Summary
protected InternetCafeManager()
           
 
Method Summary
 void addBackup(Backup backup)
          This method simply adds a backup.
 void addService(Service service)
          This method simply adds a service.
 void addSession(Session session)
          This method simply adds a session.
 void addSessionSet(Session[] sessionSet)
          This method simply adds a set of sessions.
 void addUser(User user)
          This method simply adds a user.
protected static java.lang.String backupKey(Backup backup)
          This method simply builds a key string for an instance of Backup.
 void clear()
          This method clears all the InternetCafe's data.
static boolean contains(java.lang.String[] list, java.lang.String text)
           
 void deleteBackup(Backup backup)
          This method deletes a backup from the system.
 void deleteService(Service service)
          This method deletes the service.
 void deleteSession(Session session)
          This method deletes a session.
 void deleteUser(User user)
          This method deletes the user.
 Backup[] getBackup()
           
 Backup getBackupById(int backupId)
          This method retrieves a backup specifying his id.
static InternetCafeManager getInstance()
           
 Service[] getService()
           
 Service getServiceById(int serviceId)
          This method retrieves a service specifying his id.
 Session[] getSession()
           
 Session getSessionById(int sessionId)
          This method retrieves a session specifying his id.
 User[] getUser()
           
 User getUserById(int userId)
          This method retrieves a user specifying his id.
 User getUserByNickname(java.lang.String userNickname)
          This method retrieves a user specifying his nickname.
 void retrieve()
           
protected static java.lang.String serviceKey(Service service)
          This method simply builds a key string for an instance of Service.
protected static java.lang.String sessionKey(Session session)
          This method simply builds a key string for an instance of Session.
 void store()
           
protected static java.lang.String userKey(User user)
          This method simply builds a key string for an instance of User.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternetCafeManager

protected InternetCafeManager()
Method Detail

getInstance

public static InternetCafeManager getInstance()

store

public void store()

contains

public static boolean contains(java.lang.String[] list,
                               java.lang.String text)

retrieve

public void retrieve()

addUser

public void addUser(User user)
This method simply adds a user.

Parameters:
user - The user to add.

addBackup

public void addBackup(Backup backup)
This method simply adds a backup.

Parameters:
backup - The backup to add.

addService

public void addService(Service service)
This method simply adds a service.

Parameters:
service - The service to add.

getUser

public User[] getUser()
Returns:
Returns the user.

getBackup

public Backup[] getBackup()
Returns:
Returns the backup.

getService

public Service[] getService()
Returns:
Returns the user.

getSession

public Session[] getSession()
Returns:
Returns the session.

addSession

public void addSession(Session session)
This method simply adds a session.

Parameters:
session - The session to add.

addSessionSet

public void addSessionSet(Session[] sessionSet)
This method simply adds a set of sessions.

Parameters:
sessionSet - The session set to add.

deleteUser

public void deleteUser(User user)
This method deletes the user.

Parameters:
user - The user to be deleted.

deleteService

public void deleteService(Service service)
This method deletes the service.

Parameters:
service - The user to be deleted.

userKey

protected static java.lang.String userKey(User user)
This method simply builds a key string for an instance of User.

Parameters:
user - The user from wich build the key.
Returns:
A key rappresentation for the user.

backupKey

protected static java.lang.String backupKey(Backup backup)
This method simply builds a key string for an instance of Backup.

Parameters:
backup - The backup from wich build the key.
Returns:
A key rappresentation for the backup.

serviceKey

protected static java.lang.String serviceKey(Service service)
This method simply builds a key string for an instance of Service.

Parameters:
service - The service from wich build the key.
Returns:
A key rappresentation for the service.

sessionKey

protected static java.lang.String sessionKey(Session session)
This method simply builds a key string for an instance of Session.

Parameters:
session - The session from wich build the key.
Returns:
A key rappresentation for the session.

deleteSession

public void deleteSession(Session session)
This method deletes a session.

Parameters:
session - The session to delete.

getUserById

public User getUserById(int userId)
This method retrieves a user specifying his id.

Parameters:
userId - An id associated to the user to retrieve.
Returns:
A user with id equals to userId, null if the specified userId is not a valid user's id.

getSessionById

public Session getSessionById(int sessionId)
This method retrieves a session specifying his id.

Parameters:
sessionId - An id associated to the session to retrieve.
Returns:
A session with id equals to sessionId, null if the specified sessionId is not a valid session's id.

getServiceById

public Service getServiceById(int serviceId)
This method retrieves a service specifying his id.

Parameters:
serviceId - An id associated to the service to retrieve.
Returns:
A service with id equals to serviceId, null if the specified serviceId is not a valid service's id.

getBackupById

public Backup getBackupById(int backupId)
This method retrieves a backup specifying his id.

Parameters:
backupId - An id associated to the backup to retrieve.
Returns:
A backup with id equals to backupId, null if the specified backupId is not a valid backup's id.

deleteBackup

public void deleteBackup(Backup backup)
This method deletes a backup from the system.

Parameters:
backup - The backup to delete.

clear

public void clear()
This method clears all the InternetCafe's data. Backups will not be deleted.


getUserByNickname

public User getUserByNickname(java.lang.String userNickname)
This method retrieves a user specifying his nickname.

Parameters:
userNickname - A nickname associated to the user to retrieve.
Returns:
A user with nickname equals to userNickname, null if the specified userNickname is not a valid user's nickname.


Copyright © 2006 SF.net. All Rights Reserved.