Java Doc for DbSessionStore.java in  » Authentication-Authorization » josso-1.7 » org » josso » gateway » session » service » store » db » 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 » Authentication Authorization » josso 1.7 » org.josso.gateway.session.service.store.db 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.josso.gateway.session.service.store.AbstractSessionStore
      org.josso.gateway.session.service.store.db.DbSessionStore

All known Subclasses:   org.josso.gateway.session.service.store.db.DataSourceSessionStore,  org.josso.gateway.session.service.store.db.JdbcSessionStore,
DbSessionStore
abstract public class DbSessionStore extends AbstractSessionStore (Code)
An abstraction of a SessionStore backed by a database.

Additional component properties include:

  • sizeQuery = The SQL Query used to add a new session to the store.
  • keysQuery = The SQL Query used to retrieve all session ids. The first column for each row in the result set must be the session id.
  • loadAllQuery = The SQL Query used to load all sessions from the store.
  • loadQuery = The SQL Query used to load one session from the store based on its id.
  • loadByUserNameQuery = The SQL Query used to load all sessions associated to a given user.
  • loadByLastAccesstimeQuery = The SQL Query used to load all sessions last accessed before the given date.
  • loadByValidQuery = The SQL Query used to load all sessions whose valid property is equals to the gvien argument.
  • deleteDml = The SQL Query used to remove a session from the store.
  • deletAllDml = The SQL Query used to remove ALL sessions from the store.
  • insertDml = The SQL Query used to add a new session to the store.

The columns in the result set for all load methods must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid

lastAccessTime and creationTime are treated as a longs, not dates.


author:
   Jeff Gutierrez (code@gutierrez.ph) ca




Method Summary
public  voidclear()
    
protected  voidclose(Connection dbConnection)
     Close the given db connection.
protected  BaseSessioncreateFromResultSet(ResultSet rs)
     This method builds a session instance based on a result set.
protected  voiddelete(Connection conn, String sessionId)
     This removes a session, using the value of the removeDml property as prepared statement.
abstract protected  ConnectiongetConnection()
     Implementation classes implement this method.
public  StringgetDeleteAllDml()
    
public  StringgetDeleteDml()
    
public  StringgetInsertDml()
    
public  StringgetKeysQuery()
    
public  StringgetLoadAllQuery()
    
public  StringgetLoadByLastAccessTimeQuery()
    
public  StringgetLoadByUserNameQuery()
    
public  StringgetLoadByValidQuery()
    
public  StringgetLoadQuery()
    
protected  BaseSession[]getSessions(ResultSet rs)
    
public  intgetSize()
     This method returns the number of stored sessions.
public  StringgetSizeQuery()
    
protected  voidinsert(Connection conn, BaseSession session)
    
public  String[]keys()
     Returns all session keys (ids) The first column for each row in the result set must be the session id.
public  BaseSessionload(String id)
     Loads a session based on its id.
public  BaseSession[]loadAll()
     Loads all stored sessions.
public  BaseSession[]loadByLastAccessTime(Date date)
     Loads all sessions last accessed before the given date.
public  BaseSession[]loadByUsername(String userName)
    
public  BaseSession[]loadByValid(boolean valid)
     Loads all sessions whose valid property is equals to the received argument.
public  voidremove(String id)
    
public  voidsave(BaseSession session)
     Stores a session in the DB.
public  voidsetDeleteAllDml(String query)
     The SQL Query used to remove ALL sessions from the store.
public  voidsetDeleteDml(String query)
     The SQL Query used to remove a session from the store.
public  voidsetInsertDml(String query)
     The SQL Query used to add a new session to the store.
public  voidsetKeysQuery(String query)
     The SQL Query used to retrieve all session ids.
public  voidsetLoadAllQuery(String query)
     The SQL Query used to load all sessions from the store.
public  voidsetLoadByLastAccessTimeQuery(String query)
     The SQL Query used to load all sessions last accessed before the given date.
public  voidsetLoadByUserNameQuery(String query)
     The SQL Query used to load all sessions associated to a given user.
public  voidsetLoadByValidQuery(String query)
     The SQL Query used to load all sessions whose valid property is equals to the given valid.
public  voidsetLoadQuery(String query)
     The SQL Query used to load one session from the store based on its id.
public  voidsetSizeQuery(String query)
     The SQL query used to retrieve the number of sessions in the store.



Method Detail
clear
public void clear() throws SSOSessionException(Code)
Removes ALL stored sessions
See Also:   DbSessionStore.setDeleteAllDml(String)
throws:
  SSOSessionException -



close
protected void close(Connection dbConnection) throws SSOSessionException(Code)
Close the given db connection.
Parameters:
  dbConnection -



createFromResultSet
protected BaseSession createFromResultSet(ResultSet rs) throws SQLException(Code)
This method builds a session instance based on a result set. Expected columns, in order: sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid
Parameters:
  rs -
throws:
  SQLException -



delete
protected void delete(Connection conn, String sessionId) throws SQLException(Code)
This removes a session, using the value of the removeDml property as prepared statement.
Parameters:
  conn -
Parameters:
  sessionId -
throws:
  SQLException -



