01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.oscache.base.events;
06:
07: import java.util.Date;
08:
09: /**
10: * A <code>ScopeEvent</code> is created when an event occurs across one or all scopes.
11: * This type of event is only applicable to the <code>ServletCacheAdministrator</code>.
12: *
13: * @version $Revision: 254 $
14: * @author <a href="mailto:fbeauregard@pyxis-tech.com">Francois Beauregard</a>
15: */
16: public final class ScopeEvent extends CacheEvent {
17: /**
18: * Date that the event applies to.
19: */
20: private Date date = null;
21:
22: /**
23: * Type of the event.
24: */
25: private ScopeEventType eventType = null;
26:
27: /**
28: * Scope that applies to this event.
29: */
30: private int scope = 0;
31:
32: /**
33: * Constructs a scope event object with no specified origin.
34: *
35: * @param eventType Type of the event.
36: * @param scope Scope that applies to the event.
37: * @param date Date that the event applies to.
38: */
39: public ScopeEvent(ScopeEventType eventType, int scope, Date date) {
40: this (eventType, scope, date, null);
41: }
42:
43: /**
44: * Constructs a scope event object.
45: *
46: * @param eventType Type of the event.
47: * @param scope Scope that applies to the event.
48: * @param date Date that the event applies to.
49: * @param origin The origin of this event.
50: */
51: public ScopeEvent(ScopeEventType eventType, int scope, Date date,
52: String origin) {
53: super (origin);
54: this .eventType = eventType;
55: this .scope = scope;
56: this .date = date;
57: }
58:
59: /**
60: * Retrieve the event date
61: */
62: public Date getDate() {
63: return date;
64: }
65:
66: /**
67: * Retrieve the type of the event.
68: */
69: public ScopeEventType getEventType() {
70: return eventType;
71: }
72:
73: /**
74: * Retrieve the scope that applies to the event.
75: */
76: public int getScope() {
77: return scope;
78: }
79: }
|