001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
005: * (C) 2005, Refractions Research Inc.
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation;
010: * version 2.1 of the License.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: */
017: package org.geotools.catalog;
018:
019: /**
020: * Captures changes to the Catalog.
021: *
022: * <p>
023: * For those familiar with IResourceChangeEvent and IResourceDelta from eclipse
024: * development there is one <b>important addition</b>. The constant REPLACE
025: * indicates a reaname, or substiution, you will need to replace any
026: * references you have to the oldObject with the newObject.
027: * </p>
028: *
029: * @author Jody Garnett, Refractions Research
030: * @since 2.2.M3
031: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/catalog/ResolveChangeEvent.java $
032: */
033: public interface ResolveChangeEvent {
034: /**
035: * Returns a delta, rooted at the catalog, describing the set of changes
036: * that happened to resources in the workspace. Returns <code>null</code>
037: * if not applicable to this type of event.
038: *
039: * @return the resource delta, or <code>null</code> if not applicable
040: */
041: ResolveDelta getDelta();
042:
043: /**
044: * Returns the handle in question. Returns <code>null</code> if not
045: * applicable to this type of event.
046: *
047: * @return the resource, or <code>null</code> if not applicable
048: */
049: Resolve getResolve();
050:
051: /**
052: * Returns an object identifying the source of this event.
053: *
054: * @return an object identifying the source of this event
055: *
056: * @see java.util.EventObject
057: */
058: Object getSource();
059:
060: /**
061: * Returns the type of event being reported.
062: *
063: * @return one of the event type constants
064: *
065: * @see #POST_CHANGE
066: * @see #PRE_CLOSE
067: * @see #PRE_DELETE
068: */
069: Type getType();
070:
071: class Type {
072: /**
073: * Event type constant (bit mask) indicating an after-the-fact report
074: * of replacements, creations, deletions, and modifications to one or
075: * more resources expressed as a hierarchical resource delta as
076: * returned by <code>getDelta</code>.
077: *
078: * @see #getType()
079: * @see #getDelta()
080: */
081: public static final Type POST_CHANGE = new Type();
082:
083: /**
084: * Event type constant (bit mask) indicating a before-the-fact report
085: * of the impending closure of a single service as returned by
086: * <code>getService</code>.
087: *
088: * @see #getType()
089: * @see #getService()
090: */
091: public static final Type PRE_CLOSE = new Type();
092:
093: /**
094: * Event type constant (bit mask) indicating a before-the-fact report
095: * of the impending deletion of a single service, as returned by
096: * <code>getService</code>.
097: *
098: * @see #getType()
099: * @see #getService()
100: */
101: public static final Type PRE_DELETE = new Type();
102:
103: private Type() {
104: }
105: }
106: }
|