org.activemath.author.toc
Class AMSessionInfo

java.lang.Object
  extended by org.activemath.author.toc.AMSessionInfo

public class AMSessionInfo
extends Object

A class that contains a set of strings describing an activemath session.


Constructor Summary
AMSessionInfo()
          Constructs an empty AMSessionInfo object
AMSessionInfo(AMSessionInfo otherSession)
          Constructs a new AMSessionInfo object, copying the parameters of the given session.
AMSessionInfo(URL toceditServletURL, String userName, String sessionName, String language)
          Constructs an AMSessionInfo object with given serverName, userName, sessionName and default language
 
Method Summary
 boolean check()
          asks the server if the session described by this AMSessionInfo objectis available.
 boolean equals(AMSessionInfo otherSession)
          tests if two AMSessionInfo objects describe exactly the same session.
 String getLanguage()
          returns the default language stored in this AMSessionInfo object.
 int getPage()
          returns the current page number the learner was reading last time
 String getSessionName()
          returns the sessionName stored in this AMSessionInfo object.
 URL getToceditServletURL()
          returns the serverName stored in this AMSessionInfo object.
 URL getTocEditServletURL()
           
 String getUserName()
          returns the userName stored in this AMSessionInfo object.
 boolean isEmpty()
          checks if this AMSessionInfo object contains any data.
 void setLanguage(String newLanguage)
          replaces the language string stored in this AMSessionInfo object by a given string.
 void setPage(int page)
          sets the current page number
 void setSessionName(String newSessionName)
          replaces the session name stored in this AMSessionInfo object by a given name.
 void setToceditServletURL(URL newToceditServletURL)
          replaces the server name stored in this AMSessionInfo object by a given name.
 void setUserName(String newUserName)
          replaces the user name stored in this AMSessionInfo object by a given userName.
 String toString()
          produces a brief String representation of this AMSessionInfo object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AMSessionInfo

public AMSessionInfo()
Constructs an empty AMSessionInfo object


AMSessionInfo

public AMSessionInfo(URL toceditServletURL,
                     String userName,
                     String sessionName,
                     String language)
Constructs an AMSessionInfo object with given serverName, userName, sessionName and default language

Parameters:
serverName - name of the activemath server, without protocol and port.
userName - username to use
sessionName - sessionName
language - default language

AMSessionInfo

public AMSessionInfo(AMSessionInfo otherSession)
Constructs a new AMSessionInfo object, copying the parameters of the given session.

Parameters:
otherSession - The session to take parameters from.
Method Detail

equals

public boolean equals(AMSessionInfo otherSession)
tests if two AMSessionInfo objects describe exactly the same session.


getUserName

public String getUserName()
returns the userName stored in this AMSessionInfo object.


getToceditServletURL

public URL getToceditServletURL()
returns the serverName stored in this AMSessionInfo object.


getSessionName

public String getSessionName()
returns the sessionName stored in this AMSessionInfo object.


getLanguage

public String getLanguage()
returns the default language stored in this AMSessionInfo object.


getPage

public int getPage()
returns the current page number the learner was reading last time


setUserName

public void setUserName(String newUserName)
replaces the user name stored in this AMSessionInfo object by a given userName.

Parameters:
newUserName - the new user name to store.

setToceditServletURL

public void setToceditServletURL(URL newToceditServletURL)
replaces the server name stored in this AMSessionInfo object by a given name.

Parameters:
newServerName - the new server name to store.

getTocEditServletURL

public URL getTocEditServletURL()

setSessionName

public void setSessionName(String newSessionName)
replaces the session name stored in this AMSessionInfo object by a given name.

Parameters:
newSessionName - the new session name to store.

setLanguage

public void setLanguage(String newLanguage)
replaces the language string stored in this AMSessionInfo object by a given string.

Parameters:
newLanguage - the new language name to store.

setPage

public void setPage(int page)
sets the current page number


isEmpty

public boolean isEmpty()
checks if this AMSessionInfo object contains any data.

Returns:
true if this AMSessionInfo object contains no data, otherwise true.

toString

public String toString()
produces a brief String representation of this AMSessionInfo object.

Overrides:
toString in class Object
Returns:
a String describing this AMSessionInfo object.

check

public boolean check()
asks the server if the session described by this AMSessionInfo objectis available.

Returns:
true if the session could be found, otherwise false.