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 create and update snapshot event, works with
28: * {@link org.compass.gps.device.jdbc.snapshot.JdbcSnapshotEventListener#onCreateAndUpdate(CreateAndUpdateSnapshotEvent)}.
29: * Holds the
30: * {@link org.compass.gps.device.jdbc.mapping.ResultSetToResourceMapping} that
31: * maps to the result set that initiated the event, a list of
32: * {@link org.compass.gps.device.jdbc.snapshot.JdbcAliasRowSnapshot} for all the
33: * row snapapshots that were created and a list for all the ones that were
34: * updated, and the <code>CompassTemplate</code> to use in order to reflect
35: * the changes to the index.
36: *
37: * @author kimchy
38: */
39: public class CreateAndUpdateSnapshotEvent extends AbstractSnapshotEvent {
40:
41: private ResultSetToResourceMapping mapping;
42:
43: private CompassGpsInterfaceDevice compassGps;
44:
45: private List createSnapshots;
46:
47: private List updateSnapshots;
48:
49: public CreateAndUpdateSnapshotEvent(Connection connection,
50: JdbcDialect dialect, ResultSetToResourceMapping mapping,
51: List createSnapshots, List updateSnapshots,
52: CompassGpsInterfaceDevice compassGps) {
53: super (connection, dialect);
54: this .mapping = mapping;
55: this .createSnapshots = createSnapshots;
56: this .updateSnapshots = updateSnapshots;
57: this .compassGps = compassGps;
58: }
59:
60: public List getCreateSnapshots() {
61: return createSnapshots;
62: }
63:
64: public List getUpdateSnapshots() {
65: return updateSnapshots;
66: }
67:
68: public ResultSetToResourceMapping getMapping() {
69: return mapping;
70: }
71:
72: public CompassGpsInterfaceDevice getCompassGps() {
73: return compassGps;
74: }
75:
76: }
|