Java Doc for Session.java in  » Content-Management-System » harmonise » org » openharmonise » rm » sessions » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » harmonise » org.openharmonise.rm.sessions 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.openharmonise.rm.sessions.Session

Session
public class Session implements DataStoreObject,Publishable(Code)
Represents a user session within the system, with an associated timeout value. Through the implementation of Publishable a user can log in and out, i.e. create and delete sessions, in a web session.
author:
   Michael Bell
version:
   $Revision: 1.3 $


Field Summary
final protected static  StringCLMN_SESSION_DATE
    
final protected static  StringCLMN_SESSION_ID
    
final protected static  StringCLMN_SESSION_TIMEOUT
    
final protected static  StringCLMN_TYPE
    
final protected static  StringCLMN_USER_ID
    
final public static  StringDEFAULT_TIMEOUT_PNAME
    
protected  intDEFAULT_USER_ID
    
public static  StringDEFAULT_USER_PREFIX
    
public static  StringLAG_PERCENT_PNAME
    
public static  StringLOGGED_IN_USER_PREFIX
    
public static  StringPREFIX_SEPARATOR
    
final public static  StringTAG_LOGOFF
    
final public static  StringTAG_LOGON
    
final public static  StringTAG_SESSION
    
final protected static  StringTBL_SESSION
    
public static  Userm_QueryUser
    
protected  booleanm_bDefaultUser
    
protected  booleanm_bTimedOut
    
protected  java.util.Datem_dtLagTime
    
protected  java.util.Datem_dtTimeout
    
protected  intm_nLagPercent
    
protected  intm_nTimeout
    
protected  Stringm_sSessionId
    
protected  CachePointerm_usrPtr
    
protected  StringsDefaultLagPercent
    

Constructor Summary
public  Session(AbstractDataStoreInterface dbinterf)
     Constructs a new empty session.
public  Session(AbstractDataStoreInterface dbinterf, User usr, String sessionId, int timeout)
     Standard constructor for a new Session object with the given data.
public  Session(AbstractDataStoreInterface dbinterf, String sSessionId)
     Constructs a session from a known session id.
public  Session(AbstractDataStoreInterface dbinterf, int timeout)
     Constructs a new sessio with the specified timeout.
public  Session(AbstractDataStoreInterface dbinterf, User user, int timeout)
     Constructs a new session object for the given user and timeout.

Method Summary
protected  intcalculateLagTime(int timeout)
     Calls getLagPercent() to calculate lagtime as a percentage of timeout.
public  voiddelete()
     Removes session from the database and cache.
public static  StringgenerateSessionId()
     Generates a SessionId with default number of characters.
public  StringgetDBTableName()
    
public  intgetId()
    
public  ColumnRefgetInstanceColumnRef(String sColumn, boolean bIsHist)
    
protected  ColumnRefgetInstanceColumnRef(String sColumn)
     Returns a ColumnRef corresponding to the column given.
public  JoinConditionsgetInstanceJoinConditions(String sObjectTag, boolean bIsOuter)
    
protected  intgetLagPercent()
     Retrieves lag percent set in harmonise.prop file.
public  StringgetSessionId()
     Returns the id of this session.
public  StringgetTagName()
    
public  UsergetUser()
     Returns the user associated with this session.
protected  booleanisDefaultUser()
     Tests whether the User associated with this Session is the system default User.
protected  booleanisLagTimedOut()
     Checks lagtime against current time.
protected  booleanisTimedOut()
     Compares timeout variable against current time, removing session from database if true.
protected  booleanlogoff(Element logoff_tag, String sessId)
     Attempts to log off user.
protected  Userlogon(Element logon, State state)
     Tries to log on and return the user with username and password found in the state.
public  voidpopulate(Element xmlElement, State state)
    
public  ListprocessResultSet(CachedResultSet resultSet, SelectStatement select)
    
public  ListprocessResultSet(CachedResultSet resultSet, SelectStatement select, int limit)
    
public  voidprocessState(State state, int nTimeout)
     Gets session id from state and if found validates against object session id.
public  Elementpublish(HarmoniseOutput output)
     Returns a Session tag with a session id attribute.
public  Elementpublish(Template template, HarmoniseOutput output, State state)
    
public  Elementpublish(Element topEl, HarmoniseOutput output, State state)
    
public  voidrecordEvent(LogEvent event)
     Records an event.
public  voidregisterHttpRequest(HttpServletRequest request)
     Register the servlet request with the session so the session has access to request info.
public static  StringremoveSessionIdPrefix(String sSessId)
     Removes session id prefix if found. For example:
D_hHk1IsvRlfC1iksMH6lt becomes hHk1IsvRlfC1iksMH6lt
Note: Used to save session id in the database and cache.
Parameters:
  sSessId - session id.
