01: /*
02: * JOSSO: Java Open Single Sign-On
03: *
04: * Copyright 2004-2008, Atricore, Inc.
05: *
06: * This is free software; you can redistribute it and/or modify it
07: * under the terms of the GNU Lesser General Public License as
08: * published by the Free Software Foundation; either version 2.1 of
09: * the License, or (at your option) any later version.
10: *
11: * This software is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this software; if not, write to the Free
18: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
20: */
21: package org.josso.agent;
22:
23: import java.util.EventObject;
24:
25: /**
26: * General event for notifying listeners of significant changes on a LocalSession.
27: *
28: * @author <a href="mailto:gbrigand@josso.org">Gianluca Brigandi</a>
29: * @version CVS $Id: LocalSessionEvent.java 508 2008-02-18 13:32:29Z sgonzalez $
30: */
31: public class LocalSessionEvent extends EventObject {
32:
33: /**
34: * The event _data associated with this event.
35: */
36: private Object _data = null;
37:
38: /**
39: * The Session on which this event occurred.
40: */
41: private LocalSession _localSession = null;
42:
43: /**
44: * The event _type this instance represents.
45: */
46: private String _type = null;
47:
48: /**
49: * Construct a new SessionEvent with the specified parameters.
50: *
51: * @param localSession Local Session on which this event occurred
52: * @param type Event _type
53: * @param data Event _data
54: */
55: public LocalSessionEvent(LocalSession localSession, String type,
56: Object data) {
57: super (localSession);
58: this ._localSession = localSession;
59: this ._type = type;
60: this ._data = data;
61: }
62:
63: /**
64: * Return the event _data of this event.
65: */
66: public Object getData() {
67: return (this ._data);
68: }
69:
70: /**
71: * Return the Session on which this event occurred.
72: */
73: public LocalSession getLocalSession() {
74: return (this ._localSession);
75: }
76:
77: /**
78: * Return the event _type of this event.
79: */
80: public String getType() {
81: return (this ._type);
82: }
83:
84: /**
85: * Return a string representation of this event.
86: */
87: public String toString() {
88: return ("LocalSessionEvent['" + getLocalSession() + "','"
89: + getType() + "']");
90: }
91:
92: }
|