01: /*
02: * Copyright (c) 2001 - 2004 ivata limited.
03: * All rights reserved.
04: * -----------------------------------------------------------------------------
05: * ivata masks may be redistributed under the GNU General Public
06: * License as published by the Free Software Foundation;
07: * version 2 of the License.
08: *
09: * These programs are free software; you can redistribute them and/or
10: * modify them under the terms of the GNU General Public License
11: * as published by the Free Software Foundation; version 2 of the License.
12: *
13: * These programs are distributed in the hope that they will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16: *
17: * See the GNU General Public License in the file LICENSE.txt for more
18: * details.
19: *
20: * If you would like a copy of the GNU General Public License write to
21: *
22: * Free Software Foundation, Inc.
23: * 59 Temple Place - Suite 330
24: * Boston, MA 02111-1307, USA.
25: *
26: *
27: * To arrange commercial support and licensing, contact ivata at
28: * http://www.ivata.com/contact.jsp
29: * -----------------------------------------------------------------------------
30: * $Log: MaskAuthenticator.java,v $
31: * Revision 1.5 2005/10/11 18:54:06 colinmacleod
32: * Fixed some checkstyle and javadoc issues.
33: *
34: * Revision 1.4 2005/09/14 12:59:26 colinmacleod
35: * Changed interface for authenticate
36: * to provide servlet context.
37: *
38: * Revision 1.3 2005/04/09 18:04:19 colinmacleod
39: * Changed copyright text to GPL v2 explicitly.
40: *
41: * Revision 1.2 2005/01/07 08:08:24 colinmacleod
42: * Moved up a version number.
43: * Changed copyright notices to 2005.
44: * Updated the documentation:
45: * - started working on multiproject:site docu.
46: * - changed the logo.
47: * Added checkstyle and fixed LOADS of style issues.
48: * Added separate thirdparty subproject.
49: * Added struts (in web), util and webgui (in webtheme) from ivata op.
50: *
51: * Revision 1.1 2004/12/23 21:28:32 colinmacleod
52: * Modifications to add ivata op compatibility.
53: * -----------------------------------------------------------------------------
54: */
55: package com.ivata.mask.web.struts;
56:
57: import javax.servlet.ServletContext;
58: import javax.servlet.http.HttpServletRequest;
59: import javax.servlet.http.HttpSession;
60:
61: import com.ivata.mask.util.SystemException;
62:
63: /**
64: * <p>
65: * Mask authenticator allows you to query the state of the current web session
66: * and return control to an alternate forward, if the current user is
67: * unauthorized.
68: * </p>
69: *
70: * @since ivata masks 0.3 (2004-11-12)
71: * @author Colin MacLeod
72: * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
73: * @version $Revision: 1.5 $
74: */
75: public interface MaskAuthenticator {
76: /**
77: * <p>
78: * This is the 'do it' method of this interface <code>:-)</code>.
79: * Identify whether or not special steps should be taken for this user, and
80: * return the <strong>Struts </strong> action forward if they should.
81: * </p>
82: *
83: * @param sessionParam The current HTTP session we are processing.
84: * @param requestParam The current HTTP request we are processing.
85: * @param servletContextParam ServletContext for the current JSP or Servlet
86: * we are processing
87: * @param login <code>true</code> if the user is performing a login action,
88: * otherwise <code>false</code>.
89: * @return name of a <strong>Struts </strong> action forward to pass control
90: * to, or <code>null</code> if the current user is valid and should be
91: * allowed to continue.
92: * @throws SystemException If the current user cannot be validated for any
93: * reason.
94: */
95: String authenticate(HttpSession sessionParam,
96: HttpServletRequest requestParam,
97: ServletContext servletContextParam, boolean login)
98: throws SystemException;
99: }
|