| java.lang.Object net.jforum.SessionFacade
SessionFacade | public class SessionFacade implements Cacheable(Code) | | author: Rafael Steil version: $Id: SessionFacade.java,v 1.40 2007/09/20 16:07:10 rafaelsteil Exp $ |
add | public static void add(UserSession us)(Code) | | Add a new UserSession entry to the session.
This method will make a call to JForum.getRequest.getSession().getId()
to retrieve the session's id
Parameters: us - The user session objetc to add See Also: SessionFacade.add(UserSession,String) |
add | public static void add(UserSession us, String sessionId)(Code) | | Registers a new
UserSession .
If a call to
UserSession.getUserId return a value different
of SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID) , then
the user will be registered as "logged". Otherwise it will enter as anonymous.
Please note that, in order to keep the number of guest and logged users correct,
it's caller's responsability to
SessionFacade.remove(String) the record before adding it
again if the current session is currently represented as "guest".
Parameters: us - the UserSession to add Parameters: sessionId - the user's session id |
anonymousSize | public static int anonymousSize()(Code) | | Get the number of anonymous users
the nuber of anonymous users |
clear | public static void clear()(Code) | | |
getAllSessions | public static List getAllSessions()(Code) | | Get all registered sessions
ArrayList with the sessions. Each entryis an UserSession object. |
getAttribute | public static Object getAttribute(String name)(Code) | | Gets an attribute value given its name
Parameters: name - The attribute name to retrieve the value The value as an Object, or null if no entry was found |
getLoggedSessions | public static List getLoggedSessions()(Code) | | Gets the
UserSession instance of all logged users
A list with the user sessions |
getTopicsReadTime | public static Map getTopicsReadTime()(Code) | | Returns a map containing information about read time of a set of topics.
a map where the key is the topicId represented as an Integer, and thevalue is a Long representing the read time of such topic. |
getTopicsReadTimeByForum | public static Map getTopicsReadTimeByForum()(Code) | | Returns a map with "all topics read" flags for some forum
a map where the key is the forum id represented as an Integer, and the value is a Long representing the read time to be used in the verifications. |
getUserSession | public static UserSession getUserSession()(Code) | | Gets the user's UserSession object
The UserSession associated to the user's session |
getUserSession | public static UserSession getUserSession(String sessionId)(Code) | | Gets an
UserSession by the session id.
Parameters: sessionId - the session's id an immutable UserSession, or null if no entry found |
isLogged | public static boolean isLogged()(Code) | | Verify is the user is logged in.
true if the user is logged, or false if is an anonymous user. |
isUserInSession | public static String isUserInSession(String username)(Code) | | Verify if the user in already loaded
Parameters: username - The username to check The session id if the user is already registered into the session, or null if it is not. |
isUserInSession | public static String isUserInSession(int userId)(Code) | | Verify if there is an user in the session with the
user id passed as parameter.
Parameters: userId - The user id to check for existance in the session The session id if the user is already registered into the session, or null if it is not. |
makeLogged | public static void makeLogged()(Code) | | Marks the current user session as "logged" in
|
makeUnlogged | public static void makeUnlogged()(Code) | | Marks the current user session as "logged" out
|
registeredSize | public static int registeredSize()(Code) | | Get the number of logged users
the number of logged users |
remove | public static void remove(String sessionId)(Code) | | Remove an entry fro the session map
Parameters: sessionId - The session id to remove |
removeAttribute | public static void removeAttribute(String name)(Code) | | Removes an attribute from the session
Parameters: name - The key associated to the the attribute to remove |
setAttribute | public static void setAttribute(String name, Object value)(Code) | | Add a new entry to the user's session
Parameters: name - The attribute name Parameters: value - The attribute value |
size | public static int size()(Code) | | Gets the number of session elements.
The number of session elements currently online (without bots) |
storeSessionData | public static void storeSessionData(String sessionId)(Code) | | Persists user session information.
This method will get a Connection making a call to
DBConnection.getImplementation().getConnection() , and
then releasing the connection after the method is processed.
Parameters: sessionId - The session which we're going to persist information See Also: SessionFacade.storeSessionData(String,Connection) |
storeSessionData | public static void storeSessionData(String sessionId, Connection conn)(Code) | | Persists user session information.
Parameters: sessionId - The session which we're going to persist Parameters: conn - A Connection to be used to connect tothe database. See Also: SessionFacade.storeSessionData(String) |
|
|