01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal;
07:
08: /**
09: * Represents the source of the PortalEvent.
10: *
11: * @author andrew.petro@yale.edu
12: * @version $Revision: 35152 $ $Date: 2004-12-14 14:23:18 -0700 (Tue, 14 Dec 2004) $
13: */
14: public class PortalEventSource {
15:
16: /**
17: * The user layout as source of events, for example control actuation events
18: * (button presses) and channel window manipulation events
19: * (minimize and maximize).
20: */
21: public static final PortalEventSource LAYOUT_GENERATED = new PortalEventSource(
22: "layout");
23:
24: /**
25: * Framework-generated events, such as sessions ending and unsubscription
26: * from channels.
27: */
28: public static final PortalEventSource FRAMEWORK_GENERATED = new PortalEventSource(
29: "framework");
30:
31: /** String representation of the type of event source. */
32: private final String typeName;
33:
34: private PortalEventSource(String name) {
35: this .typeName = name;
36: }
37:
38: public String toString() {
39: return this .typeName;
40: }
41:
42: /**
43: * Two PortalEventSources are equal if their typeNames are equal.
44: * @param other an object for comparison
45: * @return true if other is a PortalEventSource with the same typeName.
46: */
47: public boolean equals(Object other) {
48:
49: if (other == null)
50: return false;
51:
52: if (!(other instanceof PortalEventSource))
53: return false;
54:
55: PortalEventSource otherSource = (PortalEventSource) other;
56:
57: return this.typeName.equals(otherSource.typeName);
58:
59: }
60: }
|