frysk.gui.sessions
Class SessionManager

java.lang.Object
  extended by frysk.gui.sessions.SessionManager

public class SessionManager
extends Object

SessionManager is a simple singleton design pattern that keeps it own static reference. Stores a list of sessions, can load and save those sessions, and allows addition and deletion of sessions.


Field Summary
 GuiObservable currentSessionChanged
           
static SessionManager theManager
           
 
Constructor Summary
SessionManager(File sessionsDir)
           
 
Method Summary
 void addSession(Session session)
          Add a session to the manager
 void clear()
          Clear all sessions from the manager.
 Session getCurrentSession()
          Returns the session currently being examined by Frysk.
 Session getSessionByName(String name)
          Returns a session object via the name of the session
 ObservableLinkedList getSessions()
          Returns a list of all sessions the manager has knowledge about.
 void load()
           
 boolean nameIsUsed(String name)
          Determine if there already is a session in the manager via the name of that session.
 void removeSession(Session session)
          Remove a session from the manager.
 void renameSession(Session session, String newName)
           
 void save()
           
 void setCurrentSession(Session session)
          Sets the session that is to be currently examined by frysk.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theManager

public static SessionManager theManager

currentSessionChanged

public final GuiObservable currentSessionChanged
Constructor Detail

SessionManager

public SessionManager(File sessionsDir)
Method Detail

addSession

public void addSession(Session session)
Add a session to the manager

Parameters:
session - - the session to be added.

clear

public void clear()
Clear all sessions from the manager. Will not delete or alter the sessions themselves.


getSessionByName

public Session getSessionByName(String name)
Returns a session object via the name of the session

Parameters:
name - - the name of the session to lookup
Returns:
Session - the session found by the lookup.

getSessions

public ObservableLinkedList getSessions()
Returns a list of all sessions the manager has knowledge about.

Returns:
ObservableLinkedList of sessions.

nameIsUsed

public boolean nameIsUsed(String name)
Determine if there already is a session in the manager via the name of that session.

Parameters:
name - - the name of that session.
Returns:
boolean, true if found.

removeSession

public void removeSession(Session session)
Remove a session from the manager. This will delete the session from disk, also.

Parameters:
session - - the session object to remove.

renameSession

public void renameSession(Session session,
                          String newName)

setCurrentSession

public void setCurrentSession(Session session)
Sets the session that is to be currently examined by frysk.

Parameters:
session -

getCurrentSession

public Session getCurrentSession()
Returns the session currently being examined by Frysk.

Returns:

save

public void save()

load

public void load()