public  voidsave()
     Saves session id, user key and timeout values to database.
protected  voidsetDefaultUser(boolean defaultUser)
     Sets default user boolean.
protected  voidsetDetailsFromId(String sSessId)
     Populates session details from database.
protected  voidsetLagTime(int nTimeout)
     Fills lag time variable by calling calculateLagTime(nTimeout) and adding this value to the current time.
protected  voidsetTimeout(int nTimeout)
     Fills timeout variable by adding timeout to the current time.
public  StringtoString()
    
protected  voidupdateTimeout(int nTimeout)
     Checks timeout for session.
protected  voidupdateUser(User user)
     Sets User member variable to user passed in.

Field Detail
CLMN_SESSION_DATE
final protected static String CLMN_SESSION_DATE(Code)



CLMN_SESSION_ID
final protected static String CLMN_SESSION_ID(Code)



CLMN_SESSION_TIMEOUT
final protected static String CLMN_SESSION_TIMEOUT(Code)



CLMN_TYPE
final protected static String CLMN_TYPE(Code)



CLMN_USER_ID
final protected static String CLMN_USER_ID(Code)



DEFAULT_TIMEOUT_PNAME
final public static String DEFAULT_TIMEOUT_PNAME(Code)



DEFAULT_USER_ID
protected int DEFAULT_USER_ID(Code)



DEFAULT_USER_PREFIX
public static String DEFAULT_USER_PREFIX(Code)



LAG_PERCENT_PNAME
public static String LAG_PERCENT_PNAME(Code)



LOGGED_IN_USER_PREFIX
public static String LOGGED_IN_USER_PREFIX(Code)



PREFIX_SEPARATOR
public static String PREFIX_SEPARATOR(Code)



TAG_LOGOFF
final public static String TAG_LOGOFF(Code)



TAG_LOGON
final public static String TAG_LOGON(Code)



TAG_SESSION
final public static String TAG_SESSION(Code)



TBL_SESSION
final protected static String TBL_SESSION(Code)



m_QueryUser
public static User m_QueryUser(Code)



m_bDefaultUser
protected boolean m_bDefaultUser(Code)



m_bTimedOut
protected boolean m_bTimedOut(Code)



m_dtLagTime
protected java.util.Date m_dtLagTime(Code)



m_dtTimeout
protected java.util.Date m_dtTimeout(Code)



m_nLagPercent
protected int m_nLagPercent(Code)



m_nTimeout
protected int m_nTimeout(Code)



m_sSessionId
protected String m_sSessionId(Code)



m_usrPtr
protected CachePointer m_usrPtr(Code)



sDefaultLagPercent
protected String sDefaultLagPercent(Code)




Constructor Detail
Session
public Session(AbstractDataStoreInterface dbinterf)(Code)
Constructs a new empty session.
Parameters:
  dbinterf -



Session
public Session(AbstractDataStoreInterface dbinterf, User usr, String sessionId, int timeout) throws SessionException(Code)
Standard constructor for a new Session object with the given data.
Parameters:
  dbinterf -
Parameters:
  usr -
Parameters:
  sessionId -
Parameters:
  timeout -
throws:
  SessionException -



Session
public Session(AbstractDataStoreInterface dbinterf, String sSessionId) throws SessionException(Code)
Constructs a session from a known session id.
Parameters:
  dbinterf -
Parameters:
  sSessionId -



Session
public Session(AbstractDataStoreInterface dbinterf, int timeout) throws SessionException(Code)
Constructs a new sessio with the specified timeout. with a default user.
Parameters:
  dbinterf -
Parameters:
  timeout -



Session
public Session(AbstractDataStoreInterface dbinterf, User user, int timeout) throws SessionException(Code)
Constructs a new session object for the given user and timeout.
Parameters:
  dbinterf -
Parameters:
  user -
Parameters:
  timeout -




Method Detail
calculateLagTime
protected int calculateLagTime(int timeout) throws ConfigException(Code)
Calls getLagPercent() to calculate lagtime as a percentage of timeout.
Parameters:
  timeout - lagtime lagtime in minutes.
throws:
  ConfigException -



delete
public void delete() throws SessionException(Code)
Removes session from the database and cache.
throws:
  SessionException -



generateSessionId
public static String generateSessionId()(Code)
Generates a SessionId with default number of characters. int the session id generated



getDBTableName
public String getDBTableName()(Code)



getId
public int getId()(Code)



getInstanceColumnRef
public ColumnRef getInstanceColumnRef(String sColumn, boolean bIsHist) throws DataStoreException(Code)



getInstanceColumnRef
protected ColumnRef getInstanceColumnRef(String sColumn) throws DataStoreException(Code)
Returns a ColumnRef corresponding to the column given.
Parameters:
  sColumn -
