01: /*
02: * Copyright 2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * 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: package com.pentaho.security;
14:
15: import javax.servlet.http.HttpServletRequest;
16: import javax.servlet.http.HttpServletResponse;
17:
18: import org.acegisecurity.Authentication;
19: import org.acegisecurity.ui.logout.LogoutHandler;
20: import org.apache.commons.logging.Log;
21: import org.apache.commons.logging.LogFactory;
22: import org.pentaho.core.session.IPentahoSession;
23: import org.pentaho.core.system.PentahoSystem;
24: import org.pentaho.core.util.UIUtil;
25: import org.pentaho.messages.Messages;
26:
27: /**
28: * Pentaho behavior that should be invoked when a web user logs out.
29: *
30: * @author mlowery
31: * @see org.acegisecurity.ui.logout.LogoutHandler
32: * @see org.acegisecurity.ui.logout.LogoutFilter
33: */
34: public class ProPentahoLogoutHandler implements LogoutHandler {
35: private static final Log logger = LogFactory
36: .getLog(ProPentahoLogoutHandler.class);
37:
38: public void logout(HttpServletRequest request,
39: HttpServletResponse response, Authentication authentication) {
40: if (logger.isDebugEnabled()) {
41: logger
42: .debug(Messages
43: .getString("ProPentahoLogoutHandler.DEBUG_HANDLE_LOGOUT")); //$NON-NLS-1$
44: }
45: IPentahoSession userSession = UIUtil.getPentahoSession(request);
46: PentahoSystem.invokeLogoutListeners(userSession);
47: }
48:
49: }
|