DJDoc v.1.0.0b-1

net.sf.djdoc.servlet
Class SessionInfo

java.lang.Object
  extended by net.sf.djdoc.servlet.SessionInfo

public class SessionInfo
extends java.lang.Object

The instances of the SessionInfo class are container objects storing session-wide data such as information about the server (in particular, the logical name of the web application), the session's User object, references to the last accessed Api and Bunch objects and cached lists of the packages and class items last accessed by the user.


Constructor Summary
SessionInfo(User user, DjdocRequest req)
          Public constructor.
 
Method Summary
 java.util.Collection<Bunch> getAllBunches()
          Collection valued getter method of all available packages in the (last accessed) API of this SessionInfo.
 java.util.Collection<Item> getAllItems()
          Collection valued getter method of all available class Items in the (last accessed) package of this SessionInfo.
 Api getApi()
          Getter method of the Api object last used by the HTTP session associated with this SessionInfo.
 java.util.Collection<Api> getApiList()
          Collection valued getter method of all available APIs.
 Bunch getBunch()
          Getter method of the Bunch (package) object last used by the HTTP session associated with this SessionInfo.
 java.util.Collection<Bunch> getFavoriteBunches()
          Collection valued getter method of the top favorite packages in the (last accessed) API of this SessionInfo.
 java.util.Collection<Item> getFavoriteItems()
          Collection valued getter method of the top favorite class Items in the (last accessed) package of this SessionInfo.
 boolean getHasBunchHits()
          This method is used to check whether the last accessed API has previously accessed packages or not.
 boolean getHasItemHits()
          This method is used to check whether the last accessed package has previously accessed class items or not.
 java.util.Collection<Bunch> getRecentBunches()
          Collection valued getter method of the most recently accessed packages in the (last accessed) API of this SessionInfo.
 java.util.Collection<Item> getRecentItems()
          Collection valued getter method of the most recently accessed class Items in the (last accessed) package of this SessionInfo.
 java.lang.String getServerInfo()
          Getter method of this SessionInfo's server info (web application base URL) string.
 User getUser()
          Getter method of this SessionInfo's User object.
 void hitBunch(java.lang.String bunchName)
          This method causes a package of the last accessed API to be marked as currently accessed.
 void hitItem(java.lang.String itemName)
          This method causes a class item of the last accessed package to be marked as currently accessed.
 void setApiName(java.lang.String apiName)
          This method (re)sets the name of the API last accessed in the HTTP session of this SessionInfo.
 void setBunchName(java.lang.String bunchName)
          This method (re)sets the name of the package last accessed in the HTTP session of this SessionInfo.
 void toggleViewPref(byte view)
          This method is used to toggle one aspect of the view preference setting of this SessionInfo's User object between "collapsed" and "expanded".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionInfo

public SessionInfo(User user,
                   DjdocRequest req)
Public constructor. This is invoked once per session, namely by the DjdocFilter after creation of the first DjdocRequest object of the current HTTP session. During construction, the server info (base URL of the web application) is extracted from the DjdocRequest's path.

Parameters:
user - The User object associated with this SessionInfo
req - The DjdocRequest object used for initialization of this SessionInfo's server info
Method Detail

getServerInfo

public java.lang.String getServerInfo()
Getter method of this SessionInfo's server info (web application base URL) string.

Returns:
The server info String of this SessionInfo

getUser

public User getUser()
Getter method of this SessionInfo's User object.

Returns:
The User object of this SessionInfo

getApi

public Api getApi()
Getter method of the Api object last used by the HTTP session associated with this SessionInfo.

Returns:
The Api object last accessed in the HTTP session

getBunch

public Bunch getBunch()
Getter method of the Bunch (package) object last used by the HTTP session associated with this SessionInfo.

Returns:
The Bunch object last accessed in the HTTP session

setApiName

public void setApiName(java.lang.String apiName)
This method (re)sets the name of the API last accessed in the HTTP session of this SessionInfo. It acts as an "indirect" setter method of the SessionInfo's api property.

Parameters:
apiName - The name of the SessionInfo's API

setBunchName

public void setBunchName(java.lang.String bunchName)
This method (re)sets the name of the package last accessed in the HTTP session of this SessionInfo. It acts as an "indirect" setter method of the SessionInfo's bunch property.

Parameters:
bunchName - The name of the SessionInfo's last accessed package

getApiList

public java.util.Collection<Api> getApiList()
Collection valued getter method of all available APIs.

Returns:
A list of all available APIs

getHasBunchHits

public boolean getHasBunchHits()
This method is used to check whether the last accessed API has previously accessed packages or not.

Returns:
true if the last accessed API has accessed packages; false otherwise

getFavoriteBunches

public java.util.Collection<Bunch> getFavoriteBunches()
Collection valued getter method of the top favorite packages in the (last accessed) API of this SessionInfo.

Returns:
A list of the favorite packages

getRecentBunches

public java.util.Collection<Bunch> getRecentBunches()
Collection valued getter method of the most recently accessed packages in the (last accessed) API of this SessionInfo.

Returns:
A list of the most recently accessed packages

getAllBunches

public java.util.Collection<Bunch> getAllBunches()
Collection valued getter method of all available packages in the (last accessed) API of this SessionInfo.

Returns:
A list of all available packages

hitBunch

public void hitBunch(java.lang.String bunchName)
This method causes a package of the last accessed API to be marked as currently accessed.

Parameters:
bunchName - The name of the package to be accessed

getHasItemHits

public boolean getHasItemHits()
This method is used to check whether the last accessed package has previously accessed class items or not.

Returns:
true if the last accessed package has accessed class items; false otherwise

getFavoriteItems

public java.util.Collection<Item> getFavoriteItems()
Collection valued getter method of the top favorite class Items in the (last accessed) package of this SessionInfo.

Returns:
A list of the favorite class Items

getRecentItems

public java.util.Collection<Item> getRecentItems()
Collection valued getter method of the most recently accessed class Items in the (last accessed) package of this SessionInfo.

Returns:
A list of the most recently accessed class Items

getAllItems

public java.util.Collection<Item> getAllItems()
Collection valued getter method of all available class Items in the (last accessed) package of this SessionInfo.

Returns:
A list of all available class Items

hitItem

public void hitItem(java.lang.String itemName)
This method causes a class item of the last accessed package to be marked as currently accessed.

Parameters:
itemName - The name of the class item to be accessed

toggleViewPref

public void toggleViewPref(byte view)
This method is used to toggle one aspect of the view preference setting of this SessionInfo's User object between "collapsed" and "expanded".

Parameters:
view - The bit mask specifying which aspect of the user's view preference settings to toggle

DJDoc v.1.0.0b-1