throws:
  DataStoreException -



getInstanceJoinConditions
public JoinConditions getInstanceJoinConditions(String sObjectTag, boolean bIsOuter) throws DataStoreException(Code)



getLagPercent
protected int getLagPercent() throws ConfigException(Code)
Retrieves lag percent set in harmonise.prop file. lag percent
throws:
  ConfigException -



getSessionId
public String getSessionId()(Code)
Returns the id of this session. session id variable.



getTagName
public String getTagName()(Code)



getUser
public User getUser() throws DataAccessException(Code)
Returns the user associated with this session. User variable.



isDefaultUser
protected boolean isDefaultUser()(Code)
Tests whether the User associated with this Session is the system default User. true or false.



isLagTimedOut
protected boolean isLagTimedOut()(Code)
Checks lagtime against current time.



isTimedOut
protected boolean isTimedOut() throws SessionException(Code)
Compares timeout variable against current time, removing session from database if true. true or false.
throws:
  SessionException -



logoff
protected boolean logoff(Element logoff_tag, String sessId) throws DataStoreException(Code)
Attempts to log off user. Resets session user as default user.
Parameters:
  logoff_tag -
Parameters:
  sessId - true if successful.
throws:
  DataStoreException -



logon
protected User logon(Element logon, State state) throws SessionException(Code)
Tries to log on and return the user with username and password found in the state. Sets default user flag to false.
Parameters:
  logon -
Parameters:
  state - User
throws:
  SessionException -



populate
public void populate(Element xmlElement, State state) throws PopulateException(Code)



processResultSet
public List processResultSet(CachedResultSet resultSet, SelectStatement select)(Code)



processResultSet
public List processResultSet(CachedResultSet resultSet, SelectStatement select, int limit)(Code)



processState
public void processState(State state, int nTimeout) throws SessionException(Code)
Gets session id from state and if found validates against object session id. Checks for log off, switching session id prefix to default if logging off. Updates timeout, throwing error if timed out unless default user. Checks for log on, logging on user if found and switching session id prefix to logged on. If no session id was found in the state, initialize(user, nTimeout) is called. Otherwise, updateUser(user) is called.
exception:
  SessionException -
Parameters:
  state -
Parameters:
  nTimeout -



publish
public Element publish(HarmoniseOutput output) throws PublishException(Code)
Returns a Session tag with a session id attribute.
Parameters:
  output -
Parameters:
  state -
throws:
  PublishException -



publish
public Element publish(Template template, HarmoniseOutput output, State state) throws PublishException(Code)



publish
public Element publish(Element topEl, HarmoniseOutput output, State state) throws PublishException(Code)



recordEvent
public void recordEvent(LogEvent event) throws SessionException(Code)
Records an event.
Parameters:
  nEvent -
Parameters:
  sMessage -
Parameters:
  nTimeout -
throws:
  SessionException -



registerHttpRequest
public void registerHttpRequest(HttpServletRequest request)(Code)
Register the servlet request with the session so the session has access to request info.



removeSessionIdPrefix
public static String removeSessionIdPrefix(String sSessId)(Code)
Removes session id prefix if found. For example:
D_hHk1IsvRlfC1iksMH6lt becomes hHk1IsvRlfC1iksMH6lt
Note: Used to save session id in the database and cache.
Parameters:
  sSessId - session id. session id without prefix.



save
public void save() throws SessionException(Code)
Saves session id, user key and timeout values to database.
throws:
  InvalidSessionIdException - if there is no session id or user.



setDefaultUser
protected void setDefaultUser(boolean defaultUser)(Code)
Sets default user boolean.
Parameters:
  defaultUser - true or false.



setDetailsFromId
protected void setDetailsFromId(String sSessId) throws SessionException(Code)
Populates session details from database.
Parameters:
  sSessId -
throws:
  SessionException -



setLagTime
protected void setLagTime(int nTimeout) throws ConfigException(Code)
Fills lag time variable by calling calculateLagTime(nTimeout) and adding this value to the current time.
Parameters:
  nTimeout - timeout in minutes.
throws:
  ConfigException -



setTimeout
protected void setTimeout(int nTimeout)(Code)
Fills timeout variable by adding timeout to the current time.
Parameters:
  nTimeout - timeout in minutes.



toString
public String toString()(Code)



updateTimeout
protected void updateTimeout(int nTimeout) throws SessionException(Code)
Checks timeout for session. Calls updateSession() if ok.
throws:
  SessionException - if timed out, unless default user



updateUser
protected void updateUser(User user) throws DataStoreException(Code)
Sets User member variable to user passed in. Calls updateDataBase().
Parameters:
  user -
throws:
  DataStoreException -



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.