KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > core > NewHTTPSessionEvent


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.core;
21
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23 import javax.servlet.http.HttpServletResponse JavaDoc;
24 import javax.servlet.http.HttpSession JavaDoc;
25
26
27 /**
28  * Fired when a new HTTP session is created. The session created is
29  * available either from the parameter or from the request object
30  * specified.
31  *
32  *
33  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
34  */

35 public class NewHTTPSessionEvent extends CoreEvent {
36     
37     private HttpServletRequest JavaDoc request;
38     private HttpServletResponse JavaDoc response;
39
40     /**
41      * Constructor.
42      *
43      * @param source source of event
44      * @param request request
45      * @param response response
46      */

47     public NewHTTPSessionEvent(Object JavaDoc source, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
48         super(source, CoreEventConstants.NEW_HTTP_SESSION, request.getSession(), null);
49         this.request = request;
50         this.response = response;
51     }
52
53     /**
54      * Get the request that caused this new session event. The session
55      * itself may be retrieved from this request object.
56      *
57      * @return request
58      */

59     public HttpServletRequest JavaDoc getRequest() {
60         return request;
61     }
62
63     /**
64      * Get the response for the request that caused this new session event.
65      *
66      * @return response
67      */

68     public HttpServletResponse JavaDoc getResponse() {
69         return response;
70     }
71     
72     /**
73      * Get the new session that was created.
74      *
75      * @return new session
76      */

77     public HttpSession JavaDoc getSession() {
78         return (HttpSession JavaDoc)getParameter();
79     }
80 }
81
Popular Tags