getConnection
abstract protected Connection getConnection() throws SQLException, SSOSessionException(Code)
Implementation classes implement this method. A database connection.



getDeleteAllDml
public String getDeleteAllDml()(Code)



getDeleteDml
public String getDeleteDml()(Code)



getInsertDml
public String getInsertDml()(Code)



getKeysQuery
public String getKeysQuery()(Code)



getLoadAllQuery
public String getLoadAllQuery()(Code)



getLoadByLastAccessTimeQuery
public String getLoadByLastAccessTimeQuery()(Code)



getLoadByUserNameQuery
public String getLoadByUserNameQuery()(Code)



getLoadByValidQuery
public String getLoadByValidQuery()(Code)



getLoadQuery
public String getLoadQuery()(Code)



getSessions
protected BaseSession[] getSessions(ResultSet rs) throws SQLException(Code)



getSize
public int getSize() throws SSOSessionException(Code)
This method returns the number of stored sessions. The first column of the first row in the result set must be the number of sessions.
See Also:   DbSessionStore.setSizeQuery(String) the number of sessions
exception:
  SSOSessionException -



getSizeQuery
public String getSizeQuery()(Code)



insert
protected void insert(Connection conn, BaseSession session) throws SQLException(Code)



keys
public String[] keys() throws SSOSessionException(Code)
Returns all session keys (ids) The first column for each row in the result set must be the session id.
See Also:   DbSessionStore.setKeysQuery(String) The session keys
exception:
  SSOSessionException -



load
public BaseSession load(String id) throws SSOSessionException(Code)
Loads a session based on its id. The columns in the result set must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid
See Also:   DbSessionStore.setLoadQuery(String)
Parameters:
  id -
throws:
  SSOSessionException -



loadAll
public BaseSession[] loadAll() throws SSOSessionException(Code)
Loads all stored sessions. The columns in the result set must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid
See Also:   DbSessionStore.setLoadAllQuery(String)



loadByLastAccessTime
public BaseSession[] loadByLastAccessTime(Date date) throws SSOSessionException(Code)
Loads all sessions last accessed before the given date. The date is converted to java.sql.Date when setting up the prepared statement. The columns in the result set must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid
See Also:   DbSessionStore.setLoadByLastAccessTimeQuery(String)



loadByUsername
public BaseSession[] loadByUsername(String userName) throws SSOSessionException(Code)
Loads all sessions based on the associated username The columns in the result set must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid
See Also:   DbSessionStore.setLoadByUserNameQuery(String)



loadByValid
public BaseSession[] loadByValid(boolean valid) throws SSOSessionException(Code)
Loads all sessions whose valid property is equals to the received argument.
See Also:   DbSessionStore.setLoadByValidQuery(String)



remove
public void remove(String id) throws SSOSessionException(Code)
Removes a session from the store based on its id
See Also:   DbSessionStore.setDeleteDml(String)
exception:
  SSOSessionException -



save
public void save(BaseSession session) throws SSOSessionException(Code)
Stores a session in the DB. This method opens a transaccion, removes the old session if present, the creates it again using the configured savenDml Query and commits the transaction. Session attributes will be passed to the prepared statemetn in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid
See Also:   DbSessionStore.setInsertDml(String)
Parameters:
  session -
throws:
  SSOSessionException -



setDeleteAllDml
public void setDeleteAllDml(String query)(Code)
The SQL Query used to remove ALL sessions from the store.



setDeleteDml
public void setDeleteDml(String query)(Code)
The SQL Query used to remove a session from the store.



setInsertDml
public void setInsertDml(String query)(Code)
The SQL Query used to add a new session to the store.
Parameters:
  query -



setKeysQuery
public void setKeysQuery(String query)(Code)
The SQL Query used to retrieve all session ids. The first column for each row in the result set must be the session id.



setLoadAllQuery
public void setLoadAllQuery(String query)(Code)
The SQL Query used to load all sessions from the store. The columns in the result set must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid
Parameters:
  query -



setLoadByLastAccessTimeQuery
public void setLoadByLastAccessTimeQuery(String query)(Code)
The SQL Query used to load all sessions last accessed before the given date. The columns in the result set must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid



setLoadByUserNameQuery
public void setLoadByUserNameQuery(String query)(Code)
The SQL Query used to load all sessions associated to a given user. The columns in the result set must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid
Parameters:
  query -



setLoadByValidQuery
public void setLoadByValidQuery(String query)(Code)
The SQL Query used to load all sessions whose valid property is equals to the given valid. The columns in the result set must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid



setLoadQuery
public void setLoadQuery(String query)(Code)
The SQL Query used to load one session from the store based on its id. The columns in the result set must be in the following order : sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid example : SELECT sessionId, userName, creationTime, lastAccessTime, accessCount, maxInactiveInterval, valid FROM JOSSO_SESSION WHERE sessionId = ?
Parameters:
  query -



setSizeQuery
public void setSizeQuery(String query)(Code)
The SQL query used to retrieve the number of sessions in the store. The first column of the first row in the result set must be the number of sessions.




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)

w__w__w___.__j__a_v___a_2_s__._c__o__m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.