KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snipsnap > container > SessionService


1 package org.snipsnap.container;
2
3 import org.snipsnap.user.User;
4
5 import javax.servlet.http.Cookie JavaDoc;
6 import javax.servlet.http.HttpServletRequest JavaDoc;
7 import javax.servlet.http.HttpServletResponse JavaDoc;
8
9
10 /*
11  * This file is part of "SnipSnap Wiki/Weblog".
12  *
13  * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
14  * All Rights Reserved.
15  *
16  * Please visit http://snipsnap.org/ for updates and contact.
17  *
18  * --LICENSE NOTICE--
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License
21  * as published by the Free Software Foundation; either version 2
22  * of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32  * --LICENSE NOTICE--
33  */

34
35 public interface SessionService {
36   /**
37    * Get/Set user from session or cookie.
38    */

39   public void setUser(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, User user);
40   public User getUser(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response);
41
42   /**
43    * Set cookie with has of encoded user/pass and last login time.
44    */

45   public void setCookie(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, User user);
46   public void removeCookie(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response);
47   public Cookie JavaDoc getCookie(HttpServletRequest JavaDoc request, String JavaDoc name);
48 }
49
Popular Tags