01: /*
02: * uDig - User Friendly Desktop Internet GIS client
03: * http://udig.refractions.net
04: * (C) 2004, Refractions Research Inc.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library 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: */
17: package net.refractions.udig.catalog;
18:
19: /**
20: * Captures changes to the Catalog.
21: * <p>
22: * For those familiar with IResourceChangeEvent and IResourceDelta from eclipse development there is
23: * one <b>important addition</b>. The constant REPLACE indicates a reaname, or substiution, you
24: * will need to replace any references you have to the oldObject with the newObject.
25: * </p>
26: *
27: * @author jgarnett
28: * @since 0.6.0
29: */
30: public interface IResolveChangeEvent {
31:
32: public enum Type {
33: /**
34: * Event type constant (bit mask) indicating an after-the-fact report of replacements,
35: * creations, deletions, and modifications to one or more resources expressed as a
36: * hierarchical resource delta as returned by <code>getDelta</code>.
37: *
38: * @see #getType()
39: * @see #getDelta()
40: */
41: POST_CHANGE,
42:
43: /**
44: * Event type constant (bit mask) indicating a before-the-fact report of the impending
45: * closure of a single service as returned by <code>getService</code>.
46: *
47: * @see #getType()
48: * @see #getService()
49: */
50: PRE_CLOSE,
51:
52: /**
53: * Event type constant (bit mask) indicating a before-the-fact report of the impending
54: * deletion of a single service, as returned by <code>getService</code>.
55: *
56: * @see #getType()
57: * @see #getService()
58: */
59: PRE_DELETE;
60: }
61:
62: /**
63: * Returns a delta, rooted at the catalog, describing the set of changes that happened to
64: * resources in the workspace. Returns <code>null</code> if not applicable to this type of
65: * event.
66: *
67: * @return the resource delta, or <code>null</code> if not applicable
68: */
69: public IResolveDelta getDelta();
70:
71: /**
72: * Returns the handle in question. Returns <code>null</code> if not applicable to this type of
73: * event.
74: *
75: * @return the resource, or <code>null</code> if not applicable
76: */
77: public IResolve getResolve();
78:
79: /**
80: * Returns an object identifying the source of this event.
81: *
82: * @return an object identifying the source of this event
83: * @see java.util.EventObject
84: */
85: public Object getSource();
86:
87: /**
88: * Returns the type of event being reported.
89: *
90: * @return one of the event type constants
91: * @see #POST_CHANGE
92: * @see #PRE_CLOSE
93: * @see #PRE_DELETE
94: */
95: public Type getType();
96: }
|