01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.client.event;
19:
20: /**
21: * Created when a user has logged in to the server.
22: */
23: public class LoginEvent extends AbstractContelligentEvent {
24:
25: /**
26: * The name of the user who logged in.
27: */
28: private String userName = null;
29:
30: /**
31: * The name of the host from where the user logged in.
32: */
33: private String hostName = null;
34:
35: /**
36: * The id of session which was created for the login.
37: */
38: private String sessionId = null;
39:
40: /**
41: * Creates a login event.
42: *
43: * @param source
44: * the object which produced this event.
45: * @param userName
46: * the name of the user who logged in.
47: * @param hostName
48: * the name of the host from where the user logged in.
49: * @param sessionId
50: * The id of session which was created for the login.
51: */
52: public LoginEvent(Object source, String userName, String hostName,
53: String sessionId) {
54: super (source);
55: this .userName = userName;
56: this .hostName = hostName;
57: this .sessionId = sessionId;
58: }
59:
60: /**
61: * Get the name of the host from where the user logged in.
62: */
63: public String getHostName() {
64: return hostName;
65: }
66:
67: /**
68: * Get the id of the session which was created at the login.
69: */
70: public String getSessionId() {
71: return sessionId;
72: }
73:
74: /**
75: * Get the name of the user who logged in.
76: */
77: public String getUserName() {
78: return userName;
79: }
80:
81: public String toString() {
82: return getClass().getName() + "[user=" + userName + ", host="
83: + hostName + "]";
84: // ", session=" + sessionId + "]";
85: }
86:
87: }
|