01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.gps.device.jdbc.snapshot;
18:
19: import java.sql.Connection;
20: import java.util.List;
21:
22: import org.compass.gps.spi.CompassGpsInterfaceDevice;
23: import org.compass.gps.device.jdbc.dialect.JdbcDialect;
24: import org.compass.gps.device.jdbc.mapping.ResultSetToResourceMapping;
25:
26: /**
27: * A delete snapshot event, works with
28: * {@link org.compass.gps.device.jdbc.snapshot.JdbcSnapshotEventListener#onDelete(DeleteSnapshotEvent)}.
29: * Holds the
30: * {@link org.compass.gps.device.jdbc.mapping.ResultSetToResourceMapping}
31: * that maps to the result set that initiated the event, a list of
32: * {@link org.compass.gps.device.jdbc.snapshot.JdbcAliasRowSnapshot}
33: * for all the row snapapshots that were deleted, and the
34: * <code>CompassTemplate</code> to use in order to reflect the changes to the
35: * index.
36: *
37: * @author kimchy
38: */
39: public class DeleteSnapshotEvent extends AbstractSnapshotEvent {
40:
41: private ResultSetToResourceMapping mapping;
42:
43: private List deleteSnapshots;
44:
45: private CompassGpsInterfaceDevice compassGps;
46:
47: public DeleteSnapshotEvent(Connection connection,
48: JdbcDialect dialect, ResultSetToResourceMapping mapping,
49: List deleteSnapshots, CompassGpsInterfaceDevice compassGps) {
50: super (connection, dialect);
51: this .mapping = mapping;
52: this .deleteSnapshots = deleteSnapshots;
53: this .compassGps = compassGps;
54: }
55:
56: public List getDeleteSnapshots() {
57: return deleteSnapshots;
58: }
59:
60: public ResultSetToResourceMapping getMapping() {
61: return mapping;
62: }
63:
64: public CompassGpsInterfaceDevice getCompassGps() {
65: return compassGps;
66: }
67:
68: }
|