KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > session > IPentahoSession


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Jun 17, 2005
14  * @author James Dixon
15  *
16  */

17
18 package org.pentaho.core.session;
19
20 import java.util.Iterator JavaDoc;
21 import java.util.Locale JavaDoc;
22
23 import org.pentaho.core.audit.IAuditable;
24 import org.pentaho.util.logging.ILogger;
25
26 /**
27  * Provides an overall representation of the concept of a session. Sessions are not
28  * necessarily user-based, but typically wrap the HttpSession object and
29  * PortletSession object in a standard framework with methods that session objects
30  * typically provide.
31  *
32  * @author jdixon
33  *
34  */

35
36 public interface IPentahoSession extends ILogger, IAuditable {
37     
38     /**
39      * Gets the name for this session, for example if this is an authenticated
40      * HTTP or Portlet session the name will be the name of the user
41      *
42      * @return Name for this session
43      */

44     public String JavaDoc getName();
45
46     /**
47      * Gets ths id for this session. This is typically a GUID or semi-unique
48      * string.
49      *
50      * @return Id for this session
51      */

52     public String JavaDoc getId();
53
54     /**
55      * Sets the name of the action sequence document that the session is
56      * currently performing
57      *
58      * @param actionName
59      * The name of the action sequence document
60      */

61     public void setActionName(String JavaDoc actionName);
62
63     /**
64      * Sets the name of the process for which an action sequence is being
65      * performed.
66      *
67      * @param processId
68      * The name of the process
69      */

70     public void setProcessId(String JavaDoc processId);
71
72     /**
73      * Destroys any resources owned by the session object
74      *
75      */

76     public void destroy();
77
78     /**
79      * Get the value of a named session attribute
80      *
81      * @param attributeName
82      * The name of the attribute
83      * @return The value of the attribute
84      */

85     public Object JavaDoc getAttribute(String JavaDoc attributeName);
86
87     /**
88      * Sets the value of a session attribute
89      *
90      * @param attributeName
91      * The name of the attribute
92      * @param value
93      * The value of the attribute
94      */

95     public void setAttribute(String JavaDoc attributeName, Object JavaDoc value);
96
97     /**
98      * Removes an attribute from the session and returns is
99      *
100      * @param attributeName
101      * The name of the attribute to remove
102      * @return The value of the removed attribute
103      */

104     public Object JavaDoc removeAttribute(String JavaDoc attributeName);
105
106     /**
107      * Returns an enumeration of the names of the attributes stored in the
108      * session
109      *
110      * @return The enumeration of the attribute names
111      */

112     public Iterator JavaDoc getAttributeNames();
113
114     /**
115      * Gets the Locale of the session
116      *
117      * @return The Locale of the session
118      */

119     public Locale JavaDoc getLocale();
120
121     /**
122      * Gets whether the session is known to be authenticated or not
123      *
124      * @return Is the session authenticated
125      */

126     public boolean isAuthenticated();
127
128     /**
129      * Sets the name of the session and indicates that the session is
130      * authenticated. If this is a HTTP or Portlet session the name should be
131      * the name of the user that is logged in (e.g. using
132      * <code>request.getRemoteUser()</code> )
133      *
134      * @param name
135      * The name of the session
136      */

137     public void setAuthenticated(String JavaDoc name);
138
139     /**
140      * Sets that the user is no longer authenticated
141      */

142     public void setNotAuthenticated();
143     
144     /**
145      * Toggles on an alert condition indicating that the background
146      * execution of a task has completed during this session.
147      *
148      */

149     public void setBackgroundExecutionAlert();
150     
151     /**
152      * Checks the status of a background execution task.
153      * @return True if a background execution has triggered
154      * an alert.
155      */

156     public boolean getBackgroundExecutionAlert();
157     
158     /**
159      * Toggles off the background execution alert status.
160      *
161      */

162     public void resetBackgroundExecutionAlert();
163     
164 }
165
Popular Tags