Java Doc for JwmaSession.java in  » Web-Mail » Jwma » dtw » webmail » 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 » Web Mail » Jwma » dtw.webmail 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   dtw.webmail.JwmaSession

JwmaSession
public class JwmaSession implements Serializable(Code)
Class that models the state of a jwma session.

Each instance stores the state and provides accessor and mutator operations for retrieving and changing.

The reference to the instance itself is stored in the HttpSession as session attribute.

Note that this class is actually the bridge between the web session and the mail client session, and that instances have the responsibility to manage the state of both.
author:
   Dieter Wimberger
version:
   0.9.7 07/02/2003


Inner Class :class StoreConnectionHandler extends ConnectionAdapter


Constructor Summary
public  JwmaSession(HttpSession session)
     Constructs a JwmaSession instance.

Method Summary
public  booleanauthenticate(String username, String password, boolean newAccount)
     Authenticates the given user by initializing the mail session, thus authenticating against the post office of this session. Note that the credentials (i.e.
public  voidend()
     Ends this session, by cleaning up user related data and resources. If the session is authenticated, then the new last login String is stored in the users preferences, before they are saved.
public  voidensureAdministrator()
     Tests whether the user associated with this session is allowed to administrate jwma and throws a JwmaException if not, thus ensuring an administrative user.
public  voidensureAuthenticated()
     Tests wheter this session is authenticated, throwing a JwmaException if not, thus ensuring an authenticated session.
public  voidensurePostOfficeConnection()
     Tests wheter a connection to the post office exists, throwing a JwmaException if not, thus it ensures that a connection to the post office exists.
public  voidfinalize()
     Overrides the superclass method to call end().
public  JwmaStoreImplgetJwmaStore()
     Returns the actual mailsession's JwmaStoreImpl.
public  JwmaTransportImplgetJwmaTransport()
     Returns the actual mailsession's JwmaTransportImpl.
public  StringgetLastLogin()
     Returns a String representing the user's last login date and originating host.
public  MailTransportAgentgetMTA()
    
public  SessiongetMailSession()
     Returns this instances mailsession.
public  PostOfficegetPostOffice()
    
public  JwmaPreferencesImplgetPreferences()
     Returns the JwmaPreferencesImpl instance of this session instance's user.
public  HttpServletRequestgetRequest()
     Returns the reference to the actual HttpServletRequest instance.
public  StringgetRequestParameter(String name)
     Returns the value of a request parameter from this session's HttpServletRequest.
public  String[]getRequestParameters(String name)
     Returns the values of a request parameter from this session's HttpServletRequest.
public  HttpServletResponsegetResponse()
     Returns the reference to the actual HttpServletResponse instance.
public  StringgetUserIdentity(String username)
     Returns the assembled user's identity as String.
Parameters:
  username - the user's name as String.
public  StringgetUserIdentity()
     Returns the assembled user's identity as String.
public  StringgetUsername()
     Returns the username associated with this JwmaSession.
public  HttpSessiongetWebSession()
     Returns the reference to the actual HttpSession instance.
public  booleanisAdministrator()
     Tests if this session's associated user is an administrator.
public  booleanisAuthenticated()
     Tests if this session is authenticated.
public  booleanisPostOfficeConnected()
     Tests if this session has a connection to the post office.
public  booleanisValidWebSession()
     Tests if the associated web session is valid.
public  voidredirect(String view)
     Redirects the the actual HttpServletRequest to an abstract view.
public  voidredirectToActual()
     Redirects the the actual HttpServletRequest to the present view.
public  voidredirectToLast()
     Redirects the the actual HttpServletRequest to the last view.
public  voidremoveBean(String name)
     Removes a reference to a bean (model) in the actual HttpSession.
public  ObjectretrieveBean(String name)
     Returns a reference to a bean(model) in the actual HttpSession.

If no bean with the given name/identifyer is stored in the actual session, then it returns null.
Parameters:
  name - the unique identifier of bean to be stored assession attribute.

public  booleansavePreferences()
     Saves the JwmaPreferencesImpl instance of this session instance's user.
public  voidsetLocale()
     Sets the Locale of this Session to the one that is stored in the user's preferences.
public  voidsetMTA(MailTransportAgent MTA)
    
public  voidsetPostOffice(PostOffice office)
    
public  voidsetRequest(HttpServletRequest request)
     Sets the reference to the actual HttpServletRequest instance.
public  voidsetResponse(HttpServletResponse response)
     Sets the reference to the actual HttpServletResponse instance.
public  voidsetWebSession(HttpSession websession)
     Sets the reference to the actual HttpSession instance.
public  voidstoreBean(String name, Object bean)
     Stores a reference to a bean(model) in the actual HttpSession.


Constructor Detail
JwmaSession
public JwmaSession(HttpSession session)(Code)
Constructs a JwmaSession instance.
Parameters:
  session - reference to the actual HttpSession instance.




Method Detail
authenticate
public boolean authenticate(String username, String password, boolean newAccount) throws JwmaException(Code)
Authenticates the given user by initializing the mail session, thus authenticating against the post office of this session. Note that the credentials (i.e. password) are not stored anywhere.
Parameters:
  username - the name of this session's user asString.
Parameters:
  password - the related credentials as String.
Parameters:
  newAccount - a flag that denotes whether a jwma accountalready exists (false) or not (true).
throws:
  JwmaException - if initializing a mailsession orauthenticating against the post office fails.



end
public void end()(Code)
Ends this session, by cleaning up user related data and resources. If the session is authenticated, then the new last login String is stored in the users preferences, before they are saved. Consequently the mail session is closed, and the bean references stored in this session are cleaned up.
See Also:   JwmaSession.isAuthenticated()
See Also:   JwmaSession.savePreferences()



ensureAdministrator
public void ensureAdministrator() throws JwmaException(Code)
Tests whether the user associated with this session is allowed to administrate jwma and throws a JwmaException if not, thus ensuring an administrative user.
throws:
  JwmaException - if the associated username is not anadmin.



ensureAuthenticated
public void ensureAuthenticated() throws JwmaException(Code)
Tests wheter this session is authenticated, throwing a JwmaException if not, thus ensuring an authenticated session.
throws:
  JwmaException - if the session is not authenticated.



ensurePostOfficeConnection
public void ensurePostOfficeConnection() throws JwmaException(Code)
Tests wheter a connection to the post office exists, throwing a JwmaException if not, thus it ensures that a connection to the post office exists.
throws:
  JwmaException - if there is no connection tothe post office.



finalize
public void finalize()(Code)
Overrides the superclass method to call end().
See Also:   JwmaSession.end()



getJwmaStore
public JwmaStoreImpl getJwmaStore()(Code)
Returns the actual mailsession's JwmaStoreImpl. the actual mailsession's store as JwmaStoreImpl
See Also:   dtw.webmail.model.JwmaStoreImpl



getJwmaTransport
public JwmaTransportImpl getJwmaTransport()(Code)
Returns the actual mailsession's JwmaTransportImpl. the actual mailsession's transport as JwmaTransportImpl
See Also:   dtw.webmail.model.JwmaTransportImpl



getLastLogin
public String getLastLogin()(Code)
Returns a String representing the user's last login date and originating host. the last login with date and originatinghost as String.



getMTA
public MailTransportAgent getMTA()(Code)



getMailSession
public Session getMailSession()(Code)
Returns this instances mailsession. this instances mailsession as javax.mail.Session.
See Also:   javax.mail.Session



getPostOffice
public PostOffice getPostOffice()(Code)



getPreferences
public JwmaPreferencesImpl getPreferences()(Code)
Returns the JwmaPreferencesImpl instance of this session instance's user. this session instance's user's preferences asJwmaPreferencesImpl.



getRequest
public HttpServletRequest getRequest()(Code)
Returns the reference to the actual HttpServletRequest instance. reference to the actual HttpServletRequest instance.



getRequestParameter
public String getRequestParameter(String name)(Code)
Returns the value of a request parameter from this session's HttpServletRequest. This is a convenience method that trims the Strings. the value of the request parameter or nullif it doesn't have a value.



getRequestParameters
public String[] getRequestParameters(String name)(Code)
Returns the values of a request parameter from this session's HttpServletRequest. This is a convenience method that trims the Strings. the value of the request parameters or nullif it doesn't have any value.



getResponse
public HttpServletResponse getResponse()(Code)
Returns the reference to the actual HttpServletResponse instance. reference to the actual HttpServletResponseinstance.



getUserIdentity
public String getUserIdentity(String username)(Code)
Returns the assembled user's identity as String.
Parameters:
  username - the user's name as String. the identifier is assembled like a standard email addressusing the set postoffice host.



getUserIdentity
public String getUserIdentity()(Code)
Returns the assembled user's identity as String. the identifier assembled like a standard email addressusing the set username and hostname.



getUsername
public String getUsername()(Code)
Returns the username associated with this JwmaSession. the name as String.



getWebSession
public HttpSession getWebSession()(Code)
Returns the reference to the actual HttpSession instance. reference to the actual HttpSession instance.



isAdministrator
public boolean isAdministrator()(Code)
Tests if this session's associated user is an administrator. true if associated username represents an admin,false otherwise.



isAuthenticated
public boolean isAuthenticated()(Code)
Tests if this session is authenticated. If the session is flagged as authenticated, the initialization of the mail session worked successfully, and the user associated with this session could be authenticated against the post office. true if authenticated, false otherwise.



isPostOfficeConnected
public boolean isPostOfficeConnected()(Code)
Tests if this session has a connection to the post office. true if there is a connection, false otherwise.



isValidWebSession
public boolean isValidWebSession()(Code)
Tests if the associated web session is valid. This is the case if it is not new, and if it has not been invalidated. true if valid, false otherwise.



redirect
public void redirect(String view)(Code)
Redirects the the actual HttpServletRequest to an abstract view.

The String parameter passed in has to be one of the defined abstract view constants.
Parameters:
  view - representing one of the constants defining an abstractview.
See Also:   dtw.webmail.JwmaKernel.LOGIN_VIEW
See Also:   dtw.webmail.JwmaKernel.ERROR_VIEW
See Also:   dtw.webmail.JwmaKernel.LOGOUT_VIEW
See Also:   dtw.webmail.JwmaKernel.FOLDER_VIEW
See Also:   dtw.webmail.JwmaKernel.MESSAGE_VIEW
See Also:   dtw.webmail.JwmaKernel.PREFERENCES_VIEW
See Also:   dtw.webmail.JwmaKernel.COMPOSE_VIEW
See Also:   dtw.webmail.JwmaKernel.FIRSTTIME_VIEW
See Also:   dtw.webmail.JwmaKernel.CONTACTS_VIEW




redirectToActual
public void redirectToActual()(Code)
Redirects the the actual HttpServletRequest to the present view.

The actual view is traced by a simple history mechanism implemented in the redirect() method. This method helps to acquire an updated view of the actual view.




redirectToLast
public void redirectToLast()(Code)
Redirects the the actual HttpServletRequest to the last view.

The last view is traced by a simple history mechanism implemented in the redirect() method.




removeBean
public void removeBean(String name)(Code)
Removes a reference to a bean (model) in the actual HttpSession.
Parameters:
  name - the unique identifier of bean to be stored assession attribute.



retrieveBean
public Object retrieveBean(String name)(Code)
Returns a reference to a bean(model) in the actual HttpSession.

If no bean with the given name/identifyer is stored in the actual session, then it returns null.
Parameters:
  name - the unique identifier of bean to be stored assession attribute. the reference to the bean stored as sessionattribute or null.




savePreferences
public boolean savePreferences() throws JwmaException(Code)
Saves the JwmaPreferencesImpl instance of this session instance's user. Note that the actual process of saving is delegated to the active PreferencesPersistencePlugin instance obtained from the kernel.
See Also:   dtw.webmail.plugin.PreferencesPersistencePlugin.savePreferences(JwmaPreferencesImpl) true if saved properly, false otherwise.



setLocale
public void setLocale()(Code)
Sets the Locale of this Session to the one that is stored in the user's preferences.



setMTA
public void setMTA(MailTransportAgent MTA)(Code)



setPostOffice
public void setPostOffice(PostOffice office)(Code)



setRequest
public void setRequest(HttpServletRequest request)(Code)
Sets the reference to the actual HttpServletRequest instance.
Parameters:
  request - reference to the actual incomingHttpServletRequest instance.



setResponse
public void setResponse(HttpServletResponse response)(Code)
Sets the reference to the actual HttpServletResponse instance.
Parameters:
  request - reference to the actual HttpServletResponseinstance.



setWebSession
public void setWebSession(HttpSession websession)(Code)
Sets the reference to the actual HttpSession instance.
Parameters:
  reference - to the actual HttpSession instance.



storeBean
public void storeBean(String name, Object bean)(Code)
Stores a reference to a bean(model) in the actual HttpSession.

All stored beans are traced, so that they can be properly removed.
Parameters:
  name - the unique identifier of bean to be stored assession attribute.
Parameters:
  bean - the reference to the bean to be stored as sessionattribute.




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.