001: /*
002: * Copyright 2006 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
007: * BI Platform. The Initial Developer is Pentaho Corporation.
008: *
009: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
011: * the license for the specific language governing your rights and limitations.
012: *
013: * @created Jun 17, 2005
014: * @author James Dixon
015: *
016: */
017:
018: package org.pentaho.core.session;
019:
020: import java.util.Iterator;
021: import java.util.Locale;
022:
023: import org.pentaho.core.audit.IAuditable;
024: import org.pentaho.util.logging.ILogger;
025:
026: /**
027: * Provides an overall representation of the concept of a session. Sessions are not
028: * necessarily user-based, but typically wrap the HttpSession object and
029: * PortletSession object in a standard framework with methods that session objects
030: * typically provide.
031: *
032: * @author jdixon
033: *
034: */
035:
036: public interface IPentahoSession extends ILogger, IAuditable {
037:
038: /**
039: * Gets the name for this session, for example if this is an authenticated
040: * HTTP or Portlet session the name will be the name of the user
041: *
042: * @return Name for this session
043: */
044: public String getName();
045:
046: /**
047: * Gets ths id for this session. This is typically a GUID or semi-unique
048: * string.
049: *
050: * @return Id for this session
051: */
052: public String getId();
053:
054: /**
055: * Sets the name of the action sequence document that the session is
056: * currently performing
057: *
058: * @param actionName
059: * The name of the action sequence document
060: */
061: public void setActionName(String actionName);
062:
063: /**
064: * Sets the name of the process for which an action sequence is being
065: * performed.
066: *
067: * @param processId
068: * The name of the process
069: */
070: public void setProcessId(String processId);
071:
072: /**
073: * Destroys any resources owned by the session object
074: *
075: */
076: public void destroy();
077:
078: /**
079: * Get the value of a named session attribute
080: *
081: * @param attributeName
082: * The name of the attribute
083: * @return The value of the attribute
084: */
085: public Object getAttribute(String attributeName);
086:
087: /**
088: * Sets the value of a session attribute
089: *
090: * @param attributeName
091: * The name of the attribute
092: * @param value
093: * The value of the attribute
094: */
095: public void setAttribute(String attributeName, Object value);
096:
097: /**
098: * Removes an attribute from the session and returns is
099: *
100: * @param attributeName
101: * The name of the attribute to remove
102: * @return The value of the removed attribute
103: */
104: public Object removeAttribute(String 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 getAttributeNames();
113:
114: /**
115: * Gets the Locale of the session
116: *
117: * @return The Locale of the session
118: */
119: public Locale 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 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: }
|