|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.misc.CurrentLogin
Bean that stores current login info in session; implements session binding listener so that it can hear when session is terminated. This class be overriden and replaced with subclass by adding a line to expresso-config.xml under 'class-handlers', like class-handler name="CurrentLogin" classHandler="my.subclass.of.CurrentLogin" This override will allow custom handling in the session bind/unbind events.
| Field Summary | |
static String |
LOGIN_KEY
The session key that we can use to get the currentlogin from a person's session. |
| Constructor Summary | |
CurrentLogin()
Default constructor. |
|
CurrentLogin(String newSessionId,
String newUserName,
String newIPAddress,
String newDataContext,
long newLoggedInAt,
int newUid)
Deprecated. use newInstance() instead; 9/04 v5.5+ |
|
| Method Summary | |
void |
addMessage(String newMessage)
Add message to the current login. |
ArrayList |
getAndClearMessages()
Gets the current messages associated with this current login and then automatically removes them. |
Object |
getAttribute(String key)
Get an attribute stored in hashtable in session. |
String |
getDBName()
Bean method that gets the current database name. |
String |
getIPAddress()
|
static org.apache.log4j.Logger |
getLogger()
Loads the Log4j Logger if necessary. |
long |
getLogInTime()
|
String |
getSessionId()
Bean method that gets the session id. |
int |
getUid()
Bean method that gets the current uid. |
String |
getUserName()
Bean method that gets the currently logged in user name. |
static CurrentLogin |
newInstance(String newUserName,
String newIPAddress,
String dataContext,
int newUid)
Object construction. |
static CurrentLogin |
newInstance(String newSessionId,
String newUserName,
String newIPAddress,
String dataContext,
long newLoggedInAt,
int newUid)
Deprecated. use other newInstance instead; 9/04 v.5.5+ |
void |
removeAttribute(String key)
Remove an attribute stored in hashtable in session. |
void |
setAttribute(String key,
Object attribute)
Set an attribute stored in hashtable in session. |
void |
setDBName(String newDBName)
Bean method that setse the database context name for the login. |
void |
setIpAddress(String theIpAddress)
Convenience setter. |
void |
setLoggedInAt(long loggedInAt)
Convenience setter. |
void |
setSessionId(String theSessionId)
Convenience setter. |
void |
setUid(int theUid)
Convenience setter. |
void |
setUserName(String newUserName)
Bean method that sets the user name for the login. |
void |
valueBound(HttpSessionBindingEvent evt)
This class listens to the binding of this object to the session. |
void |
valueUnbound(HttpSessionBindingEvent evt)
This class listens to the unbinding of this object to the session. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String LOGIN_KEY
| Constructor Detail |
public CurrentLogin(String newSessionId,
String newUserName,
String newIPAddress,
String newDataContext,
long newLoggedInAt,
int newUid)
newSessionId - the session id as returned by the servlet containernewUserName - the user login namenewIPAddress - the user's ip addressnewDataContext - the data context for the loginnewLoggedInAt - the time the user logged innewUid - the new user idpublic CurrentLogin()
| Method Detail |
public static org.apache.log4j.Logger getLogger()
public void addMessage(String newMessage)
newMessage - The New Message.public ArrayList getAndClearMessages()
public void setUserName(String newUserName)
newUserName - the new user name.public void setDBName(String newDBName)
newDBName - the database context.public String getSessionId()
public String getUserName()
public int getUid()
public String getDBName()
public String getIPAddress()
public long getLogInTime()
public void valueBound(HttpSessionBindingEvent evt)
valueBound in interface HttpSessionBindingListenerevt - The HttpSession Binding Event.public void valueUnbound(HttpSessionBindingEvent evt)
valueUnbound in interface HttpSessionBindingListenerevt - The HttpSessionBindingEvent that is the source.
public static CurrentLogin newInstance(String newUserName,
String newIPAddress,
String dataContext,
int newUid)
newUserName - the user name of the person logging innewIPAddress - the client ip addressdataContext - the data context to log into.newUid - The new user id.
public static CurrentLogin newInstance(String newSessionId,
String newUserName,
String newIPAddress,
String dataContext,
long newLoggedInAt,
int newUid)
newSessionId - the servlet session idnewUserName - the user name of the person logging innewIPAddress - the client ip addressdataContext - the data context to log into.newLoggedInAt - system time that the person logged in.newUid - The new user id.
public void setLoggedInAt(long loggedInAt)
loggedInAt - timestamp in millisecondspublic Object getAttribute(String key)
key - hashkey
public void setAttribute(String key,
Object attribute)
key - hashkeyattribute - to be storedpublic void removeAttribute(String key)
key - hashkeypublic void setIpAddress(String theIpAddress)
theIpAddress - address of this loginpublic void setUid(int theUid)
theUid - user ID of this loginpublic void setSessionId(String theSessionId)
theSessionId - ID of this session
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||